Question about rsdp test?

Colin Ian King colin.king at canonical.com
Thu Jul 21 13:25:34 UTC 2016


On 21/07/16 02:34, Dong, Eric wrote:
>> On 07/20/2016 01:02 AM, Dong, Eric wrote:
>>> Hi Alex,
>>>
>>> We are using the UEFI code. In UEFI code, it uses both Rsdt and Xsdt. I check the ACPI spec and found below info: (Excerpt from ACPI
>> spec 6.0 page 113)
>>> 	Platforms provide the RSDT to enable compatibility with ACPI 1.0 operating systems. The XSDT, described in the next section,
>> supersedes RSDT functionality.
>>>
>>> So base on this, I think UEFI code is ok and Fwts should not do such check.
>>
>> Right.  That is what the spec says.  I think Alex's question was different,
>> though, and something the spec does not address.
>>
> 
> I think if the spec not has clear description, the Fwts tool should not add such check base on some of the current implementation.
>  
>> The test being referred to below is saying that the RSDT and XSDT addresses
>> are different.  It is okay to use both addresses.  But, if they are different,
>> which one is the correct one for the OS?  There is no way to know, and the
>> spec does not tell us, so this is an error.
>>
> 
> I think it depend on what ACPI version this OS support. If the OS supports ACPI 1.0 version, it can use the RSDT, else it use XSDT.
>  
> For the UEFI code, I think it just wants to support different OS with same image. So it use RSDT and XSDT both with different value.  If the OS supports ACPI 1.0, it can use RSDT, else it can use XSDT. I think the UEFI solution is correct and make sense.

Given the case we have some ambiguity here, I think the way forward is
to remove the failure mode from the test and replace it with some
warning and NOT report an error, e.g. something like:

fwts_log_warning(fw, "Note: The RSDT and XSDT are both defined. An "
	"OS supporting ACPI 1.0 should use the RSDT, otherwise the "
	"OS will use the XSDT. RSDT = 0x%" PRIu32 "x, "
	"XSDT = 0x%" PRIu64,
	rsdp->rsdt_address, rsdp->xsdt_address);

If that sounds sane I'll send a patch.

Colin

> 
>> As a practical matter, in the firmware I have seen, either RSDT is used, or
>> XSDT is used, or both are used and have exactly the same value.
>>
> 
> The Entry size for RSDT and XSDT are different (RSDT is 4 bytes and XSDT is 8 bites), so use same address for both RSDT and XSDT is not make sense.

well... unless the upper 32 bits of the XSDT are zero, and hence RSDT ==
XSDT.

