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

[Xen-changelog] Propagate information about bad (or good) REGSEL register



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 42358db788fdbf648e9595ed468e7089077fd3a1
# Parent  29e9a0313c090e64cce0c97bd13f142f603e8817
Propagate information about bad (or good) REGSEL register
of chipset IO-APICs to Xen. If REGSEL is bad (some old SiS
chipsets) then we have a slower read-modify-write routine.
Loosely based on an original patch from Jan Beulich.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 29e9a0313c09 -r 42358db788fd 
linux-2.6-xen-sparse/arch/i386/kernel/io_apic-xen.c
--- a/linux-2.6-xen-sparse/arch/i386/kernel/io_apic-xen.c       Fri Apr 21 
10:11:00 2006 +0100
+++ b/linux-2.6-xen-sparse/arch/i386/kernel/io_apic-xen.c       Fri Apr 21 
10:44:54 2006 +0100
@@ -2483,6 +2483,12 @@ static int __init io_apic_bug_finalize(v
 {
        if(sis_apic_bug == -1)
                sis_apic_bug = 0;
+       if (xen_start_info->flags & SIF_INITDOMAIN) {
+               dom0_op_t op = { .cmd = DOM0_PLATFORM_QUIRK };
+               op.u.platform_quirk.quirk_id = sis_apic_bug ?
+                       QUIRK_IOAPIC_BAD_REGSEL : QUIRK_IOAPIC_GOOD_REGSEL;
+               HYPERVISOR_dom0_op(&op);
+       }
        return 0;
 }
 
diff -r 29e9a0313c09 -r 42358db788fd xen/arch/x86/dom0_ops.c
--- a/xen/arch/x86/dom0_ops.c   Fri Apr 21 10:11:00 2006 +0100
+++ b/xen/arch/x86/dom0_ops.c   Fri Apr 21 10:44:54 2006 +0100
@@ -379,12 +379,23 @@ long arch_do_dom0_op(struct dom0_op *op,
     case DOM0_PLATFORM_QUIRK:
     {
         extern int opt_noirqbalance;
-        switch ( op->u.platform_quirk.quirk_id )
+        int quirk_id = op->u.platform_quirk.quirk_id;
+        switch ( quirk_id )
         {
         case QUIRK_NOIRQBALANCING:
             printk("Platform quirk -- Disabling IRQ balancing/affinity.\n");
             opt_noirqbalance = 1;
             setup_ioapic_dest();
+            break;
+        case QUIRK_IOAPIC_BAD_REGSEL:
+        case QUIRK_IOAPIC_GOOD_REGSEL:
+#ifndef sis_apic_bug
+            sis_apic_bug = (quirk_id == QUIRK_IOAPIC_BAD_REGSEL);
+            printk("Platform info -- IO-APIC REGSEL is %s\n",
+                   sis_apic_bug ? "bad" : "good");
+#else
+            BUG_ON(sis_apic_bug == (quirk_id == QUIRK_IOAPIC_BAD_REGSEL));
+#endif
             break;
         default:
             ret = -EINVAL;
diff -r 29e9a0313c09 -r 42358db788fd xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c    Fri Apr 21 10:11:00 2006 +0100
+++ b/xen/arch/x86/io_apic.c    Fri Apr 21 10:44:54 2006 +0100
@@ -51,6 +51,14 @@ static DEFINE_SPINLOCK(vector_lock);
 static DEFINE_SPINLOCK(vector_lock);
 
 int skip_ioapic_setup;
+
+#ifndef sis_apic_bug
+/*
+ * Is the SiS APIC rmw bug present?
+ * -1 = don't know, 0 = no, 1 = yes
+ */
+int sis_apic_bug = -1;
+#endif
 
 /*
  * # of IRQ routing registers
diff -r 29e9a0313c09 -r 42358db788fd xen/include/asm-x86/io_apic.h
--- a/xen/include/asm-x86/io_apic.h     Fri Apr 21 10:11:00 2006 +0100
+++ b/xen/include/asm-x86/io_apic.h     Fri Apr 21 10:44:54 2006 +0100
@@ -139,7 +139,11 @@ static inline void io_apic_write(unsigne
  *
  * Older SiS APIC requires we rewrite the index regiser
  */
-#define sis_apic_bug 0 /* This may need propagating from domain0. */
+#ifdef __i386__
+extern int sis_apic_bug;
+#else
+#define sis_apic_bug 0
+#endif
 static inline void io_apic_modify(unsigned int apic, unsigned int reg, 
unsigned int value)
 {
        if (sis_apic_bug)
diff -r 29e9a0313c09 -r 42358db788fd xen/include/public/dom0_ops.h
--- a/xen/include/public/dom0_ops.h     Fri Apr 21 10:11:00 2006 +0100
+++ b/xen/include/public/dom0_ops.h     Fri Apr 21 10:44:54 2006 +0100
@@ -404,7 +404,9 @@ DEFINE_GUEST_HANDLE(dom0_getdomaininfoli
 DEFINE_GUEST_HANDLE(dom0_getdomaininfolist_t);
 
 #define DOM0_PLATFORM_QUIRK      39
-#define QUIRK_NOIRQBALANCING  1
+#define QUIRK_NOIRQBALANCING      1 /* Do not restrict IO-APIC RTE targets */
+#define QUIRK_IOAPIC_BAD_REGSEL   2 /* IO-APIC REGSEL forgets its value    */
+#define QUIRK_IOAPIC_GOOD_REGSEL  3 /* IO-APIC REGSEL behaves properly     */
 typedef struct dom0_platform_quirk {
     /* IN variables. */
     uint32_t quirk_id;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
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®.