qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: CLEMENT MATHIEU--DRIF <clement.mathieu--drif@eviden.com>,
	Konstantin Belousov <kib@kib.kiev.ua>
Cc: Yi Liu <yi.l.liu@intel.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	 Jason Wang <jasowang@redhat.com>, Le Tan <tamlokveer@gmail.com>,
	"jhb@freebsd.org" <jhb@freebsd.org>,
	 Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Eduardo Habkost <eduardo@habkost.net>,
	 "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [PATCH v2] intel_iommu: Allow both Status Write and Interrupt Flag in QI wait
Date: Tue, 15 Jul 2025 09:27:45 +0100	[thread overview]
Message-ID: <7cf6b91c1e1ea8b50d116f738215bcb55732b214.camel@infradead.org> (raw)
In-Reply-To: <afe3881b-1193-4d89-b0d0-6c316e54684f@eviden.com>

[-- Attachment #1: Type: text/plain, Size: 2287 bytes --]

On Tue, 2025-07-15 at 06:11 +0000, CLEMENT MATHIEU--DRIF wrote:
> 
> 
> On 14/07/2025 11:22 pm, Konstantin Belousov wrote:
> > Caution: External email. Do not open attachments or click links,
> > unless this email comes from a known sender and you know the
> > content is safe.
> > 
> > 
> > On Mon, Jul 14, 2025 at 05:41:22PM +0100, David Woodhouse wrote:
> > > On 14 July 2025 15:28:09 GMT+01:00, Yi Liu <yi.l.liu@intel.com>
> > > wrote:
> > > > Hi David,
> > > > 
> > > > On 2025/7/14 16:00, David Woodhouse wrote:
> > > > > From: David Woodhouse <dwmw@amazon.co.uk>
> > > > > 
> > > > > FreeBSD does both, and this appears to be perfectly valid. The VT-d
> > > > > spec even talks about the ordering (the status write should be done
> > > > > first, unsurprisingly).
> 
> Are you talking about the ordering constraint mentioned in bullet 
> "Page-request Drain (PD)"?
> 

No, in the v4.0 spec it's just below that bullet list, at the bottom of
§6.5.2.8.

The wording in §6.5.2.9 is even clearer:

"The invalidation completion event interrupt must push any in-flight
invalidation completion status writes, including status writes that may
have originated from the same inv_wait_dsc for which the interrupt was
generated."

> > > > I think this "if branch" can be moved just after the inv_desc non-zero
> > > > reserved bit checking. Hence you don't need a ret at all. :)
> > > 
> > > We want to return false if the memory write fails, and the
> > > interrupt has to happen afterwards.
> 
> Per spec: "Hardware behavior is undefined if the Status Address 
> specified is not an address route-able to memory"
> 
> Do we want to trigger the interrupt even when the DMA fails?

Yes, we do. That's a quality of implementation issue. Just because the
behaviour is 'undefined' and theoretically gives us permission to do
whatever we like to the guest, we should still be as sensible as
possible.


> > > 
> > > > btw. I'm
> > > > also asking if VT-d spec allows it or not. So let's wait for a
> > > > while..

Rapidly losing interest in this conversation. QEMU currently has a
guest-triggerable crash, for crying out loud. I'd like to fix it and
move on to finding out why FreeBSD doesn't work *even* when QEMU
doesn't abort...

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]

  reply	other threads:[~2025-07-15  8:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-14  8:00 [PATCH v2] intel_iommu: Allow both Status Write and Interrupt Flag in QI wait David Woodhouse
2025-07-14 14:28 ` Yi Liu
2025-07-14 16:41   ` David Woodhouse
2025-07-14 21:22     ` Konstantin Belousov via
2025-07-15  6:11       ` CLEMENT MATHIEU--DRIF
2025-07-15  8:27         ` David Woodhouse [this message]
2025-07-15 12:27           ` CLEMENT MATHIEU--DRIF
2025-07-16  4:01             ` Yi Liu
2025-07-16  4:05               ` Konstantin Belousov
2025-07-16  9:23                 ` Yi Liu
2025-07-16  9:36                   ` Konstantin Belousov via
2025-07-15 12:35         ` Yi Liu
2025-07-15 13:59           ` CLEMENT MATHIEU--DRIF
2025-07-22 12:04           ` David Woodhouse
2025-08-01 15:09             ` Liu, Yi L
2025-08-02  5:38 ` Michael Tokarev

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=7cf6b91c1e1ea8b50d116f738215bcb55732b214.camel@infradead.org \
    --to=dwmw2@infradead.org \
    --cc=clement.mathieu--drif@eviden.com \
    --cc=eduardo@habkost.net \
    --cc=jasowang@redhat.com \
    --cc=jhb@freebsd.org \
    --cc=kib@kib.kiev.ua \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=tamlokveer@gmail.com \
    --cc=yi.l.liu@intel.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;
as well as URLs for NNTP newsgroup(s).