diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2016-05-06 14:41:56 -0400 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2016-05-11 05:12:40 -0400 |
commit | 7c9b973061b03af62734f613f6abec46c0dd4a88 (patch) | |
tree | a3b7b2eec8c222855b54b3f1de8ca35daf8e470d | |
parent | 74c967aaffeace8a85fc3d7be773fd165ebde3da (diff) |
irqchip/gic-v3: Configure all interrupts as non-secure Group-1
The GICv3 driver wrongly assumes that it runs on the non-secure
side of a secure-enabled system, while it could be on a system
with a single security state, or a GICv3 with GICD_CTLR.DS set.
Either way, it is important to configure this properly, or
interrupts will simply not be delivered on this HW.
Cc: stable@vger.kernel.org
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
-rw-r--r-- | drivers/irqchip/irq-gic-v3.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index c3870a8f1be0..1a1ea4f733c1 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c | |||
@@ -393,6 +393,15 @@ static void __init gic_dist_init(void) | |||
393 | writel_relaxed(0, base + GICD_CTLR); | 393 | writel_relaxed(0, base + GICD_CTLR); |
394 | gic_dist_wait_for_rwp(); | 394 | gic_dist_wait_for_rwp(); |
395 | 395 | ||
396 | /* | ||
397 | * Configure SPIs as non-secure Group-1. This will only matter | ||
398 | * if the GIC only has a single security state. This will not | ||
399 | * do the right thing if the kernel is running in secure mode, | ||
400 | * but that's not the intended use case anyway. | ||
401 | */ | ||
402 | for (i = 32; i < gic_data.irq_nr; i += 32) | ||
403 | writel_relaxed(~0, base + GICD_IGROUPR + i / 8); | ||
404 | |||
396 | gic_dist_config(base, gic_data.irq_nr, gic_dist_wait_for_rwp); | 405 | gic_dist_config(base, gic_data.irq_nr, gic_dist_wait_for_rwp); |
397 | 406 | ||
398 | /* Enable distributor with ARE, Group1 */ | 407 | /* Enable distributor with ARE, Group1 */ |
@@ -510,6 +519,9 @@ static void gic_cpu_init(void) | |||
510 | 519 | ||
511 | rbase = gic_data_rdist_sgi_base(); | 520 | rbase = gic_data_rdist_sgi_base(); |
512 | 521 | ||
522 | /* Configure SGIs/PPIs as non-secure Group-1 */ | ||
523 | writel_relaxed(~0, rbase + GICR_IGROUPR0); | ||
524 | |||
513 | gic_cpu_config(rbase, gic_redist_wait_for_rwp); | 525 | gic_cpu_config(rbase, gic_redist_wait_for_rwp); |
514 | 526 | ||
515 | /* Give LPIs a spin */ | 527 | /* Give LPIs a spin */ |