linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] x86: make rsdp address accessible via boot params
@ 2017-12-08 15:11 Juergen Gross
  2017-12-08 15:11 ` [PATCH v3 1/4] x86/boot: add acpi rsdp address to setup_header Juergen Gross
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Juergen Gross @ 2017-12-08 15:11 UTC (permalink / raw)
  To: linux-kernel, xen-devel, x86
  Cc: boris.ostrovsky, hpa, tglx, mingo, corbet, rjw, lenb, linux-acpi,
	Juergen Gross

In the non-EFI boot path the ACPI RSDP table is currently found via
either EBDA or by searching through low memory for the RSDP magic.
This requires the RSDP to be located in the first 1MB of physical
memory. Xen PVH guests, however, get the RSDP address via the start of
day information block.

In order to support an arbitrary RSDP address this patch series adds
the physical address of the RSDP to the boot params structure filled
by the boot loader. A kernel booted directly in PVH mode can save the
RSDP address in the boot params, while a kernel booted in PVH mode via
grub can rely on the RSDP address being specified by grub2 (which in
turn got the address via the start of day information block from Xen).


Juergen Gross (4):
  x86/boot: add acpi rsdp address to setup_header
  x86/acpi: take rsdp address for boot params if available
  x86/xen: fix boot loader version reported for pvh guests
  x86/xen: supply rsdp address in boot params for pvh guests

 Documentation/x86/boot.txt            | 19 +++++++++++++++++++
 arch/x86/boot/header.S                |  6 +++++-
 arch/x86/include/uapi/asm/bootparam.h |  1 +
 arch/x86/kernel/acpi/boot.c           |  7 +++++++
 arch/x86/xen/enlighten_pvh.c          |  5 ++++-
 drivers/acpi/osl.c                    | 10 +++++++++-
 include/linux/acpi.h                  |  2 ++
 7 files changed, 47 insertions(+), 3 deletions(-)

-- 
2.12.3

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v3 1/4] x86/boot: add acpi rsdp address to setup_header
  2017-12-08 15:11 [PATCH v3 0/4] x86: make rsdp address accessible via boot params Juergen Gross
@ 2017-12-08 15:11 ` Juergen Gross
  2017-12-12 10:53   ` [tip:x86/boot] x86/boot: Add the ACPI RSDP address to struct setup_header::acpi_rdsp_addr tip-bot for Juergen Gross
  2017-12-08 15:11 ` [PATCH v3 2/4] x86/acpi: take rsdp address for boot params if available Juergen Gross
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Juergen Gross @ 2017-12-08 15:11 UTC (permalink / raw)
  To: linux-kernel, xen-devel, x86
  Cc: boris.ostrovsky, hpa, tglx, mingo, corbet, rjw, lenb, linux-acpi,
	Juergen Gross

Xen PVH guests receive the address of the RSDP table from Xen. In order
to support booting a Xen PVH guest via Grub2 using the standard x86
boot entry we need a way for Grub2 to pass the RSDP address to the
kernel.

For this purpose expand the struct setup_header to hold the physical
address of the RSDP address. Being zero means it isn't specified and
has to be located the legacy way (searching through low memory or
EBDA).

While documenting the new setup_header layout and protocol version
2.14 add the missing documentation of protocol version 2.13.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
V3: fix commit message and some documentation bits (Ingo Molnar)
---
 Documentation/x86/boot.txt            | 19 +++++++++++++++++++
 arch/x86/boot/header.S                |  6 +++++-
 arch/x86/include/uapi/asm/bootparam.h |  1 +
 3 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/Documentation/x86/boot.txt b/Documentation/x86/boot.txt
index 5e9b826b5f62..cec112909c35 100644
--- a/Documentation/x86/boot.txt
+++ b/Documentation/x86/boot.txt
@@ -61,6 +61,13 @@ Protocol 2.12:	(Kernel 3.8) Added the xloadflags field and extension fields
 	 	to struct boot_params for loading bzImage and ramdisk
 		above 4G in 64bit.
 
+Protocol 2.13:	(Kernel 3.14) Support 32- and 64-bit flags being set in
+		xloadflags to support booting a 64-bit kernel from 32-bit
+		EFI
+
+Protocol 2.14	(Kernel 4.16) Added acpi_rsdp_addr holding the physical
+		address of the ACPI RSDP table.
+
 **** MEMORY LAYOUT
 
 The traditional memory map for the kernel loader, used for Image or
