linux-stable/arch/x86/kvm
Sean Christopherson fadcead00c KVM: nVMX: Intercept VMWRITEs to read-only shadow VMCS fields
Allowing L1 to VMWRITE read-only fields is only beneficial in a double
nesting scenario, e.g. no sane VMM will VMWRITE VM_EXIT_REASON in normal
non-nested operation.  Intercepting RO fields means KVM doesn't need to
sync them from the shadow VMCS to vmcs12 when running L2.  The obvious
downside is that L1 will VM-Exit more often when running L3, but it's
likely safe to assume most folks would happily sacrifice a bit of L3
performance, which may not even be noticeable in the grande scheme, to
improve L2 performance across the board.

Not intercepting fields tagged read-only also allows for additional
optimizations, e.g. marking GUEST_{CS,SS}_AR_BYTES as SHADOW_FIELD_RO
since those fields are rarely written by a VMMs, but read frequently.

When utilizing a shadow VMCS with asymmetric R/W and R/O bitmaps, fields
that cause VM-Exit on VMWRITE but not VMREAD need to be propagated to
the shadow VMCS during VMWRITE emulation, otherwise a subsequence VMREAD
from L1 will consume a stale value.

Note, KVM currently utilizes asymmetric bitmaps when "VMWRITE any field"
is not exposed to L1, but only so that it can reject the VMWRITE, i.e.
propagating the VMWRITE to the shadow VMCS is a new requirement, not a
bug fix.

Eliminating the copying of RO fields reduces the latency of nested
VM-Entry (copy_shadow_to_vmcs12()) by ~100 cycles (plus 40-50 cycles
if/when the AR_BYTES fields are exposed RO).

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-06-18 11:46:04 +02:00
..
vmx KVM: nVMX: Intercept VMWRITEs to read-only shadow VMCS fields 2019-06-18 11:46:04 +02:00
cpuid.c kvm: x86: add host poll control msrs 2019-06-18 11:43:46 +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: offset is ensure to be in range 2019-06-18 11:43:48 +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: VMX: Handle NMIs, #MCs and async #PFs in common irqs-disabled fn 2019-06-18 11:46:04 +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: VMX: Handle NMIs, #MCs and async #PFs in common irqs-disabled fn 2019-06-18 11:46:04 +02:00
x86.h KVM: X86: Provide a capability to disable cstate msr read intercepts 2019-06-04 19:27:35 +02:00