Hello, I want to run Genode on Windriver Simics https://www.windriver.com/products/simics/. I've just created a disk image with the demo scenario from a freshly cloned Genode. It crashes with the following error.
page fault, pd='init -> drivers -> acpi_drv' thread='ep' cpu=0 ip=0x1011062 address=0xbff00000 stack pointer=0x401fbbc0 qualifiers=0x4 irUwp reason=1
addr2line -e debug/acpi_drv 0x1011062
The IP 0x1011062 resolves to repos/base/include/util/mmio.h:54
/**
- Read '_ACCESS_T' typed from MMIO base + 'offset'
*/ template <typename ACCESS_T> inline ACCESS_T _read(off_t const &offset) const { addr_t const dst = _base + offset; 54 ACCESS_T const value = *(ACCESS_T volatile *)dst; return value; }
When using the Genode::backtrace(), I get this
Error: PAGE-FAULT IN CORE addr=0x204 ip=0x1b32b8 (read)
stack pointer 0x403feda0, qualifiers 0x4 irUwp faulter utcb 0x403ff000, last message item count 0 #1 0x00000000403feda0 0x00000000001b32b8 #2 0x00000000403feea8 0x000000000015e7c3 [ 0] Killed EC:0xffffffff8103b4c0 SC:0xffffffff81148040 V:0xe CS:0x2b IP:0x1c6ac3(0x2155ca) CR2:0x100000008 ERR:0x4 (Livelock) Pd::root [ 0] Killed EC:0xffffffff8103bb80 SC:0xffffffff81148040 V:0xe CS:0x2b IP:0x1b32b8(0x1) CR2:0x204 ERR:0x4 (IPC Abort) Pd::root [ 0] Killed EC:0xffffffff81139280 SC:0xffffffff81148040 V:0xe CS:0x2b IP:0x1010ab2(0x0) CR2:0xbff00000 ERR:0x4 (IPC Abort) [ 0] Killed EC:0xffffffff816cb280 SC:0xffffffff816d9040 V:0xe CS:0x2b IP:0x1021b10(0x1) CR2:0x1021b10 ERR:0x14 (IPC Timeout) [ 0] Killed EC:0xffffffff8178d280 SC:0xffffffff8106b040 V:0xe CS:0x2b IP:0xf11fb(0x1067000) CR2:0x1392fff ERR:0x6 (IPC Timeout) [ 0] Killed EC:0xffffffff8178d040 SC:0xffffffff8106b040 V:0xe CS:0x2b IP:0xccd34(0x0) CR2:0xccd34 ERR:0x14 (IPC Timeout) [init -> drivers -> acpi_drv] Error: Uncaught exception of type 'Genode::Ipc_error' [init -> drivers -> acpi_drv] Warning: abort called - thread: main
The IP:0x1010ab2 resolves to /home/parfait/git/genode20.05/repos/os/src/drivers/acpi/acpi.cc:254 where I can read following :
Fadt(addr_t a) : Genode::Mmio(a)
{ features = readFadt::Feature_flags(); reset_type = readFadt::Reset_reg_type(); 254 reset_addr = readFadt::Reset_reg_addr(); reset_value = readFadt::Reset_value(); }
It seems like there is an issue with the parsing of the acpi table, especially the FADT. How can I proceed to resolve this ?
Hello,
On 07.07.20 21:40, Parfait Tokponnon wrote:
Hello, I want to run Genode on Windriver Simics https://www.windriver.com/products/simics/. I've just created a disk image with the demo scenario from a freshly cloned Genode. It crashes with the following error.
page fault, pd='init -> drivers -> acpi_drv' thread='ep' cpu=0 ip=0x1011062 address=0xbff00000 stack pointer=0x401fbbc0 qualifiers=0x4 irUwp reason=1
it looks like that not all memory is mapped for parsing the table.
The IP:0x1010ab2 resolves to /home/parfait/git/genode20.05/repos/os/src/drivers/acpi/acpi.cc:254 where I can read following :
Fadt(addr_t a) : Genode::Mmio(a)
{ features = readFadt::Feature_flags(); reset_type = readFadt::Reset_reg_type(); 254 reset_addr = readFadt::Reset_reg_addr(); reset_value = readFadt::Reset_value(); }
It seems like there is an issue with the parsing of the acpi table, especially the FADT.
I would suggest to set the 'verbose' variable to 'true' within the code. Additionally, I would suggest to monitor the memory ranges which get attached during parsing all the tables.
Attached patch gives you some output alike:
Genode 20.05-83-g75f3012ade <local changes> 471 MiB RAM and 63253 caps assigned to init [init -> test-pci] --- Platform test started --- [init -> acpi_drv] Warning: attach memory - 0x1ffe2000+0x1000 [init -> acpi_drv] table mapped 'RSDT' at 0x9ffe20b8 (from 0x1ffe20b8) size 0x34 [init -> acpi_drv] Warning: attach memory - 0x1ffe1000+0x1000 [init -> acpi_drv] table mapped 'FACP' at 0x9ffe1ed8 (from 0x1ffe1ed8) size 0xf4 [init -> acpi_drv] Warning: attach memory - 0x1ffe0000+0x1000 [init -> acpi_drv] Warning: attach memory - 0x1ffe0000+0x2000 [init -> acpi_drv] table mapped 'DSDT' at 0x9ffe0040 (from 0x1ffe0040) size 0x1e98
The attached memory ranges should comprise the whole table, e.g for FADT/FACP of interest is:
[init -> acpi_drv] Warning: attach memory - 0x1ffe1000+0x1000 [init -> acpi_drv] table mapped 'FACP' at 0x9ffe1ed8 (from 0x1ffe1ed8) size 0xf4
If for your FACP/FADT table not the whole memory is mapped, you will have to look into repos/os/src/drivers/acpi/memory.h to understand and fix the issue.
Hope it helps,
Alex.
Hello Parfait,
On Wed, Jul 08, 2020 at 14:54:30 CEST, Alexander Boettcher wrote:
If for your FACP/FADT table not the whole memory is mapped, you will have to look into repos/os/src/drivers/acpi/memory.h to understand and fix the issue.
I did an extensive rewrite of the table-memory mapping code in acpi_drv last November. Are you already using Genode 19.11 or later? If no, I suggest you update to Genode 20.05 first. If yes, don't hesitate to post your complete log to the mailing list and I'll have a look.
Regards
On 08.07.20 14:54, Alexander Botcher wrote:
On 07.07.20 21:40, Parfait Tokponnon wrote:
The IP:0x1010ab2 resolves to /home/parfait/git/genode20.05/repos/os/src/drivers/acpi/acpi.cc:254 where I can read following :
Fadt(addr_t a) : Genode::Mmio(a)
{ features = readFadt::Feature_flags(); reset_type = readFadt::Reset_reg_type(); 254 reset_addr = readFadt::Reset_reg_addr(); reset_value = readFadt::Reset_value(); }
Reading again the Fadt structure documentation, I noticed that the reset fields are supported for ACPI 2.0+. If only a ACPI 1.x structure is provided, we should not read the values. I think depending on the ACPI version we should not read the values.
Since the reset values are not used anywhere in the code, you could just comment out the 3 lines and you should get further.
Cheers,
Alex.
Hello, I commented out the reset_addr line without success. It triggers a page fault at another address. Applying the patch reveals the following about the 'FACP' table structure just before the page fault
[init -> drivers -> acpi_drv] Warning: attach memory - 0x3feff000+0x1000, Loop_base 0x7feff000, IO base 1073741824 [init -> drivers -> acpi_drv] table mapped 'FACP' at 0xbfefff80 (from 0x7fefff80) size 0x74
page fault, pd='init -> drivers -> acpi_drv' thread='ep' cpu=0 ip=0x10126a3
address=0xbff00000 stack pointer=0x401fbba0 qualifiers=0x4 irUwp reason=1
If I replace
memory.map_region(base, _table->size);
by
memory.map_region(base, _table->size+0xe); // To force the mapping of 0x80000000
in acpi.cc, it works fine. But I don't think this is a good way to fix the issue. Any idea? @Christian, Yes I'am working with the 20.05 version. Please, find attached the related log files.
Le mer. 8 juil. 2020 à 16:39, Alexander Boettcher < alexander.boettcher@genode-labs.com> a écrit :
On 08.07.20 14:54, Alexander Botcher wrote:
On 07.07.20 21:40, Parfait Tokponnon wrote:
The IP:0x1010ab2 resolves to /home/parfait/git/genode20.05/repos/os/src/drivers/acpi/acpi.cc:254
where I
can read following :
Fadt(addr_t a) : Genode::Mmio(a)
{ features = readFadt::Feature_flags(); reset_type = readFadt::Reset_reg_type(); 254 reset_addr = readFadt::Reset_reg_addr(); reset_value = readFadt::Reset_value(); }
Reading again the Fadt structure documentation, I noticed that the reset fields are supported for ACPI 2.0+. If only a ACPI 1.x structure is provided, we should not read the values. I think depending on the ACPI version we should not read the values.
Since the reset values are not used anywhere in the code, you could just comment out the 3 lines and you should get further.
Cheers,
Alex.
-- Alexander Boettcher Genode Labs
https://www.genode-labs.com - https://www.genode.org
Genode Labs GmbH - Amtsgericht Dresden - HRB 28424 - Sitz Dresden Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
On 09.07.20 15:19, Parfait Tokponnon wrote:
I commented out the reset_addr line without success. It triggers a page fault at another address.
I wrote to remove all _3_ lines with reset_* to avoid the pagefault, not only 1 line ;-)
Applying the patch reveals the following about the 'FACP' table structure just before the page fault
[init -> drivers -> acpi_drv] Warning: attach memory - 0x3feff000+0x1000, Loop_base 0x7feff000, IO base 1073741824 [init -> drivers -> acpi_drv] table mapped 'FACP' at 0xbfefff80 (from 0x7fefff80) size 0x74
As I pressumed, the table is solely 0x74 in size. Looking at the code:
253 . . reset_type = readFadt::Reset_reg_type(); 254 . . reset_addr = readFadt::Reset_reg_addr(); 255 . . reset_value = readFadt::Reset_value(); 256 . } 257 258 . struct Dsdt : Register<0x28, 32> { }; 259 . struct Feature_flags : Register<0x70, 32> { }; 260 . struct Reset_reg_type : Register<0x74, 32> { }; 261 . struct Reset_reg_addr : Register<0x78, 64> { }; 262 . struct Reset_value : Register<0x80, 8> { };
you see that the Reset_* types are behind the tables, namely at offset 0x74, 0x78, 0x80.
Do you like to open an issue and provide a patch ?
Thanks for investigation,
Alex.
Since the reset values are not used anywhere in the code, you could just comment out the 3 lines and you should get further.
Oh sorry, I didn't see it, Thank you!
Le jeu. 9 juil. 2020 à 17:44, Alexander Boettcher < alexander.boettcher@genode-labs.com> a écrit :
On 09.07.20 15:19, Parfait Tokponnon wrote:
I commented out the reset_addr line without success. It triggers a page fault at another address.
I wrote to remove all _3_ lines with reset_* to avoid the pagefault, not only 1 line ;-)
Applying the patch reveals the following about the 'FACP' table structure just before the page fault
[init -> drivers -> acpi_drv] Warning: attach memory -
0x3feff000+0x1000,
Loop_base 0x7feff000, IO base 1073741824 [init -> drivers -> acpi_drv] table mapped 'FACP' at 0xbfefff80 (from 0x7fefff80) size 0x74
As I pressumed, the table is solely 0x74 in size. Looking at the code:
253 . . reset_type = readFadt::Reset_reg_type();
254 . . reset_addr = readFadt::Reset_reg_addr();
255 . . reset_value = readFadt::Reset_value();
256 . }
257
258 . struct Dsdt : Register<0x28, 32> { };
259 . struct Feature_flags : Register<0x70, 32> { };
260 . struct Reset_reg_type : Register<0x74, 32> { };
261 . struct Reset_reg_addr : Register<0x78, 64> { };
262 . struct Reset_value : Register<0x80, 8> { };
you see that the Reset_* types are behind the tables, namely at offset 0x74, 0x78, 0x80.
Do you like to open an issue and provide a patch ?
May be, it is tempting!
Thanks for investigation,
Alex.
Since the reset values are not used anywhere in the code, you could just comment out the 3 lines and you should get further.
-- Alexander Boettcher Genode Labs
https://www.genode-labs.com - https://www.genode.org
Genode Labs GmbH - Amtsgericht Dresden - HRB 28424 - Sitz Dresden Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth