Discussion:
[PATCH] hurd - ACPI tables netfs translator
Damien Zammit
2018-11-11 07:28:08 UTC
Permalink
Hello,

This patch provides a translator for mounting x86 ACPI tables under a
path as read-only files. I believe it is needed so that other things
that depend on ACPI to find the base address such as Intel's IOMMU (DMAR
table), memory mapped PCI space (MCFG table) etc, can be discovered in
userspace. Otherwise, this functionality would need to be built into
gnumach which would be a burden to maintain.

The basic principle of this translator is that it searches for the ACPI
root table within the PnP Extended System Configuration Data (ESCD)
memory region that is sitting at address 0xE0000, then mmaps into it and
extracts the ACPI tables from other physical pointers.

The crux of my method is in acpi.c and the structure of tables is in acpi.h

Please provide feedback, and I can revise as necessary.

Cheers, Damien
Almudena Garcia
2018-11-12 18:12:16 UTC
Permalink
I think if you need ACPI in gnumach to provide SMP support for the
kernel, then ACPI tables reading functionality should be in gnumach then?
I agree. In this case, access to ACPI tables through a translator could
produce a recursive dependency problem (Translator could need gnumach, and
gnumach needs translator to enable the processors during the boot)

Thanks
It's so interesting!! I'm in a project to provide SMP support to
gnumach, and I need to read ACPI tables to get certain information.
Hello,
I think if you need ACPI in gnumach to provide SMP support for the
kernel, then ACPI tables reading functionality should be in gnumach then?
Please post this to the list with your reply so we can all discuss.
Thanks,
Damien
Samuel Thibault
2018-11-12 18:29:57 UTC
Permalink
I think if you need ACPI in gnumach to provide SMP support for the
kernel, then ACPI tables reading functionality should be in gnumach then?
I agree. In this case, access to ACPI tables through a translator could produce
a recursive dependency problem (Translator could need gnumach, and gnumach
needs translator to enable the processors during the boot)
But we don't need all ACPI to get what SMP needs. ACPI is a nightmare,
if we can avoid most of it in the kernel, that's for all the best.

Samuel
Samuel Thibault
2018-11-12 18:30:40 UTC
Permalink
Post by Samuel Thibault
I think if you need ACPI in gnumach to provide SMP support for the
kernel, then ACPI tables reading functionality should be in gnumach then?
I agree. In this case, access to ACPI tables through a translator could produce
a recursive dependency problem (Translator could need gnumach, and gnumach
needs translator to enable the processors during the boot)
But we don't need all ACPI to get what SMP needs.
I mean, the kernel can have its own ACPI implementation, just enough to
get the information needed for SMP.

Samuel
Almudena Garcia
2018-11-12 18:39:17 UTC
Permalink
Post by Samuel Thibault
I mean, the kernel can have its own ACPI implementation, just enough to
get the information needed for SMP.
Ok. What I need is to read RSDT table, to get the pointer to APIC table,
which store the information about processors and ioapic

In my docs, I've written the procedure to get this:


*- How to find APIC tableTo find APIC table, we can read RSDT table RSDT
reference. To get the address of RSDT, we need to read RDSP table.*
* Once got RSDT table, we need to read Entry field, and search the pointer
to the APIC table in the array referenced in this field.*
Post by Samuel Thibault
Post by Samuel Thibault
I think if you need ACPI in gnumach to provide SMP support for the
kernel, then ACPI tables reading functionality should be in
gnumach then?
Post by Samuel Thibault
I agree. In this case, access to ACPI tables through a translator
could produce
Post by Samuel Thibault
a recursive dependency problem (Translator could need gnumach, and
gnumach
Post by Samuel Thibault
needs translator to enable the processors during the boot)
But we don't need all ACPI to get what SMP needs.
I mean, the kernel can have its own ACPI implementation, just enough to
get the information needed for SMP.
Samuel
Damien Zammit
2018-11-13 08:40:14 UTC
Permalink
/- How to find APIC table
To find APIC table, we can read RSDT table RSDT reference. To get the
address of RSDT, we need to read RDSP table./
/Once got RSDT table, we need to read Entry field, and search the
pointer to the APIC table in the array referenced in this field./
You could reuse some of the code I wrote in acpi.{c,h} and modify it as
you need to only get the required table(s), my function gets all the
tables, but you can restrict it to ones that match the four byte
"signature" that you need and clean it up so it only supports the
minimum required. Also, considering you are in kernel land, it would be
probably easier to read physical pointers you don't need mmap or /dev/mem.

Damien

Loading...