[PATCH v2 1/2] xen/common: annotate saved_cmdline with __ro_after_init

[email protected] Mon, 3 Aug 2026 00:00:46 -0700
Newsgroups org.xenproject.lists.xen-devel
Message-ID <[email protected]>
From: Denis Mukhin <[email protected]> 

The hypervisor command line is not modified after initialization.
Annotate saved_cmdline with __ro_after_init to place it in the
dedicated read-only-after-init section.

Suggested-by: Jan Beulich <[email protected]>
Signed-off-by: Denis Mukhin <[email protected]>
---
Changes since v1:
- new patch
---
 xen/common/kernel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index fb45f8139995..d1bef9ac2b2b 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -34,7 +34,7 @@ bool __ro_after_init opt_dit = IS_ENABLED(CONFIG_DIT_DEFAULT);
 boolean_param("dit", opt_dit);
 #endif
 
-static xen_commandline_t saved_cmdline;
+static xen_commandline_t __ro_after_init saved_cmdline;
 static const char __initconst opt_builtin_cmdline[] = CONFIG_CMDLINE;
 char __ro_after_init xen_cap_info[128];
 
-- 
2.54.0