From: Marc Zyngier <maz@kernel.org>
To: Justin He <Justin.He@arm.com>
Cc: "sashiko-reviews@lists.linux.dev"
<sashiko-reviews@lists.linux.dev>,
"kvmarm@lists.linux.dev" <kvmarm@lists.linux.dev>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
Oliver Upton <oupton@kernel.org>, nd <nd@arm.com>
Subject: Re: [PATCH v4 4/4] KVM: arm64: nv: Allow the L1 VNCR page in cacheable PFNMAP memory
Date: Fri, 04 Dec 2026 16:31:19 +0000 [thread overview]
Message-ID: <86v759vwh4.wl-maz@kernel.org> (raw)
In-Reply-To: <AS2PR08MB9786C24D66FE66C1F5CEF850F74A2@AS2PR08MB9786.eurprd08.prod.outlook.com>
On Fri, 04 Dec 2026 11:34:36 +0000,
Justin He <Justin.He@arm.com> wrote:
>
> Hi Marc,
>
> [...]
> > > > Thank you for your contribution! Sashiko AI review found 1 potential
> > > > issue to consider:
> > > > - [High] KVM: arm64: vncr_pfn_is_cacheable() checks VMA prot instead of
> > > > PTE prot
> > > > --
> > >
> > > Make sense to me. Inspecting vma->vm_page_prot can indeed misclassify a
> > > VM_PFNMAP mapping whose per-PTE attributes were overridden with
> > > vmf_insert_pfn_prot().
> > >
> > > vncr_pfn_is_cacheable() will resolve the actual host PTE pgprot
> > > via follow_pfnmap_start() and check it with kvm_pgprot_is_cacheable()
> > > instead of relying on vma->vm_page_prot.
> > >
> > > I'll give it another day for any further comments before sending v5.
> >
> > Honestly, I'm starting to question whether this is worth the
> > complexity. I can see the appeal for memory that lives outside of the
> > kernel's view, but having to deal with devices on the VNCR path is
> > absolutely deadly.
>
> Fair point. The goal is strictly cacheable memory outside the linear
> map that the guest uses as RAM, not device MMIO, and I agree that
> getting a device mapping wrong on the EL2 fixmap path is not
> acceptable.
>
> Let's drop patch 4 from this series so patches 1-3 (the fixmap offset
> fix, the AF update SEA fix, and the selftest) can move forward on
> their own. I'll send v5 with just those three patches if you agree.
I can take those first three patches right as they are, no need to resend.
> If we revisit non-linear-map cacheable RAM for VNCR later, would you
> prefer an explicit opt-in from the backing memory (similar to
> VM_MTE_ALLOWED) to rule out arbitrary devices, or should VNCR stay
> restricted to memory with a linear map / struct page?
The issue is to distinguish RAM from devices when the only thing we
have for that purpose is a userspace PTE and no notion of which is
what. Do you see any reliable way to distinguish those? They are both
flagged PTE_SPECIAL, but that's about it.
I'm not sure what a new flag gives us, to be honest. Ideally, what I'd
really want is a PTE bit saying "this is memory" or "this is a
device". But we only have the attributes for this, and I'm worried
this is not enough...
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2026-12-04 16:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 10:58 [PATCH v4 0/4] KVM: arm64: nv: VNCR page mapping fixes Jia He
2026-12-03 10:58 ` [PATCH v4 1/4] KVM: arm64: nv: Locate the VNCR page in the host page from its PA Jia He
2026-12-03 10:58 ` [PATCH v4 2/4] KVM: arm64: nv: Inject an SEA when the VNCR walk cannot set the AF Jia He
2026-12-03 10:58 ` [PATCH v4 3/4] KVM: arm64: selftests: Add a test for VNCR_EL2 translation faults Jia He
2026-12-03 11:16 ` sashiko-bot
2026-12-04 1:46 ` Justin He
2026-12-04 9:12 ` Marc Zyngier
2026-12-04 9:51 ` Justin He
2026-12-03 10:58 ` [PATCH v4 4/4] KVM: arm64: nv: Allow the L1 VNCR page in cacheable PFNMAP memory Jia He
2026-12-03 11:16 ` sashiko-bot
2026-12-04 2:59 ` Justin He
2026-12-04 10:24 ` Marc Zyngier
2026-12-04 11:34 ` Justin He
2026-12-04 16:31 ` Marc Zyngier [this message]
2026-12-05 1:32 ` Justin He
2026-12-05 9:32 ` Marc Zyngier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86v759vwh4.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=Justin.He@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=nd@arm.com \
--cc=oupton@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.