> 
>>> Thanks,
>>> Eric
>>>> -----Original Message-----
>>>> From: Alex Hung [mailto:alex.hung at canonical.com]
>>>> Sent: Wednesday, July 20, 2016 1:44 PM
>>>> To: Dong, Eric
>>>> Cc: Al Stone; fwts-devel at lists.ubuntu.com
>>>> Subject: Re: Question about rsdp test?
>>>>
>>>> FWTS only generates this error message when both are RSDT and XSDT
>>>> aren't zero && they aren't not pointing to the same address, as below.
>>>> Is there any reason why your firmware to point to different two
>>>> differently? Recent 64 bit OS will have no problem choosing XSDT, but
>>>> older 32 bit OS may pick RSDT which is never tested and that can
>>>> potentially cause problems.
>>>>
>>>>         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.");
>>>>
>>>> On Wed, Jul 20, 2016 at 9:39 AM, Dong, Eric <eric.dong at intel.com> wrote:
>>>>>> On 07/18/2016 06:06 AM, Dong, Eric wrote:
>>>>>>> When I do the Fwts test, I got below error for the rsdp test.
>>>>>>>
>>>>>>> rsdp           ;HED rsdp: RSDP Root System Description Pointer test.
>>>>>>>
>>>>>>> rsdp           ;SEP ------------------------------------------------------------
>>>>>>>
>>>>>>> rsdp           ;INF Test 1 of 1: RSDP Root System Description Pointer test.
>>>>>>>
>>>>>>> rsdp           ;PAS PASSED: Test 1, RSDP first checksum is correct
>>>>>>>
>>>>>>> rsdp           ;PAS PASSED: Test 1, RSDP: oem_id contains only printable
>>>>>>>
>>>>>>> rsdp           ;PAS characters.
>>>>>>>
>>>>>>> rsdp           ;PAS PASSED: Test 1, RSDP: revision is 2.
>>>>>>>
>>>>>>> rsdp           ;PAS PASSED: Test 1, RSDP: at least one of RsdtAddress or
>>>>>>>
>>>>>>> rsdp           ;PAS XsdtAddress is non-zero.
>>>>>>>
>>>>>>> rsdp           ;FAL FAILED [MEDIUM] RSDPBothAddressesFound: Test 1, RSDP: only
>>>>>>>
>>>>>>> rsdp           ;FAL one of RsdtAddress or XsdtAddress should be non-zero. Both
>>>>>>>
>>>>>>> rsdp           ;FAL fields are non-zero.
>>>>>>>
>>>>>>> rsdp           ;PAS PASSED: Test 1, RSDP: the correct RSDT/XSDT address is being
>>>>>>>
>>>>>>> rsdp           ;PAS used.
>>>>>>>
>>>>>>> rsdp           ;PAS PASSED: Test 1, RSDP: the table is the correct length.
>>>>>>>
>>>>>>> rsdp           ;PAS PASSED: Test 1, RSDP second checksum is correct
>>>>>>>
>>>>>>> rsdp           ;PAS PASSED: Test 1, RSDP: the reserved field is zero.
>>>>>>>
>>>>>>> rsdp           ;NLN
>>>>>>>
>>>>>>> rsdp           ;SEP ============================================================
>>>>>>>
>>>>>>> rsdp           ;SUM 8 passed, 1 failed, 0 warning, 0 aborted, 0 skipped, 0 info
>>>>>>>
>>>>>>> rsdp           ;SUM only.
>>>>>>>
>>>>>>> rsdp           ;SEP ============================================================
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> I think it caused by both Rsdt and Xsdt address are not zero. But From ACPI 6.0
>>>>>>> spec: (page 115)
>>>>>>>
>>>>>>> Notice that both the XSDT and the RSDT can be pointed to by the RSDP structure.
>>>>>>> An ACPI-compatible OS must use the XSDT if present.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> From the above description, I think the spec allowed the case of both Xsdt and
>>>>>>> Rsdt are not zero.  So I think Fwts tool should not report error for this case,
>>>>>>> am I correct?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Eric
>>>>>>
>>>>>> On what architecture?  If this is on ARMv8, we should not be using an RSDT,
>>>>>> according to SBSA/SBBR specifications.  If this is on x86, or perhaps ia64,
>>>>>> then the test probably needs to allow for that, if it doesn't already.
>>>>>>
>>>>>> Personally, I'd really like to discourage new systems from using the 32-bit
>>>>>> tables.
>>>>>>
>>>>>
>>>>> Yes, I use the x86 system. I think it's an optional choice, Fwts should not report it as an error, maybe a warning is ok.
>>>>>
>>>>>> --
>>>>>> ciao,
>>>>>> al
>>>>>> -----------------------------------
>>>>>> Al Stone
>>>>>> Software Engineer
>>>>>> Linaro Enterprise Group
>>>>>> al.stone at linaro.org
>>>>>> -----------------------------------
>>>>>
>>>>> --
>>>>> fwts-devel mailing list
>>>>> fwts-devel at lists.ubuntu.com
>>>>> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/fwts-devel
>>>>
>>>>
>>>>
>>>> --
>>>> Cheers,
>>>> Alex Hung
>>
>>
>> --
>> ciao,
>> al
>> -----------------------------------
>> Al Stone
>> Software Engineer
>> Linaro Enterprise Group
>> al.stone at linaro.org
>> -----------------------------------
> 
> Thanks,
> Eric
> 




More information about the fwts-devel mailing list