Skip to contentSkip to conversation

Documentation: Merge x86-specific boot options doc into kernel-parameters.txt

PATCH In review Borislav Petkov 3 participants 7 messages Nov 20, 2024

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

PATCH 1/2 Documentation: Merge x86-specific boot options doc into kernel-parameters.txt

From: "Borislav Petkov (AMD)" <[email protected]>

Documentation/arch/x86/x86_64/boot-options.rst is causing unnecessary confusion by being a second place where one can put x86 boot options. Move them into the main one.

Drop removed ones like "acpi=ht", while at it.

---
 .../admin-guide/kernel-parameters.rst         |   3 -
 .../admin-guide/kernel-parameters.txt         | 214 ++++++++++--
 .../arch/x86/x86_64/boot-options.rst          | 312 ------------------
 .../arch/x86/x86_64/fake-numa-for-cpusets.rst |   2 +-
 arch/x86/Kconfig.debug                        |   2 +-
 arch/x86/kernel/pci-dma.c                     |   4 -
 6 files changed, 194 insertions(+), 343 deletions(-)
 delete mode 100644 Documentation/arch/x86/x86_64/boot-options.rst
Documentation/admin-guide/kernel-parameters.rst +0 -3
index fdea7c26ef80..5f68b40247d4 100644
@@ -178,8 +178,6 @@ is applicable::
 	WDT	Watchdog support is enabled.
 	X86-32	X86-32, aka i386 architecture is enabled.
 	X86-64	X86-64 architecture is enabled.
-			More X86-64 boot options can be found in
-			Documentation/arch/x86/x86_64/boot-options.rst.
 	X86	Either 32-bit or 64-bit x86 (same as X86-32+X86-64)
 	X86_UV	SGI UV support is enabled.
 	XEN	Xen support is enabled
@@ -197,7 +195,6 @@ Do not modify the syntax of boot loader parameters without extreme
 need or coordination with <Documentation/arch/x86/boot.rst>.
 
 There are also arch-specific kernel-parameters not documented here.
-See for example <Documentation/arch/x86/x86_64/boot-options.rst>.
 
 Note that ALL kernel parameters listed below are CASE SENSITIVE, and that
 a trailing = on the name of any parameter states that that parameter will
Documentation/admin-guide/kernel-parameters.txt +192 -22

301 lines not on this page · raw message

Documentation/arch/x86/x86_64/boot-options.rst deleted +0 -312

312 lines not on this page · raw message

Documentation/arch/x86/x86_64/fake-numa-for-cpusets.rst +1 -1
index ba74617d4999..970ee94eb551 100644
@@ -18,7 +18,7 @@ For more information on the features of cpusets, see
 Documentation/admin-guide/cgroup-v1/cpusets.rst.
 There are a number of different configurations you can use for your needs.  For
 more information on the numa=fake command line option and its various ways of
-configuring fake nodes, see Documentation/arch/x86/x86_64/boot-options.rst.
+configuring fake nodes, see Documentation/admin-guide/kernel-parameters.txt
 
 For the purposes of this introduction, we'll assume a very primitive NUMA
 emulation setup of "numa=fake=4*512,".  This will split our system memory into
arch/x86/Kconfig.debug +1 -1
index 74777a97e394..1eb4d23cdaae 100644
@@ -97,7 +97,7 @@ config IOMMU_DEBUG
 	  code. When you use it make sure you have a big enough
 	  IOMMU/AGP aperture.  Most of the options enabled by this can
 	  be set more finegrained using the iommu= command line
-	  options. See Documentation/arch/x86/x86_64/boot-options.rst for more
+	  options. See Documentation/admin-guide/kernel-parameters.txt for more
 	  details.
 
 config IOMMU_LEAK
arch/x86/kernel/pci-dma.c +0 -4
index f323d83e40a7..6267363e0189 100644
@@ -108,10 +108,6 @@ void __init pci_iommu_alloc(void)
 	swiotlb_init(x86_swiotlb_enable, x86_swiotlb_flags);
 }
 
