Define a linker script alias of a kernel-proper symbol referenced by pKVM code. pKVM can directly use the alias defined symbol when sharing some Linux kernel header files, for example, the global physical_mask used by __PHYSICAL_MASK if CONFIG_DYNAMIC_PHYSICAL_MASK=true. TODO: security analysis if a kernel symbol can be directly used by pKVM. Signed-off-by: Jason Chen CJ <jason.cj.chen@xxxxxxxxx> --- arch/x86/include/asm/pkvm_image.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/include/asm/pkvm_image.h b/arch/x86/include/asm/pkvm_image.h index 191776677ce2..ed026b740a78 100644 --- a/arch/x86/include/asm/pkvm_image.h +++ b/arch/x86/include/asm/pkvm_image.h @@ -37,6 +37,12 @@ *(NAME NAME##.*) \ END_PKVM_SECTION +/* + * Defines a linker script alias of a kernel-proper symbol referenced by + * PKVM code. + */ +#define PKVM_ALIAS(sym) pkvm_sym(sym) = sym; + #endif /* LINKER_SCRIPT */ #endif /* __X86_INTEL_PKVM_IMAGE_H */ -- 2.25.1