@@ -976,10 +976,20 @@ intel_ir_set_affinity(struct irq_data *data, const struct cpumask *mask,
{
struct intel_ir_data *ir_data = data->chip_data;
struct irte *irte = &ir_data->irte_entry;
+ struct irte_pi *irte_pi = (struct irte_pi *)irte;
struct irq_cfg *cfg = irqd_cfg(data);
struct irq_data *parent = data->parent_data;
int ret;
+ /*
+ * If the interrupt is for posting, it is used by guests,
+ * we cannot set irq affinity here.
+ */
+ if (irte_pi->pst == 1) {
+ pr_warn("cannot set irq affinity for posted-interrupts\n");
+ return -EBUSY;
+ }
+
ret = parent->chip->irq_set_affinity(parent, mask, force);
if (ret < 0 || ret == IRQ_SET_MASK_OK_DONE)
return ret;