Lines Matching +defs:val +defs:e

97  * recomputed from scratch during vendor module load, e.g. to account for a
106 #define ERR_PTR_USR(e) ((void __user *)ERR_PTR(e))
200 * usermode, e.g. SYSCALL MSRs and TSC_AUX, can be deferred until the CPU
201 * returns to userspace, i.e. the kernel can run with the guest's value.
309 * require host support, i.e. should be probed via RDMSR. emulated_msrs holds
311 * msr_based_features holds MSRs that enumerate features, i.e. are effectively
443 * List of MSRs that control the existence of MSR-based features, i.e. MSRs
510 * guest and/or userspace, e.g. if the failure is ignored below.
589 u64 val;
593 ret = rdmsrl_safe(msr, &val);
596 ret = wrmsrl_safe(msr, val);
721 * state, e.g. DR6, to determine whether a #DB is a trap or fault.
753 * bit, FIXED_1 bits and active high bits (e.g. DR6_BD,
1092 * MMU's metadata needs to be updated, e.g. so that emulating guest
1424 * stuff CR3, e.g. for RSM emulation, and there is no guarantee that
1446 * i.e. only PCID=0 can be relevant.
1513 int kvm_set_dr(struct kvm_vcpu *vcpu, int dr, unsigned long val)
1519 vcpu->arch.db[array_index_nospec(dr, size)] = val;
1521 vcpu->arch.eff_db[dr] = val;
1525 if (!kvm_dr6_valid(val))
1527 vcpu->arch.dr6 = (val & DR6_VOLATILE) | kvm_dr6_fixed(vcpu);
1531 if (!kvm_dr7_valid(val))
1533 vcpu->arch.dr7 = (val & DR7_VOLATILE) | DR7_FIXED_1;
1846 * AMD CPUs completely ignore bits 63:32, i.e. they aren't
2112 * i.e. the sending of IPI, sending IPI early in the VM-Exit flow reduces
2114 * from guest to host, e.g. reacquiring KVM's SRCU lock. In contrast to the
2189 u64 val;
2193 * not support modifying the guest vCPU model on the fly, e.g. changing
2195 * writes of the same value, e.g. to allow userspace to blindly stuff
2199 (do_get_msr(vcpu, index, &val) || *data != val))
3287 * which it started (i.e. its epoch, when its kvmclock was zero).
3882 /* R bits, i.e. writes are ignored, but don't fault. */
4788 static int __kvm_x86_dev_get_attr(struct kvm_device_attr *attr, u64 *val)
4792 return kvm_x86_call(dev_get_attr)(attr->group, attr->attr, val);
4798 *val = kvm_caps.supported_xcr0;
4809 u64 val;
4811 r = __kvm_x86_dev_get_attr(attr, &val);
4815 if (put_user(val, uaddr))
4823 u64 val;
4825 return __kvm_x86_dev_get_attr(attr, &val);
5332 * will be intercepted by L1, e.g. KVM should not modifying CR2 if L1
7583 static int kvm_read_guest_virt_helper(gva_t addr, void *val, unsigned int bytes,
7588 void *data = val;
7616 gva_t addr, void *val, unsigned int bytes,
7634 ret = kvm_vcpu_read_guest_page(vcpu, gpa >> PAGE_SHIFT, val,
7643 gva_t addr, void *val, unsigned int bytes,
7655 return kvm_read_guest_virt_helper(addr, val, bytes, vcpu, access,
7661 gva_t addr, void *val, unsigned int bytes,
7672 return kvm_read_guest_virt_helper(addr, val, bytes, vcpu, access, exception);
7675 static int kvm_write_guest_virt_helper(gva_t addr, void *val, unsigned int bytes,
7680 void *data = val;
7705 static int emulator_write_std(struct x86_emulate_ctxt *ctxt, gva_t addr, void *val,
7717 return kvm_write_guest_virt_helper(addr, val, bytes, vcpu,
7721 int kvm_write_guest_virt_system(struct kvm_vcpu *vcpu, gva_t addr, void *val,
7727 return kvm_write_guest_virt_helper(addr, val, bytes, vcpu,
7745 struct x86_exception e;
7754 sig, sizeof(sig), &e) == 0 &&
7812 const void *val, int bytes)
7816 ret = kvm_vcpu_write_guest(vcpu, gpa, val, bytes);
7819 kvm_page_track_write(vcpu, gpa, val, bytes);
7824 int (*read_write_prepare)(struct kvm_vcpu *vcpu, void *val,
7827 void *val, int bytes);
7829 int bytes, void *val);
7831 void *val, int bytes);
7835 static int read_prepare(struct kvm_vcpu *vcpu, void *val, int bytes)
7839 vcpu->mmio_fragments[0].gpa, val);
7848 void *val, int bytes)
7850 return !kvm_vcpu_read_guest(vcpu, gpa, val, bytes);
7854 void *val, int bytes)
7856 return emulator_write_phys(vcpu, gpa, val, bytes);
7859 static int write_mmio(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes, void *val)
7861 trace_kvm_mmio(KVM_TRACE_MMIO_WRITE, bytes, gpa, val);
7862 return vcpu_mmio_write(vcpu, gpa, bytes, val);
7866 void *val, int bytes)
7873 void *val, int bytes)
7895 static int emulator_read_write_onepage(unsigned long addr, void *val,
7924 if (!ret && ops->read_write_emulate(vcpu, gpa, val, bytes))
7930 handled = ops->read_write_mmio(vcpu, gpa, bytes, val);
7936 val += handled;
7941 frag->data = val;
7948 void *val, unsigned int bytes,
7957 ops->read_write_prepare(vcpu, val, bytes))
7967 rc = emulator_read_write_onepage(addr, val, now, exception,
7975 val += now;
7979 rc = emulator_read_write_onepage(addr, val, bytes, exception,
7997 return ops->read_write_exit_mmio(vcpu, gpa, val, bytes);
8002 void *val,
8006 return emulator_read_write(ctxt, addr, val, bytes,
8012 const void *val,
8016 return emulator_read_write(ctxt, addr, (void *)val, bytes,
8158 unsigned short port, void *val, unsigned int count)
8160 int r = emulator_pio_in_out(vcpu, size, port, val, count, true);
8162 trace_kvm_pio(KVM_PIO_IN, port, size, count, val);
8167 static void complete_emulator_pio_in(struct kvm_vcpu *vcpu, void *val)
8171 memcpy(val, vcpu->arch.pio_data, size * count);
8177 int size, unsigned short port, void *val,
8189 complete_emulator_pio_in(vcpu, val);
8193 return emulator_pio_in(vcpu, size, port, val, count);
8197 unsigned short port, const void *val,
8200 trace_kvm_pio(KVM_PIO_OUT, port, size, count, val);
8201 return emulator_pio_in_out(vcpu, size, port, (void *)val, count, false);
8206 const void *val, unsigned int count)
8208 return emulator_pio_out(emul_to_vcpu(ctxt), size, port, val, count);
8299 static int emulator_set_cr(struct x86_emulate_ctxt *ctxt, int cr, ulong val)
8306 res = kvm_set_cr0(vcpu, mk_cr_64(kvm_read_cr0(vcpu), val));
8309 vcpu->arch.cr2 = val;
8312 res = kvm_set_cr3(vcpu, val);
8315 res = kvm_set_cr4(vcpu, mk_cr_64(kvm_read_cr4(vcpu), val));
8318 res = kvm_set_cr8(vcpu, val);
8533 static void emulator_write_gpr(struct x86_emulate_ctxt *ctxt, unsigned reg, ulong val)
8535 kvm_register_write_raw(emul_to_vcpu(ctxt), reg, val);
8895 * fault indefinitely, i.e. there's nothing to lose by retrying.
8983 * breakpoints, i.e. the fact that the intercepted exception occurred
9190 * writing instruction, try to unprotect the gfn, i.e. zap shadow pages,
9332 unsigned long val = kvm_rax_read(vcpu);
9333 int ret = emulator_pio_out(vcpu, size, port, &val, 1);
9356 unsigned long val;
9367 val = (vcpu->arch.pio.size < 4) ? kvm_rax_read(vcpu) : 0;
9369 complete_emulator_pio_in(vcpu, &val);
9370 kvm_rax_write(vcpu, val);
9378 unsigned long val;
9382 val = (size < 4) ? kvm_rax_read(vcpu) : 0;
9384 ret = emulator_pio_in(vcpu, size, port, &val, 1);
9386 kvm_rax_write(vcpu, val);
9537 static int kvmclock_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
9543 if (val == CPUFREQ_PRECHANGE && freq->old > freq->new)
9545 if (val == CPUFREQ_POSTCHANGE && freq->old < freq->new)
9671 * hardware, e.g. during CPU hotplug, to ensure all online CPUs are
9672 * compatible, i.e. KVM should never perform a compatibility check on
9721 * kernel, i.e. failure indicates a kernel bug or broken firmware.
9911 * common code, e.g. for tracing. Defer initialization to the compiler.
10231 * priority. This handles both "pending" events, i.e. events that have never
10232 * been injected into the guest, and "injected" events, i.e. events that were
10237 * i.e. doesn't guarantee that there's an event window in the guest. KVM must
10240 * I.e. for exceptions and re-injected events, NOT invoking this on instruction
10247 * the instruction or injecting an exception, e.g. instruction and exception
10262 * phase of instruction execution, e.g. on the instruction fetch from memory.
10298 * exceptions, e.g. most #DBs, have higher priority than interrupts.
10299 * And while fault-like exceptions, e.g. #GP and #PF, are the lowest
10387 * due to architectural conditions (e.g. IF=0) a window-open exit
10481 * incoming NMIs as quickly as bare metal, e.g. if the vCPU is
10749 * also flushes the "current" TLB entries, i.e. servicing the
10938 * i.e. they can post interrupts even if APICv is temporarily disabled.
11038 * rely on the fact that guest_fpu::xfd is up-to-date (e.g.
11298 * The vCPU has halted, e.g. executed HLT. Update the run state if the
11505 * i.e. put the vCPU into a nonsensical state. Only an INIT
12405 * Several of the "set" flows, e.g. ->set_cr0(), read other registers
12418 * bits), i.e. virtualization is disabled.
12493 * i.e. it's impossible for kvm_find_cpuid_entry() to find a valid entry
12812 * remain valid and unchanged until the VM is destroyed, i.e., the
12814 * address, i.e. its accessibility is not guaranteed, and must be
13044 * trackers attached to the VM, i.e. if KVMGT is in use.
13116 * other flag is LOG_DIRTY_PAGES, i.e. something is wrong if dirty
13125 * is disabled, i.e. now that KVM does not have to track guest
13160 * write-protected before returning to userspace, i.e. before
13164 * making decisions based on writable status of an SPTE, e.g. a
13174 * e.g. to allow dirty logging without taking mmu_lock.
13186 * writable bit was set. I.e. KVM is almost guaranteed to need
13382 u32 val;
13385 &val, offset, sizeof(val)))
13388 return !val;
13702 struct x86_exception *e)
13705 if (KVM_BUG_ON(!e, vcpu->kvm))
13708 kvm_inject_emulated_page_fault(vcpu, e);
13728 struct x86_exception e;
13735 r = kvm_read_guest_virt(vcpu, gva, &operand, sizeof(operand), &e);
13737 return kvm_handle_memory_failure(vcpu, r, &e);