linux/Documentation/x86
Daniel Kiper 2c33c27fd6 x86/boot: Introduce kernel_info
The relationships between the headers are analogous to the various data
sections:

  setup_header = .data
  boot_params/setup_data = .bss

What is missing from the above list? That's right:

  kernel_info = .rodata

We have been (ab)using .data for things that could go into .rodata or .bss for
a long time, for lack of alternatives and -- especially early on -- inertia.
Also, the BIOS stub is responsible for creating boot_params, so it isn't
available to a BIOS-based loader (setup_data is, though).

setup_header is permanently limited to 144 bytes due to the reach of the
2-byte jump field, which doubles as a length field for the structure, combined
with the size of the "hole" in struct boot_params that a protected-mode loader
or the BIOS stub has to copy it into. It is currently 119 bytes long, which
leaves us with 25 very precious bytes. This isn't something that can be fixed
without revising the boot protocol entirely, breaking backwards compatibility.

boot_params proper is limited to 4096 bytes, but can be arbitrarily extended
by adding setup_data entries. It cannot be used to communicate properties of
the kernel image, because it is .bss and has no image-provided content.

kernel_info solves this by providing an extensible place for information about
the kernel image. It is readonly, because the kernel cannot rely on a
bootloader copying its contents anywhere, but that is OK; if it becomes
necessary it can still contain data items that an enabled bootloader would be
expected to copy into a setup_data chunk.

Do not bump setup_header version in arch/x86/boot/header.S because it
will be followed by additional changes coming into the Linux/x86 boot
protocol.

Suggested-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
Reviewed-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: ard.biesheuvel@linaro.org
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: dave.hansen@linux.intel.com
Cc: eric.snowberg@oracle.com
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Juergen Gross <jgross@suse.com>
Cc: kanth.ghatraju@oracle.com
Cc: linux-doc@vger.kernel.org
Cc: linux-efi <linux-efi@vger.kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: rdunlap@infradead.org
Cc: ross.philipson@oracle.com
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: x86-ml <x86@kernel.org>
Cc: xen-devel@lists.xenproject.org
Link: https://lkml.kernel.org/r/20191112134640.16035-2-daniel.kiper@oracle.com
2019-11-12 16:10:34 +01:00
..
i386 Documentation: x86: convert i386/IO-APIC.txt to reST 2019-05-08 14:34:11 -06:00
x86_64 dma-mapping: fix filename references 2019-09-03 08:36:30 +02:00
amd-memory-encryption.rst Documentation: x86: convert amd-memory-encryption.txt to reST 2019-05-08 14:34:10 -06:00
boot.rst x86/boot: Introduce kernel_info 2019-11-12 16:10:34 +01:00
earlyprintk.rst Documentation: x86: convert earlyprintk.txt to reST 2019-05-08 14:34:10 -06:00
entry_64.rst Documentation: x86: convert entry_64.txt to reST 2019-05-08 14:34:09 -06:00
exception-tables.rst Documentation/x86: Fix path to entry_32.S 2019-05-24 08:52:54 +02:00
index.rst docs: x86: move two x86-specific files to x86 arch dir 2019-07-15 11:03:01 -03:00
intel_mpx.rst Documentation: x86: convert intel_mpx.txt to reST 2019-05-08 14:34:10 -06:00
intel_txt.rst docs: x86: move two x86-specific files to x86 arch dir 2019-07-15 11:03:01 -03:00
intel-iommu.rst docs: x86: move two x86-specific files to x86 arch dir 2019-07-15 11:03:01 -03:00
kernel-stacks.rst Some late arriving documentation changes. In particular, this contains the 2019-05-10 13:24:53 -04:00
mds.rst x86/speculation/mds: Improve CPU buffer clear documentation 2019-05-16 09:05:12 +02:00
microcode.rst Documentation: x86: convert microcode.txt to reST 2019-05-08 14:34:11 -06:00
mtrr.rst Documentation: x86: convert mtrr.txt to reST 2019-05-08 14:34:10 -06:00
orc-unwinder.rst Documentation: x86: convert orc-unwinder.txt to reST 2019-05-08 14:34:11 -06:00
pat.rst Documentation: x86: convert pat.txt to reST 2019-05-08 14:34:10 -06:00
pti.rst Documentation: x86: convert pti.txt to reST 2019-05-08 14:34:10 -06:00
resctrl_ui.rst Documentation: x86: fix some typos 2019-06-20 14:16:12 -06:00
tlb.rst Documentation: x86: convert tlb.txt to reST 2019-05-08 14:34:10 -06:00
topology.rst docs: admin-guide: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
usb-legacy-support.rst Documentation: x86: convert usb-legacy-support.txt to reST 2019-05-08 14:34:11 -06:00
zero-page.rst Documentation: x86: convert zero-page.txt to reST 2019-05-08 14:34:10 -06:00