linux_dsm_epyc7002/arch/x86/kvm
Babu Moger 3b65909158 KVM: SVM: Clear the CR4 register on reset
[ Upstream commit 9e46f6c6c959d9bb45445c2e8f04a75324a0dfd0 ]

This problem was reported on a SVM guest while executing kexec.
Kexec fails to load the new kernel when the PCID feature is enabled.

When kexec starts loading the new kernel, it starts the process by
resetting the vCPU's and then bringing each vCPU online one by one.
The vCPU reset is supposed to reset all the register states before the
vCPUs are brought online. However, the CR4 register is not reset during
this process. If this register is already setup during the last boot,
all the flags can remain intact. The X86_CR4_PCIDE bit can only be
enabled in long mode. So, it must be enabled much later in SMP
initialization.  Having the X86_CR4_PCIDE bit set during SMP boot can
cause a boot failures.

Fix the issue by resetting the CR4 register in init_vmcb().

Signed-off-by: Babu Moger <babu.moger@amd.com>
Message-Id: <161471109108.30811.6392805173629704166.stgit@bmoger-ubuntu>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-11 14:17:29 +01:00
..
mmu KVM: x86/mmu: Expand collapsible SPTE zap for TDP MMU to ZONE_DEVICE and HugeTLB pages 2021-03-04 11:38:20 +01:00
svm KVM: SVM: Clear the CR4 register on reset 2021-03-11 14:17:29 +01:00
vmx KVM: x86: Allow guests to see MSR_IA32_TSX_CTRL even if tsx=off 2021-02-10 09:29:19 +01:00
cpuid.c KVM: x86: fix CPUID entries returned by KVM_GET_CPUID2 ioctl 2021-02-10 09:29:20 +01:00
cpuid.h KVM: x86: reinstate vendor-agnostic check on SPEC_CTRL cpuid bits 2020-12-30 11:54:14 +01:00
debugfs.c
emulate.c KVM: x86: Restore all 64 bits of DR6 and DR7 during RSM on x86-64 2021-03-04 11:37:48 +01:00
hyperv.c ARM: 2020-10-23 11:17:56 -07:00
hyperv.h
i8254.c
i8254.h
i8259.c
ioapic.c KVM: ioapic: break infinite recursion on lazy EOI 2020-10-24 04:42:06 -04:00
ioapic.h
irq_comm.c
irq.c KVM: x86: Fix split-irqchip vs interrupt injection window request 2020-11-27 09:27:28 -05:00
irq.h
Kconfig
kvm_cache_regs.h
kvm_emulate.h
lapic.c KVM: x86: handle !lapic_in_kernel case in kvm_cpu_*_extint 2020-11-27 09:19:52 -05:00
lapic.h
Makefile kvm: x86/mmu: Init / Uninit the TDP MMU 2020-10-21 18:17:00 -04:00
mmu.h KVM: x86: fix shift out of bounds reported by UBSAN 2021-01-12 20:18:26 +01:00
mtrr.c
pmu.c
pmu.h
trace.h
tss.h
x86.c KVM: x86: cleanup CR3 reserved bits checks 2021-02-17 11:02:24 +01:00
x86.h KVM: x86: Supplement __cr4_reserved_bits() with X86_FEATURE_PCID check 2021-03-11 14:17:26 +01:00