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-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Propagate information about bad (or good) REGSEL register
From: Xen patchbot -3.0-testing <patchbot-3.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 21 Apr 2006 12:28:19 +0000
Delivery-date: Fri, 21 Apr 2006 05:51:22 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID ee007b1d5e1ae3c8f9ccf850d2cbab9830929272
# Parent  492ff179e08623bad1ff5e381e332fbda2b5ebc8
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 492ff179e086 -r ee007b1d5e1a 
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:37 2006 +0100
+++ b/linux-2.6-xen-sparse/arch/i386/kernel/io_apic-xen.c       Fri Apr 21 
10:45:31 2006 +0100
@@ -2485,6 +2485,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 492ff179e086 -r ee007b1d5e1a xen/arch/x86/dom0_ops.c
--- a/xen/arch/x86/dom0_ops.c   Fri Apr 21 10:11:37 2006 +0100
+++ b/xen/arch/x86/dom0_ops.c   Fri Apr 21 10:45:31 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 492ff179e086 -r ee007b1d5e1a xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c    Fri Apr 21 10:11:37 2006 +0100
+++ b/xen/arch/x86/io_apic.c    Fri Apr 21 10:45:31 2006 +0100
@@ -50,6 +50,14 @@ static DEFINE_SPINLOCK(ioapic_lock);
 static DEFINE_SPINLOCK(ioapic_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 492ff179e086 -r ee007b1d5e1a xen/include/asm-x86/io_apic.h
--- a/xen/include/asm-x86/io_apic.h     Fri Apr 21 10:11:37 2006 +0100
+++ b/xen/include/asm-x86/io_apic.h     Fri Apr 21 10:45:31 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 492ff179e086 -r ee007b1d5e1a xen/include/public/dom0_ops.h
--- a/xen/include/public/dom0_ops.h     Fri Apr 21 10:11:37 2006 +0100
+++ b/xen/include/public/dom0_ops.h     Fri Apr 21 10:45:31 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

<Prev in Thread] Current Thread [Next in Thread>