driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9KBKD
------------------------------------------------------------------
Add erratum 162200803 for hip10c and exclude GICv4.1 for hip10/hip10c erratum 162200803.
Fixes: 12e11032205e ("irqchip: gicv3: Add workaround for hip09 erratum 162200803") Signed-off-by: caijian caijian11@h-partners.com Signed-off-by: Zhou Wang wangzhou1@hisilicon.com --- Documentation/arch/arm64/silicon-errata.rst | 2 +- arch/arm64/kvm/vgic/vgic-mmio-v3.c | 2 +- arch/arm64/kvm/vgic/vgic-mmio.h | 2 +- drivers/irqchip/irq-gic-v3.c | 24 +++++++++++++-------- 4 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/Documentation/arch/arm64/silicon-errata.rst b/Documentation/arch/arm64/silicon-errata.rst index efd57b87f096..db761bb448b1 100644 --- a/Documentation/arch/arm64/silicon-errata.rst +++ b/Documentation/arch/arm64/silicon-errata.rst @@ -216,7 +216,7 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | Hisilicon | SMMUv3 | #162100602 | HISILICON_ERRATUM_162100602 | +----------------+-----------------+-----------------+-----------------------------+ -| Hisilicon | Hip09 | #162200803 | N/A | +| Hisilicon | Hip{10,10C} | #162200803 | N/A | +----------------+-----------------+-----------------+-----------------------------+ | Hisilicon | Hip09 | #162200806 | N/A | +----------------+-----------------+-----------------+-----------------------------+ diff --git a/arch/arm64/kvm/vgic/vgic-mmio-v3.c b/arch/arm64/kvm/vgic/vgic-mmio-v3.c index c29c0b5669a6..909584cd21c7 100644 --- a/arch/arm64/kvm/vgic/vgic-mmio-v3.c +++ b/arch/arm64/kvm/vgic/vgic-mmio-v3.c @@ -84,7 +84,7 @@ static unsigned long vgic_mmio_read_v3_misc(struct kvm_vcpu *vcpu, value |= (INTERRUPT_ID_BITS_ITS - 1) << 19; value |= GICD_TYPER_LPIS; /* Limit the number of vlpis to 4096 */ - if (kvm_vgic_global_state.flags & FLAGS_WORKAROUND_HIP09_ERRATUM_162200803) + if (kvm_vgic_global_state.flags & FLAGS_WORKAROUND_HIP10_ERRATUM_162200803) value |= 11 << GICD_TYPER_NUM_LPIS_SHIFT;
} else { diff --git a/arch/arm64/kvm/vgic/vgic-mmio.h b/arch/arm64/kvm/vgic/vgic-mmio.h index 0477ec95e96c..b50235ffb002 100644 --- a/arch/arm64/kvm/vgic/vgic-mmio.h +++ b/arch/arm64/kvm/vgic/vgic-mmio.h @@ -5,7 +5,7 @@ #ifndef __KVM_ARM_VGIC_MMIO_H__ #define __KVM_ARM_VGIC_MMIO_H__
-#define FLAGS_WORKAROUND_HIP09_ERRATUM_162200803 (1ULL << 4) +#define FLAGS_WORKAROUND_HIP10_ERRATUM_162200803 (1ULL << 4) #define FLAGS_WORKAROUND_HIP09_ERRATUM_162200806 (1ULL << 5)
struct vgic_register_region { diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 7b450c1dc616..9a7a710aa281 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -45,7 +45,7 @@ #define FLAGS_WORKAROUND_CAVIUM_ERRATUM_38539 (1ULL << 1) #define FLAGS_WORKAROUND_MTK_GICR_SAVE (1ULL << 2) #define FLAGS_WORKAROUND_ASR_ERRATUM_8601001 (1ULL << 3) -#define FLAGS_WORKAROUND_HIP09_ERRATUM_162200803 (1ULL << 4) +#define FLAGS_WORKAROUND_HIP10_ERRATUM_162200803 (1ULL << 4) #define FLAGS_WORKAROUND_HIP09_ERRATUM_162200806 (1ULL << 5)
#define GIC_IRQ_TYPE_PARTITION (GIC_IRQ_TYPE_LPI + 1) @@ -2116,11 +2116,11 @@ static bool rd_set_non_coherent(void *data) return true; }
-static bool gic_enable_quirk_hip09_162200803(void *data) +static bool gic_enable_quirk_hip10_10c_162200803(void *data) { struct gic_chip_data *d = data;
- d->flags |= FLAGS_WORKAROUND_HIP09_ERRATUM_162200803; + d->flags |= FLAGS_WORKAROUND_HIP10_ERRATUM_162200803;
return true; } @@ -2206,10 +2206,16 @@ static const struct gic_quirk gic_quirks[] = { .init = rd_set_non_coherent, }, { - .desc = "GICv3: HIP09 erratum 162200803", + .desc = "GICv3: HIP10 erratum 162200803", .iidr = 0x01050736, .mask = 0xffffffff, - .init = gic_enable_quirk_hip09_162200803, + .init = gic_enable_quirk_hip10_10c_162200803, + }, + { + .desc = "GICv3: HIP10C erratum 162200803", + .iidr = 0x00061736, + .mask = 0xffffffff, + .init = gic_enable_quirk_hip10_10c_162200803, }, { .desc = "GICv3: HIP09 erratum 162200806", @@ -2528,8 +2534,8 @@ static void __init gic_of_setup_kvm_info(struct device_node *node) #ifdef CONFIG_VIRT_VTIMER_IRQ_BYPASS gic_v3_kvm_info.has_vtimer = gic_data.rdists.has_vtimer; #endif - if (gic_v3_kvm_info.has_v4) - gic_v3_kvm_info.flags = gic_data.flags; + if (gic_v3_kvm_info.has_v4 && !gic_v3_kvm_info.has_v4_1) + gic_v3_kvm_info.flags |= gic_data.flags & FLAGS_WORKAROUND_HIP10_ERRATUM_162200803; vgic_set_kvm_info(&gic_v3_kvm_info); }
@@ -2882,8 +2888,8 @@ static void __init gic_acpi_setup_kvm_info(void) #ifdef CONFIG_VIRT_VTIMER_IRQ_BYPASS gic_v3_kvm_info.has_vtimer = gic_data.rdists.has_vtimer; #endif - if (gic_v3_kvm_info.has_v4) - gic_v3_kvm_info.flags = gic_data.flags; + if (gic_v3_kvm_info.has_v4 && !gic_v3_kvm_info.has_v4_1) + gic_v3_kvm_info.flags |= gic_data.flags & FLAGS_WORKAROUND_HIP10_ERRATUM_162200803; vgic_set_kvm_info(&gic_v3_kvm_info); }