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

[Xen-changelog] Ported genapic to Xen: support for bigsmp and numa platforms such as



ChangeSet 1.1555, 2005/05/25 18:29:20+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        Ported genapic to Xen: support for bigsmp and numa platforms such as
        es7000.
        Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>



 b/xen/arch/x86/Makefile                                 |    2 
 b/xen/arch/x86/Rules.mk                                 |    4 
 b/xen/arch/x86/apic.c                                   |    3 
 b/xen/arch/x86/dmi_scan.c                               |  493 ++++++++++++++++
 b/xen/arch/x86/genapic/bigsmp.c                         |   51 +
 b/xen/arch/x86/genapic/default.c                        |   26 
 b/xen/arch/x86/genapic/es7000.c                         |   28 
 b/xen/arch/x86/genapic/es7000.h                         |  110 +++
 b/xen/arch/x86/genapic/es7000plat.c                     |  302 +++++++++
 b/xen/arch/x86/genapic/probe.c                          |  101 +++
 b/xen/arch/x86/genapic/summit.c                         |   26 
 b/xen/arch/x86/mpparse.c                                |    2 
 b/xen/arch/x86/mtrr/generic.c                           |    1 
 b/xen/arch/x86/setup.c                                  |   15 
 b/xen/arch/x86/smp.c                                    |   74 +-
 b/xen/arch/x86/smpboot.c                                |    1 
 b/xen/common/kernel.c                                   |   56 +
 b/xen/include/asm-x86/apic.h                            |    1 
 b/xen/include/asm-x86/fixmap.h                          |   11 
 b/xen/include/asm-x86/genapic.h                         |  115 +++
 b/xen/include/asm-x86/mach-bigsmp/mach_apic.h           |  167 +++++
 b/xen/include/asm-x86/mach-bigsmp/mach_apicdef.h        |   13 
 b/xen/include/asm-x86/mach-bigsmp/mach_ipi.h            |   25 
 b/xen/include/asm-x86/mach-default/irq_vectors_limits.h |   16 
 b/xen/include/asm-x86/mach-es7000/mach_apic.h           |  207 ++++++
 b/xen/include/asm-x86/mach-es7000/mach_apicdef.h        |   13 
 b/xen/include/asm-x86/mach-es7000/mach_ipi.h            |   24 
 b/xen/include/asm-x86/mach-es7000/mach_mpparse.h        |   41 +
 b/xen/include/asm-x86/mach-es7000/mach_wakecpu.h        |   58 +
 b/xen/include/asm-x86/mach-generic/mach_apic.h          |   32 +
 b/xen/include/asm-x86/mach-generic/mach_apicdef.h       |   11 
 b/xen/include/asm-x86/mach-generic/mach_ipi.h           |   10 
 b/xen/include/asm-x86/mach-generic/mach_mpparse.h       |   12 
 b/xen/include/asm-x86/mach-generic/mach_mpspec.h        |   10 
 b/xen/include/asm-x86/mach-summit/mach_apic.h           |  189 ++++++
 b/xen/include/asm-x86/mach-summit/mach_apicdef.h        |   13 
 b/xen/include/asm-x86/mach-summit/mach_ipi.h            |   25 
 b/xen/include/asm-x86/mach-summit/mach_mpparse.h        |  121 +++
 b/xen/include/asm-x86/page.h                            |   12 
 b/xen/include/asm-x86/shadow.h                          |    1 
 b/xen/include/asm-x86/system.h                          |    2 
 b/xen/include/xen/dmi.h                                 |   47 +
 xen/include/asm-x86/mach-default/apm.h                  |   75 --
 xen/include/asm-x86/mach-default/do_timer.h             |   85 --
 xen/include/asm-x86/mach-default/entry_arch.h           |   34 -
 xen/include/asm-x86/mach-default/mach_mpspec.h          |    8 
 xen/include/asm-x86/mach-default/mach_reboot.h          |   30 
 xen/include/asm-x86/mach-default/mach_time.h            |  122 ---
 xen/include/asm-x86/mach-default/mach_timer.h           |   48 -
 xen/include/asm-x86/mach-default/mach_traps.h           |   29 
 xen/include/asm-x86/mach-default/pci-functions.h        |   19 
 xen/include/asm-x86/mach-default/setup_arch_post.h      |   40 -
 xen/include/asm-x86/mach-default/setup_arch_pre.h       |    5 
 53 files changed, 2391 insertions(+), 575 deletions(-)


