From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH] x86/msi: always propagate MSI writes when not in active system mode
Date: Tue, 18 Mar 2025 09:54:12 +0100 [thread overview]
Message-ID: <Z9k0tL30_yLuj5kM@macbook.local> (raw)
In-Reply-To: <38076c0d-8e1a-4d16-b22c-b1db9460ed1c@suse.com>
On Tue, Mar 18, 2025 at 09:36:37AM +0100, Jan Beulich wrote:
> On 18.03.2025 09:29, Roger Pau Monne wrote:
> > --- a/xen/drivers/passthrough/amd/iommu_intr.c
> > +++ b/xen/drivers/passthrough/amd/iommu_intr.c
> > @@ -546,7 +546,7 @@ int cf_check amd_iommu_msi_msg_update_ire(
> > rc = update_intremap_entry_from_msi_msg(iommu, bdf, nr,
> > &msi_desc->remap_index,
> > msg, &data);
> > - if ( rc > 0 )
> > + if ( rc >= 0 )
> > {
> > for ( i = 1; i < nr; ++i )
> > msi_desc[i].remap_index = msi_desc->remap_index + i;
>
> I understand that Marek's testing has made clear that this change is needed,
> yet I don't understand it. If we didn't allocate a new index, why would we
> need to update in-memory state, when memory is preserved across S3?
Is this always the case for device memory? (iow: contents of the BARs
and possibly the PCI config space?)
> (This
> lack of understanding on my part is why I didn't associate the last
> paragraph of the description with this extra change, when you first sent it
> in this shape on the original thread.)
At least for the AMD IOMMU driver it seems to be expected. See how
amd_iommu_resume() performs a pair of disable_iommu() and
enable_iommu() calls, and in the enable_iommu() function there's a
call to set_{msi,x2apic}_affinity() that's expected to (re)set the
interrupts. Or at least that would be my understanding.
This change reverts the behavior to what it used to be prior to
8e60d47cf011 for the suspend and resume paths. I'm afraid I don't
have a sensible way to test changes in that area, so I cannot
investigate much.
Thanks, Roger.
next prev parent reply other threads:[~2025-03-18 8:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-18 8:29 [PATCH] x86/msi: always propagate MSI writes when not in active system mode Roger Pau Monne
2025-03-18 8:36 ` Jan Beulich
2025-03-18 8:54 ` Roger Pau Monné [this message]
2025-03-18 10:14 ` Jan Beulich
2025-03-18 10:45 ` Roger Pau Monné
2025-03-18 11:31 ` Jan Beulich
2025-03-18 11:23 ` Marek Marczykowski-Górecki
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=Z9k0tL30_yLuj5kM@macbook.local \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=marmarek@invisiblethingslab.com \
--cc=xen-devel@lists.xenproject.org \
/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.