From: Santosh Shukla <santosh.shukla@amd.com>
To: <qemu-devel@nongnu.org>
Cc: <pbonzini@redhat.com>, <joao.m.martins@oracle.com>,
<Suravee.Suthikulpanit@amd.com>, <vasant.hegde@amd.com>,
<mtosatti@redhat.com>, <mst@redhat.com>,
<marcel.apfelbaum@gmail.com>, <santosh.shukla@amd.com>,
<alejandro.j.jimenez@oracle.com>
Subject: [PATCH v3 4/5] amd_iommu: Send notification when invalidate interrupt entry cache
Date: Fri, 27 Sep 2024 12:29:12 -0500 [thread overview]
Message-ID: <20240927172913.121477-5-santosh.shukla@amd.com> (raw)
In-Reply-To: <20240927172913.121477-1-santosh.shukla@amd.com>
From: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
In order to support AMD IOMMU interrupt remapping emulation with PCI
pass-through devices, QEMU needs to notify VFIO when guest IOMMU driver
updates and invalidate the guest interrupt remapping table (IRT), and
communicate information so that the host IOMMU driver can update
the shadowed interrupt remapping table in the host IOMMU.
Therefore, send notification when guest IOMMU emulates the IRT
invalidation commands.
Reviewed-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Signed-off-by: Santosh Shukla <santosh.shukla@amd.com>
---
v3:
- Fixed the typos in patch description.
hw/i386/amd_iommu.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
index 9b923f6eb482..38297376e7a9 100644
--- a/hw/i386/amd_iommu.c
+++ b/hw/i386/amd_iommu.c
@@ -431,6 +431,12 @@ static void amdvi_complete_ppr(AMDVIState *s, uint64_t *cmd)
trace_amdvi_ppr_exec();
}
+static void amdvi_intremap_inval_notify_all(AMDVIState *s, bool global,
+ uint32_t index, uint32_t mask)
+{
+ x86_iommu_iec_notify_all(X86_IOMMU_DEVICE(s), global, index, mask);
+}
+
static void amdvi_inval_all(AMDVIState *s, uint64_t *cmd)
{
if (extract64(cmd[0], 0, 60) || cmd[1]) {
@@ -438,6 +444,9 @@ static void amdvi_inval_all(AMDVIState *s, uint64_t *cmd)
s->cmdbuf + s->cmdbuf_head);
}
+ /* Notify global invalidation */
+ amdvi_intremap_inval_notify_all(s, true, 0, 0);
+
amdvi_iotlb_reset(s);
trace_amdvi_all_inval();
}
@@ -486,6 +495,9 @@ static void amdvi_inval_inttable(AMDVIState *s, uint64_t *cmd)
return;
}
+ /* Notify global invalidation */
+ amdvi_intremap_inval_notify_all(s, true, 0, 0);
+
trace_amdvi_intr_inval();
}
--
2.43.5
next prev parent reply other threads:[~2024-09-27 17:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-27 17:29 [PATCH v3 0/5] Interrupt Remap support for emulated amd viommu Santosh Shukla
2024-09-27 17:29 ` [PATCH v3 1/5] amd_iommu: Rename variable mmio to mr_mmio Santosh Shukla
2024-09-27 17:29 ` [PATCH v3 2/5] amd_iommu: Add support for pass though mode Santosh Shukla
2024-09-27 17:29 ` [PATCH v3 3/5] amd_iommu: Use shared memory region for Interrupt Remapping Santosh Shukla
2024-09-27 17:29 ` Santosh Shukla [this message]
2024-09-27 17:29 ` [PATCH v3 5/5] amd_iommu: Check APIC ID > 255 for XTSup Santosh Shukla
2024-10-09 6:05 ` [PATCH v3 0/5] Interrupt Remap support for emulated amd viommu Shukla, Santosh
2024-10-28 10:26 ` Shukla, Santosh
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=20240927172913.121477-5-santosh.shukla@amd.com \
--to=santosh.shukla@amd.com \
--cc=Suravee.Suthikulpanit@amd.com \
--cc=alejandro.j.jimenez@oracle.com \
--cc=joao.m.martins@oracle.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=vasant.hegde@amd.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).