Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACPI RSDT not zero #25

Closed
samerhaj opened this issue Mar 17, 2020 · 8 comments
Closed

ACPI RSDT not zero #25

samerhaj opened this issue Mar 17, 2020 · 8 comments
Labels
bug Something isn't working fixed-v1.10 Issue known to be fixed in v1.10 and subsequent releases v1.2 Issue known to exist in v1.2 v1.3 Issue known to exist in v1.3 v1.4 Issue known to exist in v1.4 v1.5 Issue known to exist in v1.5 v1.6 Issue known to exist in v1.6 v1.7 Issue known to exist in v1.7 v1.8 Issue known to exist in v1.8 v1.9 Issue known to exist in v1.9

Comments

@samerhaj
Copy link
Member

samerhaj commented Mar 17, 2020

Acpiview shows an error indicating RSDT Address needs to be NULL on ARM platforms.

This is consistent with SBBR 1.2 rule (section 4.2.1.1)

 --------------- RSDP Table --------------- 

Address  : 0x33D30014
Length   : 36
  
00000000 : 52 53 44 20 50 54 52 20 - 97 4D 43 52 53 46 54 02   RSD PTR .MCRSFT.
00000010 : 74 00 D2 33 24 00 00 00 - E8 00 D2 33 00 00 00 00   t..3$......3....
00000020 : EF 00 00 00                                         ....

Table Checksum : OK

RSDP                                 :
  Signature                          : RSD PTR 
  Checksum                           : 0x97
  Oem ID                             : MCRSFT
  Revision                           : 2
  RSDT Address                       : 0x33D20074
ERROR: Rsdt Address = 0x33D20074. This must be NULL on ARM Platforms.
  Length                             : 36
  XSDT Address                       : 0x33D200E8
  Extended Checksum                  : 0xEF
  Reserved                           : 0 0 0
@samerhaj samerhaj added bug Something isn't working v1.5 Issue known to exist in v1.5 labels Mar 17, 2020
@pbatard
Copy link
Member

pbatard commented Mar 18, 2020

Yeah, I've seen that error for some time. It looks to me like an edk2 bug, because, as far as I can tell, that table is generated automatically and we have little/no control about it in our platform files.

I'm willing to bet that we're far from the only ARM platform producing this error, and I've kind of been waiting for some other ARM platforms to be bothered enough with this to send a global edk2 fix... 😉

@samerhaj
Copy link
Member Author

I think you simply need to set gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions to 0x20. This is what the other Arm platforms (Juno, FVP, Socionext DeveloperBox, etc..) did/

The default value of PcdAcpiExposedTableVersions is 0x3E, which sets multiple ACPI revisions supported, including EFI_ACPI_TABLE_VERSION_1_0B (bit 1)

The code in AcpiTableDxe populates the RSDT pointer only if PcdAcpiExposedTableVersions has the EFI_ACPI_TABLE_VERSION_1_0B bit set. Look for example at PublishTables ( ) and similar code. This is per ACPI spec section 5.2.7, which defines RSDT to be for compatability with ACPI 1.0 OSes.

@samerhaj
Copy link
Member Author

I think you simply need to set gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions to 0x20.

Confirmed this fixes the issue. I will send a patch

@pbatard
Copy link
Member

pbatard commented Mar 18, 2020

That's good to know (and I will test that too), but I would argue that, if the EDK2 code for ARM sets a default PCD value that produces an ACPI error, then EDK2 should be fixed, because I think one is entitled to expect that the default PCD values should not generate an ACPI error.

In other words, the default value for gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions should be set to 0x20 for ARM platforms in the EDK2, and that is the patch I think we should be aiming for.

@pbatard
Copy link
Member

pbatard commented Mar 18, 2020

It's currently defined at https://github.com/tianocore/edk2/blob/01ce872739d2f0cd3a8917be2180381db5f0391e/MdeModulePkg/MdeModulePkg.dec#L1415

I think we probably want to have a [PcdsFixedAtBuild.ARM, PcdsFixedAtBuild.AARCH64, PcdsPatchableInModule.ARM, PcdsPatchableInModule.AARCH64] section to override this, since this is currently set under [PcdsFixedAtBuild, PcdsPatchableInModule]. If you want to send a patch for that, that would be great, otherwise I'll be happy to do it.

@samerhaj
Copy link
Member Author

samerhaj commented Mar 20, 2020

OK adding this in MdeModulePkg.dec does take care of the issue, and seems to keep the old value for non-Arm systems

