Xen on RP4
+ xen-devel
Quoted 35 lines · Elliott Mitchell
Quoted 23 lines · Stefano Stabellini
Quoted 22 lines · Elliott Mitchell
Quoted 10 lines · Stefano Stabellini
Quoted 6 lines · Elliott Mitchell
Due to experimenting with "proper" console on serial port, I ended up getting output. Apparently domain 0 was panicing when trying to setup xen-blkback due to the swiotlb code being unable to allocate a bounce buffer.
Stefano, what is the status of swiotlb in the 5.8 kernel series?
The swiotlb fixes for RPi4 are not in 5.8. Linux 5.9 has just been released, and it should come with everything you need.
I had 13 patches applied to Debian's 5.8 kernel source. Two of the batch I had against 5.6 had gotten into mainline. No issues were visible during normal operation.
Problem showed up when trying to start a domain. By using Xen's console device I managed to get the messages:
xen-blkback: backend/vbd/3/51712: using 2 queues, protocol 1 (arm-abi) persistent grants
Kernel panic - not syncing: Can not allocate SWIOTLB buffer earlier and can't now provide you with the DMA bounce bufferQuoted 6 lines
Quoted 4 lines
Worth noting that by the time when I was starting this domain, the device had an uptime of more than an hour. There could be a problem of swiotlb needing the ability to claim DMA-viable pages after they've been in use for other purposes.
I'll have a look
Finally came up with one detail of a change I'd made in the right time frame to trigger this issue. As such I can now control this behavior and get it to occur or not.
Quoted 6 lines
I have some suspicion my planned workload approach differs from others.
During the runs where I was able to successfully boot a child domain, domain 0 had been allocated 512MB of memory. During the unsuccessful run where the above message occurred, domain 0 had been allocated 2GB of memory. This appears to reliably control the occurrence of this bug.
This is what is going on. kernel/dma/swiotlb.c:swiotlb_init gets called and tries to allocate a buffer for the swiotlb. It does so by calling
memblock_alloc_low(PAGE_ALIGN(bytes), PAGE_SIZE);
In your case, the allocation must fail, no_iotlb_memory is set, and I expect you see this warning among the boot messages:
Cannot allocate buffer
Later during initialization swiotlb-xen comes in (drivers/xen/swiotlb-xen.c:xen_swiotlb_init) and given that io_tlb_start is != 0 it thinks the memory is ready to use when actually it is not.
When the swiotlb is actually needed, swiotlb_tbl_map_single gets called and since no_iotlb_memory is set the kernel panics.
The reason why you are only seeing it with a 2G dom0 is because swiotlb_init is only called when:
max_pfn > PFN_DOWN(arm64_dma_phys_limit ? : arm64_dma32_phys_limit))
see arch/arm64/mm/init.c:mem_init. So when dom0 is 512MB swiotlb_init is not called at all. swiotlb-xen does the allocation itself with memblock_alloc and it succeeds.
Note that I tried to repro the issue here at my end but it works for me with device tree. So the swiotlb_init memory allocation failure probably only shows on ACPI, maybe because ACPI is reserving too much low memory.
In any case, I think the issue might be "fixed" by this patch:
kernel/dma/swiotlb.c +5 -0
@@ -231,6 +231,7 @@ int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose) io_tlb_orig_addr[i] =INVALID_PHYS_ADDR ; } io_tlb_index =0 ; + no_iotlb_memory = false;if (verbose)swiotlb_print_info ();
@@ -263,8 +264,11 @@ swiotlb_init(int verbose)return ;if (io_tlb_start) + {memblock_free_early (io_tlb_start,PAGE_ALIGN (io_tlb_nslabs <<IO_TLB_SHIFT )); + io_tlb_start =0 ; + }pr_warn ("Cannot allocate buffer" ); no_iotlb_memory = true; }
@@ -362,6 +366,7 @@ swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs) io_tlb_orig_addr[i] =INVALID_PHYS_ADDR ; } io_tlb_index =0 ; + no_iotlb_memory = false;swiotlb_print_info ();
Quoted 60 lines · Stefano Stabellini
This is what is going on. kernel/dma/swiotlb.c:swiotlb_init gets called and tries to allocate a buffer for the swiotlb. It does so by calling
memblock_alloc_low(PAGE_ALIGN(bytes), PAGE_SIZE);In your case, the allocation must fail,
no_iotlb_memoryis set, and I expect you see this warning among the boot messages:Cannot allocate buffer
Later during initialization swiotlb-xen comes in (drivers/xen/swiotlb-xen.c:xen_swiotlb_init) and given that
io_tlb_startis != 0 it thinks the memory is ready to use when actually it is not.When the swiotlb is actually needed,
swiotlb_tbl_map_singlegets called and sinceno_iotlb_memoryis set the kernel panics.The reason why you are only seeing it with a 2G dom0 is because
swiotlb_initis only called when:
max_pfn>PFN_DOWN(arm64_dma_phys_limit ? : arm64_dma32_phys_limit))see arch/arm64/mm/init.c:mem_init. So when dom0 is 512MB
swiotlb_initis not called at all. swiotlb-xen does the allocation itself withmemblock_allocand it succeeds.Note that I tried to repro the issue here at my end but it works for me with device tree. So the
swiotlb_initmemory allocation failure probably only shows on ACPI, maybe because ACPI is reserving too much low memory.In any case, I think the issue might be "fixed" by this patch:
kernel/dma/swiotlb.c +4
-0@@ -231,6 +231,7 @@ int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose) io_tlb_orig_addr[i] =INVALID_PHYS_ADDR ; } io_tlb_index =0 ; + no_iotlb_memory = false;if (verbose)swiotlb_print_info ();@@ -263,8 +264,11 @@ swiotlb_init(int verbose)return ;if (io_tlb_start) + {memblock_free_early (io_tlb_start,PAGE_ALIGN (io_tlb_nslabs <<IO_TLB_SHIFT )); + io_tlb_start =0 ; + }pr_warn ("Cannot allocate buffer" ); no_iotlb_memory = true; }
kernel/dma/swiotlb.c swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs) · line 371
Quoted 6 lines
kernel/dma/swiotlb.c +1
-0@@ -362,6 +366,7 @@ swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs) io_tlb_orig_addr[i] =INVALID_PHYS_ADDR ; } io_tlb_index =0 ; + no_iotlb_memory = false;swiotlb_print_info ();
This does indeed appear to take care of the domain 0 panic.
Last issue is the framebuffer and this project has reached usability. My impression was framebuffer was an issue for device-tree as well.
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 5 lines · Stefano Stabellini
This is what is going on. kernel/dma/swiotlb.c:swiotlb_init gets called and tries to allocate a buffer for the swiotlb. It does so by calling
memblock_alloc_low(PAGE_ALIGN(bytes), PAGE_SIZE);
Quoted 8 lines
In your case, the allocation must fail,
no_iotlb_memoryis set, and I expect you see this warning among the boot messages:Cannot allocate buffer
Later during initialization swiotlb-xen comes in (drivers/xen/swiotlb-xen.c:xen_swiotlb_init) and given that
io_tlb_startis != 0 it thinks the memory is ready to use when actually it is not.
Forgot to respond to this portion even though I'd noticed on my first read. I haven't ever observed that message.
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 12 lines · Stefano Stabellini
Quoted 10 lines · Elliott Mitchell
Finally came up with one detail of a change I'd made in the right time frame to trigger this issue. As such I can now control this behavior and get it to occur or not.
I have some suspicion my planned workload approach differs from others.
During the runs where I was able to successfully boot a child domain, domain 0 had been allocated 512MB of memory. During the unsuccessful run where the above message occurred, domain 0 had been allocated 2GB of memory. This appears to reliably control the occurrence of this bug.
Quoted 8 lines
In your case, the allocation must fail,
no_iotlb_memoryis set, and I expect you see this warning among the boot messages:Cannot allocate buffer
Later during initialization swiotlb-xen comes in (drivers/xen/swiotlb-xen.c:xen_swiotlb_init) and given that
io_tlb_startis != 0 it thinks the memory is ready to use when actually it is not.
Then I look at more copies of dmesg logs and discover I did have one where that message occurred. Then start playing a bit more and a matching pattern emerges.
dom0_mem=1023M
=> "software IO TLB: mapped [mem 0x2c000000-0x30000000] (64MB)"
dom0_mem=1024M
=> "software IO TLB: Cannot allocate buffer"
That looks suspicious. Really suspicious. I don't know how many bugs are combined together, nor where they are, but more data for you.
I see a possibility Tianocore marks a smaller region of memory as being DMA-capable. This though is speculation.
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 3 lines · Stefano Stabellini
Note that I tried to repro the issue here at my end but it works for me with device tree. So the
swiotlb_initmemory allocation failure probably only shows on ACPI, maybe because ACPI is reserving too much low memory.
Found it. Take a look at 437b0aa06a014ce174e24c0d3530b3e9ab19b18b
PLATFORM_START(rpi4, "Raspberry Pi 4")
.compatible = rpi4_dt_compat,
.blacklist_dev = rpi4_blacklist_dev,
+ .dma_bitsize = 30, PLATFORM_END
Where this is used to match against a *device-tree*. ACPI has a distinct means of specifying a limited DMA-width; the above fails, because it assumes a *device-tree*.
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Hi Elliott,
Quoted 7 lines · Elliott Mitchell
Quoted 3 lines · Stefano Stabellini
Note that I tried to repro the issue here at my end but it works for me with device tree. So the
swiotlb_initmemory allocation failure probably only shows on ACPI, maybe because ACPI is reserving too much low memory.Found it. Take a look at
437b0aa06a014ce174e24c0d3530b3e9ab19b18b
Quoted 7 lines
PLATFORM_START(rpi4, "Raspberry Pi 4")
.compatible =rpi4_dt_compat,
.blacklist_dev =rpi4_blacklist_dev,
+ .dma_bitsize = 30,
PLATFORM_ENDWhere this is used to match against a *device-tree*.
Right. When we introduced ACPI in Xen, we made the assumption there would be no need for per-platform workaround.
Quoted 3 lines
ACPI has a distinct
means of specifying a limited DMA-width; the above fails, because it assumes a *device-tree*.
Do you know if it would be possible to infer from the ACPI static table the DMA-width?
If not, is there a way to uniquely identify the platform?
Cheers,
Signature · 1 line
Julien Grall
Quoted 7 lines · Julien Grall
Quoted 3 lines · Elliott Mitchell
ACPI has a distinct
means of specifying a limited DMA-width; the above fails, because it assumes a *device-tree*.Do you know if it would be possible to infer from the ACPI static table the DMA-width?
Yes, and it is. Due to not knowing much about ACPI tables I don't know what the C code would look like though (problem is which documentation should I be looking at first?).
Handy bit of information is in the RP4 Tianocore table source:
https://github.com/tianocore/edk2-platforms/blob/d492639638eee331ac3389e6cf53ea266c3c84b3/Platform/RaspberryPi/AcpiTables/Dsdt.asl
Name (_DMA, ResourceTemplate() {
//
// Only the first GB is available.
// Bus 0xC0000000 -> CPU 0x00000000.
//
QWordMemory (ResourceConsumer,
,
MinFixed,
MaxFixed,
NonCacheable,
ReadWrite,
0x0,
0x00000000C0000000, // MIN
0x00000000FFFFFFFF, // MAX
0xFFFFFFFF40000000, // TRA
0x0000000040000000, // LEN
,
,
)
})There should be some corresponding code in the Linux 5.9 kernels. From the look of that, it might even be possible to specify a memory range which didn't start at address 0.
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Hi Elliott,
Quoted 6 lines · Elliott Mitchell
Quoted 5 lines · Julien Grall
Quoted 3 lines · Elliott Mitchell
ACPI has a distinct
means of specifying a limited DMA-width; the above fails, because it assumes a *device-tree*.
Quoted 6 lines
Quoted 2 lines
Do you know if it would be possible to infer from the ACPI static table the DMA-width?
Yes, and it is. Due to not knowing much about ACPI tables I don't know what the C code would look like though (problem is which documentation should I be looking at first?).
What you provided below is an excerpt of the DSDT. AFAIK, DSDT content is written in AML. So far the shortest implementation I have seen for the AML parser is around 5000 lines (see [1]). It might be possible to strip some the code, although I think this will still probably too big for a single workaround.
What I meant by "static table" is a table that looks like a structure and can be parsed in a few lines. If we can't find on contain the DMA window, then the next best solution is to find a way to identity the platform.
I don't know enough ACPI to know if this solution is possible. A good starter would probably be the ACPI spec [2].
Quoted 25 lines
Handy bit of information is in the RP4 Tianocore table source:
https://github.com/tianocore/edk2-platforms/blob/d492639638eee331ac3389e6cf53ea266c3c84b3/Platform/RaspberryPi/AcpiTables/Dsdt.aslName (_DMA, ResourceTemplate() { // // Only the first GB is available. // Bus 0xC0000000 -> CPU 0x00000000. // QWordMemory (ResourceConsumer, , MinFixed, MaxFixed, NonCacheable, ReadWrite, 0x0, 0x00000000C0000000, // MIN 0x00000000FFFFFFFF, // MAX 0xFFFFFFFF40000000, // TRA 0x0000000040000000, // LEN , , ) })
Quoted 5 lines
There should be some corresponding code in the Linux 5.9 kernels. From the look of that, it might even be possible to specify a memory range which didn't start at address 0.
Cheers,
[1] https://github.com/openbsd/src/blob/master/sys/dev/acpi/dsdt.c
[2] https://www.uefi.org/sites/default/files/resources/ACPI_6.0.pdf
Signature · 1 line
Julien Grall
Quoted 22 lines · Julien Grall
Hi Elliott,
Quoted 6 lines · Elliott Mitchell
Quoted 5 lines · Julien Grall
Quoted 3 lines · Elliott Mitchell
ACPI has a distinct
means of specifying a limited DMA-width; the above fails, because it assumes a *device-tree*.Quoted 6 lines
Quoted 2 lines
Do you know if it would be possible to infer from the ACPI static table the DMA-width?
Yes, and it is. Due to not knowing much about ACPI tables I don't know what the C code would look like though (problem is which documentation should I be looking at first?).
What you provided below is an excerpt of the DSDT. AFAIK, DSDT content is written in AML. So far the shortest implementation I have seen for the AML parser is around 5000 lines (see [1]). It might be possible to strip some the code, although I think this will still probably too big for a single workaround.
Quoted 7 lines
What I meant by "static table" is a table that looks like a structure and can be parsed in a few lines. If we can't find on contain the DMA window, then the next best solution is to find a way to identity the platform.
I don't know enough ACPI to know if this solution is possible. A good starter would probably be the ACPI spec [2].
Be assured, you likely know more about ACPI than I do. :-)
A crucial point though is the mentions of dealing with DMA on the Raspberry PI 4B using ACPI pointed at that "_DMA" string. What is there is Good Enough(tm) to make a 5.8 Linux kernel successfully operate using ACPI.
Looking at the 5.8 source, apparently _DMA is an ACPI method. That almost looks straightforward enough for me to tackle for Xen... Good news is looks like only supportting a single DMA window...
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 20 lines · Julien Grall
Quoted 6 lines · Elliott Mitchell
Quoted 5 lines · Julien Grall
Quoted 3 lines · Elliott Mitchell
ACPI has a distinct
means of specifying a limited DMA-width; the above fails, because it assumes a *device-tree*.Quoted 6 lines
Quoted 2 lines
Do you know if it would be possible to infer from the ACPI static table the DMA-width?
Yes, and it is. Due to not knowing much about ACPI tables I don't know what the C code would look like though (problem is which documentation should I be looking at first?).
What you provided below is an excerpt of the DSDT. AFAIK, DSDT content is written in AML. So far the shortest implementation I have seen for the AML parser is around 5000 lines (see [1]). It might be possible to strip some the code, although I think this will still probably too big for a single workaround.
Quoted 7 lines
What I meant by "static table" is a table that looks like a structure and can be parsed in a few lines. If we can't find on contain the DMA window, then the next best solution is to find a way to identity the platform.
I don't know enough ACPI to know if this solution is possible. A good starter would probably be the ACPI spec [2].
Okay, that is worse than I had thought (okay, ACPI is impressively complex for something nominally firmware-level).
There are strings in the present Tianocore implementation for Raspberry PI 4B which could be targeted. Notably included in the output during boot listing the tables, "RPIFDN", "RPIFDN RPI" and "RPIFDN RPI4" (I'm unsure how kosher these are as this wsn't implemented nor blessed by the Raspberry PI Foundation).
I strongly dislike this approach as you soon turn the Xen project into a database of hardware. This is already occurring with xen/arch/arm/platforms and I would love to do something about this. On that thought, how about utilizing Xen's command-line for this purpose?
Have a procedure of during installation/updates retrieve DMA limitation information from the running OS and the following boot Xen will follow the appropriate setup. By its nature, Domain 0 will have the information needed, just becomes an issue of how hard that is to retrieve...
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 38 lines · Elliott Mitchell
Quoted 20 lines · Julien Grall
Quoted 6 lines · Elliott Mitchell
Quoted 5 lines · Julien Grall
Quoted 3 lines · Elliott Mitchell
ACPI has a distinct
means of specifying a limited DMA-width; the above fails, because it assumes a *device-tree*.Quoted 6 lines
Quoted 2 lines
Do you know if it would be possible to infer from the ACPI static table the DMA-width?
Yes, and it is. Due to not knowing much about ACPI tables I don't know what the C code would look like though (problem is which documentation should I be looking at first?).
What you provided below is an excerpt of the DSDT. AFAIK, DSDT content is written in AML. So far the shortest implementation I have seen for the AML parser is around 5000 lines (see [1]). It might be possible to strip some the code, although I think this will still probably too big for a single workaround.
Quoted 7 lines
What I meant by "static table" is a table that looks like a structure and can be parsed in a few lines. If we can't find on contain the DMA window, then the next best solution is to find a way to identity the platform.
I don't know enough ACPI to know if this solution is possible. A good starter would probably be the ACPI spec [2].
Okay, that is worse than I had thought (okay, ACPI is impressively complex for something nominally firmware-level).
There are strings in the present Tianocore implementation for Raspberry PI 4B which could be targeted. Notably included in the output during boot listing the tables, "RPIFDN", "RPIFDN RPI" and "RPIFDN RPI4" (I'm unsure how kosher these are as this wsn't implemented nor blessed by the Raspberry PI Foundation).
Quoted 4 lines
I strongly dislike this approach as you soon turn the Xen project into a database of hardware. This is already occurring with xen/arch/arm/platforms and I would love to do something about this. On that thought, how about utilizing Xen's command-line for this purpose?
I don't think that a command line option is a good idea: basically it is punting to users the task of platform detection. Also, it means that users will be necessarily forced to edit the uboot script or grub configuration file to boot.
Note that even if we introduced a new command line, we wouldn't take away the need for xen/arch/arm/platforms anyway.
It would be far better for Xen to autodetect the platform if we can.
Quoted 4 lines
Have a procedure of during installation/updates retrieve DMA limitation information from the running OS and the following boot Xen will follow the appropriate setup. By its nature, Domain 0 will have the information needed, just becomes an issue of how hard that is to retrieve...
Historically that is what we used to do for many things related to ACPI, but unfortunately it leads to a pretty bad architecture where Xen depends on Dom0 for booting rather than the other way around. (Dom0 should be the one requiring Xen for booting, given that Xen is higher privilege and boots first.)
I think the best compromise is still to use an ACPI string to detect the platform. For instance, would it be possible to use the OEMID fields in RSDT, XSDT, FADT? Possibly even a combination of them?
Another option might be to get the platform name from UEFI somehow.
Quoted 67 lines · Stefano Stabellini
Quoted 38 lines · Elliott Mitchell
Quoted 20 lines · Julien Grall
Quoted 6 lines · Elliott Mitchell
Quoted 5 lines · Julien Grall
Quoted 3 lines · Elliott Mitchell
ACPI has a distinct
means of specifying a limited DMA-width; the above fails, because it assumes a *device-tree*.Quoted 6 lines
Quoted 2 lines
Do you know if it would be possible to infer from the ACPI static table the DMA-width?
Yes, and it is. Due to not knowing much about ACPI tables I don't know what the C code would look like though (problem is which documentation should I be looking at first?).
What you provided below is an excerpt of the DSDT. AFAIK, DSDT content is written in AML. So far the shortest implementation I have seen for the AML parser is around 5000 lines (see [1]). It might be possible to strip some the code, although I think this will still probably too big for a single workaround.
Quoted 7 lines
What I meant by "static table" is a table that looks like a structure and can be parsed in a few lines. If we can't find on contain the DMA window, then the next best solution is to find a way to identity the platform.
I don't know enough ACPI to know if this solution is possible. A good starter would probably be the ACPI spec [2].
Okay, that is worse than I had thought (okay, ACPI is impressively complex for something nominally firmware-level).
There are strings in the present Tianocore implementation for Raspberry PI 4B which could be targeted. Notably included in the output during boot listing the tables, "RPIFDN", "RPIFDN RPI" and "RPIFDN RPI4" (I'm unsure how kosher these are as this wsn't implemented nor blessed by the Raspberry PI Foundation).
Quoted 4 lines
I strongly dislike this approach as you soon turn the Xen project into a database of hardware. This is already occurring with xen/arch/arm/platforms and I would love to do something about this. On that thought, how about utilizing Xen's command-line for this purpose?
I don't think that a command line option is a good idea: basically it is punting to users the task of platform detection. Also, it means that users will be necessarily forced to edit the uboot script or grub configuration file to boot.
Note that even if we introduced a new command line, we wouldn't take away the need for xen/arch/arm/platforms anyway.
It would be far better for Xen to autodetect the platform if we can.
Quoted 4 lines
Have a procedure of during installation/updates retrieve DMA limitation information from the running OS and the following boot Xen will follow the appropriate setup. By its nature, Domain 0 will have the information needed, just becomes an issue of how hard that is to retrieve...
Historically that is what we used to do for many things related to ACPI, but unfortunately it leads to a pretty bad architecture where Xen depends on Dom0 for booting rather than the other way around. (Dom0 should be the one requiring Xen for booting, given that Xen is higher privilege and boots first.)
Quoted 5 lines
I think the best compromise is still to use an ACPI string to detect the platform. For instance, would it be possible to use the OEMID fields in RSDT, XSDT, FADT? Possibly even a combination of them?
Another option might be to get the platform name from UEFI somehow.
What about having a small domain parsing the ACPI booting first and use that information for booting dom0?
That dom would be part of the Xen build and the hypervisor wouldn't need to gain all the ACPI AML logic.
Juergen
Quoted 75 lines · Jürgen Groß
Quoted 74 lines · Stefano Stabellini
Quoted 41 lines · Elliott Mitchell
Quoted 23 lines · Julien Grall
Quoted 7 lines · Elliott Mitchell
Quoted 6 lines · Julien Grall
Quoted 4 lines · Elliott Mitchell
ACPI has a distinct
means of specifying a limited DMA-width; the above fails, because it
assumes a *device-tree*.Quoted 8 lines
Quoted 3 lines
Do you know if it would be possible to infer from the ACPI static table
the DMA-width?Yes, and it is. Due to not knowing much about ACPI tables I don't know
what the C code would look like though (problem is which documentation should I be looking at first?).What you provided below is an excerpt of the DSDT. AFAIK, DSDT content is written in AML. So far the shortest implementation I have seen for the AML parser is around 5000 lines (see [1]). It might be possible to strip some the code, although I think this will still probably too big for a single workaround.
Quoted 7 lines
What I meant by "static table" is a table that looks like a structure and can be parsed in a few lines. If we can't find on contain the DMA window, then the next best solution is to find a way to identity the platform.
I don't know enough ACPI to know if this solution is possible. A good starter would probably be the ACPI spec [2].
Okay, that is worse than I had thought (okay, ACPI is impressively complex for something nominally firmware-level).
There are strings in the present Tianocore implementation for Raspberry PI 4B which could be targeted. Notably included in the output during boot listing the tables, "RPIFDN", "RPIFDN RPI" and "RPIFDN RPI4" (I'm unsure how kosher these are as this wsn't implemented nor blessed by the Raspberry PI Foundation).
Quoted 4 lines
I strongly dislike this approach as you soon turn the Xen project into a database of hardware. This is already occurring with xen/arch/arm/platforms and I would love to do something about this. On that thought, how about utilizing Xen's command-line for this purpose?
I don't think that a command line option is a good idea: basically it is punting to users the task of platform detection. Also, it means that users will be necessarily forced to edit the uboot script or grub configuration file to boot.
Note that even if we introduced a new command line, we wouldn't take away the need for xen/arch/arm/platforms anyway.
It would be far better for Xen to autodetect the platform if we can.
Quoted 4 lines
Have a procedure of during installation/updates retrieve DMA limitation information from the running OS and the following boot Xen will follow the appropriate setup. By its nature, Domain 0 will have the information needed, just becomes an issue of how hard that is to retrieve...
Historically that is what we used to do for many things related to ACPI, but unfortunately it leads to a pretty bad architecture where Xen depends on Dom0 for booting rather than the other way around. (Dom0 should be the one requiring Xen for booting, given that Xen is higher privilege and boots first.)
I think the best compromise is still to use an ACPI string to detect the platform. For instance, would it be possible to use the OEMID fields in RSDT, XSDT, FADT? Possibly even a combination of them?
Quoted 7 lines
Quoted 1 line
Another option might be to get the platform name from UEFI somehow.
What about having a small domain parsing the ACPI booting first and use that information for booting dom0?
That dom would be part of the Xen build and the hypervisor wouldn't need to gain all the ACPI AML logic.
That could work, but in practice we don't have such a domain today -- the infrastructure is missing. I wonder whether the bootloader (uboot or grub) would know about the platform and might be able to pass that information to Xen somehow.
Quoted 44 lines · Stefano Stabellini
Quoted 38 lines · Elliott Mitchell
Quoted 20 lines · Julien Grall
Quoted 6 lines · Elliott Mitchell
Quoted 5 lines · Julien Grall
Quoted 3 lines · Elliott Mitchell
ACPI has a distinct
means of specifying a limited DMA-width; the above fails, because it assumes a *device-tree*.Quoted 6 lines
Quoted 2 lines
Do you know if it would be possible to infer from the ACPI static table the DMA-width?
Yes, and it is. Due to not knowing much about ACPI tables I don't know what the C code would look like though (problem is which documentation should I be looking at first?).
What you provided below is an excerpt of the DSDT. AFAIK, DSDT content is written in AML. So far the shortest implementation I have seen for the AML parser is around 5000 lines (see [1]). It might be possible to strip some the code, although I think this will still probably too big for a single workaround.
Quoted 7 lines
What I meant by "static table" is a table that looks like a structure and can be parsed in a few lines. If we can't find on contain the DMA window, then the next best solution is to find a way to identity the platform.
I don't know enough ACPI to know if this solution is possible. A good starter would probably be the ACPI spec [2].
Okay, that is worse than I had thought (okay, ACPI is impressively complex for something nominally firmware-level).
There are strings in the present Tianocore implementation for Raspberry PI 4B which could be targeted. Notably included in the output during boot listing the tables, "RPIFDN", "RPIFDN RPI" and "RPIFDN RPI4" (I'm unsure how kosher these are as this wsn't implemented nor blessed by the Raspberry PI Foundation).
Quoted 4 lines
I strongly dislike this approach as you soon turn the Xen project into a database of hardware. This is already occurring with xen/arch/arm/platforms and I would love to do something about this. On that thought, how about utilizing Xen's command-line for this purpose?
Quoted 4 lines
I don't think that a command line option is a good idea: basically it is punting to users the task of platform detection. Also, it means that users will be necessarily forced to edit the uboot script or grub configuration file to boot.
-EINVAL
Many Linux installations (near universal on desktop/server, but may be uncommon on ARM servers) Xen's command-line comes from grub.cfg. grub.cfg is in turn created by a series of scripts with several places for users to modify configuration without breaking things.
The scripts which create grub.cfg could add a "dma_mem=" option to Xen's command-line based upon what the running kernel reports. If the kernel is running on top of Xen, it will still be able to retrieve this information out of ACPI.
This does mean distributions would need to modify scripts, but that is doable. This also means a dumb user could potentially jump in, modify the value and thus cause unrecoverable breakage. Yet on the flip side this also allows for the short-term stop-gap of smart users modifying the option as appropriate for new hardware.
Certainly it may not be the greatest approach, but it isn't as bad as you're claiming.
Quoted 2 lines
Note that even if we introduced a new command line, we wouldn't take away the need for xen/arch/arm/platforms anyway.
Perhaps, but it could allow for this setting at least to be moved to somewhere outside of Xen.
I'm inclined to agree with Juergen Gro??, this reads kind of like having an extra domain run during Xen's initialization which can talk ACPI.
Quoted 12 lines
Quoted 4 lines
Have a procedure of during installation/updates retrieve DMA limitation information from the running OS and the following boot Xen will follow the appropriate setup. By its nature, Domain 0 will have the information needed, just becomes an issue of how hard that is to retrieve...
Historically that is what we used to do for many things related to ACPI, but unfortunately it leads to a pretty bad architecture where Xen depends on Dom0 for booting rather than the other way around. (Dom0 should be the one requiring Xen for booting, given that Xen is higher privilege and boots first.)
Quoted 5 lines
I think the best compromise is still to use an ACPI string to detect the platform. For instance, would it be possible to use the OEMID fields in RSDT, XSDT, FADT? Possibly even a combination of them?
Another option might be to get the platform name from UEFI somehow.
I included appropriate strings in e-mail. Suitable strings do appear in dmesg.
Problem is this feels like you're hard-coding a fixed list of platforms Xen can run on. Instead values like these should be provided by firmware. ACPI includes a method for encoding DMA limitations, device-tree really should have one added. Only challenge for device-tree is getting everyone to agree on names and parameters.
Looking at it, there are really issues with the allocate_memory_11() function in xen/arch/arm/domain_build.c. Two tasks have been merged and I'm unsure they were merged correctly.
I'm unaware of any Xen-capable platforms with such, but DMA can have distinct restrictions outside of what allocate_memory_11() provides for. ACPI allows for explicit address ranges and in the past many devices have used addresses that didn't start at zero.
Additionally a device might have several devices with restricted DMA and these could have differing non-overlapping ranges. Domain 0 might need memory in several DMA ranges. Luckily In the past few years I haven't read about any potentially Xen-capable devices where DMA-capable memory had differing capabilities/performance from non-DMA-capable memory.
Meanwhile for a platform which does have DMA limitations, the kernel and boot information for domain 0 shouldn't be placed in DMA-capable memory if domain 0 has any memory which isn't DMA-capable. Yet it appears allocate_memory_11() will cause kernel/initrd/boot information to be placed in DMA-capable memory.
If my understanding is correct (this is a BIG IF), as a last step allocate_memory_11() should reverse the order of memory banks. Another trick is DMA-capable banks need to be subject to ballooning AFTER non-DMA-capable banks (I'm unsure how often ballooning is used on ARM).
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 62 lines · Elliott Mitchell
Quoted 44 lines · Stefano Stabellini
Quoted 38 lines · Elliott Mitchell
Quoted 20 lines · Julien Grall
Quoted 6 lines · Elliott Mitchell
Quoted 5 lines · Julien Grall
Quoted 3 lines · Elliott Mitchell
ACPI has a distinct
means of specifying a limited DMA-width; the above fails, because it assumes a *device-tree*.Quoted 6 lines
Quoted 2 lines
Do you know if it would be possible to infer from the ACPI static table the DMA-width?
Yes, and it is. Due to not knowing much about ACPI tables I don't know what the C code would look like though (problem is which documentation should I be looking at first?).
What you provided below is an excerpt of the DSDT. AFAIK, DSDT content is written in AML. So far the shortest implementation I have seen for the AML parser is around 5000 lines (see [1]). It might be possible to strip some the code, although I think this will still probably too big for a single workaround.
Quoted 7 lines
What I meant by "static table" is a table that looks like a structure and can be parsed in a few lines. If we can't find on contain the DMA window, then the next best solution is to find a way to identity the platform.
I don't know enough ACPI to know if this solution is possible. A good starter would probably be the ACPI spec [2].
Okay, that is worse than I had thought (okay, ACPI is impressively complex for something nominally firmware-level).
There are strings in the present Tianocore implementation for Raspberry PI 4B which could be targeted. Notably included in the output during boot listing the tables, "RPIFDN", "RPIFDN RPI" and "RPIFDN RPI4" (I'm unsure how kosher these are as this wsn't implemented nor blessed by the Raspberry PI Foundation).
Quoted 4 lines
I strongly dislike this approach as you soon turn the Xen project into a database of hardware. This is already occurring with xen/arch/arm/platforms and I would love to do something about this. On that thought, how about utilizing Xen's command-line for this purpose?
Quoted 4 lines
I don't think that a command line option is a good idea: basically it is punting to users the task of platform detection. Also, it means that users will be necessarily forced to edit the uboot script or grub configuration file to boot.
-EINVALMany Linux installations (near universal on desktop/server, but may be uncommon on ARM servers) Xen's command-line comes from grub.cfg. grub.cfg is in turn created by a series of scripts with several places for users to modify configuration without breaking things.
The scripts which create grub.cfg could add a "dma_mem=" option to Xen's command-line based upon what the running kernel reports. If the kernel is running on top of Xen, it will still be able to retrieve this information out of ACPI.
Quoted 8 lines
This does mean distributions would need to modify scripts, but that is doable. This also means a dumb user could potentially jump in, modify the value and thus cause unrecoverable breakage. Yet on the flip side this also allows for the short-term stop-gap of smart users modifying the option as appropriate for new hardware.
Certainly it may not be the greatest approach, but it isn't as bad as you're claiming.
From what I have seen in previous years getting all the distros to update their scripts is actually a lot of work. It would take a long time to see it through. A few years. I think it is likely we would solve the problem more quickly with a different solution.
Quoted 5 lines
Quoted 2 lines
Note that even if we introduced a new command line, we wouldn't take away the need for xen/arch/arm/platforms anyway.
Perhaps, but it could allow for this setting at least to be moved to somewhere outside of Xen.
I was trying to say that it is not just about dma_mem=. There are other things under xen/arch/arm/platforms that are sometimes required. In the specific case of the RPi4, if we added a general dma_mem= parameter, we would still need to detect the platform to be able to do a platform reboot, unless it is guaranteed that when ACPI is present ATF is also present?
Quoted 15 lines
I'm inclined to agree with Juergen Gro??, this reads kind of like having an extra domain run during Xen's initialization which can talk ACPI.
Quoted 12 lines
Quoted 4 lines
Have a procedure of during installation/updates retrieve DMA limitation information from the running OS and the following boot Xen will follow the appropriate setup. By its nature, Domain 0 will have the information needed, just becomes an issue of how hard that is to retrieve...
Historically that is what we used to do for many things related to ACPI, but unfortunately it leads to a pretty bad architecture where Xen depends on Dom0 for booting rather than the other way around. (Dom0 should be the one requiring Xen for booting, given that Xen is higher privilege and boots first.)
Quoted 8 lines
Quoted 5 lines
I think the best compromise is still to use an ACPI string to detect the platform. For instance, would it be possible to use the OEMID fields in RSDT, XSDT, FADT? Possibly even a combination of them?
Another option might be to get the platform name from UEFI somehow.
I included appropriate strings in e-mail. Suitable strings do appear in
dmesg.
Do you mean the ones mentioned in the previous email or did you forget an attachment here? I don't think you added the value of OEMID anywhere?
Quoted 3 lines
Problem is this feels like you're hard-coding a fixed list of platforms Xen can run on. Instead values like these should be provided by firmware. ACPI includes a method for encoding DMA limitations,
I see where you are coming from: DMA limitations is a general problem, so it looks like there should be a general solution.
Yes, I agree that it would be good to have a general solution to automatically detect DMA limitations, no matter if we do ACPI or device tree.
However, xen/arch/arm/platforms is not just for DMA limitations. There are per-platform quirks and workarounds that sometimes are required for booting. Even if we solved the DMA limitations problem generically (which would be good if we find a way), we are still likely to have to find another way to detect the platform name.
Quoted 2 lines
device-tree really should have one added. Only challenge for device-tree is getting everyone to agree on names and parameters.
Device tree has ways to describe dma limitations, but they are not really taken into account when allocating dom0 memory today unfortunately :-/
Quoted 9 lines
Looking at it, there are really issues with the
allocate_memory_11()function inxen/arch/arm/domain_build.c. Two tasks have been merged and I'm unsure they were merged correctly.I'm unaware of any Xen-capable platforms with such, but DMA can have distinct restrictions outside of what
allocate_memory_11()provides for. ACPI allows for explicit address ranges and in the past many devices have used addresses that didn't start at zero.
Quoted 5 lines
Additionally a device might have several devices with restricted DMA and these could have differing non-overlapping ranges. Domain 0 might need memory in several DMA ranges. Luckily In the past few years I haven't read about any potentially Xen-capable devices where DMA-capable memory had differing capabilities/performance from non-DMA-capable memory.
What you described is possible, at least theoretically. Any patches to improve allocate_memory_11() in that respect would be great to have.
Quoted 5 lines
Meanwhile for a platform which does have DMA limitations, the kernel and boot information for domain 0 shouldn't be placed in DMA-capable memory if domain 0 has any memory which isn't DMA-capable. Yet it appears
allocate_memory_11()will causekernel/initrd/bootinformation to be placed in DMA-capable memory.
The dom0 kernel (if zImage) needs to be loaded in the first 128Mb of RAM. In any case, the kernel will relocate those modules in high memory and free the original memory during boot, so it shouldn't make a lot of difference?
Quoted 4 lines
If my understanding is correct (this is a BIG IF), as a last step
allocate_memory_11()should reverse the order of memory banks. Another trick is DMA-capable banks need to be subject to ballooning AFTER non-DMA-capable banks (I'm unsure how often ballooning is used on ARM).
Why reverse the order?
Hi,
Quoted 8 lines
Quoted 5 lines
I think the best compromise is still to use an ACPI string to detect the platform. For instance, would it be possible to use the OEMID fields in RSDT, XSDT, FADT? Possibly even a combination of them?
Another option might be to get the platform name from UEFI somehow.
I included appropriate strings in e-mail. Suitable strings do appear in
dmesg.
Just as a heads-up, SMCCC does define the optional SMCCC_ARCH_SOC_ID [1] function and this is listed as mandatory in the Server Base Boot Reqs (SBBR); see pp 15 of ARM DEN 0044F [2].
Unfortunately it looks like RPi 4's firmware doesn't currently support this, or at least the rpi4-uefi project [3] didn't think so as of FW version 1.6 [4], but I couldn't find equivalent SBBR feature tracking pages on that site for FW versions 1.7 or 1.8 to confirm, nor could I find any reference to SMCCC_ARCH_SOC_ID in the RPi 4 FW sources [5].
On the bright side, while not very helpful in the short-term, note that Arm's recently announced SystemReady [6] program is an evolution of ServerReady (SBSA+SBBR) but for other segments and applications incl. Embedded, IoT, and general Linux Boot.
That means in future we should see more platform firmware supporting SMCCC_ARCH_SOC_ID, as the SiPs will (hopefully) want their platforms to be SystemReady certified.
Hope that's useful info.
Thanks,
Ash.
[1] https://developer.arm.com/documentation/den0028/c
[2] https://developer.arm.com/documentation/den0044/latest
[3] https://rpi4-uefi.dev/about/
[4] https://rpi4-uefi.dev/status-v1-6-firmware/
[5] https://github.com/pftf/RPi4/tree/master
[6] https://developer.arm.com/architectures/system-architectures/arm-systemready
Quoted 6 lines · Ash Wilding
Quoted 6 lines
Quoted 5 lines
I think the best compromise is still to use an ACPI string to detect the platform. For instance, would it be possible to use the OEMID fields in RSDT, XSDT, FADT? Possibly even a combination of them?
Another option might be to get the platform name from UEFI somehow.
Quoted 7 lines
Quoted 2 lines
I included appropriate strings in e-mail. Suitable strings do appear in
dmesg.Just as a heads-up, SMCCC does define the optional
SMCCC_ARCH_SOC_ID[1] function and this is listed as mandatory in the Server Base Boot Reqs (SBBR); see pp 15 of ARM DEN 0044F [2].
Thanks for sharing, it is good to know there is a "proper" way to do it.
Quoted 5 lines
Unfortunately it looks like RPi 4's firmware doesn't currently support this, or at least the rpi4-uefi project [3] didn't think so as of FW version 1.6 [4], but I couldn't find equivalent SBBR feature tracking pages on that site for FW versions 1.7 or 1.8 to confirm, nor could I find any reference to
SMCCC_ARCH_SOC_IDin the RPi 4 FW sources [5].
Well, call me an optimist but maybe it is just one patch away from happening :-)
Quoted 21 lines
On the bright side, while not very helpful in the short-term, note that Arm's recently announced SystemReady [6] program is an evolution of ServerReady (SBSA+SBBR) but for other segments and applications incl. Embedded, IoT, and general Linux Boot.
That means in future we should see more platform firmware supporting
SMCCC_ARCH_SOC_ID, as the SiPs will (hopefully) want their platforms to be SystemReady certified.Hope that's useful info.
Thanks,
Ash.[1] https://developer.arm.com/documentation/den0028/c
[2] https://developer.arm.com/documentation/den0044/latest
[3] https://rpi4-uefi.dev/about/
[4] https://rpi4-uefi.dev/status-v1-6-firmware/
[5] https://github.com/pftf/RPi4/tree/master
[6] https://developer.arm.com/architectures/system-architectures/arm-systemready
Quoted 11 lines · Stefano Stabellini
Quoted 5 lines · J??rgen Gro??
What about having a small domain parsing the ACPI booting first and use that information for booting dom0?
That dom would be part of the Xen build and the hypervisor wouldn't need to gain all the ACPI AML logic.
That could work, but in practice we don't have such a domain today -- the infrastructure is missing. I wonder whether the bootloader (uboot or grub) would know about the platform and might be able to pass that information to Xen somehow.
How long would such likely take to implement? This reads like a complicated project, and likely to take a while...
Then would be the issue of efifb.
I've been pondering allocate_memory_11() and coming up with a rather complicated potential problem. ACPI appears to potentially allow for non-power of 2 DMA ranges; I'm unaware of any such device, but the code should allow for such.
I can imagine a device which has multiple DMA ranges. The ranges could be fully contained within each other, the ranges could partially overlap, or the ranges could be disjoint.
Someone might wish to allocate all DMA-capable memory to domain 0, someone might wish to allocate less. Additionally if all DMA-capable memory is allocated to domain 0, some non-DMA-capable memory could be desired.
Ideally Xen would move to non-DMA memory. This would protect Xen against a malicious domain 0 and allow allocating more DMA-capable memory to domain 0.
This interacts with ballooning. If memory is removed from domain 0, non-DMA memory should be removed first. If domain 0 is allocated more memory, DMA memory should be added first (if any isn't allocated to domain 0).
Then again I may be severely overthinking things.
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 82 lines · Stefano Stabellini
Quoted 80 lines · Jürgen Groß
Quoted 70 lines · Stefano Stabellini
Quoted 41 lines · Elliott Mitchell
Quoted 23 lines · Julien Grall
Quoted 7 lines · Elliott Mitchell
Quoted 6 lines · Julien Grall
Quoted 4 lines · Elliott Mitchell
ACPI has a distinct
means of specifying a limited DMA-width; the above fails, because it
assumes a *device-tree*.Quoted 8 lines
Quoted 3 lines
Do you know if it would be possible to infer from the ACPI static table
the DMA-width?Yes, and it is. Due to not knowing much about ACPI tables I don't know
what the C code would look like though (problem is which documentation should I be looking at first?).What you provided below is an excerpt of the DSDT. AFAIK, DSDT content is written in AML. So far the shortest implementation I have seen for the AML parser is around 5000 lines (see [1]). It might be possible to strip some the code, although I think this will still probably too big for a single workaround.
Quoted 7 lines
What I meant by "static table" is a table that looks like a structure and can be parsed in a few lines. If we can't find on contain the DMA window, then the next best solution is to find a way to identity the platform.
I don't know enough ACPI to know if this solution is possible. A good starter would probably be the ACPI spec [2].
Okay, that is worse than I had thought (okay, ACPI is impressively complex for something nominally firmware-level).
There are strings in the present Tianocore implementation for Raspberry PI 4B which could be targeted. Notably included in the output during boot listing the tables, "RPIFDN", "RPIFDN RPI" and "RPIFDN RPI4" (I'm unsure how kosher these are as this wsn't implemented nor blessed by the Raspberry PI Foundation).
Quoted 4 lines
I strongly dislike this approach as you soon turn the Xen project into a database of hardware. This is already occurring with xen/arch/arm/platforms and I would love to do something about this. On that thought, how about utilizing Xen's command-line for this purpose?
I don't think that a command line option is a good idea: basically it is punting to users the task of platform detection. Also, it means that users will be necessarily forced to edit the uboot script or grub configuration file to boot.
Note that even if we introduced a new command line, we wouldn't take away the need for xen/arch/arm/platforms anyway.
It would be far better for Xen to autodetect the platform if we can.
Quoted 4 lines
Have a procedure of during installation/updates retrieve DMA limitation information from the running OS and the following boot Xen will follow the appropriate setup. By its nature, Domain 0 will have the information needed, just becomes an issue of how hard that is to retrieve...
Historically that is what we used to do for many things related to ACPI, but unfortunately it leads to a pretty bad architecture where Xen depends on Dom0 for booting rather than the other way around. (Dom0 should be the one requiring Xen for booting, given that Xen is higher privilege and boots first.)
Quoted 5 lines
I think the best compromise is still to use an ACPI string to detect the platform. For instance, would it be possible to use the OEMID fields in RSDT, XSDT, FADT? Possibly even a combination of them?
Another option might be to get the platform name from UEFI somehow.
What about having a small domain parsing the ACPI booting first and use that information for booting dom0?
Quoted 7 lines
Quoted 2 lines
That dom would be part of the Xen build and the hypervisor wouldn't need to gain all the ACPI AML logic.
That could work, but in practice we don't have such a domain today -- the infrastructure is missing. I wonder whether the bootloader (uboot or grub) would know about the platform and might be able to pass that information to Xen somehow.
This is one of the functions envisioned for the Boot Domain in the proposal to add DomB mode to dom0less[1], in the work developed by Daniel Smith and I.
With DomB as much or as little of platform detection and initial domain configuration will be possible from the Boot Domain. ACPI was specifically discussed in the second DomB Design Session at this year's Xen Summit[2].
Further information on this is available on the Xen wiki[3], thanks to Rich Persaud, including links to the Summit presentation on DomB for Xen System Boot, and the following discussion of that in the Design Session[4], and specific questions can be raised in this thread.
thanks,
Christopher
[1] https://lists.xenproject.org/archives/html/xen-devel/2020-05/msg00233.html
[2] https://www.youtube.com/watch?v=jlyWfdW6D-E&t=15m26s
[3] https://wiki.xenproject.org/wiki/DomB_mode_of_dom0less
[4] https://lists.archive.carbon60.com/xen/devel/592140