Skip to content

Commit 3841840

Browse files
jgross1Ingo Molnar
authored andcommitted
x86/boot: Mostly revert commit ae7e123 ("Add ACPI RSDP address to setup_header")
Peter Anvin pointed out that commit: ae7e123 ("x86/boot: Add ACPI RSDP address to setup_header") should be reverted as setup_header should only contain items set by the legacy BIOS. So revert said commit. Instead of fully reverting the dependent commit of: e7b66d1 ("x86/acpi, x86/boot: Take RSDP address for boot params if available") just remove the setup_header reference in order to replace it by a boot_params in a followup patch. Suggested-by: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Juergen Gross <jgross@suse.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: boris.ostrovsky@oracle.com Cc: bp@alien8.de Cc: daniel.kiper@oracle.com Cc: sstabellini@kernel.org Cc: xen-devel@lists.xenproject.org Link: http://lkml.kernel.org/r/20181120072529.5489-2-jgross@suse.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent d19f913 commit 3841840

File tree

8 files changed

+3
-63
lines changed

8 files changed

+3
-63
lines changed

Documentation/x86/boot.txt

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,6 @@ Protocol 2.12: (Kernel 3.8) Added the xloadflags field and extension fields
6161
to struct boot_params for loading bzImage and ramdisk
6262
above 4G in 64bit.
6363

64-
Protocol 2.13: (Kernel 3.14) Support 32- and 64-bit flags being set in
65-
xloadflags to support booting a 64-bit kernel from 32-bit
66-
EFI
67-
68-
Protocol 2.14: (Kernel 4.20) Added acpi_rsdp_addr holding the physical
69-
address of the ACPI RSDP table.
70-
The bootloader updates version with:
71-
0x8000 | min(kernel-version, bootloader-version)
72-
kernel-version being the protocol version supported by
73-
the kernel and bootloader-version the protocol version
74-
supported by the bootloader.
75-
7664
**** MEMORY LAYOUT
7765

7866
The traditional memory map for the kernel loader, used for Image or
@@ -209,7 +197,6 @@ Offset Proto Name Meaning
209197
0258/8 2.10+ pref_address Preferred loading address
210198
0260/4 2.10+ init_size Linear memory required during initialization
211199
0264/4 2.11+ handover_offset Offset of handover entry point
212-
0268/8 2.14+ acpi_rsdp_addr Physical address of RSDP table
213200

214201
(1) For backwards compatibility, if the setup_sects field contains 0, the
215202
real value is 4.
@@ -322,20 +309,14 @@ Protocol: 2.00+
322309
Contains the magic number "HdrS" (0x53726448).
323310

324311
Field name: version
325-
Type: modify
312+
Type: read
326313
Offset/size: 0x206/2
327314
Protocol: 2.00+
328315

329316
Contains the boot protocol version, in (major << 8)+minor format,
330317
e.g. 0x0204 for version 2.04, and 0x0a11 for a hypothetical version
331318
10.17.
332319

333-
Up to protocol version 2.13 this information is only read by the
334-
bootloader. From protocol version 2.14 onwards the bootloader will
335-
write the used protocol version or-ed with 0x8000 to the field. The
336-
used protocol version will be the minimum of the supported protocol
337-
versions of the bootloader and the kernel.
338-
339320
Field name: realmode_swtch
340321
Type: modify (optional)
341322
Offset/size: 0x208/4
@@ -763,17 +744,6 @@ Offset/size: 0x264/4
763744

764745
See EFI HANDOVER PROTOCOL below for more details.
765746

766-
Field name: acpi_rsdp_addr
767-
Type: write
768-
Offset/size: 0x268/8
769-
Protocol: 2.14+
770-
771-
This field can be set by the boot loader to tell the kernel the
772-
physical address of the ACPI RSDP table.
773-
774-
A value of 0 indicates the kernel should fall back to the standard
775-
methods to locate the RSDP.
776-
777747

778748
**** THE IMAGE CHECKSUM
779749

arch/x86/boot/header.S

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ _start:
300300
# Part 2 of the header, from the old setup.S
301301

