[tip:tools/kvm] kvm tools: ARM: set interrupt priority mask in secondary boot path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  76d82083b5322cd166bf8262350e25e11a538430
Gitweb:     http://git.kernel.org/tip/76d82083b5322cd166bf8262350e25e11a538430
Author:     Marc Zyngier <Marc.Zyngier@xxxxxxx>
AuthorDate: Wed, 5 Dec 2012 16:32:15 +0000
Committer:  Pekka Enberg <penberg@xxxxxxxxxx>
CommitDate: Mon, 10 Dec 2012 09:29:37 +0200

kvm tools: ARM: set interrupt priority mask in secondary boot path

A bug in the KVM GIC init code set the priority mask to the
highest possible value, while the reset value should be zero.

Now that the kernel bug is fixed, kvm-tool must properly configure
its GIC CPU interface in order to receive the boot IPI.  Just set
the GICC_PMR register to the maximum value (0xff), and it "just works".

Signed-off-by: Marc Zyngier <marc.zyngier@xxxxxxx>
[will: added #define for PMR offset]
Signed-off-by: Will Deacon <will.deacon@xxxxxxx>
Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx>
---
 tools/kvm/arm/aarch32/smp-pen.S        | 4 ++++
 tools/kvm/arm/include/arm-common/gic.h | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/tools/kvm/arm/aarch32/smp-pen.S b/tools/kvm/arm/aarch32/smp-pen.S
index 0861171..1e63c95 100644
--- a/tools/kvm/arm/aarch32/smp-pen.S
+++ b/tools/kvm/arm/aarch32/smp-pen.S
@@ -17,6 +17,10 @@ smp_pen_start:
 	mov	r1, #GIC_CPUI_CTLR_EN
 	str	r1, [r0]
 
+	@ Set the priority mask to accept any interrupt
+	mov	r1, #GIC_CPUI_PMR_MIN_PRIO
+	str	r1, [r0, #GIC_CPUI_OFF_PMR]
+
 	@ Now wait for the primary to poke us
 	adr	r0, smp_jump_addr
 	ldr	r1, =AARCH32_SMP_BAD_MAGIC
diff --git a/tools/kvm/arm/include/arm-common/gic.h b/tools/kvm/arm/include/arm-common/gic.h
index d534174..d6a18e1 100644
--- a/tools/kvm/arm/include/arm-common/gic.h
+++ b/tools/kvm/arm/include/arm-common/gic.h
@@ -19,6 +19,9 @@
 #define GIC_FDT_IRQ_PPI_CPU_MASK	(0xff << GIC_FDT_IRQ_PPI_CPU_SHIFT)
 
 #define GIC_CPUI_CTLR_EN		(1 << 0)
+#define GIC_CPUI_PMR_MIN_PRIO		0xff
+
+#define GIC_CPUI_OFF_PMR		4
 
 #define GIC_MAX_CPUS			8
 #define GIC_MAX_IRQ			255
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux