On Thu, Apr 29, 2021 at 10:27:49PM +0200, Peter Nicolai Mathias Hansteen wrote:
> I just spent the evening trying to work around an odd error that happens 
> after an apparently straightforward install on a new laptop.
> 
> The most useful info I can offer is that the install proceeds with no 
> complaints, but on first boot this happens:
> 
> 
> 
> 
> Followed by
> 
> 
> 
> This is a modern laptop so things such as serial consoles are not easily 
> available.
> 
> How do I go about supplying useful information here? I tried but failed to 
> collect useful things such as dmesg (trying to write to the install USB only 
> corrupts and so forth).
> 
> The store’s return policy is friendly enough that I can have this one lying 
> around at least a few days (actually 60 but I suspect the lady of the house 
> will not be quite as accommodating)
> 
> All the best,
> Peter
> 
> PS in case the attachments do not survive the pics are also up at 
> https://www.bsdly.net/~peter/20210429_190606.jpg 
> <https://www.bsdly.net/~peter/20210429_190606.jpg> and 
> https://www.bsdly.net/~peter/20210429_190645.jpg 
> <https://www.bsdly.net/~peter/20210429_190645.jpg>
> 

acpicpu0 at acpi0kernel: integer divide fault trap, code=0
Stopped at acpi_gasio+0x36: idivl %r8d,%eax
acpi_gasio(x,1,0,0.0.0) at acpi_gasio+0x36
acpi_write_pmreg(x,2,0,3,x,3) at acpi_write_pmreg+0xba
acpi_write_pmreg(x,10,0,3,x,x) at acpi_write_pmreg+0x18f
acpicpu_attach(...) at acpicpu_attach+0x1c3

acpi_gasio+0x36 is /usr/src/sys/dev/acpi/acpi.c line 265

acpi_gasio(struct acpi_softc *sc, int iodir, int iospace, uint64_t address,
    int access_size, int len, void *buffer)
..
        KASSERT((len % access_size) == 0);

acpi_write_pmreg+0xba is /usr/src/sys/dev/acpi/acpi.c line 1541

        /*
         * For Hardware-reduced ACPI we also emulate PM1A_CNT using
         * SLEEP_CONTROL_REG.
         */
        if (sc->sc_hw_reduced && reg == ACPIREG_PM1A_CNT) {
                uint8_t value = (regval >> 8);

                KASSERT(offset == 0);
                acpi_gasio(sc, ACPI_IOWRITE,
                    sc->sc_fadt->sleep_control_reg.address_space_id,
                    sc->sc_fadt->sleep_control_reg.address,
                    sc->sc_fadt->sleep_control_reg.register_bit_width / 8,
                    sc->sc_fadt->sleep_control_reg.access_size, &value);
                return;
        }

If you can build a kernel on another machine try

Index: sys/dev/acpi/acpi.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpi.c,v
retrieving revision 1.397
diff -u -p -r1.397 acpi.c
--- sys/dev/acpi/acpi.c 15 Mar 2021 22:44:57 -0000      1.397
+++ sys/dev/acpi/acpi.c 30 Apr 2021 01:57:00 -0000
@@ -262,6 +262,11 @@ acpi_gasio(struct acpi_softc *sc, int io
        dnprintf(50, "gasio: %.2x 0x%.8llx %s\n",
            iospace, address, (iodir == ACPI_IOWRITE) ? "write" : "read");
 
+       if (access_size == 0) {
+               printf("%s: invalid size 0\n", DEVNAME(sc));
+               return -1;
+       }
+
        KASSERT((len % access_size) == 0);
 
        pb = (uint8_t *)buffer;

Reply via email to