On 2015-10-05 at 17:18 ron minnich <
rmin...@gmail.com> wrote:
> The ACPI tables are good. They don't contain all the things you want
> to see in them. This is allowed.
>
> The things you're looking for in the ACPI table don't have to be
> there. I learned this the hard way over the years and
> had to put fixes into the Plan 9 parser to cover those cases. I just
> love ACPI.
>
> I don't think we should mess with the ACPI tables, personally. Start
> down that road, it will never end, and we'll have code in different
> places trying to change things for different reasons.
Just to be clear, I didn't mean to mess with the ACPI tables. I meant
to mess with our in-kernel data structures that we built from parsing
ACPI. And that fiddling happens in the ACPI parsing code itself, such
that we can express and enforce a few invariants on the kernel data
structures.
For instance, we can mandate that there is at least one lapic and it's
domain is >= 0 (if that makes sense). We can add something like
acpi_check() at the end of acpiinit() that will:
struct Srat *temp = srat;
while (temp)
if ((temp->type == SRlapic) && (temp->lapic.dom >= 0))
break;
if (!temp)
panic("") || return -1 || whatever();
And in the case of the chromebook, we now know that we're going to fail
that check, so we'll need to catch it and patch up the struct *srat srat
list by creating a new struct Srat * and adding it to the list. This
way, we localize the fix (kernel structures do Foo) closest to the
problem (ACPI tables).
Anyway, I'm up for whatever fix you guys have.
Barret