Re: [RFC PATCH v2 0/2] KVM: arm64: Add support for BBM level 3

From: Mostafa Saleh

Date: Thu Jul 30 2026 - 05:46:29 EST


Hi Linu,

On Thu, Jul 30, 2026 at 08:52:37AM +0530, Linu Cherian wrote:
> Hi,
>
> On Thu, Jul 23, 2026 at 06:21:38PM +0000, Mostafa Saleh wrote:
> > This patch series adds support for BBM level 3 to KVM pgtable, it
> > depends on [1]
> >
> > Changes from v1:
> > https://lore.kernel.org/all/20260717130901.2239134-1-smostafa@xxxxxxxxxx/
> > - Limit BBML3 to systems with FWB and DIC and remove race check.
> >
> > Motivation
> > ==========
> > I have been looking into this for the context of:
> > - Page table sharing between the host CPU stage-2 and the SMMUv3 for
> > protected KVM.
> > - Use the pagtable code to populate SMMUv3 stage-2 shadowed
> > page table [2]
> >
> > However, BBM level 3 is still useful for CPU only operations as it
> > avoids intermediately breaking translation.
> >
> > Design
> > ======
> > Some of the conditions that BBM level 3 will be useful in (RWHZWS):
> > 1) A change to a PTE memory type, shareability, cacheability or OA
>
> Could you please clarify how BBM level 3 is helping this particular scenario ?
> This is supposed to be a case where break before make is required.

Right, I initially misinterpreted the rule.
However, AFAIK, KVM does not rely on those, I added a comment based
on Oliver feedback in the last version.

I will update the cover letter. But looking again, may be we also need
an extra check to enforce that in the run time and fallback to SW BBM
as I'd be concerned about some of the KVM call chains as
user_mem_abort().

Thanks,
Mostafa

>
> Thanks,
> Linu Cherian.
>