Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/boot: Enumerate documentation for the x86 hardware_subarch

Although hardware_subarch has been in place since the x86 boot
protocol 2.07 it hasn't been used much. Enumerate current possible
values to avoid misuses and help with semantics later at boot
time should this be used further.

These enums should only ever be used by architecture x86 code,
and all that code should be well contained and compartamentalized,
clarify that as well.

Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: andrew.cooper3@citrix.com
Cc: andriy.shevchenko@linux.intel.com
Cc: bigeasy@linutronix.de
Cc: boris.ostrovsky@oracle.com
Cc: david.vrabel@citrix.com
Cc: ffainelli@freebox.fr
Cc: george.dunlap@citrix.com
Cc: glin@suse.com
Cc: jgross@suse.com
Cc: jlee@suse.com
Cc: josh@joshtriplett.org
Cc: julien.grall@linaro.org
Cc: konrad.wilk@oracle.com
Cc: kozerkov@parallels.com
Cc: lenb@kernel.org
Cc: lguest@lists.ozlabs.org
Cc: linux-acpi@vger.kernel.org
Cc: lv.zheng@intel.com
Cc: matt@codeblueprint.co.uk
Cc: mbizon@freebox.fr
Cc: rjw@rjwysocki.net
Cc: robert.moore@intel.com
Cc: rusty@rustcorp.com.au
Cc: tiwai@suse.de
Cc: toshi.kani@hp.com
Cc: xen-devel@lists.xensource.com
Link: http://lkml.kernel.org/r/1460592286-300-2-git-send-email-mcgrof@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Luis R. Rodriguez and committed by
Ingo Molnar
18c78a96 0f8ede1b

+40 -1
+40 -1
arch/x86/include/uapi/asm/bootparam.h
··· 157 157 __u8 _pad9[276]; /* 0xeec */ 158 158 } __attribute__((packed)); 159 159 160 - enum { 160 + /** 161 + * enum x86_hardware_subarch - x86 hardware subarchitecture 162 + * 163 + * The x86 hardware_subarch and hardware_subarch_data were added as of the x86 164 + * boot protocol 2.07 to help distinguish and support custom x86 boot 165 + * sequences. This enum represents accepted values for the x86 166 + * hardware_subarch. Custom x86 boot sequences (not X86_SUBARCH_PC) do not 167 + * have or simply *cannot* make use of natural stubs like BIOS or EFI, the 168 + * hardware_subarch can be used on the Linux entry path to revector to a 169 + * subarchitecture stub when needed. This subarchitecture stub can be used to 170 + * set up Linux boot parameters or for special care to account for nonstandard 171 + * handling of page tables. 172 + * 173 + * These enums should only ever be used by x86 code, and the code that uses 174 + * it should be well contained and compartamentalized. 175 + * 176 + * KVM and Xen HVM do not have a subarch as these are expected to follow 177 + * standard x86 boot entries. If there is a genuine need for "hypervisor" type 178 + * that should be considered separately in the future. Future guest types 179 + * should seriously consider working with standard x86 boot stubs such as 180 + * the BIOS or EFI boot stubs. 181 + * 182 + * WARNING: this enum is only used for legacy hacks, for platform features that 183 + * are not easily enumerated or discoverable. You should not ever use 184 + * this for new features. 185 + * 186 + * @X86_SUBARCH_PC: Should be used if the hardware is enumerable using standard 187 + * PC mechanisms (PCI, ACPI) and doesn't need a special boot flow. 188 + * @X86_SUBARCH_LGUEST: Used for x86 hypervisor demo, lguest 189 + * @X86_SUBARCH_XEN: Used for Xen guest types which follow the PV boot path, 190 + * which start at asm startup_xen() entry point and later jump to the C 191 + * xen_start_kernel() entry point. Both domU and dom0 type of guests are 192 + * currently supportd through this PV boot path. 193 + * @X86_SUBARCH_INTEL_MID: Used for Intel MID (Mobile Internet Device) platform 194 + * systems which do not have the PCI legacy interfaces. 195 + * @X86_SUBARCH_CE4100: Used for Intel CE media processor (CE4100) SoC for 196 + * for settop boxes and media devices, the use of a subarch for CE4100 197 + * is more of a hack... 198 + */ 199 + enum x86_hardware_subarch { 161 200 X86_SUBARCH_PC = 0, 162 201 X86_SUBARCH_LGUEST, 163 202 X86_SUBARCH_XEN,