WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

[XenPPC] [ppc/xen-unstable.hg] [POWERPC][XEN] Stop sharing the MPIC betw

Changeset 50fab2124ef0 : 
http://xenbits.xensource.com/ext/ppc/xen-unstable.hg?cmd=changeset;node=50fab2124ef0

        [POWERPC][XEN] Stop sharing the MPIC between dom0 and Xen.
        Xen is now the sole owner of the MPIC. Requires Xen Linux 2.6.18.
        Signed-off-by: Hollis Blanchard <hollisb@xxxxxxxxxx>

diffstat:

3 files changed, 14 insertions(+), 133 deletions(-)
xen/arch/powerpc/external.c  |   85 ------------------------------------------
xen/arch/powerpc/mpic_init.c |   58 +++++-----------------------
xen/arch/powerpc/mpic_init.h |    4 -

diffs (239 lines):

diff -r abc2bd44e1dc -r 50fab2124ef0 xen/arch/powerpc/external.c
--- a/xen/arch/powerpc/external.c       Fri Jul 06 16:21:39 2007 -0500
+++ b/xen/arch/powerpc/external.c       Fri Jul 06 16:25:10 2007 -0500
@@ -43,8 +43,6 @@ unsigned long io_apic_irqs;
 unsigned long io_apic_irqs;
 int ioapic_ack_new = 1;
 
