[PATCH v7 4/5] KVM: arm64: Allow cacheable stage 2 mapping using VMA flags
Jason Gunthorpe
jgg at nvidia.com
Wed Jun 18 09:38:36 PDT 2025
On Wed, Jun 18, 2025 at 05:34:16PM +0100, Catalin Marinas wrote:
> > + *
> > + * Do not set device as the device memory is cacheable. Note
> > + * that such mapping is safe as the KVM S2 will have the same
> > + * Normal memory type as the VMA has in the S1.
> > */
> > - disable_cmo = true;
> > + if (!is_vma_cacheable)
> > + disable_cmo = true;
>
> I'm tempted to stick to the 'device' variable name. Or something like
> s2_noncacheable. As I commented, it's not just about disabling CMOs.
I think it would be clearer to have two concepts/variable then because
the cases where it is really about preventing cachable access to
prevent aborts are not linked to the logic that checks pfn valid. We
have to detect those cases separately (through the VMA flags was it?).
Having these two things together is IMHO confusing..
Jason
More information about the linux-arm-kernel
mailing list