All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konstantin Belousov via <qemu-devel@nongnu.org>
To: David Woodhouse <dwmw2@infradead.org>
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,
	"Clément Mathieu--Drif" <clement.mathieu--drif@eviden.com>,
	"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
Subject: Re: [PATCH v2] intel_iommu: Allow both Status Write and Interrupt Flag in QI wait
Date: Tue, 15 Jul 2025 00:22:03 +0300	[thread overview]
Message-ID: <aHV0-wDJImAjRPPp@kib.kiev.ua> (raw)
In-Reply-To: <4FE9A8E3-5BA5-46D3-A1FA-EA1B7C85C058@infradead.org>

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).
> >
> >interesting. Have you tried setting both flags on baremetal and the hw
> >gives you both the status code and an interrupt?
> 
> I see no reason why it shouldn't. The spec (§6.5.2.8) gives no that the IF and SW bits should be mutually exclusive and even talks about ordering:
> 
> Section 6.5.2.11 describes queued invalidation ordering considerations. Hardware completes an 
> invalidation wait command as follows:
> • If a status write is specified in the wait descriptor (SW=1), hardware performs a coherent write of 
> the status data to the status address.
> • If an interrupt is requested in the wait descriptor (IF=1), hardware sets the IWC field in the 
> Invalidation Completion Status Register. An invalidation completion interrupt may be generated as 
> described in the following section
> 

Yes, and the FreeBSD DMAR code uses that, and relies on that, as was
mentioned earlier in the mail thread.

> 
> 
> >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.
> 
> > btw. I'm
> >also asking if VT-d spec allows it or not. So let's wait for a while..
> 
> Ok.
> 
> 


  reply	other threads:[~2025-07-14 22:47 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 [this message]
2025-07-15  6:11       ` CLEMENT MATHIEU--DRIF
2025-07-15  8:27         ` David Woodhouse
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=aHV0-wDJImAjRPPp@kib.kiev.ua \
    --to=qemu-devel@nongnu.org \
    --cc=clement.mathieu--drif@eviden.com \
    --cc=dwmw2@infradead.org \
    --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=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 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.