|
14 | 14 | #include <linux/dma-iommu.h> |
15 | 15 | #include <linux/efi.h> |
16 | 16 | #include <linux/interrupt.h> |
| 17 | +#include <linux/iopoll.h> |
17 | 18 | #include <linux/irqdomain.h> |
18 | 19 | #include <linux/list.h> |
19 | 20 | #include <linux/log2.h> |
@@ -3672,6 +3673,20 @@ static int its_vpe_set_affinity(struct irq_data *d, |
3672 | 3673 | return IRQ_SET_MASK_OK_DONE; |
3673 | 3674 | } |
3674 | 3675 |
|
| 3676 | +static void its_wait_vpt_parse_complete(void) |
| 3677 | +{ |
| 3678 | + void __iomem *vlpi_base = gic_data_rdist_vlpi_base(); |
| 3679 | + u64 val; |
| 3680 | + |
| 3681 | + if (!gic_rdists->has_vpend_valid_dirty) |
| 3682 | + return; |
| 3683 | + |
| 3684 | + WARN_ON_ONCE(readq_relaxed_poll_timeout(vlpi_base + GICR_VPENDBASER, |
| 3685 | + val, |
| 3686 | + !(val & GICR_VPENDBASER_Dirty), |
| 3687 | + 10, 500)); |
| 3688 | +} |
| 3689 | + |
3675 | 3690 | static void its_vpe_schedule(struct its_vpe *vpe) |
3676 | 3691 | { |
3677 | 3692 | void __iomem *vlpi_base = gic_data_rdist_vlpi_base(); |
@@ -3702,6 +3717,8 @@ static void its_vpe_schedule(struct its_vpe *vpe) |
3702 | 3717 | val |= vpe->idai ? GICR_VPENDBASER_IDAI : 0; |
3703 | 3718 | val |= GICR_VPENDBASER_Valid; |
3704 | 3719 | gicr_write_vpendbaser(val, vlpi_base + GICR_VPENDBASER); |
| 3720 | + |
| 3721 | + its_wait_vpt_parse_complete(); |
3705 | 3722 | } |
3706 | 3723 |
|
3707 | 3724 | static void its_vpe_deschedule(struct its_vpe *vpe) |
@@ -3910,6 +3927,8 @@ static void its_vpe_4_1_schedule(struct its_vpe *vpe, |
3910 | 3927 | val |= FIELD_PREP(GICR_VPENDBASER_4_1_VPEID, vpe->vpe_id); |
3911 | 3928 |
|
3912 | 3929 | gicr_write_vpendbaser(val, vlpi_base + GICR_VPENDBASER); |
| 3930 | + |
| 3931 | + its_wait_vpt_parse_complete(); |
3913 | 3932 | } |
3914 | 3933 |
|
3915 | 3934 | static void its_vpe_4_1_deschedule(struct its_vpe *vpe, |
@@ -4035,6 +4054,7 @@ static int its_sgi_set_affinity(struct irq_data *d, |
4035 | 4054 | * not on the host (since they can only be targetting a vPE). |
4036 | 4055 | * Tell the kernel we've done whatever it asked for. |
4037 | 4056 | */ |
| 4057 | + irq_data_update_effective_affinity(d, mask_val); |
4038 | 4058 | return IRQ_SET_MASK_OK; |
4039 | 4059 | } |
4040 | 4060 |
|
|
0 commit comments