]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iommu/vt-d: Don't clobber posted vCPU IRTE when host IRQ affinity changes
authorSean Christopherson <seanjc@google.com>
Wed, 19 Mar 2025 02:21:00 +0000 (10:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 Apr 2025 08:18:15 +0000 (10:18 +0200)
commit96ecaf76df42aec2da4aabf5920eb6827b7e326f
tree2e70eec1e14bf63b95988c4dc707f26b1a9f5756
parent5e62dfae5891412289926b3635249913aebcf157
iommu/vt-d: Don't clobber posted vCPU IRTE when host IRQ affinity changes

commit 688124cc541f60d26a7547f45637b23dada4e527 upstream.

Don't overwrite an IRTE that is posting IRQs to a vCPU with a posted MSI
entry if the host IRQ affinity happens to change.  If/when the IRTE is
reverted back to "host mode", it will be reconfigured as a posted MSI or
remapped entry as appropriate.

Drop the "mode" field, which doesn't differentiate between posted MSIs and
posted vCPUs, in favor of a dedicated posted_vcpu flag.  Note!  The two
posted_{msi,vcpu} flags are intentionally not mutually exclusive; an IRTE
can transition between posted MSI and posted vCPU.

Fixes: ed1e48ea4370 ("iommu/vt-d: Enable posted mode for device MSIs")
Cc: stable@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20250315025135.2365846-3-seanjc@google.com
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iommu/intel/irq_remapping.c