@@ -197,6 +204,7 @@ Offset	Proto	Name		Meaning
 0258/8	2.10+	pref_address	Preferred loading address
 0260/4	2.10+	init_size	Linear memory required during initialization
 0264/4	2.11+	handover_offset	Offset of handover entry point
+0268/8	2.14+	acpi_rsdp_addr	Physical address of RSDP table
 
 (1) For backwards compatibility, if the setup_sects field contains 0, the
     real value is 4.
@@ -744,6 +752,17 @@ Offset/size:	0x264/4
 
   See EFI HANDOVER PROTOCOL below for more details.
 
+Field name:	acpi_rsdp_addr
+Type:		write
+Offset/size:	0x268/8
+Protocol:	2.14+
+
+  This field can be set by the boot loader to tell the kernel the
+  physical address of the ACPI RSDP table.
+
+  A value of 0 indicates the kernel should fall back to the standard
+  methods to locate the RSDP.
+
 
 **** THE IMAGE CHECKSUM
 
diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S
index 850b8762e889..4c881c850125 100644
--- a/arch/x86/boot/header.S
+++ b/arch/x86/boot/header.S
@@ -300,7 +300,7 @@ _start:
 	# Part 2 of the header, from the old setup.S
 
 		.ascii	"HdrS"		# header signature
-		.word	0x020d		# header version number (>= 0x0105)
+		.word	0x020e		# header version number (>= 0x0105)
 					# or else old loadlin-1.5 will fail)
 		.globl realmode_swtch
 realmode_swtch:	.word	0, 0		# default_switch, SETUPSEG
@@ -558,6 +558,10 @@ pref_address:		.quad LOAD_PHYSICAL_ADDR	# preferred load addr
 init_size:		.long INIT_SIZE		# kernel initialization size
 handover_offset:	.long 0			# Filled in by build.c
 
+acpi_rsdp_addr:		.quad 0			# 64-bit physical pointer to the
+						# ACPI RSDP table, added with
+						# version 2.14
+
 # End of setup header #####################################################
 
 	.section ".entrytext", "ax"
