On Mon, Jul 27, 2020 at 05:16:47PM +0200, Mark Kettenis wrote:
> > Date: Mon, 27 Jul 2020 17:02:41 +0200 (CEST)
> > From: Mark Kettenis <[email protected]>
> >
> > Recent ACPI versions have deprecated "Processor()" nodes in favout of
> > "Device()" nodes with a _HID() method that returns "ACPI0007". This
> > diff tries to support machines with firmware that implements this. If
> > you see something like:
> >
> > "ACPI0007" at acpi0 not configured
> >
> > please try the following diff and report back with an updated dmesg.
> >
> > Cheers,
> >
> > Mark
>
> And now with the right diff...
On a dell r6415, it looks like this:
acpicpu0 at acpi0copyvalue: 6: C1(@1 halt!)
all the way up to
acpicpu127 at acpi0copyvalue: 6: no cpu matching ACPI ID 127
which I guess means aml_copyvalue() needs to learn how to copy
AML_OBJTYPE_DEVICE.
>
>
> Index: dev/acpi/acpicpu.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/acpi/acpicpu.c,v
> retrieving revision 1.85
> diff -u -p -r1.85 acpicpu.c
> --- dev/acpi/acpicpu.c 27 May 2020 05:02:21 -0000 1.85
> +++ dev/acpi/acpicpu.c 27 Jul 2020 14:58:38 -0000
> @@ -186,6 +186,11 @@ struct cfdriver acpicpu_cd = {
> NULL, "acpicpu", DV_DULL
> };
>
> +const char *acpicpu_hids[] = {
> + "ACPI0007",
> + NULL
> +};
> +
> extern int setperf_prio;
>
> struct acpicpu_softc *acpicpu_sc[MAXCPUS];
> @@ -650,6 +655,9 @@ acpicpu_match(struct device *parent, voi
> struct acpi_attach_args *aa = aux;
> struct cfdata *cf = match;
>
> + if (acpi_matchhids(aa, acpicpu_hids, cf->cf_driver->cd_name))
> + return (1);
> +
> /* sanity */
> if (aa->aaa_name == NULL ||
> strcmp(aa->aaa_name, cf->cf_driver->cd_name) != 0 ||
> @@ -665,6 +673,7 @@ acpicpu_attach(struct device *parent, st
> struct acpicpu_softc *sc = (struct acpicpu_softc *)self;
> struct acpi_attach_args *aa = aux;
> struct aml_value res;
> + int64_t uid;
> int i;
> uint32_t status = 0;
> CPU_INFO_ITERATOR cii;
> @@ -675,6 +684,10 @@ acpicpu_attach(struct device *parent, st
> acpicpu_sc[sc->sc_dev.dv_unit] = sc;
>
> SLIST_INIT(&sc->sc_cstates);
> +
> + if (aml_evalinteger(sc->sc_acpi, sc->sc_devnode,
> + "_UID", 0, NULL, &uid) == 0)
> + sc->sc_cpu = uid;
>
> if (aml_evalnode(sc->sc_acpi, sc->sc_devnode, 0, NULL, &res) == 0) {
> if (res.type == AML_OBJTYPE_PROCESSOR) {
>