Skip to contentSkip to conversation

x86/entry: Add __init to ia32_emulation_override_cmdline()

PATCH In review Vitaly Kuznetsov 3 participants 6 messages Dec 10, 2024 – Jan 8, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/entry: Add __init to ia32_emulation_override_cmdline()

ia32_emulation_override_cmdline() is an early_param() arg and these are only needed at boot time. In fact, all other early_param() functions in arch/x86 seem to have '__init' annotation and ia32_emulation_override_cmdline() is the only exception.

Fixes a11e097504ac ("x86: Make IA32_EMULATION boot time configurable")
---
 arch/x86/entry/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/entry/common.c +1 -1
index 94941c5a10ac..51efd2da4d7f 100644
@@ -142,7 +142,7 @@ static __always_inline int syscall_32_enter(struct pt_regs *regs)
 #ifdef CONFIG_IA32_EMULATION
 bool __ia32_enabled __ro_after_init = !IS_ENABLED(CONFIG_IA32_EMULATION_DEFAULT_DISABLED);
 
-static int ia32_emulation_override_cmdline(char *arg)
+static int __init ia32_emulation_override_cmdline(char *arg)
 {
 	return kstrtobool(arg, &__ia32_enabled);
 }
Signature · 1 line
2.47.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Vitaly Kuznetsov

ia32_emulation_override_cmdline() is an early_param() arg and these are only needed at boot time. In fact, all other early_param() functions in arch/x86 seem to have '__init' annotation and ia32_emulation_override_cmdline() is the only exception.

Fixes a11e097504ac ("x86: Make IA32_EMULATION boot time configurable")

nit: Does it really warrant a Fix tag, it's not a bug per-se, just frees up some memory?

#2 lore raw
Quoted 11 lines · Nikolay Borisov
Quoted 7 lines · Vitaly Kuznetsov

ia32_emulation_override_cmdline() is an early_param() arg and these are only needed at boot time. In fact, all other early_param() functions in arch/x86 seem to have '__init' annotation and ia32_emulation_override_cmdline() is the only exception.

Fixes a11e097504ac ("x86: Make IA32_EMULATION boot time configurable")

Thanks!

Quoted 2 lines

nit: Does it really warrant a Fix tag, it's not a bug per-se, just frees up some memory?

I don't think we have any issues with early_param() functions without __init currently, by 'Fixes:' I meant "this fixes commit ... which was sub-optimal" and to help backporters. I'm absolutely fine with dropping it if that's the consensus.

Signature · 1 line
Vitaly
#3 lore raw
In reply to Vitaly Kuznetsov
Quoted 16 lines · Vitaly Kuznetsov

ia32_emulation_override_cmdline() is an early_param() arg and these are only needed at boot time. In fact, all other early_param() functions in arch/x86 seem to have '__init' annotation and ia32_emulation_override_cmdline() is the only exception.

Fixes a11e097504ac ("x86: Make IA32_EMULATION boot time configurable")
---
 arch/x86/entry/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/entry/common.c +0 -0
index 94941c5a10ac..51efd2da4d7f 100644

arch/x86/entry/common.c static __always_inline int syscall_32_enter(struct pt_regs *regs) · line 148

Quoted 8 lines
arch/x86/entry/common.c +1 -1
@@ -142,7 +142,7 @@ static __always_inline int syscall_32_enter(struct pt_regs *regs)
 #ifdef CONFIG_IA32_EMULATION
 bool __ia32_enabled __ro_after_init = !IS_ENABLED(CONFIG_IA32_EMULATION_DEFAULT_DISABLED);
 
-static int ia32_emulation_override_cmdline(char *arg)
+static int __init ia32_emulation_override_cmdline(char *arg)
 {
 	return kstrtobool(arg, &__ia32_enabled);
 }

Post-holidays ping)

Signature · 1 line
Vitaly
#4 lore raw
Quoted 6 lines · Vitaly Kuznetsov

arch/x86/entry/common.c static __always_inline int syscall_32_enter(struct pt_regs *regs) · line 148

Quoted 5 lines
arch/x86/entry/common.c +1 -1
-static int ia32_emulation_override_cmdline(char *arg)
+static int __init ia32_emulation_override_cmdline(char *arg)
 {
 	return kstrtobool(arg, &__ia32_enabled);
 }

Post-holidays ping)

I'll put this in the queue to look at after the next merge window since it looks like pure housekeeping.

Is there any reason to do it with any more urgency?

#5 lore raw
Quoted 8 lines · Dave Hansen
Quoted 6 lines · Vitaly Kuznetsov

arch/x86/entry/common.c static __always_inline int syscall_32_enter(struct pt_regs *regs) · line 148

Quoted 5 lines
arch/x86/entry/common.c +1 -1
-static int ia32_emulation_override_cmdline(char *arg)
+static int __init ia32_emulation_override_cmdline(char *arg)
 {
 	return kstrtobool(arg, &__ia32_enabled);
 }

Post-holidays ping)

Quoted 4 lines

I'll put this in the queue to look at after the next merge window since it looks like pure housekeeping.

Is there any reason to do it with any more urgency?

No reason, just checking that it doesn't fall through the cracks. Thanks!

Signature · 1 line
Vitaly