]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/fpu: Allow multiple bits in clearcpuid= parameter
authorArvind Sankar <nivedita@alum.mit.edu>
Mon, 7 Sep 2020 21:39:19 +0000 (17:39 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 09:07:14 +0000 (10:07 +0100)
commitb45c14f9b0c6c842c5ccceb9b296fcf605d3cf4b
tree56e1ad3420d71e0403a34f2c6f4aa1bf2523d126
parent4f596c780958cab8f5bb50a094a8a3a87886c9be
x86/fpu: Allow multiple bits in clearcpuid= parameter

[ Upstream commit 0a4bb5e5507a585532cc413125b921c8546fc39f ]

Commit

  0c2a3913d6f5 ("x86/fpu: Parse clearcpuid= as early XSAVE argument")

changed clearcpuid parsing from __setup() to cmdline_find_option().
While the __setup() function would have been called for each clearcpuid=
parameter on the command line, cmdline_find_option() will only return
the last one, so the change effectively made it impossible to disable
more than one bit.

Allow a comma-separated list of bit numbers as the argument for
clearcpuid to allow multiple bits to be disabled again. Log the bits
being disabled for informational purposes.

Also fix the check on the return value of cmdline_find_option(). It
returns -1 when the option is not found, so testing as a boolean is
incorrect.

Fixes: 0c2a3913d6f5 ("x86/fpu: Parse clearcpuid= as early XSAVE argument")
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20200907213919.2423441-1-nivedita@alum.mit.edu
Signed-off-by: Sasha Levin <sashal@kernel.org>
Documentation/admin-guide/kernel-parameters.txt
arch/x86/kernel/fpu/init.c