diff mbox series

[RFC,1/5] dump_stack: Make arch description buffer __ro_after_init

Message ID 20240118-update-dump-stack-arch-str-v1-1-5c0f98d017b5@linux.ibm.com (mailing list archive)
State New
Headers show
Series dump_stack: Allow runtime updates of the hardware description | expand

Commit Message

Nathan Lynch via B4 Relay Jan. 18, 2024, 3:25 p.m. UTC
From: Nathan Lynch <nathanl@linux.ibm.com>

The static hardware description buffer is populated by arch code
during boot and should not change afterwards, so mark it
__ro_after_init.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
 lib/dump_stack.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/dump_stack.c b/lib/dump_stack.c
index 83471e81501a..1057f102f6f2 100644
--- a/lib/dump_stack.c
+++ b/lib/dump_stack.c
@@ -6,6 +6,7 @@ 
 
 #include <linux/kernel.h>
 #include <linux/buildid.h>
+#include <linux/cache.h>
 #include <linux/export.h>
 #include <linux/sched.h>
 #include <linux/sched/debug.h>
@@ -15,7 +16,7 @@ 
 #include <linux/utsname.h>
 #include <linux/stop_machine.h>
 
-static char dump_stack_arch_desc_str[128];
+static char dump_stack_arch_desc_str[128] __ro_after_init;
 
 /**
  * dump_stack_set_arch_desc - set arch-specific str to show with task dumps