From: Yi Liu <yi.l.liu@intel.com>
To: Konstantin Belousov <kostikbel@gmail.com>
Cc: CLEMENT MATHIEU--DRIF <clement.mathieu--drif@eviden.com>,
David Woodhouse <dwmw2@infradead.org>,
Konstantin Belousov <kib@kib.kiev.ua>,
"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: Wed, 16 Jul 2025 17:23:57 +0800 [thread overview]
Message-ID: <80e9a8fd-e03b-48b0-856c-b8dd761a774e@intel.com> (raw)
In-Reply-To: <aHck8KHvEJqrRJ2s@kib.kiev.ua>
On 2025/7/16 12:05, Konstantin Belousov wrote:
> On Wed, Jul 16, 2025 at 12:01:44PM +0800, Yi Liu wrote:
>> On 2025/7/15 20:27, CLEMENT MATHIEU--DRIF wrote:
>>>
>>>
>>> On 15/07/2025 10:27 am, David Woodhouse wrote:
>>>> On Tue, 2025-07-15 at 06:11 +0000, CLEMENT MATHIEU--DRIF wrote:
>>>>>
>>>>>
>>>>> On 14/07/2025 11:22 pm, Konstantin Belousov wrote:
>>>>>>
>>>>>> 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>
>>>>>>>>>
>>>>
>>>>>>>> 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.
>>>
>>
>> Personally, I'm fine with generating the interrupt even the status write
>> failed. But to avoid potential conflict, I've also raised this question to
>> the VT-d spec owner. Haven't got a clear answer yet. To further understand
>> this, may I ask some dumb questions here. Why FreeBSD set both SW and IF
>> flag. What is the usage model here. Would software consider that all the QI
>> descriptors prior to this specific wait descriptor has succeeded when
>> either the interrupt got invoked or the expected status is written back?
>
> FreeBSD queues invalidations, each invalidation has the gen number. To
> know that some invalidation finished, FreeBSD waits for the interrupt,
> we do not scan the invalidation sequence word otherwise. There might be
> further generations of the invalidation descriptors in flight when we
> get the interrupt, which means that we need to know which generation is
> finished.
thanks for the explanation. So software still relies on checking the
written back status of the wait descriptor to identify finished
invalidation. If so might be better to generate interrupt when status write
is succeeded? Otherwise, the interrupt is meaningless to software. Does the
current software implementation rely on this interrupt even status write
failed?
Regards,
Yi Liu
next prev parent reply other threads:[~2025-07-16 9:18 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
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 [this message]
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=80e9a8fd-e03b-48b0-856c-b8dd761a774e@intel.com \
--to=yi.l.liu@intel.com \
--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=kostikbel@gmail.com \
--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 \
/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.