Message ID | 20220127101044.13803-2-joro@8bytes.org |
---|---|
State | New |
Headers | show |
Series | [v3,01/10] x86/kexec/64: Disable kexec when SEV-ES is active | expand |
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index f5da4a18070a..5079a75f8944 100644 --- a/arch/x86/kernel/machine_kexec_64.c +++ b/arch/x86/kernel/machine_kexec_64.c @@ -269,11 +269,22 @@ static void load_segments(void) ); } +static bool machine_kexec_supported(void) +{ + if (cc_platform_has(CC_ATTR_GUEST_STATE_ENCRYPT)) + return false; + + return true; +} + int machine_kexec_prepare(struct kimage *image) { unsigned long start_pgtable; int result; + if (!machine_kexec_supported()) + return -ENOSYS; + /* Calculate the offsets */ start_pgtable = page_to_pfn(image->control_code_page) << PAGE_SHIFT;