302302
.ascii "HdrS" # header signature
303-
.word 0x020e # header version number (>= 0x0105)
303+
.word 0x020d # header version number (>= 0x0105)
304304
# or else old loadlin-1.5 will fail)
305305
.globl realmode_swtch
306306
realmode_swtch: .word 0, 0 # default_switch, SETUPSEG
@@ -558,10 +558,6 @@ pref_address: .quad LOAD_PHYSICAL_ADDR # preferred load addr
558558
init_size: .long INIT_SIZE # kernel initialization size
559559
handover_offset: .long 0 # Filled in by build.c
560560

561-
acpi_rsdp_addr: .quad 0 # 64-bit physical pointer to the
562-
# ACPI RSDP table, added with
563-
# version 2.14
564-
565561
# End of setup header #####################################################
566562

567563
.section ".entrytext", "ax"

arch/x86/include/asm/x86_init.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,4 @@ extern void x86_init_noop(void);
303303
extern void x86_init_uint_noop(unsigned int unused);
304304
extern bool x86_pnpbios_disabled(void);
305305

306-
void x86_verify_bootdata_version(void);
307-
308306
#endif

arch/x86/include/uapi/asm/bootparam.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
#define RAMDISK_PROMPT_FLAG 0x8000
1717
#define RAMDISK_LOAD_FLAG 0x4000
1818

19-
/* version flags */
20-
#define VERSION_WRITTEN 0x8000
21-
2219
/* loadflags */
2320
#define LOADED_HIGH (1<<0)
2421
#define KASLR_FLAG (1<<1)
@@ -89,7 +86,6 @@ struct setup_header {
8986
__u64 pref_address;
9087
__u32 init_size;
9188
__u32 handover_offset;
92-
__u64 acpi_rsdp_addr;
9389
} __attribute__((packed));
9490

9591
struct sys_desc_table {

arch/x86/kernel/acpi/boot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1776,5 +1776,5 @@ void __init arch_reserve_mem_area(acpi_physical_address addr, size_t size)
17761776

17771777
u64 x86_default_get_root_pointer(void)
17781778
{
1779-
return boot_params.hdr.acpi_rsdp_addr;
1779+
return 0;
17801780
}

arch/x86/kernel/head32.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ asmlinkage __visible void __init i386_start_kernel(void)
3737
cr4_init_shadow();
3838

3939
sanitize_boot_params(&boot_params);
40-
x86_verify_bootdata_version();
4140

4241
x86_early_init_platform_quirks();
4342

arch/x86/kernel/head64.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,6 @@ void __init x86_64_start_reservations(char *real_mode_data)
457457
if (!boot_params.hdr.version)
458458
copy_bootdata(__va(real_mode_data));
459459

460-
x86_verify_bootdata_version();
461-
462460
x86_early_init_platform_quirks();
463461

464462
switch (boot_params.hdr.hardware_subarch) {

arch/x86/kernel/setup.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,23 +1280,6 @@ void __init setup_arch(char **cmdline_p)
12801280
unwind_init();
12811281
}
12821282

1283-
/*
1284-
* From boot protocol 2.14 onwards we expect the bootloader to set the
1285-
* version to "0x8000 | <used version>". In case we find a version >= 2.14
1286-
* without the 0x8000 we assume the boot loader supports 2.13 only and
1287-
* reset the version accordingly. The 0x8000 flag is removed in any case.
1288-
*/
1289-
void __init x86_verify_bootdata_version(void)
1290-
{
1291-
if (boot_params.hdr.version & VERSION_WRITTEN)
1292-
boot_params.hdr.version &= ~VERSION_WRITTEN;
1293-
else if (boot_params.hdr.version >= 0x020e)
1294-
boot_params.hdr.version = 0x020d;
1295-
1296-
if (boot_params.hdr.version < 0x020e)
1297-
boot_params.hdr.acpi_rsdp_addr = 0;
1298-
}
1299-
13001283
#ifdef CONFIG_X86_32
13011284

13021285
static struct resource video_ram_resource = {

0 commit comments

Comments
 (0)