Re: [External] Re: [PATCH v13 00/11] Parallel CPU bringup for x86_64

From: Usama Arif
Date: Wed Mar 08 2023 - 09:11:58 EST




static bool prepare_parallel_bringup(void)
{
bool has_sev_es = IS_ENABLED(CONFIG_AMD_MEM_ENCRYPT) &&
static_branch_unlikely(&sev_es_enable_key);

sev_es_enable_key is only defined when CONFIG_AMD_MEM_ENCRYPT is enabled, so it gives a build error when AMD_MEM_ENCRYPT is disabled. maybe below is better?

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 282cca020777..e7df41436cfe 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1519,8 +1519,12 @@ void __init smp_prepare_cpus_common(void)
*/
static bool prepare_parallel_bringup(void)
{
- bool has_sev_es = IS_ENABLED(CONFIG_AMD_MEM_ENCRYPT) &&
- static_branch_unlikely(&sev_es_enable_key);
+ bool has_sev_es;
+#ifdef CONFIG_AMD_MEM_ENCRYPT
+ has_sev_es = static_branch_unlikely(&sev_es_enable_key);
+#else
+ has_sev_es = 0;
+#endif

if (IS_ENABLED(CONFIG_X86_32))
return false;