Re: [PATCH 07/18] arm64: Add system_supports_hvo
From: James Houghton
Date: Mon Aug 24 2026 - 20:19:16 EST
On Tue, Aug 18, 2026 at 7:07 AM Catalin Marinas <catalin.marinas@xxxxxxx> wrote:
>
> On Wed, Jul 08, 2026 at 03:11:17AM +0000, James Houghton wrote:
> > diff --git a/arch/arm64/include/asm/cpucaps.h b/arch/arm64/include/asm/cpucaps.h
> > index 25c61cda901c..6db3ef827f86 100644
> > --- a/arch/arm64/include/asm/cpucaps.h
> > +++ b/arch/arm64/include/asm/cpucaps.h
> > @@ -75,6 +75,8 @@ cpucap_is_possible(const unsigned int cap)
> > return IS_ENABLED(CONFIG_HW_PERF_EVENTS);
> > case ARM64_HAS_LSUI:
> > return IS_ENABLED(CONFIG_ARM64_LSUI);
> > + case ARM64_HVO_COMPATIBLE:
> > + return IS_ENABLED(CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP);
> > }
>
> We shouldn't use HVO, a software feature, as a CPU capability name, even
> if it's called HVO_COMPATIBLE. Maybe we can come up with a hardware
> related name, e.g. BBM_THROUGH_AF.
I was struggling to come up with a good name. BBM_THROUGH_AF sounds
good, thanks!
I think with that more generic name, the
CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP reference here no longer makes
sense, so I'll drop that.
> > diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
> > index 9a22df0c5120..3b9224b99a5f 100644
> > --- a/arch/arm64/kernel/cpufeature.c
> > +++ b/arch/arm64/kernel/cpufeature.c
> > @@ -2172,6 +2172,16 @@ static bool has_bbml2_noabort(const struct arm64_cpu_capabilities *caps, int sco
> > return cpu_supports_bbml2_noabort();
> > }
> >
> > +static bool hvo_compatible(const struct arm64_cpu_capabilities *caps, int scope)
> > +{
> > + /*
> > + * We need BBML2 to support Block -> Table transitions without taking
> > + * faults, and we need HW AF support to support changing the OA without
> > + * taking faults.
> > + */
> > + return cpu_supports_bbml2_noabort() && supports_hw_af(scope);
> > +}
>
> I think this is wrong. cpu_supports_bbml2_noabort() only checks the
> current CPU while hvo_compatible() will be run once on the sanitised
> register values (SCOPE_SYSTEM). I should be something like:
>
> cpus_have_cap(ARM64_HAS_BBML2_NOABORT) && supports_hw_af(scope)
Yep, it's wrong. :( I think I had some things confused in my head.
With my newfound understanding of things, I don't think the previous
patch (6) is doing anything. So I'll drop that patch and just write:
cpus_have_cap(ARM64_HAS_BBML2_NOABORT) && cpu_has_hw_af()
Thanks!