[RFC PATCH PoC 05/11] HACK: provide __pti_set_user_pgtbl() to startup code

Ard Biesheuvel
2025-04-23T11:10:46Z

The SME startup code may call out to pti_set_user_pgtbl(), which is not
part of the code corpus that is explicitly built to tolerate execution
from the 1:1 mapping of memory.

Hack around this for now by providing an alternative that just returns
the pgd.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
arch/x86/boot/startup/sme.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/x86/boot/startup/sme.c b/arch/x86/boot/startup/sme.c
index 5738b31c8e60..d55b24cd4d08 100644
--- a/arch/x86/boot/startup/sme.c
+++ b/arch/x86/boot/startup/sme.c
@@ -564,3 +564,8 @@ void __head sme_enable(struct boot_params *bp)
cc_vendor = CC_VENDOR_AMD;
cc_set_mask(me_mask);
}
+
+pgd_t __pti_set_user_pgtbl(pgd_t *pgdp, pgd_t pgd)
+{
+ return pgd;
+}
--
2.49.0.805.g082f7c87e0-goog