diff --git a/arch/x86/include/uapi/asm/bootparam.h b/arch/x86/include/uapi/asm/bootparam.h
index afdd5ae0fcc4..5742e433e93e 100644
--- a/arch/x86/include/uapi/asm/bootparam.h
+++ b/arch/x86/include/uapi/asm/bootparam.h
@@ -85,6 +85,7 @@ struct setup_header {
 	__u64	pref_address;
 	__u32	init_size;
 	__u32	handover_offset;
+	__u64	acpi_rsdp_addr;
 } __attribute__((packed));
 
 struct sys_desc_table {
-- 
2.12.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v3 2/4] x86/acpi: take rsdp address for boot params if available
  2017-12-08 15:11 [PATCH v3 0/4] x86: make rsdp address accessible via boot params Juergen Gross
  2017-12-08 15:11 ` [PATCH v3 1/4] x86/boot: add acpi rsdp address to setup_header Juergen Gross
@ 2017-12-08 15:11 ` Juergen Gross
  2017-12-12 10:54   ` [tip:x86/boot] x86/acpi: Take the RSDP address for boot parameters " tip-bot for Juergen Gross
  2017-12-08 15:11 ` [PATCH v3 3/4] x86/xen: fix boot loader version reported for pvh guests Juergen Gross
  2017-12-08 15:11 ` [PATCH v3 4/4] x86/xen: supply rsdp address in boot params for pvh guests Juergen Gross
  3 siblings, 1 reply; 12+ messages in thread
From: Juergen Gross @ 2017-12-08 15:11 UTC (permalink / raw)
  To: linux-kernel, xen-devel, x86
  Cc: boris.ostrovsky, hpa, tglx, mingo, corbet, rjw, lenb, linux-acpi,
	Juergen Gross

In case the rsdp address in struct boot_params is specified don't try
to find the table by searching, but take the address directly as set
by the boot loader.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V3: use a generic retrieval function with a __weak annotated default
    function (Ingo Molnar)
---
 arch/x86/kernel/acpi/boot.c |  7 +++++++
 drivers/acpi/osl.c          | 10 +++++++++-
 include/linux/acpi.h        |  2 ++
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index f4c463df8b08..26fc8972dc4b 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -47,6 +47,7 @@
 #include <asm/mpspec.h>
 #include <asm/smp.h>
 #include <asm/i8259.h>
+#include <asm/setup.h>
 
 #include "sleep.h" /* To include x86_acpi_suspend_lowlevel */
 static int __initdata acpi_force = 0;
@@ -1758,3 +1759,9 @@ void __init arch_reserve_mem_area(acpi_physical_address addr, size_t size)
 	e820__range_add(addr, size, E820_TYPE_ACPI);
 	e820__update_table_print();
 }
+
+acpi_physical_address acpi_arch_get_root_pointer(void)
+{
+	return boot_params.hdr.acpi_rsdp_addr;
+}
+EXPORT_SYMBOL_GPL(acpi_arch_get_root_pointer);
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 3bb46cb24a99..2b77db914752 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -178,6 +178,11 @@ void acpi_os_vprintf(const char *fmt, va_list args)
 #endif
 }
 
+__weak acpi_physical_address acpi_arch_get_root_pointer(void)
+{
+	return 0;
+}
+
 #ifdef CONFIG_KEXEC
 static unsigned long acpi_rsdp;
 static int __init setup_acpi_rsdp(char *arg)
@@ -189,12 +194,15 @@ early_param("acpi_rsdp", setup_acpi_rsdp);
 
 acpi_physical_address __init acpi_os_get_root_pointer(void)
 {
-	acpi_physical_address pa = 0;
+	acpi_physical_address pa;
 
 #ifdef CONFIG_KEXEC
 	if (acpi_rsdp)
 		return acpi_rsdp;
 #endif
+	pa = acpi_arch_get_root_pointer();
+	if (pa)
+		return pa;
 
 	if (efi_enabled(EFI_CONFIG_TABLES)) {
 		if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index dc1ebfeeb5ec..aa603cc5ad30 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -1266,4 +1266,6 @@ static inline int lpit_read_residency_count_address(u64 *address)
 }
 #endif
 
+acpi_physical_address acpi_arch_get_root_pointer(void);
+
 #endif	/*_LINUX_ACPI_H*/
-- 
2.12.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v3 3/4] x86/xen: fix boot loader version reported for pvh guests
  2017-12-08 15:11 [PATCH v3 0/4] x86: make rsdp address accessible via boot params Juergen Gross
  2017-12-08 15:11 ` [PATCH v3 1/4] x86/boot: add acpi rsdp address to setup_header Juergen Gross
  2017-12-08 15:11 ` [PATCH v3 2/4] x86/acpi: take rsdp address for boot params if available Juergen Gross
@ 2017-12-08 15:11 ` Juergen Gross
  2017-12-12 10:54   ` [tip:x86/boot] x86/xen: Fix the boot loader version reported for PVH guests tip-bot for Juergen Gross
  2017-12-08 15:11 ` [PATCH v3 4/4] x86/xen: supply rsdp address in boot params for pvh guests Juergen Gross
  3 siblings, 1 reply; 12+ messages in thread
From: Juergen Gross @ 2017-12-08 15:11 UTC (permalink / raw)
  To: linux-kernel, xen-devel, x86
  Cc: boris.ostrovsky, hpa, tglx, mingo, corbet, rjw, lenb, linux-acpi,
	Juergen Gross, stable

The boot loader version reported via sysfs is wrong in case of the
kernel being booted via the Xen PVH boot entry. it should be 2.12
(0x020c), but it is reported to be 2.18 (0x0212).

As the current way to set the version is error prone use the more
readable variant (2 << 8) | 12.

Cc: <stable@vger.kernel.org> # 4.12
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/xen/enlighten_pvh.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/xen/enlighten_pvh.c b/arch/x86/xen/enlighten_pvh.c
index 436c4f003e17..6e6430cb5e3f 100644
--- a/arch/x86/xen/enlighten_pvh.c
+++ b/arch/x86/xen/enlighten_pvh.c
@@ -69,7 +69,7 @@ static void __init init_pvh_bootparams(void)
 	 * Version 2.12 supports Xen entry point but we will use default x86/PC
 	 * environment (i.e. hardware_subarch 0).
 	 */
-	pvh_bootparams.hdr.version = 0x212;
+	pvh_bootparams.hdr.version = (2 << 8) | 12;
 	pvh_bootparams.hdr.type_of_loader = (9 << 4) | 0; /* Xen loader */
 }
 
-- 
2.12.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v3 4/4] x86/xen: supply rsdp address in boot params for pvh guests
  2017-12-08 15:11 [PATCH v3 0/4] x86: make rsdp address accessible via boot params Juergen Gross
                   ` (2 preceding siblings ...)
  2017-12-08 15:11 ` [PATCH v3 3/4] x86/xen: fix boot loader version reported for pvh guests Juergen Gross
@ 2017-12-08 15:11 ` Juergen Gross
  2017-12-11 10:09   ` [Xen-devel] " Jan Beulich
                     ` (2 more replies)
  3 siblings, 3 replies; 12+ messages in thread
From: Juergen Gross @ 2017-12-08 15:11 UTC (permalink / raw)
  To: linux-kernel, xen-devel, x86
  Cc: boris.ostrovsky, hpa, tglx, mingo, corbet, rjw, lenb, linux-acpi,
	Juergen Gross

When booted via the special PVH entry save the RSDP address set in the
boot information block in struct boot_params. This will enable Xen to
locate the RSDP at an arbitrary address.

Set the boot loader version to 2.14 (0x020e) replacing the wrong 0x0212
which should have been 0x020c.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2: set bootloader version to 2.14 (Roger Pau Monné)
---
 arch/x86/xen/enlighten_pvh.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/xen/enlighten_pvh.c b/arch/x86/xen/enlighten_pvh.c
index 6e6430cb5e3f..e85e6dafe4bc 100644
--- a/arch/x86/xen/enlighten_pvh.c
+++ b/arch/x86/xen/enlighten_pvh.c
@@ -68,9 +68,12 @@ static void __init init_pvh_bootparams(void)
 	 *
 	 * Version 2.12 supports Xen entry point but we will use default x86/PC
 	 * environment (i.e. hardware_subarch 0).
+	 * The RSDP address is available from version 2.14 on.
 	 */
-	pvh_bootparams.hdr.version = (2 << 8) | 12;
+	pvh_bootparams.hdr.version = (2 << 8) | 14;
 	pvh_bootparams.hdr.type_of_loader = (9 << 4) | 0; /* Xen loader */
+
+	pvh_bootparams.hdr.acpi_rsdp_addr = pvh_start_info.rsdp_paddr;
 }
 
 /*
-- 
2.12.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [Xen-devel] [PATCH v3 4/4] x86/xen: supply rsdp address in boot params for pvh guests
  2017-12-08 15:11 ` [PATCH v3 4/4] x86/xen: supply rsdp address in boot params for pvh guests Juergen Gross
@ 2017-12-11 10:09   ` Jan Beulich
       [not found]   ` <5A2E674C0200007800196522@suse.com>
  2017-12-12 10:55   ` [tip:x86/boot] x86/xen: Supply RSDP address in boot params for PVH guests tip-bot for Juergen Gross
  2 siblings, 0 replies; 12+ messages in thread
From: Jan Beulich @ 2017-12-11 10:09 UTC (permalink / raw)
  To: Juergen Gross
  Cc: lenb, x86, tglx, xen-devel, corbet, boris.ostrovsky, mingo, rjw,
	linux-acpi, linux-kernel, hpa

>>> On 08.12.17 at 16:11, <jgross@suse.com> wrote:
> Set the boot loader version to 2.14 (0x020e) replacing the wrong 0x0212
> which should have been 0x020c.

This part of the description has become partly stale now with the
new patch 3.

Jan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Xen-devel] [PATCH v3 4/4] x86/xen: supply rsdp address in boot params for pvh guests
       [not found]   ` <5A2E674C0200007800196522@suse.com>
@ 2017-12-11 10:51     ` Juergen Gross
  2017-12-11 14:14       ` Ingo Molnar
  0 siblings, 1 reply; 12+ messages in thread
From: Juergen Gross @ 2017-12-11 10:51 UTC (permalink / raw)
  To: Jan Beulich
  Cc: lenb, x86, tglx, xen-devel, corbet, boris.ostrovsky, mingo, rjw,
	linux-acpi, linux-kernel, hpa

On 11/12/17 11:09, Jan Beulich wrote:
>>>> On 08.12.17 at 16:11, <jgross@suse.com> wrote:
>> Set the boot loader version to 2.14 (0x020e) replacing the wrong 0x0212
>> which should have been 0x020c.
> 
> This part of the description has become partly stale now with the
> new patch 3.

Indeed. I'll wait for other comments before sending out a new version.

Thanks,


Juergen

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Xen-devel] [PATCH v3 4/4] x86/xen: supply rsdp address in boot params for pvh guests
  2017-12-11 10:51     ` Juergen Gross
@ 2017-12-11 14:14       ` Ingo Molnar
  0 siblings, 0 replies; 12+ messages in thread
From: Ingo Molnar @ 2017-12-11 14:14 UTC (permalink / raw)
  To: Juergen Gross
  Cc: Jan Beulich, lenb, x86, tglx, xen-devel, corbet, boris.ostrovsky,
	mingo, rjw, linux-acpi, linux-kernel, hpa


* Juergen Gross <jgross@suse.com> wrote:

> On 11/12/17 11:09, Jan Beulich wrote:
> >>>> On 08.12.17 at 16:11, <jgross@suse.com> wrote:
> >> Set the boot loader version to 2.14 (0x020e) replacing the wrong 0x0212
> >> which should have been 0x020c.
> > 
> > This part of the description has become partly stale now with the
> > new patch 3.
> 
> Indeed. I'll wait for other comments before sending out a new version.

Looks good to me now, and I've applied the series to tip:x86/boot. I have removed 
this stale sentence from patch #4.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [tip:x86/boot] x86/boot: Add the ACPI RSDP address to struct setup_header::acpi_rdsp_addr
  2017-12-08 15:11 ` [PATCH v3 1/4] x86/boot: add acpi rsdp address to setup_header Juergen Gross
@ 2017-12-12 10:53   ` tip-bot for Juergen Gross
  0 siblings, 0 replies; 12+ messages in thread
From: tip-bot for Juergen Gross @ 2017-12-12 10:53 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, peterz, torvalds, jgross, roger.pau, tglx, mingo, hpa

Commit-ID:  2f74cbf947f45fa082dda8eac1a1f1299a372f49
Gitweb:     https://git.kernel.org/tip/2f74cbf947f45fa082dda8eac1a1f1299a372f49
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri, 8 Dec 2017 16:11:36 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 11 Dec 2017 15:14:20 +0100

x86/boot: Add the ACPI RSDP address to struct setup_header::acpi_rdsp_addr

Xen PVH guests receive the address of the RSDP table from Xen. In order
to support booting a Xen PVH guest via Grub2 using the standard x86
boot entry we need a way for Grub2 to pass the RSDP address to the
kernel.

For this purpose expand the struct setup_header to hold the physical
address of the RSDP address. Being zero means it isn't specified and
has to be located the legacy way (searching through low memory or
EBDA).

While documenting the new setup_header layout and protocol version
2.14 add the missing documentation of protocol version 2.13.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.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: corbet@lwn.net
Cc: lenb@kernel.org
Cc: linux-acpi@vger.kernel.org
Cc: rjw@rjwysocki.net
Cc: xen-devel@lists.xenproject.org
Link: http://lkml.kernel.org/r/20171208151139.30213-2-jgross@suse.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 Documentation/x86/boot.txt            | 19 +++++++++++++++++++
 arch/x86/boot/header.S                |  6 +++++-
 arch/x86/include/uapi/asm/bootparam.h |  1 +
 3 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/Documentation/x86/boot.txt b/Documentation/x86/boot.txt
index 5e9b826..cec1129 100644
--- a/Documentation/x86/boot.txt
+++ b/Documentation/x86/boot.txt
@@ -61,6 +61,13 @@ Protocol 2.12:	(Kernel 3.8) Added the xloadflags field and extension fields
 	 	to struct boot_params for loading bzImage and ramdisk
 		above 4G in 64bit.
 
+Protocol 2.13:	(Kernel 3.14) Support 32- and 64-bit flags being set in
+		xloadflags to support booting a 64-bit kernel from 32-bit
+		EFI
+
+Protocol 2.14	(Kernel 4.16) Added acpi_rsdp_addr holding the physical
+		address of the ACPI RSDP table.
+
 **** MEMORY LAYOUT
 
 The traditional memory map for the kernel loader, used for Image or
@@ -197,6 +204,7 @@ Offset	Proto	Name		Meaning
 0258/8	2.10+	pref_address	Preferred loading address
 0260/4	2.10+	init_size	Linear memory required during initialization
 0264/4	2.11+	handover_offset	Offset of handover entry point
+0268/8	2.14+	acpi_rsdp_addr	Physical address of RSDP table
 
 (1) For backwards compatibility, if the setup_sects field contains 0, the
     real value is 4.
@@ -744,6 +752,17 @@ Offset/size:	0x264/4
 
   See EFI HANDOVER PROTOCOL below for more details.
 
+Field name:	acpi_rsdp_addr
+Type:		write
+Offset/size:	0x268/8
+Protocol:	2.14+
+
+  This field can be set by the boot loader to tell the kernel the
+  physical address of the ACPI RSDP table.
+
+  A value of 0 indicates the kernel should fall back to the standard
+  methods to locate the RSDP.
+
 
 **** THE IMAGE CHECKSUM
 
diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S
index 850b876..4c881c8 100644
--- a/arch/x86/boot/header.S
+++ b/arch/x86/boot/header.S
@@ -300,7 +300,7 @@ _start:
 	# Part 2 of the header, from the old setup.S
 
 		.ascii	"HdrS"		# header signature
-		.word	0x020d		# header version number (>= 0x0105)
+		.word	0x020e		# header version number (>= 0x0105)
 					# or else old loadlin-1.5 will fail)
 		.globl realmode_swtch
 realmode_swtch:	.word	0, 0		# default_switch, SETUPSEG
@@ -558,6 +558,10 @@ pref_address:		.quad LOAD_PHYSICAL_ADDR	# preferred load addr
 init_size:		.long INIT_SIZE		# kernel initialization size
 handover_offset:	.long 0			# Filled in by build.c
 
+acpi_rsdp_addr:		.quad 0			# 64-bit physical pointer to the
+						# ACPI RSDP table, added with
+						# version 2.14
+
 # End of setup header #####################################################
 
 	.section ".entrytext", "ax"
diff --git a/arch/x86/include/uapi/asm/bootparam.h b/arch/x86/include/uapi/asm/bootparam.h
index afdd5ae..5742e43 100644
--- a/arch/x86/include/uapi/asm/bootparam.h
+++ b/arch/x86/include/uapi/asm/bootparam.h
@@ -85,6 +85,7 @@ struct setup_header {
 	__u64	pref_address;
 	__u32	init_size;
 	__u32	handover_offset;
+	__u64	acpi_rsdp_addr;
 } __attribute__((packed));
 
 struct sys_desc_table {

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [tip:x86/boot] x86/acpi: Take the RSDP address for boot parameters if available
  2017-12-08 15:11 ` [PATCH v3 2/4] x86/acpi: take rsdp address for boot params if available Juergen Gross
@ 2017-12-12 10:54   ` tip-bot for Juergen Gross
  0 siblings, 0 replies; 12+ messages in thread
From: tip-bot for Juergen Gross @ 2017-12-12 10:54 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: tglx, peterz, jgross, hpa, mingo, linux-kernel, torvalds

Commit-ID:  0c89cf36424f7c1177de8a5712514d7cc2eb369f
Gitweb:     https://git.kernel.org/tip/0c89cf36424f7c1177de8a5712514d7cc2eb369f
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri, 8 Dec 2017 16:11:37 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 11 Dec 2017 15:14:20 +0100

x86/acpi: Take the RSDP address for boot parameters if available

In case the rsdp address in struct boot_params is specified don't try
to find the table by searching, but take the address directly as set
by the boot loader.

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: corbet@lwn.net
Cc: lenb@kernel.org
Cc: linux-acpi@vger.kernel.org
Cc: rjw@rjwysocki.net
Cc: xen-devel@lists.xenproject.org
Link: http://lkml.kernel.org/r/20171208151139.30213-3-jgross@suse.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/acpi/boot.c |  7 +++++++
 drivers/acpi/osl.c          | 10 +++++++++-
 include/linux/acpi.h        |  2 ++
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index f4c463d..26fc897 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -47,6 +47,7 @@
 #include <asm/mpspec.h>
 #include <asm/smp.h>
 #include <asm/i8259.h>
+#include <asm/setup.h>
 
 #include "sleep.h" /* To include x86_acpi_suspend_lowlevel */
 static int __initdata acpi_force = 0;
@@ -1758,3 +1759,9 @@ void __init arch_reserve_mem_area(acpi_physical_address addr, size_t size)
 	e820__range_add(addr, size, E820_TYPE_ACPI);
 	e820__update_table_print();
 }
