Lines Matching refs:bytes

575     unsigned long linear, unsigned int bytes, uint32_t pfec,  in hvmemul_map_linear_addr()  argument
580 unsigned int nr_frames = ((linear + bytes - !!bytes) >> PAGE_SHIFT) - in hvmemul_map_linear_addr()
708 void *mapping, unsigned long linear, unsigned int bytes, in hvmemul_unmap_linear_addr() argument
712 unsigned int nr_frames = ((linear + bytes - !!bytes) >> PAGE_SHIFT) - in hvmemul_unmap_linear_addr()
1123 static bool known_gla(unsigned long addr, unsigned int bytes, uint32_t pfec) in known_gla() argument
1141 (addr & ~PAGE_MASK) + bytes <= PAGE_SIZE); in known_gla()
1144 static int linear_read(unsigned long addr, unsigned int bytes, void *p_data, in linear_read() argument
1152 if ( offset + bytes > PAGE_SIZE ) in linear_read()
1159 rc = linear_read(addr + part1, bytes - part1, p_data + part1, in linear_read()
1171 rc = hvm_copy_from_guest_linear(p_data, addr, bytes, pfec, &pfinfo); in linear_read()
1186 return hvmemul_linear_mmio_read(addr, bytes, p_data, pfec, in linear_read()
1188 known_gla(addr, bytes, pfec)); in linear_read()
1199 static int linear_write(unsigned long addr, unsigned int bytes, void *p_data, in linear_write() argument
1207 if ( offset + bytes > PAGE_SIZE ) in linear_write()
1214 rc = linear_write(addr + part1, bytes - part1, p_data + part1, in linear_write()
1226 rc = hvm_copy_to_guest_linear(addr, p_data, bytes, pfec, &pfinfo); in linear_write()
1238 return hvmemul_linear_mmio_write(addr, bytes, p_data, pfec, in linear_write()
1240 known_gla(addr, bytes, pfec)); in linear_write()
1255 unsigned int bytes, in __hvmemul_read() argument
1271 seg, offset, bytes, NULL, access_type, hvmemul_ctxt, &addr); in __hvmemul_read()
1272 if ( rc != X86EMUL_OKAY || !bytes ) in __hvmemul_read()
1275 return linear_read(addr, bytes, p_data, pfec, hvmemul_ctxt); in __hvmemul_read()
1282 unsigned int bytes, in hvmemul_read() argument
1289 return set_context_data(p_data, bytes); in hvmemul_read()
1292 seg, offset, p_data, bytes, hvm_access_read, in hvmemul_read()
1300 unsigned int bytes, in hvmemul_insn_fetch() argument
1312 if ( !bytes || in hvmemul_insn_fetch()
1313 unlikely((insn_off + bytes) > hvmemul_ctxt->insn_buf_bytes) ) in hvmemul_insn_fetch()
1315 int rc = __hvmemul_read(seg, offset, p_data, bytes, in hvmemul_insn_fetch()
1318 if ( rc == X86EMUL_OKAY && bytes ) in hvmemul_insn_fetch()
1325 insn_off + bytes > sizeof(hvmemul_ctxt->insn_buf) ) in hvmemul_insn_fetch()
1331 memcpy(&hvmemul_ctxt->insn_buf[insn_off], p_data, bytes); in hvmemul_insn_fetch()
1332 hvmemul_ctxt->insn_buf_bytes = insn_off + bytes; in hvmemul_insn_fetch()
1339 memcpy(p_data, &hvmemul_ctxt->insn_buf[insn_off], bytes); in hvmemul_insn_fetch()
1347 unsigned int bytes, in hvmemul_write() argument
1363 seg, offset, bytes, NULL, hvm_access_write, hvmemul_ctxt, &addr); in hvmemul_write()
1364 if ( rc != X86EMUL_OKAY || !bytes ) in hvmemul_write()
1367 if ( !known_gla(addr, bytes, pfec) ) in hvmemul_write()
1369 mapping = hvmemul_map_linear_addr(addr, bytes, pfec, hvmemul_ctxt); in hvmemul_write()
1375 return linear_write(addr, bytes, p_data, pfec, hvmemul_ctxt); in hvmemul_write()
1378 switch ( bytes ) in hvmemul_write()
1383 default: memcpy(mapping, p_data, bytes); break; in hvmemul_write()
1386 hvmemul_unmap_linear_addr(mapping, addr, bytes, hvmemul_ctxt); in hvmemul_write()
1394 unsigned int bytes, in hvmemul_rmw() argument
1407 seg, offset, bytes, NULL, hvm_access_write, hvmemul_ctxt, &addr); in hvmemul_rmw()
1408 if ( rc != X86EMUL_OKAY || !bytes ) in hvmemul_rmw()
1416 if ( !known_gla(addr, bytes, pfec) ) in hvmemul_rmw()
1418 mapping = hvmemul_map_linear_addr(addr, bytes, pfec, hvmemul_ctxt); in hvmemul_rmw()
1425 rc = x86_emul_rmw(mapping, bytes, eflags, state, ctxt); in hvmemul_rmw()
1426 hvmemul_unmap_linear_addr(mapping, addr, bytes, hvmemul_ctxt); in hvmemul_rmw()
1432 if ( bytes > sizeof(data) ) in hvmemul_rmw()
1434 rc = linear_read(addr, bytes, &data, pfec, hvmemul_ctxt); in hvmemul_rmw()
1436 rc = x86_emul_rmw(&data, bytes, eflags, state, ctxt); in hvmemul_rmw()
1438 rc = linear_write(addr, bytes, &data, pfec, hvmemul_ctxt); in hvmemul_rmw()
1448 unsigned int bytes, in hvmemul_blk() argument
1461 seg, offset, bytes, NULL, hvm_access_write, hvmemul_ctxt, &addr); in hvmemul_blk()
1462 if ( rc != X86EMUL_OKAY || !bytes ) in hvmemul_blk()
1473 mapping = hvmemul_map_linear_addr(addr, bytes, pfec, hvmemul_ctxt); in hvmemul_blk()
1479 rc = x86_emul_blk(mapping, p_data, bytes, eflags, state, ctxt); in hvmemul_blk()
1480 hvmemul_unmap_linear_addr(mapping, addr, bytes, hvmemul_ctxt); in hvmemul_blk()
1489 unsigned int bytes, in hvmemul_write_discard() argument
1546 unsigned int bytes, in hvmemul_cmpxchg_discard() argument
1555 unsigned int bytes, in hvmemul_read_io_discard() argument
1564 unsigned int bytes, in hvmemul_write_io_discard() argument
1593 unsigned int bytes, in hvmemul_cmpxchg() argument
1607 seg, offset, bytes, NULL, hvm_access_write, hvmemul_ctxt, &addr); in hvmemul_cmpxchg()
1616 if ( !known_gla(addr, bytes, pfec) ) in hvmemul_cmpxchg()
1618 mapping = hvmemul_map_linear_addr(addr, bytes, pfec, hvmemul_ctxt); in hvmemul_cmpxchg()
1626 return hvmemul_linear_mmio_write(addr, bytes, p_new, pfec, in hvmemul_cmpxchg()
1632 switch ( bytes ) in hvmemul_cmpxchg()
1638 memcpy(&old, p_old, bytes); in hvmemul_cmpxchg()
1639 memcpy(&new, p_new, bytes); in hvmemul_cmpxchg()
1641 cur = __cmpxchg(mapping, old, new, bytes); in hvmemul_cmpxchg()
1643 cur = cmpxchg_local_(mapping, old, new, bytes); in hvmemul_cmpxchg()
1646 memcpy(p_old, &cur, bytes); in hvmemul_cmpxchg()
1677 hvmemul_unmap_linear_addr(mapping, addr, bytes, hvmemul_ctxt); in hvmemul_cmpxchg()
1827 unsigned long saddr, daddr, bytes; in hvmemul_rep_movs() local
1869 bytes = PAGE_SIZE - (daddr & ~PAGE_MASK); in hvmemul_rep_movs()
1908 bytes = *reps * bytes_per_rep; in hvmemul_rep_movs()
1912 sgpa -= bytes - bytes_per_rep; in hvmemul_rep_movs()
1919 if ( ((dgpa + bytes_per_rep) > sgpa) && (dgpa < (sgpa + bytes)) ) in hvmemul_rep_movs()
1924 dgpa -= bytes - bytes_per_rep; in hvmemul_rep_movs()
1927 buf = xmalloc_bytes(bytes); in hvmemul_rep_movs()
1933 rc = set_context_data(buf, bytes); in hvmemul_rep_movs()
1952 rc = hvm_copy_from_guest_phys(buf, sgpa, bytes); in hvmemul_rep_movs()
1957 rc = hvm_copy_to_guest_phys(dgpa, buf, bytes, curr); in hvmemul_rep_movs()
1996 unsigned long addr, bytes; in hvmemul_rep_stos() local
2006 bytes = PAGE_SIZE - (addr & ~PAGE_MASK); in hvmemul_rep_stos()
2032 unsigned long bytes; in hvmemul_rep_stos() local
2039 bytes = *reps * bytes_per_rep; in hvmemul_rep_stos()
2040 buf = xmalloc_bytes(bytes); in hvmemul_rep_stos()
2075 gpa -= bytes - bytes_per_rep; in hvmemul_rep_stos()
2077 rc = hvm_copy_to_guest_phys(gpa, buf, bytes, curr); in hvmemul_rep_stos()
2150 unsigned int bytes, in hvmemul_read_io() argument
2160 return set_context_data(val, bytes); in hvmemul_read_io()
2162 return hvmemul_do_pio_buffer(port, bytes, IOREQ_READ, val); in hvmemul_read_io()
2167 unsigned int bytes, in hvmemul_write_io() argument
2171 return hvmemul_do_pio_buffer(port, bytes, IOREQ_WRITE, &val); in hvmemul_write_io()