Lines Matching defs:val

329 	u64 val;
333 ret = rdmsrl_safe(msr, &val);
336 ret = wrmsrl_safe(msr, val);
1139 static int __kvm_set_dr(struct kvm_vcpu *vcpu, int dr, unsigned long val)
1145 vcpu->arch.db[array_index_nospec(dr, size)] = val;
1147 vcpu->arch.eff_db[dr] = val;
1151 if (!kvm_dr6_valid(val))
1153 vcpu->arch.dr6 = (val & DR6_VOLATILE) | kvm_dr6_fixed(vcpu);
1157 if (!kvm_dr7_valid(val))
1159 vcpu->arch.dr7 = (val & DR7_VOLATILE) | DR7_FIXED_1;
1167 int kvm_set_dr(struct kvm_vcpu *vcpu, int dr, unsigned long val)
1169 if (__kvm_set_dr(vcpu, dr, val)) {
1177 int kvm_get_dr(struct kvm_vcpu *vcpu, int dr, unsigned long *val)
1183 *val = vcpu->arch.db[array_index_nospec(dr, size)];
1187 *val = vcpu->arch.dr6;
1191 *val = vcpu->arch.dr7;
4529 unsigned long val;
4533 kvm_get_dr(vcpu, 6, &val);
4534 dbgregs->dr6 = val;
6140 static int kvm_read_guest_virt_helper(gva_t addr, void *val, unsigned int bytes,
6144 void *data = val;
6173 gva_t addr, void *val, unsigned int bytes,
6190 ret = kvm_vcpu_read_guest_page(vcpu, gpa >> PAGE_SHIFT, val,
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,
6242 void *data = val;
6269 static int emulator_write_std(struct x86_emulate_ctxt *ctxt, gva_t addr, void *val,
6279 return kvm_write_guest_virt_helper(addr, val, bytes, vcpu,
6283 int kvm_write_guest_virt_system(struct kvm_vcpu *vcpu, gva_t addr, void *val,
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);
6373 int (*read_write_prepare)(struct kvm_vcpu *vcpu, void *val,
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)
6388 vcpu->mmio_fragments[0].gpa, val);
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)
6422 void *val, int bytes)
6444 static int emulator_read_write_onepage(unsigned long addr, void *val,
6473 if (!ret && ops->read_write_emulate(vcpu, gpa, val, bytes))
6479 handled = ops->read_write_mmio(vcpu, gpa, bytes, val);
6485 val += handled;
6490 frag->data = val;
6497 void *val, unsigned int bytes,
6506 ops->read_write_prepare(vcpu, val, bytes))
6516 rc = emulator_read_write_onepage(addr, val, now, exception,
6524 val += now;
6528 rc = emulator_read_write_onepage(addr, val, bytes, exception,
6546 return ops->read_write_exit_mmio(vcpu, gpa, val, bytes);
6551 void *val,
6555 return emulator_read_write(ctxt, addr, val, bytes,
6561 const void *val,
6565 return emulator_read_write(ctxt, addr, (void *)val, bytes,
6672 unsigned short port, void *val,
6696 unsigned short port, void *val, unsigned int count)
6705 ret = emulator_pio_in_out(vcpu, size, port, val, count, true);
6708 memcpy(val, vcpu->arch.pio_data, size * count);
6718 int size, unsigned short port, void *val,
6721 return emulator_pio_in(emul_to_vcpu(ctxt), size, port, val, count);
6726 unsigned short port, const void *val,
6729 memcpy(vcpu->arch.pio_data, val, size * count);
6731 return emulator_pio_in_out(vcpu, size, port, (void *)val, count, false);
6736 const void *val, unsigned int count)
6738 return emulator_pio_out(emul_to_vcpu(ctxt), size, port, val, count);
6830 static int emulator_set_cr(struct x86_emulate_ctxt *ctxt, int cr, ulong val)
6837 res = kvm_set_cr0(vcpu, mk_cr_64(kvm_read_cr0(vcpu), val));
6840 vcpu->arch.cr2 = val;
6843 res = kvm_set_cr3(vcpu, val);
6846 res = kvm_set_cr4(vcpu, mk_cr_64(kvm_read_cr4(vcpu), val));
6849 res = kvm_set_cr8(vcpu, val);
7059 static void emulator_write_gpr(struct x86_emulate_ctxt *ctxt, unsigned reg, ulong val)
7061 kvm_register_write(emul_to_vcpu(ctxt), reg, val);
7773 unsigned long val = kvm_rax_read(vcpu);
7774 int ret = emulator_pio_out(vcpu, size, port, &val, 1);
7797 unsigned long val;
7808 val = (vcpu->arch.pio.size < 4) ? kvm_rax_read(vcpu) : 0;
7814 emulator_pio_in(vcpu, vcpu->arch.pio.size, vcpu->arch.pio.port, &val, 1);
7815 kvm_rax_write(vcpu, val);
7823 unsigned long val;
7827 val = (size < 4) ? kvm_rax_read(vcpu) : 0;
7829 ret = emulator_pio_in(vcpu, size, port, &val, 1);
7831 kvm_rax_write(vcpu, val);
7986 static int kvmclock_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
7992 if (val == CPUFREQ_PRECHANGE && freq->old > freq->new)
7994 if (val == CPUFREQ_POSTCHANGE && freq->old < freq->new)
8732 unsigned long val;
8743 kvm_get_dr(vcpu, 6, &val);
8744 put_smstate(u32, buf, 0x7fcc, (u32)val);
8745 kvm_get_dr(vcpu, 7, &val);
8746 put_smstate(u32, buf, 0x7fc8, (u32)val);
8783 unsigned long val;
8792 kvm_get_dr(vcpu, 6, &val);
8793 put_smstate(u64, buf, 0x7f68, val);
8794 kvm_get_dr(vcpu, 7, &val);
8795 put_smstate(u64, buf, 0x7f60, val);
11252 u32 val;
11255 &val, offset, sizeof(val)))
11258 return !val;