Skip to content

Commit 2366c7f

Browse files
Shannon Zhaowildea01
authored andcommitted
ARM64: ACPI: Check if it runs on Xen to enable or disable ACPI
When it's a Xen domain0 booting with ACPI, it will supply a /chosen and a /hypervisor node in DT. So check if it needs to enable ACPI. Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org> Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Hanjun Guo <hanjun.guo@linaro.org> Tested-by: Julien Grall <julien.grall@arm.com> Acked-by: Mark Rutland <mark.rutland@arm.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
1 parent d8fc68a commit 2366c7f

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

arch/arm64/kernel/acpi.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,15 @@ static int __init dt_scan_depth1_nodes(unsigned long node,
6767
{
6868
/*
6969
* Return 1 as soon as we encounter a node at depth 1 that is
70-
* not the /chosen node.
70+
* not the /chosen node, or /hypervisor node with compatible
71+
* string "xen,xen".
7172
*/
72-
if (depth == 1 && (strcmp(uname, "chosen") != 0))
73-
return 1;
73+
if (depth == 1 && (strcmp(uname, "chosen") != 0)) {
74+
if (strcmp(uname, "hypervisor") != 0 ||
75+
!of_flat_dt_is_compatible(node, "xen,xen"))
76+
return 1;
77+
}
78+
7479
return 0;
7580
}
7681

@@ -184,7 +189,8 @@ void __init acpi_boot_table_init(void)
184189
/*
185190
* Enable ACPI instead of device tree unless
186191
* - ACPI has been disabled explicitly (acpi=off), or
187-
* - the device tree is not empty (it has more than just a /chosen node)
192+
* - the device tree is not empty (it has more than just a /chosen node,
193+
* and a /hypervisor node when running on Xen)
188194
* and ACPI has not been force enabled (acpi=force)
189195
*/
190196
if (param_acpi_off ||

0 commit comments

Comments
 (0)