From: Will Deacon <will.deacon@arm.com>
To: kvm@vger.kernel.org
Cc: penberg@kernel.org, marc.zyngier@arm.com,
Marc Zyngier <Marc.Zyngier@arm.com>,
Will Deacon <will.deacon@arm.com>
Subject: [PATCH 1/3] kvm-tool: ARM: set interrupt priority mask in secondary boot path
Date: Wed, 5 Dec 2012 16:32:15 +0000 [thread overview]
Message-ID: <1354725137-18077-1-git-send-email-will.deacon@arm.com> (raw)
From: Marc Zyngier <Marc.Zyngier@arm.com>
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".
Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
[will: added #define for PMR offset]
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
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
--
1.8.0
next reply other threads:[~2012-12-05 16:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-05 16:32 Will Deacon [this message]
2012-12-05 16:32 ` [PATCH 2/3] kvm tools: arm: fixup pre-processor guards for kvm-cpu-arch.h Will Deacon
2012-12-05 16:32 ` [PATCH 3/3] kvm tools: allow arch's to provide their own command-line options Will Deacon
2012-12-10 7:30 ` [PATCH 1/3] kvm-tool: ARM: set interrupt priority mask in secondary boot path Pekka Enberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1354725137-18077-1-git-send-email-will.deacon@arm.com \
--to=will.deacon@arm.com \
--cc=kvm@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=penberg@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).