diff mbox

[2/3] x86/acpi: take rsdp address for boot params if available

Message ID 20171128094400.25955-3-jgross@suse.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Jürgen Groß Nov. 28, 2017, 9:43 a.m. UTC
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>
---
 drivers/acpi/osl.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Roger Pau Monne Nov. 28, 2017, 10:18 a.m. UTC | #1
On Tue, Nov 28, 2017 at 10:43:59AM +0100, Juergen Gross wrote:
> 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>
> ---
>  drivers/acpi/osl.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
> index 3bb46cb24a99..3b25e2ad7d75 100644
> --- a/drivers/acpi/osl.c
> +++ b/drivers/acpi/osl.c
> @@ -45,6 +45,10 @@
>  #include <linux/uaccess.h>
>  #include <linux/io-64-nonatomic-lo-hi.h>
>  
> +#ifdef CONFIG_X86
> +#include <asm/setup.h>
> +#endif
> +
>  #include "internal.h"
>  
>  #define _COMPONENT		ACPI_OS_SERVICES
> @@ -195,6 +199,10 @@ acpi_physical_address __init acpi_os_get_root_pointer(void)
>  	if (acpi_rsdp)
>  		return acpi_rsdp;
>  #endif
> +#ifdef CONFIG_X86
> +	if (boot_params.hdr.acpi_rsdp_addr)
> +		return boot_params.hdr.acpi_rsdp_addr;
> +#endif

I'm struggling to figure out how was PVH getting the RSDP previously,
because that should be removed now that it's in the zero-page.

Roger.
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jürgen Groß Nov. 28, 2017, 10:30 a.m. UTC | #2
On 28/11/17 11:18, Roger Pau Monné wrote:
> On Tue, Nov 28, 2017 at 10:43:59AM +0100, Juergen Gross wrote:
>> 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>
>> ---
>>  drivers/acpi/osl.c | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
>> index 3bb46cb24a99..3b25e2ad7d75 100644
>> --- a/drivers/acpi/osl.c
>> +++ b/drivers/acpi/osl.c
>> @@ -45,6 +45,10 @@
>>  #include <linux/uaccess.h>
>>  #include <linux/io-64-nonatomic-lo-hi.h>
>>  
>> +#ifdef CONFIG_X86
>> +#include <asm/setup.h>
>> +#endif
>> +
>>  #include "internal.h"
>>  
>>  #define _COMPONENT		ACPI_OS_SERVICES
>> @@ -195,6 +199,10 @@ acpi_physical_address __init acpi_os_get_root_pointer(void)
>>  	if (acpi_rsdp)
>>  		return acpi_rsdp;
>>  #endif
>> +#ifdef CONFIG_X86
>> +	if (boot_params.hdr.acpi_rsdp_addr)
>> +		return boot_params.hdr.acpi_rsdp_addr;
>> +#endif
> 
> I'm struggling to figure out how was PVH getting the RSDP previously,
> because that should be removed now that it's in the zero-page.

I don't think it should be removed, because this was the legacy case
(searching through memory). It was pure luck that Xen put it at the
right location.


Juergen
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Roger Pau Monne Nov. 28, 2017, 10:48 a.m. UTC | #3
On Tue, Nov 28, 2017 at 11:30:15AM +0100, Juergen Gross wrote:
> On 28/11/17 11:18, Roger Pau Monné wrote:
> > On Tue, Nov 28, 2017 at 10:43:59AM +0100, Juergen Gross wrote:
> >> 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>
> >> ---
> >>  drivers/acpi/osl.c | 8 ++++++++
> >>  1 file changed, 8 insertions(+)
> >>
> >> diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
> >> index 3bb46cb24a99..3b25e2ad7d75 100644
> >> --- a/drivers/acpi/osl.c
> >> +++ b/drivers/acpi/osl.c
> >> @@ -45,6 +45,10 @@
> >>  #include <linux/uaccess.h>
> >>  #include <linux/io-64-nonatomic-lo-hi.h>
> >>  
> >> +#ifdef CONFIG_X86
> >> +#include <asm/setup.h>
> >> +#endif
> >> +
> >>  #include "internal.h"
> >>  
> >>  #define _COMPONENT		ACPI_OS_SERVICES
> >> @@ -195,6 +199,10 @@ acpi_physical_address __init acpi_os_get_root_pointer(void)
> >>  	if (acpi_rsdp)
> >>  		return acpi_rsdp;
> >>  #endif
> >> +#ifdef CONFIG_X86
> >> +	if (boot_params.hdr.acpi_rsdp_addr)
> >> +		return boot_params.hdr.acpi_rsdp_addr;
> >> +#endif
> > 
> > I'm struggling to figure out how was PVH getting the RSDP previously,
> > because that should be removed now that it's in the zero-page.
> 
> I don't think it should be removed, because this was the legacy case
> (searching through memory). It was pure luck that Xen put it at the
> right location.

Oh, right. This is working out of pure luck then.

Thanks, Roger.
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 3bb46cb24a99..3b25e2ad7d75 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -45,6 +45,10 @@ 
 #include <linux/uaccess.h>
 #include <linux/io-64-nonatomic-lo-hi.h>
 
+#ifdef CONFIG_X86
+#include <asm/setup.h>
+#endif
+
 #include "internal.h"
 
 #define _COMPONENT		ACPI_OS_SERVICES
@@ -195,6 +199,10 @@  acpi_physical_address __init acpi_os_get_root_pointer(void)
 	if (acpi_rsdp)
 		return acpi_rsdp;
 #endif
+#ifdef CONFIG_X86
+	if (boot_params.hdr.acpi_rsdp_addr)
+		return boot_params.hdr.acpi_rsdp_addr;
+#endif
 
 	if (efi_enabled(EFI_CONFIG_TABLES)) {
 		if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)