OpenCloudOS-Kernel/arch/x86/kvm/svm
Babu Moger 9e46f6c6c9 KVM: SVM: Clear the CR4 register on reset
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>
2021-03-02 14:39:11 -05:00
..
avic.c KVM: SVM: Move AVIC vCPU kicking snippet to helper function 2021-02-09 08:17:06 -05:00
nested.c KVM: nSVM: prepare guest save area while is_guest_mode is true 2021-02-22 13:11:56 -05:00
pmu.c KVM: x86/pmu: Tweak kvm_pmu_get_msr to pass 'struct msr_data' in 2020-06-01 04:26:08 -04:00
sev.c KVM: SVM: use .prepare_guest_switch() to handle CPU register save/setup 2021-02-04 05:27:35 -05:00
svm.c KVM: SVM: Clear the CR4 register on reset 2021-03-02 14:39:11 -05:00
svm.h KVM: SVM: use .prepare_guest_switch() to handle CPU register save/setup 2021-02-04 05:27:35 -05:00
svm_ops.h KVM: SVM: use vmsave/vmload for saving/restoring additional host state 2021-02-04 05:27:34 -05:00
vmenter.S KVM: SVM: Provide an updated VMRUN invocation for SEV-ES guests 2020-12-15 05:20:59 -05:00