On Fri, Aug 16, 2024 at 12:29:18AM +1200, Kai Huang wrote:
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index 9c9ac606893e..07ca9d3361a3 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -392,7 +392,7 @@ void machine_kexec(struct kimage *image)
(unsigned long)page_list,
image->start,
image->preserve_context,
- host_mem_enc_active);
+ !boot_cpu_has(X86_FEATURE_HYPERVISOR));
Everytime you feel the need to check a X86_FEATURE_ flag, make sure you use
cpu_feature_enabled().