On 11/9/26 2:23 PM, Baptiste Le Duc wrote:
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.
has_isa_extensions_property() still walks the disabled nodes, so the two
loops over /cpus now disagree on which harts count. Rather than adding
the check loop by loop, can we filter them in one place, e.g. with a
dt_for_each_available_child_node() iterator, so no /cpus walk sees a disabled
hart?
I missed updating has_isa_extensions_property() because I had Cristian
Andrei's patch in mind, which adds support for the riscv,isa-extensions
property (the patch isn't published to ML). This function will be
completely dropped as part of that work.
So, until that patch is published, it would probably be better to add an
additional check to has_isa_extensions_property().
Regarding the question of whether to use
dt_for_each_available_child_node(), I don't see many use cases for it
beyond this particular one. There are also plenty of cases where it's
perfectly fine for a node to be disabled and still parsed, so I'm not
entirely convinced that we need this change now.
Let's just add an explicit check to has_isa_extensions_property() for
now. Are you okay with that or still think it'll be better to introduce
dt_for_each_available_child_node() specifically for this case?
~ Oleksii