From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Cc: stefano.stabellini@citrix.com, tim@xen.org,
Ian Campbell <ian.campbell@citrix.com>
Subject: [PATCH 1/4] arm: disable distributor delivery on boot CPU only
Date: Mon, 6 Aug 2012 11:34:57 +0000 [thread overview]
Message-ID: <1344252900-26148-1-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1344252872.11339.27.camel@zakaz.uk.xensource.com>
The secondary processors do not call enter_hyp_mode until the boot CPU
has brought most of the system up, including enabling delivery via the
distributor. This means that bringing up secondary CPUs unexpectedly
disables the GICD again, meaning we get no further interrupts on any
CPU.
It's not clear that the distributor actually needs to be disabled to
modify the group registers but it seems reasonable that the bringup
code should make sure the GICD is disabled even if not doing the
transition to hyp mode, so move this to the main flow of head.S and
only do it on the boot processor.
For completeness also disable the GICC (CPU interface) on all CPUs
too.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
xen/arch/arm/head.S | 14 ++++++++++++++
xen/arch/arm/mode_switch.S | 14 +++++++++-----
2 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/xen/arch/arm/head.S b/xen/arch/arm/head.S
index cdbe011..a69bf72 100644
--- a/xen/arch/arm/head.S
+++ b/xen/arch/arm/head.S
@@ -67,6 +67,12 @@ start:
add r8, r10 /* r8 := paddr(DTB) */
#endif
+ /* Disable interrupt delivery at the GIC's CPU interface */
+ mov r0, #GIC_BASE_ADDRESS
+ add r0, r0, #GIC_CR_OFFSET
+ mov r1, #0
+ str r1, [r0]
+
/* Are we the boot CPU? */
mov r12, #0 /* r12 := CPU ID */
mrc CP32(r0, MPIDR)
@@ -85,8 +91,16 @@ start:
ldr r1, [r0] /* Which CPU is being booted? */
teq r1, r12 /* Is it us? */
bne 1b
+ b secondary_cpu
boot_cpu:
+ /* Setup which only needs to be done once, on the boot CPU */
+ mov r0, #GIC_BASE_ADDRESS
+ add r0, r0, #GIC_DR_OFFSET
+ mov r1, #0
+ str r1, [r0] /* Disable delivery in the distributor */
+
+secondary_cpu:
#ifdef EARLY_UART_ADDRESS
ldr r11, =EARLY_UART_ADDRESS /* r11 := UART base address */
teq r12, #0 /* CPU 0 sets up the UART too */
diff --git a/xen/arch/arm/mode_switch.S b/xen/arch/arm/mode_switch.S
index f5549d7..9211d26 100644
--- a/xen/arch/arm/mode_switch.S
+++ b/xen/arch/arm/mode_switch.S
@@ -49,13 +49,17 @@ enter_hyp_mode:
/* Continuing ugliness: Set up the GIC so NS state owns interrupts */
mov r0, #GIC_BASE_ADDRESS
add r0, r0, #GIC_DR_OFFSET
- mov r1, #0
- str r1, [r0] /* Disable delivery in the distributor */
add r0, r0, #0x80 /* GICD_IGROUP0 */
- mov r2, #0xffffffff /* All interrupts to group 1 */
+ mov r2, #0xffffffff /* Interrupts 0-31 (SGI&PPI) to group 1 */
+ /* The remaining interrupts are Shared Periphal Interrupts and so
+ * need reconfiguring only once, on the boot CPU */
str r2, [r0]
- str r2, [r0, #4]
- str r2, [r0, #8]
+ teq r12, #0
+ bne skip_spi
+ str r2, [r0, #4] /* Interrupts 32-63 (SPI) to group 1 */
+ str r2, [r0, #8] /* Interrupts 64-95 (SPI) to group 1 */
+skip_spi:
+
/* Must drop priority mask below 0x80 before entering NS state */
mov r0, #GIC_BASE_ADDRESS
add r0, r0, #GIC_CR_OFFSET
--
1.7.9.1
next prev parent reply other threads:[~2012-08-06 11:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-06 11:34 [PATCH 0/4] arm: SMP interrupt handling fixes Ian Campbell
2012-08-06 11:34 ` Ian Campbell [this message]
2012-08-06 11:55 ` [PATCH 1/4] arm: disable distributor delivery on boot CPU only Tim Deegan
2012-08-06 11:56 ` Ian Campbell
2012-08-06 13:45 ` Ian Campbell
2012-08-07 9:42 ` Tim Deegan
2012-08-09 9:10 ` Ian Campbell
2012-08-09 11:26 ` Tim Deegan
2012-08-09 11:37 ` Ian Campbell
2012-08-06 11:34 ` [PATCH 2/4] arm: don't bother setting up vtimer, vgic etc on idle CPUs Ian Campbell
2012-08-06 11:34 ` [PATCH 3/4] arm/vtimer: convert result to ticks when reading CNTPCT register Ian Campbell
2012-08-06 13:46 ` Ian Campbell
2012-08-06 11:35 ` [PATCH 4/4] arm: Use per-CPU irq_desc for PPIs and SGIs Ian Campbell
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=1344252900-26148-1-git-send-email-ian.campbell@citrix.com \
--to=ian.campbell@citrix.com \
--cc=stefano.stabellini@citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.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).