Message ID | d316e5dda29bb45e85305077f8f8c6f17a82855e.1699527082.git.kai.huang@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | TDX host kernel support | expand |
On 11/9/23 03:55, Kai Huang wrote: > #include <asm/page.h> > @@ -1402,6 +1404,15 @@ static int __init tdx_init(void) > return -ENODEV; > } > > + /* > + * At this point, hibernation_available() indicates whether or > + * not hibernation support has been permanently disabled. > + */ > + if (hibernation_available()) { > + pr_err("initialization failed: Hibernation support is enabled\n"); > + return -ENODEV; > + } > + > err = register_memory_notifier(&tdx_memory_nb); > if (err) { > pr_err("initialization failed: register_memory_notifier() failed (%d)\n", > @@ -1417,6 +1428,11 @@ static int __init tdx_init(void) > return -ENODEV; > } > > +#if defined(CONFIG_ACPI) && defined(CONFIG_SUSPEND) > + pr_info("Disable ACPI S3. Turn off TDX in the BIOS to use ACPI S3.\n"); > + acpi_suspend_lowlevel = NULL; > +#endif Rafael, are you OK with how this patch ended up? An ack would be much appreciated if so.
diff --git a/arch/x86/virt/vmx/tdx/tdx.c b/arch/x86/virt/vmx/tdx/tdx.c index 53a87034ad59..cc21a0f25bee 100644 --- a/arch/x86/virt/vmx/tdx/tdx.c +++ b/arch/x86/virt/vmx/tdx/tdx.c @@ -26,6 +26,8 @@ #include <linux/sort.h> #include <linux/log2.h> #include <linux/reboot.h> +#include <linux/acpi.h> +#include <linux/suspend.h> #include <asm/msr-index.h> #include <asm/msr.h> #include <asm/page.h> @@ -1402,6 +1404,15 @@ static int __init tdx_init(void) return -ENODEV; } + /* + * At this point, hibernation_available() indicates whether or + * not hibernation support has been permanently disabled. + */ + if (hibernation_available()) { + pr_err("initialization failed: Hibernation support is enabled\n"); + return -ENODEV; + } + err = register_memory_notifier(&tdx_memory_nb); if (err) { pr_err("initialization failed: register_memory_notifier() failed (%d)\n", @@ -1417,6 +1428,11 @@ static int __init tdx_init(void) return -ENODEV; } +#if defined(CONFIG_ACPI) && defined(CONFIG_SUSPEND) + pr_info("Disable ACPI S3. Turn off TDX in the BIOS to use ACPI S3.\n"); + acpi_suspend_lowlevel = NULL; +#endif + /* * Just use the first TDX KeyID as the 'global KeyID' and * leave the rest for TDX guests.