From: Zhenyu Wang <zhenyuw.linux@gmail.com>
To: Yuho Choi <oss.patchbox@gmail.com>
Cc: Zhi Wang <zhi.wang.linux@gmail.com>,
Jani Nikula <jani.nikula@linux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
Tvrtko Ursulin <tursulin@ursulin.net>,
Xiaolin Zhang <xiaolin.zhang@intel.com>,
intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
zhiw@nvidia.com
Subject: Re: [PATCH v1] drm/i915/gvt: Don't replace a DMA mapping that is still in use
Date: Tue, 13 Oct 2026 21:08:10 +0900 [thread overview]
Message-ID: <as4fKufR2O21NWk5@dell-wzy> (raw)
In-Reply-To: <CAGG=RgApzG=MeZ9xbpeBzqE0i0Q6RCPXtnyS-30JfEDPDKNN0Q@mail.gmail.com>
On Mon, Oct 12, 2026 at 12:01:31AM -0400, Yuho Choi wrote:
> Thanks for the review!
>
> On Fri, 9 Oct 2026 at 23:59, Zhenyu Wang <zhenyuw.linux@gmail.com> wrote:
> >
> > I don't think this is *real*, as code would simply destroy entry in
> > that case, and there won't be on-the-fly dma operation on that, as
> > guest mem setup is totally before execlist submission, if guest driver
> > changed mapping by ignoring gvt emulated execlist status, that's just bad...
>
> You know this code much better than I do, and I can't test it without
> GVT-g hardware, so I may well be missing something.
I can understand that but I think for any non-trivial change or
for sensitive part, testing is a must...
>
> The case I had in mind is the guest mapping the same page at both sizes
> and keeping both, e.g. 2M in the PPGTT of one context and 4K in the GGTT
> or in another context's PPGTT. If the second request replaces the entry,
> the first shadow entry seems to keep the old DMA address, as
> shadow_ppgtt_mm() reuses a PPGTT that is already shadowed. Is that ruled
> out somewhere? Please let me know if so.
Shadow ppgtt is created by a PV interface, so each context would have
separate shadow ppgtt or shadow mm. GVT handles guest page's dma
mapping per-vgpu as for per-VM. But GVT handles context submission in
order, shadow ppgtt is populated for each submission. I think even in
your example that possible one page mapped in different context as 4K
or 2M, it would be remapped as size doesn't match for each submission,
so no invalide dma address access.
I doubt if i915 could possibly have such case in reality..
>
> > So this change would always force 2M to split into 4K? why?
>
> No, only when a 4K entry for the same gfn is cached at the time of the
> 2M request. With no entry or a 2M entry nothing changes, and a 4K
> request now reuses an existing 2M entry instead of replacing it.
prev parent reply other threads:[~2026-10-13 12:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-04 21:22 Yuho Choi
2026-10-06 7:41 ` Jani Nikula
2026-10-06 22:14 ` Yuho Choi
2026-10-10 3:59 ` Zhenyu Wang
2026-10-12 4:01 ` Yuho Choi
2026-10-13 12:08 ` Zhenyu Wang [this message]
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=as4fKufR2O21NWk5@dell-wzy \
--to=zhenyuw.linux@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oss.patchbox@gmail.com \
--cc=rodrigo.vivi@intel.com \
--cc=stable@vger.kernel.org \
--cc=tursulin@ursulin.net \
--cc=xiaolin.zhang@intel.com \
--cc=zhi.wang.linux@gmail.com \
--cc=zhiw@nvidia.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®