Skip to content

Commit 12441cc

Browse files
rddunlapsuryasaimadhu
authored andcommitted
x86: Fix return value of __setup handlers
__setup() handlers should return 1 to obsolete_checksetup() in init/main.c to indicate that the boot option has been handled. A return of 0 causes the boot option/value to be listed as an Unknown kernel parameter and added to init's (limited) argument (no '=') or environment (with '=') strings. So return 1 from these x86 __setup handlers. Examples: Unknown kernel command line parameters "apicpmtimer BOOT_IMAGE=/boot/bzImage-517rc8 vdso=1 ring3mwait=disable", will be passed to user space. Run /sbin/init as init process with arguments: /sbin/init apicpmtimer with environment: HOME=/ TERM=linux BOOT_IMAGE=/boot/bzImage-517rc8 vdso=1 ring3mwait=disable Fixes: 2aae950 ("x86_64: Add vDSO for x86-64 with gettimeofday/clock_gettime/getcpu") Fixes: 77b52b4 ("x86: add "debugpat" boot option") Fixes: e16fd00 ("x86/cpufeature: Enable RING3MWAIT for Knights Landing") Fixes: b8ce335 ("x86_64: convert to clock events") Reported-by: Igor Zhbanov <[email protected]> Signed-off-by: Randy Dunlap <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected]
1 parent b86eb74 commit 12441cc

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

arch/x86/entry/vdso/vma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ bool arch_syscall_is_vdso_sigreturn(struct pt_regs *regs)
438438
static __init int vdso_setup(char *s)
439439
{
440440
vdso64_enabled = simple_strtoul(s, NULL, 0);
441-
return 0;
441+
return 1;
442442
}
443443
__setup("vdso=", vdso_setup);
444444

arch/x86/kernel/apic/apic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static __init int setup_apicpmtimer(char *s)
170170
{
171171
apic_calibrate_pmtmr = 1;
172172
notsc_setup(NULL);
173-
return 0;
173+
return 1;
174174
}
175175
__setup("apicpmtimer", setup_apicpmtimer);
176176
#endif

arch/x86/kernel/cpu/intel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static bool ring3mwait_disabled __read_mostly;
9191
static int __init ring3mwait_disable(char *__unused)
9292
{
9393
ring3mwait_disabled = true;
94-
return 0;
94+
return 1;
9595
}
9696
__setup("ring3mwait=disable", ring3mwait_disable);
9797

arch/x86/mm/pat/memtype.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ int pat_debug_enable;
101101
static int __init pat_debug_setup(char *str)
102102
{
103103
pat_debug_enable = 1;
104-
return 0;
104+
return 1;
105105
}
106106
__setup("debugpat", pat_debug_setup);
107107

0 commit comments

Comments
 (0)