diff -Nru a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
--- a/xen/arch/x86/Makefile     2005-05-25 14:02:40 -04:00
+++ b/xen/arch/x86/Makefile     2005-05-25 14:02:40 -04:00
@@ -5,6 +5,7 @@
 OBJS += $(patsubst %.c,%.o,$(wildcard $(TARGET_SUBARCH)/*.c))
 OBJS += $(patsubst %.c,%.o,$(wildcard acpi/*.c))
 OBJS += $(patsubst %.c,%.o,$(wildcard mtrr/*.c))
+OBJS += $(patsubst %.c,%.o,$(wildcard genapic/*.c))
 
 OBJS := $(subst $(TARGET_SUBARCH)/asm-offsets.o,,$(OBJS))
 
@@ -36,6 +37,7 @@
        rm -f x86_64/*.o x86_64/*~ x86_64/core
        rm -f mtrr/*.o mtrr/*~ mtrr/core
        rm -f acpi/*.o acpi/*~ acpi/core
+       rm -f genapic/*.o genapic/*~ genapic/core
 
 delete-unfresh-files:
        # nothing
diff -Nru a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
--- a/xen/arch/x86/Rules.mk     2005-05-25 14:02:40 -04:00
+++ b/xen/arch/x86/Rules.mk     2005-05-25 14:02:40 -04:00
@@ -3,7 +3,9 @@
 
 CFLAGS  += -nostdinc -fno-builtin -fno-common -fno-strict-aliasing
 CFLAGS  += -iwithprefix include -Wall -Werror -Wno-pointer-arith -pipe
-CFLAGS  += -I$(BASEDIR)/include -I$(BASEDIR)/include/asm-x86/mach-default
+CFLAGS  += -I$(BASEDIR)/include 
+CFLAGS  += -I$(BASEDIR)/include/asm-x86/mach-generic
+CFLAGS  += -I$(BASEDIR)/include/asm-x86/mach-default
 
 ifeq ($(optimize),y)
 CFLAGS  += -O3 -fomit-frame-pointer
diff -Nru a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c
--- a/xen/arch/x86/apic.c       2005-05-25 14:02:40 -04:00
+++ b/xen/arch/x86/apic.c       2005-05-25 14:02:40 -04:00
@@ -454,9 +454,6 @@
         apic_verbosity = APIC_DEBUG;
     else if (strcmp("verbose", str) == 0)
         apic_verbosity = APIC_VERBOSE;
-    else
-        printk(KERN_WARNING "APIC Verbosity level %s not recognised"
-               " use apic=verbose or apic=debug", str);
 }
 custom_param("apic", apic_set_verbosity);
 
diff -Nru a/xen/arch/x86/dmi_scan.c b/xen/arch/x86/dmi_scan.c
--- /dev/null   Wed Dec 31 16:00:00 196900
+++ b/xen/arch/x86/dmi_scan.c   2005-05-25 14:02:40 -04:00
@@ -0,0 +1,493 @@
+#include <xen/config.h>
+#include <xen/types.h>
+#include <xen/kernel.h>
+#include <xen/string.h>
+#include <xen/init.h>
+#include <xen/slab.h>
+#include <xen/acpi.h>
+#include <asm/io.h>
+#include <asm/system.h>
+#include <xen/dmi.h>
+
+#define bt_ioremap(b,l)  __acpi_map_table(b,l)
+#define bt_iounmap(b,l)  ((void)0)
+#define ioremap(b,l)     (__va(b))
+#define memcpy_fromio    memcpy
+#define alloc_bootmem(l) xmalloc_bytes(l)
+
+int es7000_plat = 0;
+
+struct dmi_header
+{
+       u8      type;
+       u8      length;
+       u16     handle;
+};
+
+#undef DMI_DEBUG
+
+#ifdef DMI_DEBUG
+#define dmi_printk(x) printk x
+#else
+#define dmi_printk(x)
+#endif
+
+static char * __init dmi_string(struct dmi_header *dm, u8 s)
+{
+       u8 *bp=(u8 *)dm;
+       bp+=dm->length;
+       if(!s)
+               return "";
+       s--;
+       while(s>0 && *bp)
+       {
+               bp+=strlen(bp);
+               bp++;
+               s--;
+       }
+       return bp;
+}
+
+/*
+ *     We have to be cautious here. We have seen BIOSes with DMI pointers
+ *     pointing to completely the wrong place for example
+ */
+ 
+static int __init dmi_table(u32 base, int len, int num, void (*decode)(struct 
dmi_header *))
+{
+       u8 *buf;
+       struct dmi_header *dm;
+       u8 *data;
+       int i=0;
+               
+       buf = bt_ioremap(base, len);
+       if(buf==NULL)
+               return -1;
+
+       data = buf;
+
+       /*
+        *      Stop when we see all the items the table claimed to have
+        *      OR we run off the end of the table (also happens)
+        */
+ 
+       while(i<num && data-buf+sizeof(struct dmi_header)<=len)
+       {
+               dm=(struct dmi_header *)data;
+               /*
+                *  We want to know the total length (formated area and strings)
+                *  before decoding to make sure we won't run off the table in
+                *  dmi_decode or dmi_string
+                */
+               data+=dm->length;
+               while(data-buf<len-1 && (data[0] || data[1]))
+                       data++;
+               if(data-buf<len-1)
+                       decode(dm);
+               data+=2;
+               i++;
+       }
+       bt_iounmap(buf, len);
+       return 0;
+}
+
+
+inline static int __init dmi_checksum(u8 *buf)
+{
+       u8 sum=0;
+       int a;
+       
+       for(a=0; a<15; a++)
+               sum+=buf[a];
+       return (sum==0);
+}
+
+static int __init dmi_iterate(void (*decode)(struct dmi_header *))
+{
+       u8 buf[15];
+       char __iomem *p, *q;
+
+       /*
+        * no iounmap() for that ioremap(); it would be a no-op, but it's
+        * so early in setup that sucker gets confused into doing what
+        * it shouldn't if we actually call it.
+        */
+       p = ioremap(0xF0000, 0x10000);
+       if (p == NULL)
+               return -1;
+       for (q = p; q < p + 0x10000; q += 16) {
+               memcpy_fromio(buf, q, 15);
+               if(memcmp(buf, "_DMI_", 5)==0 && dmi_checksum(buf))
+               {
+                       u16 num=buf[13]<<8|buf[12];
+                       u16 len=buf[7]<<8|buf[6];
+                       u32 base=buf[11]<<24|buf[10]<<16|buf[9]<<8|buf[8];
+
+                       /*
+                        * DMI version 0.0 means that the real version is taken 
from
+                        * the SMBIOS version, which we don't know at this 
point.
+                        */
+                       if(buf[14]!=0)
+                               printk(KERN_INFO "DMI %d.%d present.\n",
+                                       buf[14]>>4, buf[14]&0x0F);
+                       else
+                               printk(KERN_INFO "DMI present.\n");
+                       dmi_printk((KERN_INFO "%d structures occupying %d 
bytes.\n",
+                               num, len));
+                       dmi_printk((KERN_INFO "DMI table at 0x%08X.\n",
+                               base));
+                       if(dmi_table(base,len, num, decode)==0)
+                               return 0;
+               }
+       }
+       return -1;
+}
+
+static char *dmi_ident[DMI_STRING_MAX];
+
+/*
+ *     Save a DMI string
+ */
+ 
+static void __init dmi_save_ident(struct dmi_header *dm, int slot, int string)
+{
+       char *d = (char*)dm;
+       char *p = dmi_string(dm, d[string]);
+       if(p==NULL || *p == 0)
+               return;
+       if (dmi_ident[slot])
+               return;
+       dmi_ident[slot] = alloc_bootmem(strlen(p)+1);
+       if(dmi_ident[slot])
+               strcpy(dmi_ident[slot], p);
+       else
+               printk(KERN_ERR "dmi_save_ident: out of memory.\n");
+}
+
+/*
+ * Ugly compatibility crap.
+ */
+#define dmi_blacklist  dmi_system_id
+#define NO_MATCH       { DMI_NONE, NULL}
+#define MATCH          DMI_MATCH
+
+/*
+ * Toshiba keyboard likes to repeat keys when they are not repeated.
+ */
+
+static __init int broken_toshiba_keyboard(struct dmi_blacklist *d)
+{
+       printk(KERN_WARNING "Toshiba with broken keyboard detected. If your 
keyboard sometimes generates 3 keypresses instead of one, see 
http://davyd.ucc.asn.au/projects/toshiba/README\n";);
+       return 0;
+}
+
+
+#ifdef CONFIG_ACPI_SLEEP
+static __init int reset_videomode_after_s3(struct dmi_blacklist *d)
+{
+       /* See acpi_wakeup.S */
+       extern long acpi_video_flags;
+       acpi_video_flags |= 2;
+       return 0;
+}
+#endif
+
+
+#ifdef CONFIG_ACPI_BOOT
+extern int acpi_force;
+
+static __init __attribute__((unused)) int dmi_disable_acpi(struct 
dmi_blacklist *d) 
+{ 

_______________________________________________
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®.