Patchwork Allow for RSDP that is not 16 byte aligned (LP: #1271522)

login
register
mail settings
Submitter Colin King
Date Jan. 22, 2014, 12:24 p.m.
Message ID <1390393487-5881-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/313219/
State Accepted
Headers show

Comments

Colin King - Jan. 22, 2014, 12:24 p.m.
From: Colin Ian King <colin.king@canonical.com>

Commit 94ea2aa606a8115325e5c5781a958c4eb9ce856b presumed that the
RSDP is 16 byte aligned. However, UEFI systems don't seem to apply
to this old BIOS rule of thumb, so relax this constraint.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/lib/src/fwts_acpi_tables.c | 4 ----
 1 file changed, 4 deletions(-)
Alex Hung - Jan. 23, 2014, 2:09 a.m.
On 01/22/2014 08:24 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Commit 94ea2aa606a8115325e5c5781a958c4eb9ce856b presumed that the
> RSDP is 16 byte aligned. However, UEFI systems don't seem to apply
> to this old BIOS rule of thumb, so relax this constraint.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/lib/src/fwts_acpi_tables.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
> index b226e51..ca3b34a 100644
> --- a/src/lib/src/fwts_acpi_tables.c
> +++ b/src/lib/src/fwts_acpi_tables.c
> @@ -295,10 +295,6 @@ static int fwts_acpi_load_tables_from_firmware(fwts_framework *fw)
>  	if (!rsdp_addr)
>  		return FWTS_ERROR;
>  
> -	/* Must be on a 16 byte boundary */
> -	if (((unsigned long)rsdp_addr & 0xf))
> -		return FWTS_ERROR;
> -
>  	/* Load and save cached RSDP */
>  	if ((rsdp = fwts_acpi_get_rsdp(rsdp_addr, &rsdp_len)) == NULL)
>  		return FWTS_ERROR;
> 

ACPI Spec says "In Unified Extensible Firmware Interface (UEFI) enabled
systems, a pointer to the RSDP structure exists within the EFI System
Table. The OS loader is provided a pointer to the EFI System Table at
invocation. The OS loader must retrieve the pointer to the RSDP
structure from the EFI System Table and convey the pointer to OSPM,
using an OS dependent data structure, as part of the hand off of control
from the OS loader to the OS."

It seems 16 byte alignment is not necessary applying to UEFI systems.

Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu - Jan. 23, 2014, 5:28 a.m.
On 01/22/2014 08:24 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Commit 94ea2aa606a8115325e5c5781a958c4eb9ce856b presumed that the
> RSDP is 16 byte aligned. However, UEFI systems don't seem to apply
> to this old BIOS rule of thumb, so relax this constraint.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/lib/src/fwts_acpi_tables.c | 4 ----
>   1 file changed, 4 deletions(-)
>
> diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
> index b226e51..ca3b34a 100644
> --- a/src/lib/src/fwts_acpi_tables.c
> +++ b/src/lib/src/fwts_acpi_tables.c
> @@ -295,10 +295,6 @@ static int fwts_acpi_load_tables_from_firmware(fwts_framework *fw)
>   	if (!rsdp_addr)
>   		return FWTS_ERROR;
>
> -	/* Must be on a 16 byte boundary */
> -	if (((unsigned long)rsdp_addr & 0xf))
> -		return FWTS_ERROR;
> -
>   	/* Load and save cached RSDP */
>   	if ((rsdp = fwts_acpi_get_rsdp(rsdp_addr, &rsdp_len)) == NULL)
>   		return FWTS_ERROR;
>

Acked-by: Ivan Hu <ivan.hu@canonical.com>

Patch

diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
index b226e51..ca3b34a 100644
--- a/src/lib/src/fwts_acpi_tables.c
+++ b/src/lib/src/fwts_acpi_tables.c
@@ -295,10 +295,6 @@  static int fwts_acpi_load_tables_from_firmware(fwts_framework *fw)
 	if (!rsdp_addr)
 		return FWTS_ERROR;
 
-	/* Must be on a 16 byte boundary */
-	if (((unsigned long)rsdp_addr & 0xf))
-		return FWTS_ERROR;
-
 	/* Load and save cached RSDP */
 	if ((rsdp = fwts_acpi_get_rsdp(rsdp_addr, &rsdp_len)) == NULL)
 		return FWTS_ERROR;