[PcdsFixedAtBuild.ARM, PcdsFixedAtBuild.AARCH64, PcdsPatchableInModule.ARM, PcdsPatchableInModule.AARCH64]
  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x20|UINT32|0x0001004c

However, I think we should probably do this only for Aarch64 and leave Arm alone. The SBBR requirement only applies to Aarch64.

So it should be:

[PcdsFixedAtBuild.AARCH64, PcdsPatchableInModule.AARCH64]
  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x20|UINT32|0x0001004c

Thoughts?

@pbatard
Copy link
Member

pbatard commented Mar 20, 2020

Sounds good to me. The people reviewing the patch on edk2-devel will most likely let us know if they think this should apply to more than AARCH64 anyway.

@samerhaj samerhaj added v1.2 Issue known to exist in v1.2 v1.3 Issue known to exist in v1.3 v1.4 Issue known to exist in v1.4 labels Mar 22, 2020
samerhaj added a commit to samerhaj/edk2 that referenced this issue Mar 22, 2020
Set the default value of PcdAcpiExposedTableVersions for Aarch64
platforms to 0x20. Previously, the default was set to 0x3E for all
platforms. The new value removes ACPI 1.0b compatability, which forces
the use of XSDT 64-bit pointer, as required by Arm SBBR specification.
This also resolves an error reported by acpiview command, as seen on
the RPi (see pftf/RPi4#25).

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Signed-off-by: Samer El-Haj-Mahmoud <samer@elhajmahmoud.com>
@andreiw andreiw added v1.6 Issue known to exist in v1.6 v1.7 Issue known to exist in v1.7 labels Mar 26, 2020
samerhaj added a commit to samerhaj/edk2 that referenced this issue Apr 10, 2020
Set the default value of PcdAcpiExposedTableVersions for Aarch64
platforms to 0x20. Previously, the default was set to 0x3E for all
platforms. The new value removes ACPI 1.0b compatability, which forces
the use of XSDT 64-bit pointer, as required by Arm SBBR specification.
This also resolves an error reported by acpiview command, as seen on
the RPi (see pftf/RPi4#25).

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>

Signed-off-by: Samer El-Haj-Mahmoud <samer@elhajmahmoud.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
@andreiw andreiw added the v1.8 Issue known to exist in v1.8 label Apr 15, 2020
ardbiesheuvel pushed a commit to ardbiesheuvel/edk2 that referenced this issue Apr 21, 2020
Set the default value of PcdAcpiExposedTableVersions for Aarch64
platforms to 0x20. Previously, the default was set to 0x3E for all
platforms. The new value removes ACPI 1.0b compatability, which forces
the use of XSDT 64-bit pointer, as required by Arm SBBR specification.
This also resolves an error reported by acpiview command, as seen on
the RPi (see pftf/RPi4#25).

Signed-off-by: Samer El-Haj-Mahmoud <samer@elhajmahmoud.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Acked-by: Hao A Wu <hao.a.wu@intel.com>
mergify bot pushed a commit to tianocore/edk2 that referenced this issue Apr 21, 2020
Set the default value of PcdAcpiExposedTableVersions for Aarch64
platforms to 0x20. Previously, the default was set to 0x3E for all
platforms. The new value removes ACPI 1.0b compatability, which forces
the use of XSDT 64-bit pointer, as required by Arm SBBR specification.
This also resolves an error reported by acpiview command, as seen on
the RPi (see pftf/RPi4#25).

Signed-off-by: Samer El-Haj-Mahmoud <samer@elhajmahmoud.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Acked-by: Hao A Wu <hao.a.wu@intel.com>
@andreiw andreiw added the v1.9 Issue known to exist in v1.9 label Apr 21, 2020
@andreiw andreiw added v1.10 Issue known to exist in v1.10 v1.11 Issue known to exist in v1.11 fixed-v1.10 Issue known to be fixed in v1.10 and subsequent releases and removed v1.10 Issue known to exist in v1.10 v1.11 Issue known to exist in v1.11 labels May 8, 2020
@andreiw
Copy link
Member

andreiw commented May 8, 2020

Probably fixed even earlier, my bad.

@andreiw andreiw closed this as completed May 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed-v1.10 Issue known to be fixed in v1.10 and subsequent releases v1.2 Issue known to exist in v1.2 v1.3 Issue known to exist in v1.3 v1.4 Issue known to exist in v1.4 v1.5 Issue known to exist in v1.5 v1.6 Issue known to exist in v1.6 v1.7 Issue known to exist in v1.7 v1.8 Issue known to exist in v1.8 v1.9 Issue known to exist in v1.9
Projects
None yet
Development

No branches or pull requests

3 participants