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

Re: [PATCH 0/4] xen/arm: Unbreak ACPI



(Removing the x86 folks from the CC list)

Hi André,

On 30/09/2020 00:39, André Przywara wrote:
On 29/09/2020 22:11, Alex Bennée wrote:

Hi,

Julien Grall <julien@xxxxxxx> writes:

Hi Alex,

On 29/09/2020 16:29, Alex Bennée wrote:

Julien Grall <julien@xxxxxxx> writes:

From: Julien Grall <jgrall@xxxxxxxxxx>

Hi all,

Xen on ARM has been broken for quite a while on ACPI systems. This
series aims to fix it.

Unfortunately I don't have a system with ACPI v6.0 or later (QEMU seems
to only support 5.1).

Does QEMU provide ACPI tables? Or is this actually EDK2 generating them?

So I did only some light testing.

So about that v6.0 or later: it seems like the requirement comes from:
commit 1c9bd43019cd "arm/acpi: Parse FADT table and get PSCI flags":
"Since STAO table and the GIC version are introduced by ACPI 6.0, we
will check the version and only parse FADT table with version >= 6.0. If
firmware provides ACPI tables with ACPI version less than 6.0, OS will
be messed up with those information, so disable ACPI if we get an FADT
table with version less than 6.0."

STAO (and XENV) have indeed been introduced by ACPI v6.0, but those
tables are supposed to be *generated* by Xen and handed down to Dom0,
they will never be provided by firmware (or parsed) by the Xen
hypervisor. Checking the Linux code it seems to actually not (yet?)
support the STAO named list,

I may be because we don't yet use the named list in Xen. I am not sure if other hypervisor ever used the STAO.

and currently finds and uses the STAO (UART
block bit) regardless of the FADT version number.

IIRC, the concern at the time is an OS may decide to bail out if it finds a table that is not meant to exist.

I can't find anything GIC related in the FADT, the whole GIC information
is described in MADT.

My memory is quite fuzzy... IIRC the problem is (was?) related to how Linux used to check the size of the MADT.

Before commit [1], Linux was checking that the MADT entry was matching the ACPI version. As Xen generates the MADT using the ACPI 6.0 layout, it wouldn't be possible to boot Linux.


Linux/arm64 seems to be happy with ACPI >= v5.1:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/kernel/acpi.c#n148

So can we relax the v6.0 requirement, to be actually >= v5.1? That is
among the first to support ARM anyway, IIRC.

I remember trying to relax the requiring in the past. However, I can't remember why I didn't upstream it. There was possibly some issues I could not get around?

I think supporting ACPI 5.1 would be useful. So I would suggest to attempt it again and see what breaks.

Cheers,

[1]
commit 9eb1c92b47c73249465d388eaa394fe436a3b489
Author: Jeremy Linton <jeremy.linton@xxxxxxx>
Date:   Tue Nov 27 17:59:12 2018 +0000

    arm64: acpi: Prepare for longer MADTs

    The BAD_MADT_GICC_ENTRY check is a little too strict because
    it rejects MADT entries that don't match the currently known
    lengths. We should remove this restriction to avoid problems
    if the table length changes. Future code which might depend on
    additional fields should be written to validate those fields
    before using them, rather than trying to globally check
    known MADT version lengths.

Link: https://lkml.kernel.org/r/20181012192937.3819951-1-jeremy.linton@xxxxxxx
    Signed-off-by: Jeremy Linton <jeremy.linton@xxxxxxx>
    [lorenzo.pieralisi@xxxxxxx: added MADT macro comments]
    Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@xxxxxxx>
    Acked-by: Sudeep Holla <sudeep.holla@xxxxxxx>
    Cc: Will Deacon <will.deacon@xxxxxxx>
    Cc: Catalin Marinas <catalin.marinas@xxxxxxx>
    Cc: Al Stone <ahs3@xxxxxxxxxx>
    Cc: "Rafael J. Wysocki" <rjw@xxxxxxxxxxxxx>
    Signed-off-by: Will Deacon <will.deacon@xxxxxxx>

--
Julien Grall



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.