Don't try to read the RSDP structure or RSDT/XSDT tables from memory with the -c option. These are now provided as files in /sysfs, and this allows acpidump to function when /dev/mem is not available, which will be the case for Aarch64 servers.
Signed-off-by: Roy Franz roy.franz@linaro.org --- Graeme - all this is tested with your patch, which looks good. It takes care of what acpidump needs from sysfs.
Al - this fixes acpidump. Are there other utilities that I need to look at within acpica-tools?
This produces almost the same output with/without the "-c" option, with the /sysfs files being used with "-c", with the following differences: * Table address are 0x0 with -c, since we don't get them from the sysfs files * the tables are listed in a different order.
I have verified with strace that no /dev/mem accesses are made with "-c".
An issue that this patch doesn't address, is what should be the default, and what should be done if /dev/mem is missing, or there but not readable.
source/os_specific/service_layers/oslinuxtbl.c | 87 +++++++++++++------------- 1 file changed, 43 insertions(+), 44 deletions(-)
diff --git a/source/os_specific/service_layers/oslinuxtbl.c b/source/os_specific/service_layers/oslinuxtbl.c index e090a3c..95cc674 100644 --- a/source/os_specific/service_layers/oslinuxtbl.c +++ b/source/os_specific/service_layers/oslinuxtbl.c @@ -686,70 +686,69 @@ OslTableInitialize ( return (AE_OK); }
+ if (!Gbl_DumpCustomizedTables) + { /* Get RSDP from memory */
- Status = OslLoadRsdp (); - if (ACPI_FAILURE (Status)) - { - return (Status); - } + Status = OslLoadRsdp (); + if (ACPI_FAILURE (Status)) + { + return (Status); + }
- /* Get XSDT from memory */ + /* Get XSDT from memory */
- if (Gbl_Rsdp.Revision && !Gbl_DoNotDumpXsdt) - { - if (Gbl_Xsdt) + if (Gbl_Rsdp.Revision && !Gbl_DoNotDumpXsdt) { - free (Gbl_Xsdt); - Gbl_Xsdt = NULL; + if (Gbl_Xsdt) + { + free (Gbl_Xsdt); + Gbl_Xsdt = NULL; + } + + Gbl_Revision = 2; + Status = OslGetBiosTable (ACPI_SIG_XSDT, 0, + ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Xsdt), &Address); + if (ACPI_FAILURE (Status)) + { + return (Status); + } }
- Gbl_Revision = 2; - Status = OslGetBiosTable (ACPI_SIG_XSDT, 0, - ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Xsdt), &Address); - if (ACPI_FAILURE (Status)) + /* Get RSDT from memory */ + + if (Gbl_Rsdp.RsdtPhysicalAddress) { - return (Status); + if (Gbl_Rsdt) + { + free (Gbl_Rsdt); + Gbl_Rsdt = NULL; + } + + Status = OslGetBiosTable (ACPI_SIG_RSDT, 0, + ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Rsdt), &Address); + if (ACPI_FAILURE (Status)) + { + return (Status); + } } - }
- /* Get RSDT from memory */ + /* Get FADT from memory */
- if (Gbl_Rsdp.RsdtPhysicalAddress) - { - if (Gbl_Rsdt) + if (Gbl_Fadt) { - free (Gbl_Rsdt); - Gbl_Rsdt = NULL; + free (Gbl_Fadt); + Gbl_Fadt = NULL; }
- Status = OslGetBiosTable (ACPI_SIG_RSDT, 0, - ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Rsdt), &Address); + Status = OslGetBiosTable (ACPI_SIG_FADT, 0, + ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Fadt), &Gbl_FadtAddress); if (ACPI_FAILURE (Status)) { return (Status); } - }
- /* Get FADT from memory */ - - if (Gbl_Fadt) - { - free (Gbl_Fadt); - Gbl_Fadt = NULL; - } - - Status = OslGetBiosTable (ACPI_SIG_FADT, 0, - ACPI_CAST_PTR (ACPI_TABLE_HEADER *, &Gbl_Fadt), &Gbl_FadtAddress); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - - if (!Gbl_DumpCustomizedTables) - { /* Add mandatory tables to global table list first */ - Status = OslAddTableToList (ACPI_RSDP_NAME, 0); if (ACPI_FAILURE (Status)) {