+
+acpi_physical_address acpi_arch_get_root_pointer(void)
+{
+	return boot_params.hdr.acpi_rsdp_addr;
+}
+EXPORT_SYMBOL_GPL(acpi_arch_get_root_pointer);
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 3bb46cb..2b77db9 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -178,6 +178,11 @@ void acpi_os_vprintf(const char *fmt, va_list args)
 #endif
 }
 
+__weak acpi_physical_address acpi_arch_get_root_pointer(void)
+{
+	return 0;
+}
+
 #ifdef CONFIG_KEXEC
 static unsigned long acpi_rsdp;
 static int __init setup_acpi_rsdp(char *arg)
@@ -189,12 +194,15 @@ early_param("acpi_rsdp", setup_acpi_rsdp);
 
 acpi_physical_address __init acpi_os_get_root_pointer(void)
 {
-	acpi_physical_address pa = 0;
+	acpi_physical_address pa;
 
 #ifdef CONFIG_KEXEC
 	if (acpi_rsdp)
 		return acpi_rsdp;
 #endif
+	pa = acpi_arch_get_root_pointer();
+	if (pa)
+		return pa;
 
 	if (efi_enabled(EFI_CONFIG_TABLES)) {
 		if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index dc1ebfe..aa603cc 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -1266,4 +1266,6 @@ static inline int lpit_read_residency_count_address(u64 *address)
 }
 #endif
 
+acpi_physical_address acpi_arch_get_root_pointer(void);
+
 #endif	/*_LINUX_ACPI_H*/

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [tip:x86/boot] x86/xen: Fix the boot loader version reported for PVH guests
  2017-12-08 15:11 ` [PATCH v3 3/4] x86/xen: fix boot loader version reported for pvh guests Juergen Gross
@ 2017-12-12 10:54   ` tip-bot for Juergen Gross
  0 siblings, 0 replies; 12+ messages in thread
From: tip-bot for Juergen Gross @ 2017-12-12 10:54 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: torvalds, linux-kernel, tglx, peterz, jgross, mingo, hpa

Commit-ID:  88750a6c33f813b815516990f01fb5ee488c477e
Gitweb:     https://git.kernel.org/tip/88750a6c33f813b815516990f01fb5ee488c477e
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri, 8 Dec 2017 16:11:38 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 11 Dec 2017 15:14:20 +0100

x86/xen: Fix the boot loader version reported for PVH guests

The boot loader version reported via sysfs is wrong in case of the
kernel being booted via the Xen PVH boot entry. it should be 2.12
(0x020c), but it is reported to be 2.18 (0x0212).

As the current way to set the version is error prone use the more
readable variant (2 << 8) | 12.

Signed-off-by: Juergen Gross <jgross@suse.com>
Cc: <stable@vger.kernel.org> # 4.12
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: corbet@lwn.net
Cc: lenb@kernel.org
Cc: linux-acpi@vger.kernel.org
Cc: rjw@rjwysocki.net
Cc: xen-devel@lists.xenproject.org
Link: http://lkml.kernel.org/r/20171208151139.30213-4-jgross@suse.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/xen/enlighten_pvh.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/xen/enlighten_pvh.c b/arch/x86/xen/enlighten_pvh.c
index 436c4f0..6e6430c 100644
--- a/arch/x86/xen/enlighten_pvh.c
+++ b/arch/x86/xen/enlighten_pvh.c
@@ -69,7 +69,7 @@ static void __init init_pvh_bootparams(void)
 	 * Version 2.12 supports Xen entry point but we will use default x86/PC
 	 * environment (i.e. hardware_subarch 0).
 	 */
-	pvh_bootparams.hdr.version = 0x212;
+	pvh_bootparams.hdr.version = (2 << 8) | 12;
 	pvh_bootparams.hdr.type_of_loader = (9 << 4) | 0; /* Xen loader */
 }
 

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [tip:x86/boot] x86/xen: Supply RSDP address in boot params for PVH guests
  2017-12-08 15:11 ` [PATCH v3 4/4] x86/xen: supply rsdp address in boot params for pvh guests Juergen Gross
  2017-12-11 10:09   ` [Xen-devel] " Jan Beulich
       [not found]   ` <5A2E674C0200007800196522@suse.com>
@ 2017-12-12 10:55   ` tip-bot for Juergen Gross
  2 siblings, 0 replies; 12+ messages in thread
