From: Alex Williamson <alex@shazbot.org>
To: "Cédric Le Goater" <clg@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-arm@nongnu.org,
Eric Auger <eric.auger@redhat.com>,
Stefan Berger <stefanb@linux.ibm.com>,
Peter Maydell <peter.maydell@linaro.org>,
alex@shazbot.org
Subject: Re: [PATCH] vfio/listener: Only warn on misalignment for VFIO-owned regions
Date: Mon, 6 Jul 2026 09:34:38 -0600 [thread overview]
Message-ID: <20260706093438.1ea88aef@shazbot.org> (raw)
In-Reply-To: <3f799ad7-08a5-44c7-b6bf-b143da038593@redhat.com>
On Mon, 6 Jul 2026 17:12:07 +0200
Cédric Le Goater <clg@redhat.com> wrote:
> On 7/6/26 16:20, Alex Williamson wrote:
> > On Thu, 2 Jul 2026 18:06:40 +0200
> > Cédric Le Goater <clg@redhat.com> wrote:
> >
> >> Any device on the board can have non-page-aligned memory regions. The
> >> VFIO listener should not warn about misalignment for regions that are
> >> not VFIO-related.
> >>
> >> Replace the vfio_known_safe_misalignment() whitelist with a
> >> vfio_get_vfio_device() ownership check: only warn when a VFIO device's
> >> own region is misaligned. For all other regions, emit a trace event
> >> and silently skip. Extract the misalignment test into a
> >> vfio_section_misaligned() helper for readability.
> >>
> >> Note: vfio_get_vfio_device() currently only covers VFIO PCI devices,
> >> including vfio-user-pci. Other VFIO backends (AP, CCW) don't expose
> >> memory regions through this path so this is sufficient for now.
> >
> > I thought the whole point was to warn when there are non-vfio devices
> > that we cannot insert into the DMA map. 851d6d1a0ff2 added tpm-crb-cmd
> > to an ignore list because it's not a DMA target. The intention of that
> > ignore list was to continue to evaluate devices that are misaligned
> > and either add them to the ignore list or determine they could be a
> > valid DMA target and correct the alignment.
>
> If the goal was to use the VFIO listener to catch all misaligned regions,
> and potentially fix them, we should reconsider that approach :
>
> https://lore.kernel.org/qemu-devel/20260701080843.2418461-1-clg@redhat.com/
Arguably ok, likely no tpm device is a useful DMA target.
> As Peter pointed out, regions that are not page-aligned regions are valid :
>
> https://lore.kernel.org/qemu-devel/CAFEAcA-QHJ=HaBc5WSLLap8NdDw+tty4EFfGt6cmmNOK6e_m7w@mail.gmail.com/
Yes, they are valid, no argument. We're trying to DMA map things. We
can't DMA map things that aren't page-aligned and sized. If it's not
likely a DMA target, well, that's the purpose of the ignore list. If
it might be a DMA target, this is intended to log why the VM may not
work correctly vs bare metal.
> and aligning them would require a machine compat for migration.
> Not addressed in :
>
> https://lore.kernel.org/qemu-devel/20260630173245.2070268-1-clg@redhat.com/
Which I think highlights why we might rather see warnings than bury the
issue in traces.
> > Can this even legitimately trigger with a vfio-pci device?
>
> This would be a real error to report. Right ?
I suspect it's not possible, so as proposed here we're turning a blind
eye to the issue we intended to monitor and validate, and we replace it
with likely dead code. Thanks,
Alex
prev parent reply other threads:[~2026-07-06 15:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-02 16:06 [PATCH] vfio/listener: Only warn on misalignment for VFIO-owned regions Cédric Le Goater
2026-07-06 11:46 ` Cédric Le Goater
2026-07-06 14:20 ` Alex Williamson
2026-07-06 15:12 ` Cédric Le Goater
2026-07-06 15:27 ` Peter Maydell
2026-07-06 15:42 ` Alex Williamson
2026-07-06 16:12 ` Peter Maydell
2026-07-06 17:16 ` Alex Williamson
2026-07-06 17:29 ` Peter Maydell
2026-07-06 15:34 ` Alex Williamson [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=20260706093438.1ea88aef@shazbot.org \
--to=alex@shazbot.org \
--cc=clg@redhat.com \
--cc=eric.auger@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanb@linux.ibm.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 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.