|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v2 1/2] xen/riscv: skip disabled CPU nodes when probing ISA extensions
riscv_fill_hwcap_from_isa_string() intersects the riscv,isa of every CPU
node under /cpus, including the ones with status = "disabled". Such a
hart is never used by Xen, yet it can still remove extensions from the
host ISA: e.g. a disabled hart without the H extension makes Xen panic
with "Xen requires extension: h", even though every hart Xen runs on
implements it.
Skip CPU nodes which aren't available, both there and in
has_isa_extensions_property(), so that the two agree on which harts are
taken into account.
Fixes: f74ebf58b518 ("xen/riscv: identify specific ISA supported by cpu")
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
---
Changes in v2:
- Skip the disabled CPU nodes in has_isa_extensions_property() as well.
- Remove the comment, as the explanation in the commit description is
sufficient and avoids duplicating the same comment in
has_isa_extensions_property().
- Update the last paragraph of the commit message: add info about
has_isa_extensions_property().
---
---
xen/arch/riscv/cpufeature.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/xen/arch/riscv/cpufeature.c b/xen/arch/riscv/cpufeature.c
index dff590f68a30..9767ba0b5824 100644
--- a/xen/arch/riscv/cpufeature.c
+++ b/xen/arch/riscv/cpufeature.c
@@ -477,6 +477,9 @@ static void __init riscv_fill_hwcap_from_isa_string(void)
if ( !dt_device_type_is_equal(cpu, "cpu") )
continue;
+ if ( !dt_device_is_available(cpu) )
+ continue;
+
if ( dt_get_cpuid_from_node(cpu, &cpuid) < 0 )
continue;
@@ -519,6 +522,9 @@ static bool __init has_isa_extensions_property(void)
if ( !dt_device_type_is_equal(cpu, "cpu") )
continue;
+ if ( !dt_device_is_available(cpu) )
+ continue;
+
if ( dt_property_read_string(cpu, "riscv,isa-extensions", &isa) )
continue;
--
2.56.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |