]> git.baikalelectronics.ru Git - kernel.git/commit
x86: Fix return value of __setup handlers
authorRandy Dunlap <rdunlap@infradead.org>
Mon, 14 Mar 2022 01:27:25 +0000 (18:27 -0700)
committerBorislav Petkov <bp@suse.de>
Wed, 4 May 2022 14:47:57 +0000 (16:47 +0200)
commit3175206056a6f11dc1fe9ef0628c2e418ce12816
tree8b858c97a85a98ba2a27e91b6aa4d7a5b04a3b41
parent9ba5a1311b5fed4abbacc9a4e3e345a6029a0171
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: d5f8a2e57c38 ("x86_64: Add vDSO for x86-64 with gettimeofday/clock_gettime/getcpu")
Fixes: 4431a41a0cea ("x86: add "debugpat" boot option")
Fixes: 56290184b0a9 ("x86/cpufeature: Enable RING3MWAIT for Knights Landing")
Fixes: 80b04f422625 ("x86_64: convert to clock events")
Reported-by: Igor Zhbanov <i.zhbanov@omprussia.ru>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru
Link: https://lore.kernel.org/r/20220314012725.26661-1-rdunlap@infradead.org
arch/x86/entry/vdso/vma.c
arch/x86/kernel/apic/apic.c
arch/x86/kernel/cpu/intel.c
arch/x86/mm/pat/memtype.c