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

[Xen-devel] [RFC, PATCH 15/24] i386 Vmi apic header

To: Linus Torvalds <torvalds@xxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, Virtualization Mailing List <virtualization@xxxxxxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxx>, Zachary Amsden <zach@xxxxxxxxxx>, Dan Hecht <dhecht@xxxxxxxxxx>, Dan Arai <arai@xxxxxxxxxx>, Anne Holler <anne@xxxxxxxxxx>, Pratap Subrahmanyam <pratap@xxxxxxxxxx>, Christopher Li <chrisl@xxxxxxxxxx>, Joshua LeVasseur <jtl@xxxxxxxxxx>, Chris Wright <chrisw@xxxxxxxx>, Rik Van Riel <riel@xxxxxxxxxx>, Jyothy Reddy <jreddy@xxxxxxxxxx>, Jack Lo <jlo@xxxxxxxxxx>, Kip Macy <kmacy@xxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxxxx>, Ky Srinivasan <ksrinivasan@xxxxxxxxxx>, Wim Coekaerts <wim.coekaerts@xxxxxxxxxx>, Leendert van Doorn <leendert@xxxxxxxxxxxxxx>, Zachary Amsden <zach@xxxxxxxxxx>
Subject: [Xen-devel] [RFC, PATCH 15/24] i386 Vmi apic header
From: Zachary Amsden <zach@xxxxxxxxxx>
Date: Mon, 13 Mar 2006 10:10:41 -0800
Delivery-date: Tue, 14 Mar 2006 09:51:07 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Move APIC read / write accessors to sub-arch layer.  Note that we
don't bother to implement apic_write_atomic any different, as it
is only present to work around old processor erratums (Pentium
Processor Spec update 11AP), and VMI kernels do not offer support
for this class of processor.

Signed-off-by: Zachary Amsden <zach@xxxxxxxxxx>
Signed-off-by: Daniel Arai <arai@xxxxxxxxxx>

Index: linux-2.6.16-rc5/include/asm-i386/apic.h
===================================================================
--- linux-2.6.16-rc5.orig/include/asm-i386/apic.h       2006-03-10 
12:55:07.000000000 -0800
+++ linux-2.6.16-rc5/include/asm-i386/apic.h    2006-03-10 13:03:37.000000000 
-0800
@@ -7,6 +7,7 @@
 #include <asm/apicdef.h>
 #include <asm/processor.h>
 #include <asm/system.h>
+#include <mach_apicops.h>
 
 #define Dprintk(x...)
 
@@ -45,25 +46,6 @@ static inline void lapic_enable(void)
 
 #ifdef CONFIG_X86_LOCAL_APIC
 
-/*
- * Basic functions accessing APICs.
- */
-
-static __inline void apic_write(unsigned long reg, unsigned long v)
-{
-       *((volatile unsigned long *)(APIC_BASE+reg)) = v;
-}
-
-static __inline void apic_write_atomic(unsigned long reg, unsigned long v)
-{
-       xchg((volatile unsigned long *)(APIC_BASE+reg), v);
-}
-
-static __inline unsigned long apic_read(unsigned long reg)
-{
-       return *((volatile unsigned long *)(APIC_BASE+reg));
-}
-
 static __inline__ void apic_wait_icr_idle(void)
 {
        while ( apic_read( APIC_ICR ) & APIC_ICR_BUSY )
Index: linux-2.6.16-rc5/include/asm-i386/mach-vmi/mach_apicops.h
===================================================================
--- linux-2.6.16-rc5.orig/include/asm-i386/mach-vmi/mach_apicops.h      
2006-03-10 13:03:37.000000000 -0800
+++ linux-2.6.16-rc5/include/asm-i386/mach-vmi/mach_apicops.h   2006-03-10 
13:03:37.000000000 -0800
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2005, VMware, Inc.
+ *
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
+ * NON INFRINGEMENT.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Send feedback to arai@xxxxxxxxxx
+ *
+ */
+
+/*
+ * VMI implementation for basic functions accessing APICs.  Calls into VMI
+ * to perform operations.
+ */
+
+#ifndef __ASM_MACH_APICOPS_H
+#define __ASM_MACH_APICOPS_H
+
+#ifdef CONFIG_X86_LOCAL_APIC
+#include <vmi.h>
+
+static inline void apic_write(unsigned long reg, unsigned long value)
+{
+        void *addr = (void *)(APIC_BASE + reg);
+       vmi_wrap_call(
+               APICWrite, "movl %1, (%0)",
+               VMI_NO_OUTPUT,
+               2, XCONC(VMI_IREG1(addr), VMI_IREG2(value)),
+               VMI_CLOBBER_EXTENDED(ZERO_RETURNS, "memory"));
+}
+
+#define apic_write_atomic(r,v) apic_write(r,v)
+
+static inline unsigned long apic_read(unsigned long reg)
+{
+       unsigned long value;
+        void *addr = (void *)(APIC_BASE + reg);
+       vmi_wrap_call(
+               APICRead, "movl (%0), %%eax",
+               VMI_OREG1(value),
+               1,VMI_IREG1(addr),
+               VMI_CLOBBER(ONE_RETURN));
+       return value;
+}
+
+
+#endif /* CONFIG_X86_LOCAL_APIC */
+
+#endif /* __ASM_MACH_APICOPS_H */
Index: linux-2.6.16-rc5/include/asm-i386/mach-default/mach_apicops.h
===================================================================
--- linux-2.6.16-rc5.orig/include/asm-i386/mach-default/mach_apicops.h  
2006-03-10 13:03:37.000000000 -0800
+++ linux-2.6.16-rc5/include/asm-i386/mach-default/mach_apicops.h       
2006-03-10 16:00:13.000000000 -0800
@@ -0,0 +1,29 @@
+/*
+ * Basic functions accessing APICs.
+ * These may optionally be overridden by the subarchitecture in
+ * mach_apicops.h.
+ */
+
+#ifndef __ASM_MACH_APICOPS_H
+#define __ASM_MACH_APICOPS_H
+
+
+#ifdef CONFIG_X86_LOCAL_APIC
+
+static __inline void apic_write(unsigned long reg, unsigned long v)
+{
+       *((volatile unsigned long *)(APIC_BASE+reg)) = v;
+}
+
+static __inline void apic_write_atomic(unsigned long reg, unsigned long v)
+{
+       xchg((volatile unsigned long *)(APIC_BASE+reg), v);
+}
+static __inline unsigned long apic_read(unsigned long reg)
+{
+       return *((volatile unsigned long *)(APIC_BASE+reg));
+}
+
+#endif /* CONFIG_X86_LOCAL_APIC */
+
+#endif /* __ASM_MACH_APICOPS_H */

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [RFC, PATCH 15/24] i386 Vmi apic header, Zachary Amsden <=