On Sat, 3 Sep 2016, Eivind Eide wrote:
> Some more info: Did ddb trace now with 3. sept. snapshot kernel 
> (handwritten, in case of typos)
> 
> (...snip...)
> acpitimer0 at acpi0: 3579545 Hz, 24 bits
> acpiprt0 at acpi0: bus 0 (PCI0)
> acpiprt1 at acpi0: bus 1 (AGP_)
> acpiprt2 at acpi0: bus 2 (PCIE)
> acpiprt3 at acpi0: bus -1 (MPCI)
> acpicpu0 at acpi0unable to find cpu 0
> uvm_fault(0xd0baa180, 0x0, 0, 1) -> e
> kernel: page fault trap, code=0
> Stopped at    acpicpu_getcst_from_fadt+0x37:  movl    clean_idt+0x2f4(%eax),%
> eax
> ddb> trace
> acpicpu_getcst_from_fadt(d74e5300,0,0,0,d0d6aa90) at 
> acpicpu_getcst_from_fadt+0x37

Can you apply this patch in /usr/src/sys/dev/acpi/ and see if the 
resulting kernel works?  If so, please use sendbug to send in the acpidump 
output.


Philip


Index: acpi.c
===================================================================
RCS file: /data/src/openbsd/src/sys/dev/acpi/acpi.c,v
retrieving revision 1.313
retrieving revision 1.312
diff -u -p -r1.313 -r1.312
--- acpi.c      28 Jul 2016 21:57:56 -0000      1.313
+++ acpi.c      10 Jun 2016 20:03:46 -0000      1.312
@@ -1960,8 +1960,6 @@ acpi_add_device(struct aml_node *node, v
        struct acpi_attach_args aaa;
 #ifdef MULTIPROCESSOR
        struct aml_value res;
-       CPU_INFO_ITERATOR cii;
-       struct cpu_info *ci;
        int proc_id = -1;
 #endif
 
@@ -1982,11 +1980,8 @@ acpi_add_device(struct aml_node *node, v
                                proc_id = res.v_processor.proc_id;
                        aml_freevalue(&res);
                }
-               CPU_INFO_FOREACH(cii, ci) {
-                       if (ci->ci_acpi_proc_id == proc_id)
-                               break;
-               }
-               if (ci == NULL)
+               if (proc_id < -1 || proc_id >= LAPIC_MAP_SIZE ||
+                   (acpi_lapic_flags[proc_id] & ACPI_PROC_ENABLE) == 0)
                        return 0;
 #endif
                nacpicpus++;
Index: acpicpu.c
===================================================================
RCS file: /data/src/openbsd/src/sys/dev/acpi/acpicpu.c,v
retrieving revision 1.75
retrieving revision 1.74
diff -u -p -r1.75 -r1.74
--- acpicpu.c   28 Jul 2016 21:57:56 -0000      1.75
+++ acpicpu.c   17 Mar 2016 13:18:47 -0000      1.74
@@ -675,7 +675,7 @@ acpicpu_attach(struct device *parent, st
 
        /* link in the matching cpu_info */
        CPU_INFO_FOREACH(cii, ci)
-               if (ci->ci_acpi_proc_id == sc->sc_cpu) {
+               if (ci->ci_cpuid == sc->sc_dev.dv_unit) {
                        ci->ci_acpicpudev = self;
                        sc->sc_ci = ci;
                        break;
Index: acpimadt.c
===================================================================
RCS file: /data/src/openbsd/src/sys/dev/acpi/acpimadt.c,v
retrieving revision 1.35
retrieving revision 1.34
diff -u -p -r1.35 -r1.34
--- acpimadt.c  28 Jul 2016 21:57:56 -0000      1.35
+++ acpimadt.c  10 Jul 2016 20:41:19 -0000      1.34
@@ -40,6 +40,8 @@
 
 #include "ioapic.h"
 
+u_int8_t acpi_lapic_flags[LAPIC_MAP_SIZE];
+
 int acpimadt_match(struct device *, void *, void *);
 void acpimadt_attach(struct device *, struct device *, void *);
 
@@ -242,6 +244,8 @@ acpimadt_attach(struct device *parent, s
 
                        lapic_map[entry->madt_lapic.acpi_proc_id] =
                            entry->madt_lapic.apic_id;
+                       acpi_lapic_flags[entry->madt_lapic.acpi_proc_id] =
+                           entry->madt_lapic.flags;
 
                        memset(&caa, 0, sizeof(struct cpu_attach_args));
                        if (lapic_cpu_number() == entry->madt_lapic.apic_id)
@@ -251,8 +255,7 @@ acpimadt_attach(struct device *parent, s
                                ncpusfound++;
                        }
                        caa.caa_name = "cpu";
-                       caa.cpu_apicid = entry->madt_lapic.apic_id;
-                       caa.cpu_acpi_proc_id = entry->madt_lapic.acpi_proc_id;
+                       caa.cpu_number = entry->madt_lapic.apic_id;
 #ifdef MULTIPROCESSOR
                        caa.cpu_func = &mp_cpu_funcs;
 #endif
@@ -305,8 +308,7 @@ acpimadt_attach(struct device *parent, s
                                ncpusfound++;
                        }
                        caa.caa_name = "cpu";
-                       caa.cpu_apicid = entry->madt_x2apic.apic_id;
-                       caa.cpu_acpi_proc_id = entry->madt_x2apic.acpi_proc_uid;
+                       caa.cpu_number = entry->madt_x2apic.apic_id;
 #ifdef MULTIPROCESSOR
                        caa.cpu_func = &mp_cpu_funcs;
 #endif
Index: acpivar.h
===================================================================
RCS file: /data/src/openbsd/src/sys/dev/acpi/acpivar.h,v
retrieving revision 1.83
retrieving revision 1.82
diff -u -p -r1.83 -r1.82
--- acpivar.h   28 Jul 2016 21:57:56 -0000      1.83
+++ acpivar.h   12 Jan 2016 01:11:15 -0000      1.82
@@ -41,6 +41,9 @@ extern int acpi_debug;
 
 extern int acpi_hasprocfvs;
 
+#define LAPIC_MAP_SIZE 256
+extern u_int8_t acpi_lapic_flags[LAPIC_MAP_SIZE];
+
 struct klist;
 struct acpiec_softc;
 struct acpipwrres_softc;

Reply via email to