linux-stable/arch/x86
Maxim Levitsky af957eebfc KVM: nVMX: don't use vcpu->arch.efer when checking host state on nested state load
When loading nested state, don't use check vcpu->arch.efer to get the
L1 host's 64-bit vs. 32-bit state and don't check it for consistency
with respect to VM_EXIT_HOST_ADDR_SPACE_SIZE, as register state in vCPU
may be stale when KVM_SET_NESTED_STATE is called---and architecturally
does not exist.  When restoring L2 state in KVM, the CPU is placed in
non-root where nested VMX code has no snapshot of L1 host state: VMX
(conditionally) loads host state fields loaded on VM-exit, but they need
not correspond to the state before entry.  A simple case occurs in KVM
itself, where the host RIP field points to vmx_vmexit rather than the
instruction following vmlaunch/vmresume.

However, for the particular case of L1 being in 32- or 64-bit mode
on entry, the exit controls can be treated instead as the source of
truth regarding the state of L1 on entry, and can be used to check
that vmcs12.VM_EXIT_HOST_ADDR_SPACE_SIZE matches vmcs12.HOST_EFER if
vmcs12.VM_EXIT_LOAD_IA32_EFER is set.  The consistency check on CPU
EFER vs. vmcs12.VM_EXIT_HOST_ADDR_SPACE_SIZE, instead, happens only
on VM-Enter.  That's because, again, there's conceptually no "current"
L1 EFER to check on KVM_SET_NESTED_STATE.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20211115131837.195527-2-mlevitsk@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-18 02:03:42 -05:00
..
boot Kbuild updates for v5.15 2021-09-03 15:33:47 -07:00
configs configs: remove the obsolete CONFIG_INPUT_POLLDEV 2021-09-08 11:50:28 -07:00
crypto crypto: x86/sm4 - Fix frame pointer stack corruption 2021-09-24 15:58:50 +08:00
entry compat: remove some compat entry points 2021-09-08 15:32:35 -07:00
events perf/x86/intel: Update event constraints for ICX 2021-10-01 13:57:54 +02:00
hyperv hyperv-fixes for 5.15-rc2 2021-09-15 17:18:56 -07:00
ia32 binfmt: remove in-tree usage of MAP_DENYWRITE 2021-09-03 18:42:01 +02:00
include KVM: x86: Drop arbitrary KVM_SOFT_MAX_VCPUS 2021-11-11 10:56:24 -05:00
kernel KVM: x86: Make sure KVM_CPUID_FEATURES really are KVM_CPUID_FEATURES 2021-11-11 10:56:21 -05:00
kvm KVM: nVMX: don't use vcpu->arch.efer when checking host state on nested state load 2021-11-18 02:03:42 -05:00
lib x86/insn, tools/x86: Fix undefined behavior due to potential unaligned accesses 2021-09-24 12:37:38 +02:00
math-emu x86/math-emu: Rename frstor() 2021-06-23 18:16:33 +02:00
mm x86/fault: Fix wrong signal when vsyscall fails with pkey 2021-09-20 22:28:47 +02:00
net bpf, x86: Fix bpf mapping of atomic fetch implementation 2021-09-28 12:10:29 +02:00
pci pci-v5.15-changes 2021-09-07 19:13:42 -07:00
platform EFI changes: two driver API cleanups, and a log message tweak. 2021-06-28 11:34:16 -07:00
power x86/power: Fix kernel-doc warnings in cpu.c 2021-08-12 10:15:40 +02:00
purgatory kernel.h: split out panic and oops helpers 2021-07-01 11:06:04 -07:00
ras
realmode memblock: make memblock_find_in_range method private 2021-09-03 09:58:17 -07:00
tools - Remove cc-option checks which are old and already supported by the 2021-08-30 13:27:16 -07:00
um um: fix stub location calculation 2021-08-26 22:28:03 +02:00
video
xen xen/x86: fix PV trap handling on secondary processors 2021-09-21 09:40:30 +02:00
.gitignore
Kbuild
Kconfig xen: branch for v5.15-rc3 2021-09-25 15:37:31 -07:00
Kconfig.assembler
Kconfig.cpu
Kconfig.debug tracing: Refactor TRACE_IRQFLAGS_SUPPORT in Kconfig 2021-08-16 11:37:21 -04:00
Makefile Kbuild updates for v5.15 2021-09-03 15:33:47 -07:00
Makefile.um um: allow not setting extra rpaths in the linux binary 2021-06-17 21:54:15 +02:00
Makefile_32.cpu x86/build: Do not add -falign flags unconditionally for clang 2021-09-19 10:35:53 +09:00