From: "Jan Beulich" Subject: [PATCH] propagate SiS APIC bug info from dom0 to kernel Date: Thu, 20 Apr 2006 15:31:01 +0200 Message-ID: <4447A935.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartE3C6ED05.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartE3C6ED05.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline This was commented as possibly needing propagation from Dom0, and we now had a bug report where the native Linux workaround indeed appears to help. Signed-off-by: Jan Beulich --=__PartE3C6ED05.0__= Content-Type: text/plain; name="xen-SiS-APIC-bug.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xen-SiS-APIC-bug.patch" --- 2006-04-19/linux-2.6-xen-sparse/arch/i386/kernel/io_apic-xen.c.0 2006-04-20 14:18:14.000000000 +0200 +++ 2006-04-19/linux-2.6-xen-sparse/arch/i386/kernel/io_apic-xen.c 2006-04-20 14:26:17.000000000 +0200 @@ -2483,8 +2483,17 @@ __setup("enable_8254_timer", setup_enabl static int __init io_apic_bug_finalize(void) { - if(sis_apic_bug == -1) + if(sis_apic_bug == -1) { + if (xen_start_info->flags & SIF_INITDOMAIN) { + dom0_op_t op = { + .cmd = DOM0_PLATFORM_QUIRK, + .u.platform_quirk.quirk_id = QUIRK_IOAPICMODIFY + }; + + HYPERVISOR_dom0_op(&op); + } sis_apic_bug = 0; + } return 0; } --- 2006-04-19/xen/arch/x86/dom0_ops.c.0 2006-04-06 17:50:25.000000000 +0200 +++ 2006-04-19/xen/arch/x86/dom0_ops.c 2006-04-20 14:04:15.000000000 +0200 @@ -386,6 +386,12 @@ long arch_do_dom0_op(struct dom0_op *op, opt_noirqbalance = 1; setup_ioapic_dest(); break; + case QUIRK_IOAPICMODIFY: +#ifndef sis_apic_bug + printk("Platform info -- Allowing fast IO-APIC updates.\n"); + sis_apic_bug = 0; +#endif + break; default: ret = -EINVAL; break; --- 2006-04-19/xen/arch/x86/io_apic.c.0 2006-04-20 09:36:12.000000000 +0200 +++ 2006-04-19/xen/arch/x86/io_apic.c 2006-04-20 14:04:25.000000000 +0200 @@ -51,6 +51,14 @@ 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 */ --- 2006-04-19/xen/include/public/dom0_ops.h.0 2006-04-20 09:30:23.000000000 +0200 +++ 2006-04-19/xen/include/public/dom0_ops.h 2006-04-20 13:09:17.000000000 +0200 @@ -405,6 +405,7 @@ DEFINE_GUEST_HANDLE(dom0_getdomaininfoli #define DOM0_PLATFORM_QUIRK 39 #define QUIRK_NOIRQBALANCING 1 +#define QUIRK_IOAPICMODIFY 2 typedef struct dom0_platform_quirk { /* IN variables. */ uint32_t quirk_id; --- 2006-04-19/xen/include/asm-x86/io_apic.h.0 2006-04-06 17:50:27.000000000 +0200 +++ 2006-04-19/xen/include/asm-x86/io_apic.h 2006-04-20 13:13:35.000000000 +0200 @@ -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) --=__PartE3C6ED05.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__PartE3C6ED05.0__=--