Skip to content

Commit 0717220

Browse files
sean-jcbonzini
authored andcommitted
iommu/amd: Return an error if vCPU affinity is set for non-vCPU IRTE
Return -EINVAL instead of success if amd_ir_set_vcpu_affinity() is invoked without use_vapic; lying to KVM about whether or not the IRTE was configured to post IRQs is all kinds of bad. Fixes: d98de49 ("iommu/amd: Enable vAPIC interrupt remapping mode by default") Signed-off-by: Sean Christopherson <[email protected]> Message-ID: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent f1fb088 commit 0717220

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iommu/amd/iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3879,7 +3879,7 @@ static int amd_ir_set_vcpu_affinity(struct irq_data *data, void *vcpu_info)
38793879
* we should not modify the IRTE
38803880
*/
38813881
if (!dev_data || !dev_data->use_vapic)
3882-
return 0;
3882+
return -EINVAL;
38833883

38843884
ir_data->cfg = irqd_cfg(data);
38853885
pi_data->ir_data = ir_data;

0 commit comments

Comments
 (0)