Skip to content

Commit 40e8133

Browse files
jraman567gregkh
authored andcommitted
iommu/vt-d: Fix usage of force parameter in intel_ir_reconfigure_irte()
[ Upstream commit aa7528f ] It was noticed that the IRTE configured for guest OS kernel was over-written while the guest was running. As a result, vt-d Posted Interrupts configured for the guest are not being delivered directly, and instead bounces off the host. Every interrupt delivery takes a VM Exit. It was noticed that the following stack is doing the over-write: [ 147.463177] modify_irte+0x171/0x1f0 [ 147.463405] intel_ir_set_affinity+0x5c/0x80 [ 147.463641] msi_domain_set_affinity+0x32/0x90 [ 147.463881] irq_do_set_affinity+0x37/0xd0 [ 147.464125] irq_set_affinity_locked+0x9d/0xb0 [ 147.464374] __irq_set_affinity+0x42/0x70 [ 147.464627] write_irq_affinity.isra.5+0xe1/0x110 [ 147.464895] proc_reg_write+0x38/0x70 [ 147.465150] __vfs_write+0x36/0x180 [ 147.465408] ? handle_mm_fault+0xdf/0x200 [ 147.465671] ? _cond_resched+0x15/0x30 [ 147.465936] vfs_write+0xad/0x1a0 [ 147.466204] SyS_write+0x52/0xc0 [ 147.466472] do_syscall_64+0x74/0x1a0 [ 147.466744] entry_SYSCALL_64_after_hwframe+0x3d/0xa2 reversing the sense of force check in intel_ir_reconfigure_irte() restores proper posted interrupt functionality Signed-off-by: Jagannathan Raman <[email protected]> Fixes: d491bdf ('iommu/vt-d: Reevaluate vector configuration on activate()') Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f41c744 commit 40e8133

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iommu/intel_irq_remapping.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,7 @@ static void intel_ir_reconfigure_irte(struct irq_data *irqd, bool force)
11361136
irte->dest_id = IRTE_DEST(cfg->dest_apicid);
11371137

11381138
/* Update the hardware only if the interrupt is in remapped mode. */
1139-
if (!force || ir_data->irq_2_iommu.mode == IRQ_REMAPPING)
1139+
if (force || ir_data->irq_2_iommu.mode == IRQ_REMAPPING)
11401140
modify_irte(&ir_data->irq_2_iommu, irte);
11411141
}
11421142

0 commit comments

Comments
 (0)