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

[Xen-changelog] [xen-unstable] arm: enable interrupts while handling traps


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Tue, 26 Jun 2012 22:33:10 +0000
  • Delivery-date: Tue, 26 Jun 2012 22:33:17 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1340724227 -3600
# Node ID 8af8392e3a29a924663c329a417e1912e9fbe867
# Parent  e9e2127ef47a70dc926e4eed251c25ceafd7403a
arm: enable interrupts while handling traps

For most traps we can do this as soon as we have saved the necessary state.
For IRQs and FIQs we must wait until we have acked the interrupt with the GIC.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r e9e2127ef47a -r 8af8392e3a29 xen/arch/arm/entry.S
--- a/xen/arch/arm/entry.S      Tue Jun 26 16:23:46 2012 +0100
+++ b/xen/arch/arm/entry.S      Tue Jun 26 16:23:47 2012 +0100
@@ -46,6 +46,17 @@ save_guest_regs:
        ALIGN;                                                                  
                        \
 trap_##trap:                                                                   
                        \
        SAVE_ALL;                                                               
                        \
+       cpsie i;        /* local_irq_enable */                                  
                        \
+       adr lr, return_from_trap;                                               
                        \
+       mov r0, sp;                                                             
                        \
+       mov r11, sp;                                                            
                        \
+       bic sp, #7; /* Align the stack pointer (noop on guest trap) */          
                        \
+       b do_trap_##trap
+
+#define DEFINE_TRAP_ENTRY_NOIRQ(trap)                                          
                        \
+       ALIGN;                                                                  
                        \
+trap_##trap:                                                                   
                        \
+       SAVE_ALL;                                                               
                        \
        adr lr, return_from_trap;                                               
                        \
        mov r0, sp;                                                             
                        \
        mov r11, sp;                                                            
                        \
@@ -69,8 +80,8 @@ DEFINE_TRAP_ENTRY(supervisor_call)
 DEFINE_TRAP_ENTRY(prefetch_abort)
 DEFINE_TRAP_ENTRY(data_abort)
 DEFINE_TRAP_ENTRY(hypervisor)
-DEFINE_TRAP_ENTRY(irq)
-DEFINE_TRAP_ENTRY(fiq)
+DEFINE_TRAP_ENTRY_NOIRQ(irq)
+DEFINE_TRAP_ENTRY_NOIRQ(fiq)
 
 return_from_trap:
        mov sp, r11
@@ -83,7 +94,7 @@ ENTRY(return_to_new_vcpu)
 ENTRY(return_to_guest)
        mov r11, sp
        bic sp, #7 /* Align the stack pointer */
-       bl leave_hypervisor_tail
+       bl leave_hypervisor_tail /* Disables interrupts on return */
        mov sp, r11
        RESTORE_ONE_BANKED(SP_usr)
        /* LR_usr is the same physical register as lr and is restored below */
diff -r e9e2127ef47a -r 8af8392e3a29 xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c        Tue Jun 26 16:23:46 2012 +0100
+++ b/xen/arch/arm/gic.c        Tue Jun 26 16:23:47 2012 +0100
@@ -509,6 +509,8 @@ void gic_interrupt(struct cpu_user_regs 
     uint32_t intack = GICC[GICC_IAR];
     unsigned int irq = intack & GICC_IA_IRQ;
 
+    local_irq_enable();
+
     if ( irq == 1023 )
         /* Spurious interrupt */
         return;
diff -r e9e2127ef47a -r 8af8392e3a29 xen/arch/arm/traps.c
--- a/xen/arch/arm/traps.c      Tue Jun 26 16:23:46 2012 +0100
+++ b/xen/arch/arm/traps.c      Tue Jun 26 16:23:47 2012 +0100
@@ -412,7 +412,6 @@ static void do_debug_trap(struct cpu_use
 static void do_trap_hypercall(struct cpu_user_regs *regs, unsigned long iss)
 {
     arm_hypercall_t *call = NULL;
-    local_irq_enable();
 
     if ( iss != XEN_HYPERCALL_TAG )
     {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.