From: Alexey Dobriyan Date: Fri, 2 Aug 2024 15:42:53 +0000 (+0300) Subject: xen, pvh: fix unbootable VMs by inlining memset() in xen_prepare_pvh() X-Git-Tag: microblaze-v6.13~32^2~13 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=fbe5a6dfe492eff8b0adef85fcabd84e246f1102;p=linux-2.6-microblaze.git xen, pvh: fix unbootable VMs by inlining memset() in xen_prepare_pvh() If this memset() is not inlined than PVH early boot code can call into KASAN-instrumented memset() which results in unbootable VMs. Signed-off-by: Alexey Dobriyan Acked-by: Juergen Gross Message-ID: <20240802154253.482658-3-adobriyan@gmail.com> Signed-off-by: Juergen Gross --- diff --git a/arch/x86/platform/pvh/enlighten.c b/arch/x86/platform/pvh/enlighten.c index 944e0290f2c0..2263885d16ba 100644 --- a/arch/x86/platform/pvh/enlighten.c +++ b/arch/x86/platform/pvh/enlighten.c @@ -130,7 +130,11 @@ void __init xen_prepare_pvh(void) BUG(); } - memset(&pvh_bootparams, 0, sizeof(pvh_bootparams)); + /* + * This must not compile to "call memset" because memset() may be + * instrumented. + */ + __builtin_memset(&pvh_bootparams, 0, sizeof(pvh_bootparams)); hypervisor_specific_init(xen_guest);