From: tip-bot for Juergen Gross @ 2017-12-12 10:55 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: mingo, linux-kernel, jgross, tglx, torvalds, peterz, hpa

Commit-ID:  930ba49b2ce7b09a5eddc21385fd944ba6b4e829
Gitweb:     https://git.kernel.org/tip/930ba49b2ce7b09a5eddc21385fd944ba6b4e829
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Fri, 8 Dec 2017 16:11:39 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 11 Dec 2017 15:14:21 +0100

x86/xen: Supply RSDP address in boot params for PVH guests

When booted via the special PVH entry save the RSDP address set in the
boot information block in struct boot_params. This will enable Xen to
locate the RSDP at an arbitrary address.

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: corbet@lwn.net
Cc: lenb@kernel.org
Cc: linux-acpi@vger.kernel.org
Cc: rjw@rjwysocki.net
Cc: xen-devel@lists.xenproject.org
Link: http://lkml.kernel.org/r/20171208151139.30213-5-jgross@suse.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/xen/enlighten_pvh.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/xen/enlighten_pvh.c b/arch/x86/xen/enlighten_pvh.c
index 6e6430c..e85e6da 100644
--- a/arch/x86/xen/enlighten_pvh.c
+++ b/arch/x86/xen/enlighten_pvh.c
@@ -68,9 +68,12 @@ static void __init init_pvh_bootparams(void)
 	 *
 	 * Version 2.12 supports Xen entry point but we will use default x86/PC
 	 * environment (i.e. hardware_subarch 0).
+	 * The RSDP address is available from version 2.14 on.
 	 */
-	pvh_bootparams.hdr.version = (2 << 8) | 12;
+	pvh_bootparams.hdr.version = (2 << 8) | 14;
 	pvh_bootparams.hdr.type_of_loader = (9 << 4) | 0; /* Xen loader */
+
+	pvh_bootparams.hdr.acpi_rsdp_addr = pvh_start_info.rsdp_paddr;
 }
 
 /*

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-12-12 10:58 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-08 15:11 [PATCH v3 0/4] x86: make rsdp address accessible via boot params Juergen Gross
2017-12-08 15:11 ` [PATCH v3 1/4] x86/boot: add acpi rsdp address to setup_header Juergen Gross
2017-12-12 10:53   ` [tip:x86/boot] x86/boot: Add the ACPI RSDP address to struct setup_header::acpi_rdsp_addr tip-bot for Juergen Gross
2017-12-08 15:11 ` [PATCH v3 2/4] x86/acpi: take rsdp address for boot params if available Juergen Gross
2017-12-12 10:54   ` [tip:x86/boot] x86/acpi: Take the RSDP address for boot parameters " tip-bot for Juergen Gross
2017-12-08 15:11 ` [PATCH v3 3/4] x86/xen: fix boot loader version reported for pvh guests Juergen Gross
2017-12-12 10:54   ` [tip:x86/boot] x86/xen: Fix the boot loader version reported for PVH guests tip-bot for Juergen Gross
2017-12-08 15:11 ` [PATCH v3 4/4] x86/xen: supply rsdp address in boot params for pvh guests Juergen Gross
2017-12-11 10:09   ` [Xen-devel] " Jan Beulich
     [not found]   ` <5A2E674C0200007800196522@suse.com>
2017-12-11 10:51     ` Juergen Gross
2017-12-11 14:14       ` Ingo Molnar
2017-12-12 10:55   ` [tip:x86/boot] x86/xen: Supply RSDP address in boot params for PVH guests tip-bot for Juergen Gross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).