-static struct hw_interrupt_type *hc_irq;
-
 /* deliver_ee: called with interrupts off when resuming every vcpu */
 void deliver_ee(struct cpu_user_regs *regs)
 {
@@ -81,6 +79,7 @@ void do_external(struct cpu_user_regs *r
     BUG_ON(mfmsr() & MSR_EE);
 
     vec = xen_mpic_get_irq(regs);
+    DBG(">HV: vec=%d, pc=0x%lx, msr=0x%lx\n", vec, regs->pc, regs->msr);
 
     if (irq_desc[vec].status & IRQ_PER_CPU) {
         /* x86 do_IRQ does not respect the per cpu flag.  */
@@ -90,7 +89,6 @@ void do_external(struct cpu_user_regs *r
         desc->action->handler(vector_to_irq(vec), desc->action->dev_id, regs);
         desc->handler->end(vec);
     } else if (vec != -1) {
-        DBG("EE:0x%lx isrc: %d\n", regs->msr, vec);
         regs->entry_vector = vec;
         do_IRQ(regs);
 
@@ -106,87 +104,9 @@ void do_external(struct cpu_user_regs *r
     }
 }
 
-static int xen_local_irq(unsigned int irq)
-{
-    irq_desc_t *desc;
-    unsigned int vector;
-
-    vector = irq_to_vector(irq);
-    desc = &irq_desc[vector];
-
-    return !(desc->status & IRQ_GUEST);
-}
-
-static unsigned int xen_startup_irq(unsigned int irq)
-{
-    DBG("%s(%d)\n", __func__, irq);
-    if (xen_local_irq(irq)) {
-        return hc_irq->startup(irq);
-    }
-    return 0;
-}
-
-static void xen_shutdown_irq(unsigned int irq)
-{
-    DBG("%s(%d)\n", __func__, irq);
-    if (xen_local_irq(irq)) {
-        hc_irq->shutdown(irq);
-    }
-}
-
-static void xen_enable_irq(unsigned int irq)
-{
-    DBG("%s(%d)\n", __func__, irq);
-    if (xen_local_irq(irq)) {
-        hc_irq->enable(irq);
-    }
-}
-
-static void xen_disable_irq(unsigned int irq)
-{
-    DBG("%s(%d)\n", __func__, irq);
-    if (xen_local_irq(irq)) {
-        hc_irq->disable(irq);
-    }
-}
-    
-static void xen_ack_irq(unsigned int irq)
-{
-    DBG("%s(%d)\n", __func__, irq);
-    if (xen_local_irq(irq)) {
-        if (hc_irq->ack) hc_irq->ack(irq);
-    }
-}
-
-static void xen_end_irq(unsigned int irq)
-{
-    DBG("%s(%d)\n", __func__, irq);
-    if (xen_local_irq(irq)) {
-        hc_irq->end(irq);
-    }
-}
-
-static void xen_set_affinity(unsigned int irq, cpumask_t mask)
-{
-    DBG("%s(%d)\n", __func__, irq);
-    if (xen_local_irq(irq)) {
-        if (hc_irq->set_affinity) hc_irq->set_affinity(irq, mask);
-    }
-}
-
-static struct hw_interrupt_type xen_irq = {
-    .startup = xen_startup_irq,
-    .enable = xen_enable_irq,
-    .disable = xen_disable_irq,
-    .shutdown = xen_shutdown_irq,
-    .ack = xen_ack_irq,
-    .end = xen_end_irq,
-    .set_affinity = xen_set_affinity,
-};
-
 void init_IRQ(void)
 {
-    hc_irq = xen_mpic_init(&xen_irq);
+    xen_mpic_init();
 }
 
 void ack_APIC_irq(void)
@@ -251,7 +171,6 @@ int ioapic_guest_read(unsigned long phys
 int ioapic_guest_read(unsigned long physbase, unsigned int reg, u32 *pval)
 {
     BUG_ON(pval != pval);
-
     return 0;
 }
 
diff -r abc2bd44e1dc -r 50fab2124ef0 xen/arch/powerpc/mpic_init.c
--- a/xen/arch/powerpc/mpic_init.c      Fri Jul 06 16:21:39 2007 -0500
+++ b/xen/arch/powerpc/mpic_init.c      Fri Jul 06 16:25:10 2007 -0500
@@ -322,43 +322,6 @@ static int find_mpic(void)
     return rc;
 }
 
-#ifdef CONFIG_SHARE_MPIC
-static struct hw_interrupt_type hc_irq;
-
-static struct hw_interrupt_type *share_mpic(
-    struct hw_interrupt_type *mpic_irq,
-    struct hw_interrupt_type *xen_irq)
-{
-    hc_irq.startup = mpic_irq->startup;
-    mpic_irq->startup = xen_irq->startup;
-
-    hc_irq.enable = mpic_irq->enable;
-    mpic_irq->enable = xen_irq->enable;
-
-    hc_irq.disable = mpic_irq->disable;
-    mpic_irq->disable = xen_irq->disable;
-
-    hc_irq.shutdown = mpic_irq->shutdown;
-    mpic_irq->shutdown = xen_irq->shutdown;
-
-    hc_irq.ack = mpic_irq->ack;
-    mpic_irq->ack = xen_irq->ack;
-
-    hc_irq.end = mpic_irq->end;
-    mpic_irq->end = xen_irq->end;
-
-    hc_irq.set_affinity = mpic_irq->set_affinity;
-    mpic_irq->set_affinity = xen_irq->set_affinity;
-
-    return &hc_irq;
-}
-
-#else  /* CONFIG_SHARE_MPIC */
-
-#define share_mpic(M,X) (M)
-
-#endif
-
 static unsigned int mpic_startup_ipi(unsigned int irq)
 {
     mpic->hc_ipi.enable(irq);
@@ -395,7 +358,11 @@ int request_irq(unsigned int irq,
     return retval;
 }
 
-struct hw_interrupt_type *xen_mpic_init(struct hw_interrupt_type *xen_irq)
+static void dummy_ack(unsigned int irq)
+{
+}
+
+void xen_mpic_init(void)
 {
     unsigned int isu_size;
     unsigned int irq_offset;
@@ -403,7 +370,6 @@ struct hw_interrupt_type *xen_mpic_init(
     unsigned int ipi_offset;
     unsigned char *senses;
     unsigned int senses_count;
-    struct hw_interrupt_type *hit;
 
     printk("%s: start\n", __func__);
 
@@ -420,7 +386,7 @@ struct hw_interrupt_type *xen_mpic_init(
 
     if (find_mpic()) {
         printk("%s: ERROR: Could not find open pic.\n", __func__);
-        return NULL;
+        return;
     }
 
     mpic = mpic_alloc(opic_addr,
@@ -431,17 +397,15 @@ struct hw_interrupt_type *xen_mpic_init(
     BUG_ON(mpic == NULL);
     mpic_init(mpic);
 
-    hit = share_mpic(&mpic->hc_irq, xen_irq);
-
     printk("%s: success\n", __func__);
 
-    mpic->hc_ipi.ack = xen_irq->ack;
+    mpic->hc_irq.ack = dummy_ack;
+    mpic->hc_ipi.ack = dummy_ack;
     mpic->hc_ipi.startup = mpic_startup_ipi;
     mpic_request_ipis();
-
-    return hit;
-}
-
+}
+
+/* Note: reading the vector implicitly ACKs it in hardware. */
 int xen_mpic_get_irq(struct cpu_user_regs *regs)
 {
     BUG_ON(mpic == NULL);
diff -r abc2bd44e1dc -r 50fab2124ef0 xen/arch/powerpc/mpic_init.h
--- a/xen/arch/powerpc/mpic_init.h      Fri Jul 06 16:21:39 2007 -0500
+++ b/xen/arch/powerpc/mpic_init.h      Fri Jul 06 16:25:10 2007 -0500
@@ -21,9 +21,7 @@
 #ifndef _MPIC_INIT_H
 #define _MPIC_INIT_H
 
-extern struct hw_interrupt_type *xen_mpic_init(
-    struct hw_interrupt_type *xen_irq);
-
+extern void xen_mpic_init(void);
 extern int xen_mpic_get_irq(struct cpu_user_regs *regs);
 
 #endif  /* #ifndef _MPIC_INIT_H */

_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [XenPPC] [ppc/xen-unstable.hg] [POWERPC][XEN] Stop sharing the MPIC betwe..., patchbot <=