bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recent patches break ACPI tables


From: Luca
Subject: Re: Recent patches break ACPI tables
Date: Mon, 19 Jun 2023 22:18:12 +0200

Il 19/06/23 21:40, luca@orpolo.org ha scritto:
and at this stage the lapic pointer is not yet initialized:

(gdb) p lapic
$4 = (volatile ApicLocalUnit *) 0x0
(gdb) x &lapic
0xc109bc6c <lapic>:    0x00000000

I guess so far this worked because the address 0 was mapped, and now it isn't.

I'm not sure what would be the proper way to solve this. I tried anticipating the call to machine_init() to be before vm_mem_bootstrap() (to have lapic initialized) but this triggers another assert.

Strangely, initializing lapic with a dummy structure as in

===============================8<=======================================
diff --git a/i386/i386/apic.c b/i386/i386/apic.c
index ff7ba3e2..db5cbc15 100644
--- a/i386/i386/apic.c
+++ b/i386/i386/apic.c
@@ -27,7 +27,9 @@
 #include <kern/kalloc.h>

-volatile ApicLocalUnit* lapic = NULL;
+static ApicLocalUnit init_lapic;
+
+volatile ApicLocalUnit* lapic = &init_lapic;

 ApicInfo apic_data;
===============================8<=======================================

makes qemu crash, as if the cpu is started multiple times:

===============================8<=======================================
qemu-system-i386 -m 512 -nographic -no-reboot -cdrom test-hello.iso -smp 2

GNU Mach 1.8
ELF section header table at c0010198
biosmem: physical memory map:
biosmem: 000000000000000000:00000000000009f000, available
biosmem: 00000000000009fc00:0000000000000a0000, reserved
biosmem: 0000000000000f0000:000000000000100000, reserved
biosmem: 000000000000100000:00000000001ffe0000, available
biosmem: 00000000001ffe0000:000000000020000000, reserved
biosmem: 0000000000fffc0000:000000000100000000, reserved
Loaded ELF symbol table for mach (3162 symbols)
vm_page: page table size: 131024 entries (7168k)
vm_page: DMA: pages: 4080 (15M), free: 0 (0M)
vm_page: DMA: min:500 low:600 high:1000
vm_page: DIRECTMAP: pages: 126944 (495M), free: 124031 (484M)
vm_page: DIRECTMAP: min:6347 low:7616 high:12694
ACPI:
 rsdp = c00f59d0; rsdp->rsdt_addr = 1ffe1b21
 rsdt = e1184b21; rsdt->length = 34 (n = 4)
CPUS:
 CPU 0 - APIC ID 0 - addr=0xe1187000
 CPU 1 - APIC ID 1 - addr=0xe1187000
IOAPICS:
 IOAPIC 0 - APIC ID 0 - addr=0xe1188000
IRQ override: pin=0 gsi=2 trigger=EDGE polarity=HIGH
IRQ override: pin=5 gsi=5 trigger=LEVEL polarity=HIGH
IRQ override: pin=9 gsi=9 trigger=LEVEL polarity=HIGH
IRQ override: pin=10 gsi=10 trigger=LEVEL polarity=HIGH
IRQ override: pin=11 gsi=11 trigger=LEVEL polarity=HIGH
IOAPIC 0 configured
com 2 out of range
lpr0: at atbus0, port = 378x, spl = 6d, pic = 7.
RTC time is 2023-06-19 20:11:07
timer calibration... done
Starting AP 1
Trying to enable: 1
**
ERROR:../../accel/tcg/tcg-accel-ops-mttcg.c:110:mttcg_cpu_thread_fn: assertion failed: (cpu->halted) Sending IPIs to APIC ID 1...Bail out! ERROR:../../accel/tcg/tcg-accel-ops-mttcg.c:110:mttcg_cpu_thread_fn: assertion failed: (cpu->halted)
===============================8<=======================================


Luca



reply via email to

[Prev in Thread] Current Thread [Next in Thread]