linux_dsm_epyc7002/arch/x86/kvm
David Matlack 4f2777bc97 kvm: x86: nVMX: maintain internal copy of current VMCS
KVM maintains L1's current VMCS in guest memory, at the guest physical
page identified by the argument to VMPTRLD. This makes hairy
time-of-check to time-of-use bugs possible,as VCPUs can be writing
the the VMCS page in memory while KVM is emulating VMLAUNCH and
VMRESUME.

The spec documents that writing to the VMCS page while it is loaded is
"undefined". Therefore it is reasonable to load the entire VMCS into
an internal cache during VMPTRLD and ignore writes to the VMCS page
-- the guest should be using VMREAD and VMWRITE to access the current
VMCS.

To adhere to the spec, KVM should flush the current VMCS during VMPTRLD,
and the target VMCS during VMCLEAR (as given by the operand to VMCLEAR).
Since this implementation of VMCS caching only maintains the the current
VMCS, VMCLEAR will only do a flush if the operand to VMCLEAR is the
current VMCS pointer.

KVM will also flush during VMXOFF, which is not mandated by the spec,
but also not in conflict with the spec.

Signed-off-by: David Matlack <dmatlack@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-08-01 14:49:05 +02:00
..
assigned-dev.c
assigned-dev.h
cpuid.c KVM: x86: avoid vmalloc(0) in the KVM_SET_CPUID 2016-06-02 17:38:50 +02:00
cpuid.h
emulate.c
hyperv.c
hyperv.h
i8254.c KVM: x86: protect KVM_CREATE_PIT/KVM_CREATE_PIT2 with kvm->lock 2016-06-03 15:28:19 +02:00
i8254.h
i8259.c
ioapic.c
ioapic.h
iommu.c kvm/x86: remove unnecessary header file inclusion 2016-06-03 15:28:19 +02:00
irq_comm.c KVM: x86: add KVM_CAP_X2APIC_API 2016-07-14 09:03:57 +02:00
irq.c
irq.h
Kconfig KVM: remove kvm_vcpu_compatible 2016-06-16 00:05:00 +02:00
kvm_cache_regs.h
lapic.c KVM: x86: bump KVM_MAX_VCPU_ID to 1023 2016-07-14 09:29:35 +02:00
lapic.h KVM: x86: use hardware-compatible format for APIC ID register 2016-07-14 09:03:54 +02:00
Makefile
mmu_audit.c
mmu.c kvm: mmu: track read permission explicitly for shadow EPT page tables 2016-07-14 09:03:50 +02:00
mmu.h kvm: mmu: remove is_present_gpte() 2016-07-14 09:02:47 +02:00
mmutrace.h
mtrr.c
page_track.c
paging_tmpl.h kvm: mmu: track read permission explicitly for shadow EPT page tables 2016-07-14 09:03:50 +02:00
pmu_amd.c
pmu_intel.c KVM: x86: Fix typos 2016-06-14 11:16:28 +02:00
pmu.c
pmu.h
svm.c KVM: x86: use guest_exit_irqoff 2016-07-01 11:03:38 +02:00
trace.h KVM: x86: support using the vmx preemption timer for tsc deadline timer 2016-06-16 10:07:48 +02:00
tss.h
vmx.c kvm: x86: nVMX: maintain internal copy of current VMCS 2016-08-01 14:49:05 +02:00
x86.c KVM: x86: bump KVM_MAX_VCPU_ID to 1023 2016-07-14 09:29:35 +02:00
x86.h