[PATCH v5 3/3] x86/pvh: fix unbootable VMs by really inlining memset() in xen_prepare_pvh()
From: Mauricio Faria de Oliveira
Date: Mon Jun 01 2026 - 14:07:04 EST
Even with __builtin the compiler may decide to use the out of line function
instead of the inline implementation.
This particular one (still) generated the inline implementation as expected
(at least in these compiler versions) but this is not guaranteed to remain.
Switch the builtin to the inline implementation to address it.
Fixes: fbe5a6dfe492 ("xen, pvh: fix unbootable VMs by inlining memset() in xen_prepare_pvh()")
Signed-off-by: Mauricio Faria de Oliveira <mfo@xxxxxxxxxx>
Reviewed-by: Juergen Gross <jgross@xxxxxxxx>
---
arch/x86/platform/pvh/enlighten.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/platform/pvh/enlighten.c b/arch/x86/platform/pvh/enlighten.c
index f2053cbe9b0ce3d2178938269607c652ae8f528e..cb442cbd9d828619421babb281bfe9759edbca8a 100644
--- a/arch/x86/platform/pvh/enlighten.c
+++ b/arch/x86/platform/pvh/enlighten.c
@@ -8,6 +8,7 @@
#include <asm/hypervisor.h>
#include <asm/e820/api.h>
#include <asm/x86_init.h>
+#include <asm/string.h>
#include <asm/xen/interface.h>
@@ -129,7 +130,7 @@ void __init xen_prepare_pvh(void)
* This must not compile to "call memset" because memset() may be
* instrumented.
*/
- __builtin_memset(&pvh_bootparams, 0, sizeof(pvh_bootparams));
+ __inline_memset(&pvh_bootparams, 0, sizeof(pvh_bootparams));
hypervisor_specific_init(xen_guest);
--
2.51.0