rust-osdev / acpi

Rust library for parsing ACPI tables and interpreting AML
Apache License 2.0
201 stars 63 forks source link

`SdtInvalidSignature(“XSDT”)` on ACPI Revision 2+ #175

Open kennystrawnmusic opened 1 year ago

kennystrawnmusic commented 1 year ago

Despite all the checks that I've spotted in the code to determine whether or not there's a RSDT or XSDT in there, I still for the life of me can't seem to figure out why this is happening:

image

In this other view, you can see that I have my kernel set to print the ACPI revision prior to this and it's correctly reported as 2:

image

So why therefore is it still failing to validate despite this? Seems really strange to say the least — after all, if AcpiTables::from_rsdt() and all the functions that depend on it correctly check to see if the ACPI revision is non-zero before going on to call validate to verify the signature, then the problem has to be with the validate function itself. How exactly, however, I have absolutely no idea.

kennystrawnmusic commented 1 year ago

Update: Can confirm that porting my kernel to use the bleeding edge version from this repo makes no difference. Still giving me this same error despite the fact that the signature should be perfectly valid for the ACPI version involved. What say you @IsaacWoods? Looked into this issue yet?

IsaacWoods commented 1 year ago

Without access to the hardware producing this table, there's not a lot I can do without more info.

Given the error, the code on the git version that is failing is:

if self.signature != signature || str::from_utf8(&self.signature.0).is_err() {
    return Err(AcpiError::SdtInvalidSignature(signature));
}

I agree it's strange for it to be failing either of these checks. Could you dump the raw hex of the table and post it here?

kennystrawnmusic commented 1 year ago

Without access to the hardware producing this table, there's not a lot I can do without more info.

Given the error, the code on the git version that is failing is:


if self.signature != signature || str::from_utf8(&self.signature.0).is_err() {

    return Err(AcpiError::SdtInvalidSignature(signature));

}

I agree it's strange for it to be failing either of these checks. Could you dump the raw hex of the table and post it here?

find /sys/firmware/acpi/tables -iname "*XSDT*" returns nothing. How therefore is it possible to dump the table without actually getting my own kernel working on the hardware in question?

Regardless, here's the acpidump output — see what you can find in there, Isaac.