linux-stable/arch/x86/kvm
Jim Mattson b119019847 kvm: nVMX: Remove unnecessary sync_roots from handle_invept
When L0 is executing handle_invept(), the TDP MMU is active. Emulating
an L1 INVEPT does require synchronizing the appropriate shadow EPT
root(s), but a call to kvm_mmu_sync_roots in this context won't do
that. Similarly, the hardware TLB and paging-structure-cache entries
associated with the appropriate shadow EPT root(s) must be flushed,
but requesting a TLB_FLUSH from this context won't do that either.

How did this ever work? KVM always does a sync_roots and TLB flush (in
the correct context) when transitioning from L1 to L2. That isn't the
best choice for nested VM performance, but it effectively papers over
the mistakes here.

Remove the unnecessary operations and leave a comment to try to do
better in the future.

Reported-by: Junaid Shahid <junaids@google.com>
Fixes: bfd0a56b90 ("nEPT: Nested INVEPT")
Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Cc: Nadav Har'El <nyh@il.ibm.com>
Cc: Jun Nakajima <jun.nakajima@intel.com>
Cc: Xinhao Xu <xinhao.xu@intel.com>
Cc: Yang Zhang <yang.z.zhang@Intel.com>
Cc: Gleb Natapov <gleb@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by Peter Shier <pshier@google.com>
Reviewed-by: Junaid Shahid <junaids@google.com>
Signed-off-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-07-02 19:01:56 +02:00
..
vmx kvm: nVMX: Remove unnecessary sync_roots from handle_invept 2019-07-02 19:01:56 +02:00
cpuid.c KVM: X86: Expose PV_SCHED_YIELD CPUID feature bit to guest 2019-07-02 18:56:05 +02:00
cpuid.h KVM/x86: Update the reverse_cpuid list to include CPUID_7_EDX 2018-02-03 23:06:51 +01:00
debugfs.c KVM: LAPIC: Expose per-vCPU timer_advance_ns to userspace 2019-05-24 21:27:09 +02:00
emulate.c KVM: x86: Use DR_TRAP_BITS instead of hard-coded 15 2019-06-18 11:43:42 +02:00
hyperv.c * ARM: support for SVE and Pointer Authentication in guests, PMU improvements 2019-05-17 10:33:30 -07:00
hyperv.h x86/kvm/hyper-v: Introduce KVM_GET_SUPPORTED_HV_CPUID 2018-12-14 17:59:54 +01:00
i8254.c kvm: x86: Add memcg accounting to KVM allocations 2019-02-20 22:48:30 +01:00
i8254.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
i8259.c kvm: x86: Add memcg accounting to KVM allocations 2019-02-20 22:48:30 +01:00
ioapic.c kvm: x86: Add memcg accounting to KVM allocations 2019-02-20 22:48:30 +01:00
ioapic.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
irq.c kvm: Check irqchip mode before assign irqfd 2019-05-24 21:27:12 +02:00
irq.h kvm: Check irqchip mode before assign irqfd 2019-05-24 21:27:12 +02:00
irq_comm.c kvm: x86: check kvm_apic_sw_enabled() is enough 2019-06-18 11:43:46 +02:00
Kconfig kvm: x86: add host poll control msrs 2019-06-18 11:43:46 +02:00
kvm_cache_regs.h KVM: x86: use direct accessors for RIP and RSP 2019-04-30 22:07:26 +02:00
lapic.c KVM: x86: Fix apic dangling pointer in vcpu 2019-06-20 14:23:17 +02:00
lapic.h kvm: x86: use same convention to name kvm_lapic_{set,clear}_vector() 2019-06-18 11:43:47 +02:00
Makefile KVM: x86: fix TRACE_INCLUDE_PATH and remove -I. header search paths 2019-01-25 19:12:37 +01:00
mmu.c KVM: x86: clean up conditions for asynchronous page fault handling 2019-06-13 19:20:54 +02:00
mmu.h kvm: mmu: Fix overflow on kvm mmu page limit calculation 2019-04-16 15:37:30 +02:00
mmu_audit.c x86/kvm/mmu: make vcpu->mmu a pointer to the current MMU 2018-10-17 00:30:02 +02:00
mmutrace.h KVM: x86: fix handling of role.cr4_pae and rename it to 'gpte_size' 2019-03-28 17:27:03 +01:00
mtrr.c KVM: x86: optimize check for valid PAT value 2019-04-16 15:39:02 +02:00
page_track.c kvm: x86: Add memcg accounting to KVM allocations 2019-02-20 22:48:30 +01:00
paging_tmpl.h * ARM: support for SVE and Pointer Authentication in guests, PMU improvements 2019-05-17 10:33:30 -07:00
pmu.c KVM: x86/pmu: mask the result of rdpmc according to the width of the counters 2019-05-24 21:27:13 +02:00
pmu.h KVM: x86/pmu: mask the result of rdpmc according to the width of the counters 2019-05-24 21:27:13 +02:00
pmu_amd.c KVM: x86/pmu: mask the result of rdpmc according to the width of the counters 2019-05-24 21:27:13 +02:00
svm.c KVM: nVMX: list VMX MSRs in KVM_GET_MSR_INDEX_LIST 2019-07-02 17:36:18 +02:00
trace.h KVM: x86: avoid misreporting level-triggered irqs as edge-triggered in tracing 2019-04-16 15:38:08 +02:00
tss.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
x86.c KVM: X86: Implement PV sched yield hypercall 2019-07-02 18:56:04 +02:00
x86.h KVM: x86: introduce is_pae_paging 2019-06-18 11:47:38 +02:00