-/*
- * See <Documentation/arch/x86/x86_64/boot-options.rst> for the iommu kernel
- * parameter documentation.
- */
 static __init int iommu_setup(char *p)
 {
 	iommu_merge = 1;
Signature · 1 line
2.43.0
#1 lore raw

PATCH 2/2 x86/apic: Remove "disablelapic" cmdline option

From: "Borislav Petkov (AMD)" <[email protected]>

The convention is "no<something>" and there already is "nolapic". Drop the disable one.

---
 arch/x86/kernel/apic/apic.c    | 9 +--------
 arch/x86/kernel/cpu/topology.c | 2 +-
 2 files changed, 2 insertions(+), 9 deletions(-)
arch/x86/kernel/apic/apic.c +1 -8
index c5fb28e6451a..1267b2691abc 100644
@@ -2582,19 +2582,12 @@ int apic_is_clustered_box(void)
 /*
  * APIC command line parameters
  */
-static int __init setup_disableapic(char *arg)
+static int __init setup_nolapic(char *arg)
 {
 	apic_is_disabled = true;
 	setup_clear_cpu_cap(X86_FEATURE_APIC);
 	return 0;
 }
-early_param("disableapic", setup_disableapic);
-
-/* same as disableapic, for compatibility */
-static int __init setup_nolapic(char *arg)
-{
-	return setup_disableapic(arg);
-}
 early_param("nolapic", setup_nolapic);
 
 static int __init parse_lapic_timer_c2_ok(char *arg)
arch/x86/kernel/cpu/topology.c +1 -1
index 621a151ccf7d..6ebed852a9ef 100644
@@ -428,7 +428,7 @@ void __init topology_apply_cmdline_limits_early(void)
 {
 	unsigned int possible = nr_cpu_ids;
 
-	/* 'maxcpus=0' 'nosmp' 'nolapic' 'disableapic' 'noapic' */
+	/* 'maxcpus=0' 'nosmp' 'nolapic' 'noapic' */
 	if (!setup_max_cpus || ioapic_is_disabled || apic_is_disabled)
 		possible = 1;
 
Signature · 1 line
2.43.0
#2 lore raw
In reply to Borislav Petkov
Quoted 9 lines · Borislav Petkov

From: "Borislav Petkov (AMD)" <[email protected]>

Documentation/arch/x86/x86_64/boot-options.rst is causing unnecessary confusion by being a second place where one can put x86 boot options. Move them into the main one.

Drop removed ones like "acpi=ht", while at it.

Quoted 10 lines
---
 .../admin-guide/kernel-parameters.rst         |   3 -
 .../admin-guide/kernel-parameters.txt         | 214 ++++++++++--
 .../arch/x86/x86_64/boot-options.rst          | 312 ------------------
 .../arch/x86/x86_64/fake-numa-for-cpusets.rst |   2 +-
 arch/x86/Kconfig.debug                        |   2 +-
 arch/x86/kernel/pci-dma.c                     |   4 -
 6 files changed, 194 insertions(+), 343 deletions(-)
 delete mode 100644 Documentation/arch/x86/x86_64/boot-options.rst

Remove it from the index too?

(quoted diff) +0 -0

b/Documentation/arch/x86/x86_64/index.rst
index ad15e9bd623f..a0261957a08a 100644

Documentation/arch/x86/x86_64/index.rst +0 -1
@@ -7,7 +7,6 @@ x86_64 Support
 .. toctree::
    :maxdepth: 2
 
-   boot-options
    uefi
    mm
    5level-paging

Review

Quoted 4 lines
(quoted diff) +4 -0
+			triple: Force a triple fault (init)
+
+      			warm: Don't set the cold reboot flag
+

Whitespace error here: space before tab in indent

maintainer
#3 lore raw
Quoted 1 line · Sohil Mehta

Remove it from the index too?

...

Quoted 1 line

Whitespace error here: space before tab in indent

Both fixed.

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#4 lore raw
In reply to Borislav Petkov
Quoted 57 lines · Borislav Petkov
Documentation/admin-guide/kernel-parameters.txt +52 -1
@@ -3254,9 +3306,68 @@
 			devices can be requested on-demand with the
 			/dev/loop-control interface.
 
-	mce		[X86-32] Machine Check Exception
+	mce=		[X86-{32,64}]
+
+			Please see Documentation/arch/x86/x86_64/machinecheck.rst for sysfs runtime tunables.
+
+			off: disable machine check
+
+			no_cmci: disable CMCI(Corrected Machine Check
+			Interrupt) that Intel processor supports.  Usually
+			this disablement is not recommended, but it might be
+			handy if your hardware is misbehaving.
+
+			Note that you'll get more problems without CMCI than
+			with due to the shared banks, i.e. you might get
+			duplicated error logs.
+
+			dont_log_ce: don't make logs for corrected errors.
+			All events reported as corrected are silently cleared
+			by OS. This option will be useful if you have no
+			interest in any of corrected errors.
+
+			ignore_ce: disable features for corrected errors, e.g.
+			polling timer and CMCI.  All events reported as
+			corrected are not cleared by OS and remained in its
+			error banks.
+
+			Usually this disablement is not recommended, however
+			if there is an agent checking/clearing corrected
+			errors (e.g. BIOS or hardware monitoring
+			applications), conflicting with OS's error handling,
+			and you cannot deactivate the agent, then this option
+			will be a help.
+
+			no_lmce: do not opt-in to Local MCE delivery. Use
+			legacy method to broadcast MCEs.
+
+			bootlog: enable logging of machine checks left over
+			from booting. Disabled by default on AMD Fam10h and
+			older because some BIOS leave bogus ones.
+
+			If your BIOS doesn't do that it's a good idea to
+			enable though to make sure you log even machine check
+			events that result in a reboot. On Intel systems it is
+			enabled by default.
+
+			nobootlog: disable boot machine check logging.
+
+			monarchtimeout (number): sets the time in us to wait
+			for other CPUs on machine checks. 0 to disable.
+
+			bios_cmci_threshold: don't overwrite the bios-set CMCI
+			threshold. This boot option prevents Linux from
+			overwriting the CMCI threshold set by the bios.

Documentation/admin-guide/kernel-parameters.txt line 3370

Quoted 10 lines
Documentation/admin-guide/kernel-parameters.txt +9 -0
+			Without this option, Linux always sets the CMCI
+			threshold to 1. Enabling this may make memory
+			predictive failure analysis less effective if the bios
+			sets thresholds for memory errors since we will not
+			see details for all errors.
+
+			recovery: force-enable recoverable machine check code paths
+
+			Everything else is in sysfs now.
 

Instead of double tabs and <option>: <description>, would this be more readable if the options and their descriptions are separated? Something like the below wouldn't increase over width either.

mce= [X86-{32,64}]

Please see Documentation/arch/x86/x86_64/machinecheck.rst for sysfs
runtime tunables.

off disable machine check

no_cmci
disable CMCI(Corrected Machine Check Interrupt) that Intel processor supports. Usually this disablement is not recommended, but it might be handy if your hardware is misbehaving.

Note that you'll get more problems without CMCI than with due to the shared banks, i.e. you might get duplicated error logs.

dont_log_ce
don't make logs for corrected errors.
All events reported as corrected are silently cleared by OS. This option will be useful if you have no interest in any of corrected errors.

ignore_ce
disable features for corrected errors, e.g. polling timer and CMCI. All events reported as corrected are not cleared by OS and remained in its error banks.

Usually this disablement is not recommended, however if there is an agent checking/clearing corrected errors (e.g. BIOS or hardware monitoring applications), conflicting with OS's error handling, and you cannot deactivate the agent, then this option will be a help.

no_lmce
do not opt-in to Local MCE delivery. Use legacy method to broadcast MCEs.

bootlog: enable logging of machine checks left over from booting. Disabled by default on AMD Fam10h and older because some BIOS leave bogus ones.

If your BIOS doesn't do that it's a good idea to enable though to make sure you log even machine check events that result in a reboot. On Intel systems it is enabled by default.

nobootlog
disable boot machine check logging.

monarchtimeout (number)
sets the time in us to wait
for other CPUs on machine checks. 0 to disable.

bios_cmci_threshold
don't overwrite the bios-set CMCI threshold. This boot option prevents Linux from overwriting the CMCI threshold set by the bios. Without this option, Linux always sets the CMCI threshold to 1. Enabling this may make memory predictive failure analysis less effective if the bios sets thresholds for memory errors since we will not see details for all errors.

recovery
force-enable recoverable machine check code paths

Everything else is in sysfs now.

Quoted 38 lines
Documentation/admin-guide/kernel-parameters.txt +31 -1
-	mce=option	[X86-64] See Documentation/arch/x86/x86_64/boot-options.rst
 
 
@@ -5701,6 +5825,47 @@
 			      reboot_cpu is s[mp]#### with #### being the processor
 					to be used for rebooting.
 
+			acpi: Use the ACPI RESET_REG in the FADT. If ACPI is
+			not configured or the ACPI reset does not work, the
+			reboot path attempts the reset using the keyboard
+			controller.
+
+			bios: Use the CPU reboot vector for warm reset
+
+			cold: Set the cold reboot flag
+
+			default: There are some built-in platform specific
+			"quirks" - you may see: "reboot: <name> series board
+			detected. Selecting <type> for reboots." In the case
+			where you think the quirk is in error (e.g. you have
+			newer BIOS, or newer board) using this option will
+			ignore the built-in quirk table, and use the generic
+			default reboot actions.
+
+			efi: Use efi reset_system runtime service. If EFI is
+			not configured or the EFI reset does not work, the
+			reboot path attempts the reset using the keyboard
+			controller.
+
+			force: Don't stop other CPUs on reboot. This can make
+			reboot more reliable in some cases.
+
+			kbd: Use the keyboard controller. cold reset (default)
+
+			pci: Use a write to the PCI config space register
+			0xcf9 to trigger reboot.
+
+			triple: Force a triple fault (init)

Documentation/admin-guide/kernel-parameters.txt line 5868

Quoted 10 lines
Documentation/admin-guide/kernel-parameters.txt +10 -0
+
+      			warm: Don't set the cold reboot flag
+
+			Using warm reset will be much faster especially on big
+			memory systems because the BIOS will not go through
+			the memory check.  Disadvantage is that not all
+			hardware will be completely reinitialized on reboot so
+			there may be boot problems on some systems.
+
+

Same suggestion here.

maintainer
#5 lore raw
Quoted 2 lines · Sohil Mehta

Instead of double tabs and <option>: <description>, would this be more readable if the options and their descriptions are separated?

Have you seen the rest of this file?

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#6 lore raw
Quoted 6 lines · Borislav Petkov
Quoted 2 lines · Sohil Mehta

Instead of double tabs and <option>: <description>, would this be more readable if the options and their descriptions are separated?

Have you seen the rest of this file?

To clarify, I am not suggesting to have the description at less than 2 tab distance from the main command line option. It's just the sub-option. It would still keep everything aligned with the rest of the file.

	mce=
		<sub-option-1>
			[Description - ...]

		<sub-option-2>
			[Description - ...]

I see quite a few places that do exactly as the above:
console=
console_msg_format=
earlycon=
hibernate=
intel_iommu=
io_delay=
pcie_*=

In some other cases such as pci=, mitigations=, spectre_v2_user= and vsyscall= the sub-option is at a 1-2 tab distance and the description is another 1-2 tabs from that.

Either way, in most places, I see the sub-option and description being separated which is all I am requesting. (Pretty please?)

efi= and idle= has it similar to the way you have proposed for mce= but I find it harder to read. (Maybe it's just me.)