[PATCH 1/2] acpi: rsdp: don't fail if RSDT and XSDT are both defined and different

Al Stone al.stone at linaro.org
Thu Jul 21 17:52:55 UTC 2016


On 07/21/2016 11:02 AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> relax the rsdp test, don't consider it a failure case if both RSDT
> and XSDT are defined. Instead, warn about this, it may be legitmate
> for both these to be defined and different if an ACPI 1.0 OS uses
> the RSDT while one supporting > ACPI 1.0 can use a different 64 bit
> XSDT.
> 
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  src/acpi/rsdp/rsdp.c | 35 ++++++++---------------------------
>  1 file changed, 8 insertions(+), 27 deletions(-)
> 
> diff --git a/src/acpi/rsdp/rsdp.c b/src/acpi/rsdp/rsdp.c
> index 92b9753..f7e10bb 100644
> --- a/src/acpi/rsdp/rsdp.c
> +++ b/src/acpi/rsdp/rsdp.c
> @@ -123,33 +123,14 @@ static int rsdp_test1(fwts_framework *fw)
>  			    "RSDP: at least one of RsdtAddress or XsdtAddress "
>  			    "is non-zero.");
>  
> -	if (rsdp->rsdt_address != 0 && rsdp->xsdt_address != 0)
> -		if ((uint64_t)rsdp->rsdt_address == rsdp->xsdt_address) {
> -			fwts_warning(fw,
> -				     "Both RSDT and XSDT addresses are set. "
> -				     "Since they are the same address, this "
> -				     "is unambiguous to the OS.");
> -			fwts_advice(fw,
> -				    "Set only one of the 32-bit RSDT or the "
> -				    "64-bit XSDT addresses.  Recent versions "
> -				    "of the spec require that only one of "
> -				    "these be used but as a practical matter, "
> -				    "many vendors do use both.  If both "
> -				    "fields must be used, make sure they at "
> -				    "least contain the same value so that "
> -				    "the OS can unambiguously determine "
> -				    "which address is the correct one.");
> -		} else {
> -			fwts_failed(fw, LOG_LEVEL_MEDIUM,
> -				    "RSDPBothAddressesFound",
> -				    "RSDP: only one of RsdtAddress or "
> -				    "XsdtAddress should be non-zero.  Both "
> -				    "fields are non-zero.");
> -		}
> -	else
> -		fwts_passed(fw,
> -			    "RSDP: only one of RsdtAddress or XsdtAddress "
> -			    "is non-zero.");
> +	if (rsdp->rsdt_address && rsdp->xsdt_address) {
> +		fwts_log_warning(fw, "NOTE: The RSDT and XSDT are both "
> +			"defined. An operating system supporting ACPI "
> +			"1.0 should use the RSDT, otherwise it will "
> +			"use the XSDT. RSDT = 0x%" PRIu32 ", "
> +			"XSDT = 0x%" PRIu64,
> +			rsdp->rsdt_address, rsdp->xsdt_address);
> +	}
>  
>  	passed = false;
>  	switch (fw->target_arch) {
> 

My personal preference would be to include the fwts_advice(), but that's
up to you.  Otherwise, it's logically correct.

-- 
ciao,
al
-----------------------------------
Al Stone
Software Engineer
Linaro Enterprise Group
al.stone at linaro.org
-----------------------------------



More information about the fwts-devel mailing list