Lines Matching defs:bytes
6140 static int kvm_read_guest_virt_helper(gva_t addr, void *val, unsigned int bytes,
6147 while (bytes) {
6151 unsigned toread = min(bytes, (unsigned)PAGE_SIZE - offset);
6163 bytes -= toread;
6173 gva_t addr, void *val, unsigned int bytes,
6188 if (WARN_ON(offset + bytes > PAGE_SIZE))
6189 bytes = (unsigned)PAGE_SIZE - offset;
6191 offset, bytes);
6199 gva_t addr, void *val, unsigned int bytes,
6211 return kvm_read_guest_virt_helper(addr, val, bytes, vcpu, access,
6217 gva_t addr, void *val, unsigned int bytes,
6226 return kvm_read_guest_virt_helper(addr, val, bytes, vcpu, access, exception);
6230 unsigned long addr, void *val, unsigned int bytes)
6233 int r = kvm_vcpu_read_guest(vcpu, addr, val, bytes);
6238 static int kvm_write_guest_virt_helper(gva_t addr, void *val, unsigned int bytes,
6245 while (bytes) {
6250 unsigned towrite = min(bytes, (unsigned)PAGE_SIZE - offset);
6261 bytes -= towrite;
6270 unsigned int bytes, struct x86_exception *exception,
6279 return kvm_write_guest_virt_helper(addr, val, bytes, vcpu,
6284 unsigned int bytes, struct x86_exception *exception)
6289 return kvm_write_guest_virt_helper(addr, val, bytes, vcpu,
6361 const void *val, int bytes)
6365 ret = kvm_vcpu_write_guest(vcpu, gpa, val, bytes);
6368 kvm_page_track_write(vcpu, gpa, val, bytes);
6374 int bytes);
6376 void *val, int bytes);
6378 int bytes, void *val);
6380 void *val, int bytes);
6384 static int read_prepare(struct kvm_vcpu *vcpu, void *val, int bytes)
6387 trace_kvm_mmio(KVM_TRACE_MMIO_READ, bytes,
6397 void *val, int bytes)
6399 return !kvm_vcpu_read_guest(vcpu, gpa, val, bytes);
6403 void *val, int bytes)
6405 return emulator_write_phys(vcpu, gpa, val, bytes);
6408 static int write_mmio(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes, void *val)
6410 trace_kvm_mmio(KVM_TRACE_MMIO_WRITE, bytes, gpa, val);
6411 return vcpu_mmio_write(vcpu, gpa, bytes, val);
6415 void *val, int bytes)
6417 trace_kvm_mmio(KVM_TRACE_MMIO_READ_UNSATISFIED, bytes, gpa, NULL);
6422 void *val, int bytes)
6445 unsigned int bytes,
6473 if (!ret && ops->read_write_emulate(vcpu, gpa, val, bytes))
6479 handled = ops->read_write_mmio(vcpu, gpa, bytes, val);
6480 if (handled == bytes)
6484 bytes -= handled;
6491 frag->len = bytes;
6497 void *val, unsigned int bytes,
6506 ops->read_write_prepare(vcpu, val, bytes))
6512 if (((addr + bytes - 1) ^ addr) & PAGE_MASK) {
6525 bytes -= now;
6528 rc = emulator_read_write_onepage(addr, val, bytes, exception,
6546 return ops->read_write_exit_mmio(vcpu, gpa, val, bytes);
6552 unsigned int bytes,
6555 return emulator_read_write(ctxt, addr, val, bytes,
6562 unsigned int bytes,
6565 return emulator_read_write(ctxt, addr, (void *)val, bytes,
6583 unsigned int bytes,
6594 if (bytes > 8 || (bytes & (bytes - 1)))
6612 if (((gpa + bytes - 1) & page_line_mask) != (gpa & page_line_mask))
6620 switch (bytes) {
6642 kvm_page_track_write(vcpu, gpa, new, bytes);
6649 return emulator_write_emulated(ctxt, addr, new, bytes, exception);