Browse files

Sync with HEAD.

  • Loading branch information...
1 parent 0d3fa8f commit a5af9efb51a1fda2e1fca9fa14af73611fe71bc2 ad committed Dec 3, 2007
Showing with 16,808 additions and 1,320 deletions.
  1. +2 −8 sys/arch/alpha/alpha/cpu.c
  2. +4 −3 sys/arch/alpha/alpha/interrupt.c
  3. +2 −7 sys/arch/alpha/alpha/machdep.c
  4. +321 −0 sys/arch/alpha/alpha/patch.c
  5. +4 −15 sys/arch/alpha/alpha/pmap.c
  6. +1 −3 sys/arch/alpha/include/alpha.h
  7. +5 −14 sys/arch/alpha/include/intr.h
  8. +1 −3 sys/arch/alpha/include/z8530var.h
  9. +1 −4 sys/arch/amd64/amd64/cpufunc.S
  10. +2 −3 sys/arch/amd64/amd64/db_interface.c
  11. +2 −4 sys/arch/amd64/amd64/db_memrw.c
  12. +2 −4 sys/arch/amd64/amd64/fpu.c
  13. +2 −48 sys/arch/amd64/amd64/gdt.c
  14. +20 −26 sys/arch/amd64/amd64/genassym.cf
  15. +5 −58 sys/arch/amd64/amd64/locore.S
  16. +14 −66 sys/arch/amd64/amd64/machdep.c
  17. +63 −72 sys/arch/amd64/amd64/spl.S
  18. +2 −11 sys/arch/amd64/amd64/trap.c
  19. +142 −2 sys/arch/amd64/amd64/vector.S
  20. +3 −22 sys/arch/amd64/conf/GENERIC
  21. +456 −0 sys/arch/amd64/conf/INSTALL_XEN3_DOMU
  22. +2,202 −0 sys/arch/amd64/conf/XEN3_DOM0
  23. +657 −0 sys/arch/amd64/conf/XEN3_DOMU
  24. +1 −6 sys/arch/amd64/conf/files.amd64
  25. +147 −0 sys/arch/amd64/conf/kern.ldscript.Xen
  26. +1 −11 sys/arch/amd64/conf/majors.amd64
  27. +42 −0 sys/arch/amd64/conf/std.xen
  28. +1 −19 sys/arch/amd64/include/frameasm.h
  29. +1 −24 sys/arch/amd64/include/profile.h
  30. +2 −4 sys/arch/amiga/amiga/machdep.c
  31. +2 −4 sys/arch/amiga/dev/ite.c
  32. +1 −10 sys/arch/arm/arm/lock_cas.S
  33. +1 −3 sys/arch/arm/arm32/spl.S
  34. +2 −3 sys/arch/arm/xscale/i80321_icu.c
  35. +2 −3 sys/arch/arm/xscale/ixp425_intr.c
  36. +74 −0 sys/arch/bebox/bebox/cpu.c
  37. +2 −4 sys/arch/cesfic/cesfic/isr.c
  38. +1 −3 sys/arch/cesfic/include/z8530var.h
  39. +2 −5 sys/arch/cobalt/cobalt/autoconf.c
  40. +2 −5 sys/arch/cobalt/cobalt/machdep.c
  41. +1 −6 sys/arch/cobalt/stand/boot/boot.c
  42. +1 −22 sys/arch/cobalt/stand/boot/boot.h
  43. +273 −0 sys/arch/cobalt/stand/boot/cache.c
  44. +1 −20 sys/arch/cobalt/stand/boot/clock.c
  45. +459 −0 sys/arch/cobalt/stand/boot/nif_tlp.c
  46. +1,416 −0 sys/arch/cobalt/stand/boot/tlp.c
  47. +1 −2 sys/arch/cobalt/stand/boot/version
  48. +2 −4 sys/arch/dreamcast/dreamcast/machdep.c
  49. +708 −0 sys/arch/evbppc/virtex/dev/xlcom.c
  50. +2 −4 sys/arch/evbsh3/evbsh3/machdep.c
  51. +1 −2 sys/arch/ews4800mips/include/z8530var.h
  52. +2 −4 sys/arch/hp300/hp300/intr.c
  53. +2 −13 sys/arch/hp700/hp700/intr.c
  54. +2 −3 sys/arch/hpcarm/conf/JORNADA720
  55. +2 −3 sys/arch/hpcarm/hpcarm/intr.c
  56. +1 −27 sys/arch/hpcsh/conf/GENERIC
  57. +1 −3 sys/arch/hpcsh/conf/files.hpcsh
  58. +2 −3 sys/arch/hpcsh/hpcsh/machdep.c
  59. +1 −2 sys/arch/hppa/include/asm.h
  60. +1 −8 sys/arch/hppa/include/ptrace.h
  61. +3 −4 sys/arch/i386/acpi/npx_acpi.c
  62. +2 −14 sys/arch/i386/conf/ALL
  63. +2 −8 sys/arch/i386/conf/GENERIC
  64. +1 −15 sys/arch/i386/conf/GENERIC.NOACPI
  65. +1 −33 sys/arch/i386/conf/INSTALL_TINY
  66. +1 −6 sys/arch/i386/conf/files.i386
  67. +2 −3 sys/arch/i386/i386/db_interface.c
  68. +1 −4 sys/arch/i386/i386/genassym.cf
  69. +2 −8 sys/arch/i386/i386/identcpu.c
  70. +23 −23 sys/arch/i386/i386/lock_stubs.S
  71. +9 −2 sys/arch/i386/i386/machdep.c
  72. +1 −132 sys/arch/i386/i386/spl.S
  73. +18 −6 sys/arch/i386/i386/trap.c
  74. +5 −10 sys/arch/i386/include/frameasm.h
  75. +3 −4 sys/arch/i386/isa/npx_isa.c
  76. +1 −25 sys/arch/i386/stand/boot/boot2.c
  77. +2 −15 sys/arch/macppc/dev/awacs.c
  78. +5 −4 sys/arch/macppc/dev/if_wi_obio.c
  79. +2 −10 sys/arch/macppc/macppc/cpu.c
  80. +2 −94 sys/arch/macppc/macppc/machdep.c
  81. +2 −2 sys/arch/mips/include/softintr.h
  82. +1 −5 sys/arch/mips/include/types.h
  83. +3 −5 sys/arch/mips/mips/locore.S
  84. +2 −9 sys/arch/mips/mips/mips_machdep.c
  85. +2 −4 sys/arch/mmeye/mmeye/machdep.c
  86. +2 −3 sys/arch/mvme68k/dev/pcc.c
  87. +2 −3 sys/arch/mvme68k/dev/pcctwo_68k.c
  88. +1 −2 sys/arch/news68k/include/z8530var.h
  89. +2 −6 sys/arch/news68k/news68k/isr.c
  90. +1 −2 sys/arch/newsmips/include/z8530var.h
  91. +2 −4 sys/arch/next68k/next68k/isr.c
  92. +2 −10 sys/arch/ofppc/conf/GENERIC
  93. +1 −5 sys/arch/ofppc/conf/files.ofppc
  94. +1 −4 sys/arch/ofppc/include/bus.h
  95. +60 −0 sys/arch/ofppc/include/pegasosreg.h
  96. +1 −11 sys/arch/ofppc/include/vmparam.h
  97. +2 −9 sys/arch/ofppc/ofppc/machdep.c
  98. +771 −0 sys/arch/ofppc/pci/pegasospci.c
  99. +16 −46 sys/arch/pmax/include/intr.h
  100. +1 −3 sys/arch/pmax/include/z8530var.h
  101. +3 −4 sys/arch/pmax/pmax/disksubr.c
  102. +2 −16 sys/arch/pmax/pmax/interrupt.c
  103. +2 −3 sys/arch/powerpc/ibm4xx/intr.c
  104. +1 −9 sys/arch/powerpc/include/pci_machdep.h
  105. +1 −5 sys/arch/powerpc/include/types.h
  106. +3 −1 sys/arch/powerpc/include/userret.h
  107. +1,149 −0 sys/arch/powerpc/oea/ofw_autoconf.c
  108. +2 −29 sys/arch/powerpc/oea/ofw_consinit.c
  109. +804 −0 sys/arch/powerpc/oea/ofw_rascons.c
  110. +111 −0 sys/arch/powerpc/oea/ofw_rasconsvar.h
  111. +2 −6 sys/arch/powerpc/pci/pci_machdep_ofw.c
  112. +387 −0 sys/arch/powerpc/pci/pciconf_ofmethod.c
  113. +2 −48 sys/arch/powerpc/powerpc/openfirm.c
  114. +2 −10 sys/arch/powerpc/powerpc/powerpc_machdep.c
  115. +2 −16 sys/arch/powerpc/powerpc/rtas.c
  116. +138 −0 sys/arch/sandpoint/sandpoint/autoconf.c
  117. +356 −0 sys/arch/sandpoint/stand/netboot/nif.c
  118. +768 −0 sys/arch/sandpoint/stand/netboot/nvt.c
  119. +818 −0 sys/arch/sandpoint/stand/netboot/pcn.c
  120. +720 −0 sys/arch/sandpoint/stand/netboot/rge.c
  121. +856 −0 sys/arch/sandpoint/stand/netboot/sip.c
  122. +834 −0 sys/arch/sandpoint/stand/netboot/tlp.c
  123. +922 −0 sys/arch/sandpoint/stand/netboot/vge.c
  124. +874 −0 sys/arch/sandpoint/stand/netboot/wm.c
  125. +1 −3 sys/arch/sparc64/sparc64/locore.s
  126. +3 −3 sys/arch/sun2/dev/kd.c
  127. +6 −5 sys/arch/x86/conf/files.x86
  128. +1 −3 sys/arch/x86/include/cpuvar.h
  129. +1 −3 sys/arch/x86/include/intr.h
Sorry, we could not display the entire diff because it was too big.
View
10 sys/arch/alpha/alpha/cpu.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.73.30.4 2007/12/03 18:34:29 ad Exp $ */
+/* $NetBSD: cpu.c,v 1.73.30.5 2007/12/03 19:02:22 ad Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.73.30.4 2007/12/03 18:34:29 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.73.30.5 2007/12/03 19:02:22 ad Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
@@ -414,12 +414,6 @@ cpu_boot_secondary_processors(void)
did_patch = true;
}
- /* Patch MP-criticial kernel routines. */
- if (did_patch == false) {
- alpha_patch(true);
- did_patch = true;
- }
-
/*
* Link the processor into the list, and launch it.
*/
View
7 sys/arch/alpha/alpha/interrupt.c
@@ -1,4 +1,4 @@
-/* $NetBSD: interrupt.c,v 1.72.6.5 2007/12/03 18:34:29 ad Exp $ */
+/* $NetBSD: interrupt.c,v 1.72.6.6 2007/12/03 19:02:23 ad Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.72.6.5 2007/12/03 18:34:29 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.72.6.6 2007/12/03 19:02:23 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -98,6 +98,7 @@ __KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.72.6.5 2007/12/03 18:34:29 ad Exp $"
#include <machine/alpha.h>
struct scbvec scb_iovectab[SCB_VECTOIDX(SCB_SIZE - SCB_IOVECBASE)];
+static bool scb_mpsafe[SCB_VECTOIDX(SCB_SIZE - SCB_IOVECBASE)];
void netintr(void);
@@ -532,7 +533,7 @@ rlprintf(struct timeval *t, const char *fmt, ...)
const static uint8_t ipl2psl_table[] = {
[IPL_NONE] = ALPHA_PSL_IPL_0,
- [IPL_SOFT] = ALPHA_PSL_IPL_SOFT,
+ [IPL_SOFTCLOCK] = ALPHA_PSL_IPL_SOFT,
[IPL_VM] = ALPHA_PSL_IPL_IO,
[IPL_CLOCK] = ALPHA_PSL_IPL_CLOCK,
[IPL_HIGH] = ALPHA_PSL_IPL_HIGH,
View
9 sys/arch/alpha/alpha/machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.296.2.3 2007/12/03 18:34:29 ad Exp $ */
+/* $NetBSD: machdep.c,v 1.296.2.4 2007/12/03 19:02:23 ad Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.296.2.3 2007/12/03 18:34:29 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.296.2.4 2007/12/03 19:02:23 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1419,11 +1419,6 @@ regdump(framep)
printregs(&reg);
}
- /*
- * Perform any initial kernel patches based on the running system.
- * We may perform more later if we attach additional CPUs.
- */
- alpha_patch(false);
void *
View
321 sys/arch/alpha/alpha/patch.c
@@ -0,0 +1,321 @@
+/* $NetBSD: patch.c,v 1.2.2.2 2007/12/03 19:02:25 ad Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Andrew Doran and Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Patch kernel code at boot time, depending on available CPU features
+ * and configuration.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: patch.c,v 1.2.2.2 2007/12/03 19:02:25 ad Exp $");
+
+#include "opt_multiprocessor.h"
+
+#include <sys/types.h>
+#include <sys/systm.h>
+
+#include <machine/cpu.h>
+#include <machine/alpha.h>
+#include <machine/intr.h>
+
+void _membar_producer(void);
+void _membar_producer_end(void);
+void _membar_producer_mp(void);
+void _membar_producer_mp_end(void);
+
+void _membar_sync(void);
+void _membar_sync_end(void);
+void _membar_sync_mp(void);
+void _membar_sync_mp_end(void);
+
+static void __attribute__((__unused__))
+patchfunc(void *from_s, void *from_e, void *to_s, void *to_e)
+{
+ int s;
+
+ s = splhigh();
+
+ if ((uintptr_t)from_e - (uintptr_t)from_s !=
+ (uintptr_t)to_e - (uintptr_t)to_s)
+ panic("patchfunc: sizes do not match (from=%p)", from_s);
+
+ memcpy(to_s, from_s, (uintptr_t)to_e - (uintptr_t)to_s);
+ alpha_pal_imb();
+
+ splx(s);
+}
+
+void
+alpha_patch(bool is_mp)
+{
+
+ /*
+ * We allow this function to be called multiple times
+ * (there is no harm in doing so), so long as other
+ * CPUs have not yet actually hatched to start running
+ * kernel code.
+ */
+
+ KASSERT(curcpu()->ci_flags & CPUF_PRIMARY);
+ KASSERT((cpus_running & ~(1UL << cpu_number())) == 0);
+
+#if defined(MULTIPROCESSOR)
+ if (is_mp) {
+ patchfunc(_membar_producer_mp, _membar_producer_mp_end,
+ _membar_producer, _membar_producer_end);
+ patchfunc(_membar_sync_mp, _membar_sync_mp_end,
+ _membar_sync, _membar_sync_end);
+ }
+#else
+ KASSERT(is_mp == false);
+#endif /* MULTIPROCESSOR */
+}
+/* $NetBSD: patch.c,v 1.2.2.2 2007/12/03 19:02:25 ad Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Andrew Doran and Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Patch kernel code at boot time, depending on available CPU features
+ * and configuration.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: patch.c,v 1.2.2.2 2007/12/03 19:02:25 ad Exp $");
+
+#include "opt_multiprocessor.h"
+
+#include <sys/types.h>
+#include <sys/systm.h>
+
+#include <machine/cpu.h>
+#include <machine/alpha.h>
+#include <machine/intr.h>
+
+void _membar_producer(void);
+void _membar_producer_end(void);
+void _membar_producer_mp(void);
+void _membar_producer_mp_end(void);
+
+void _membar_sync(void);
+void _membar_sync_end(void);
+void _membar_sync_mp(void);
+void _membar_sync_mp_end(void);
+
+static void __attribute__((__unused__))
+patchfunc(void *from_s, void *from_e, void *to_s, void *to_e)
+{
+ int s;
+
+ s = splhigh();
+
+ if ((uintptr_t)from_e - (uintptr_t)from_s !=
+ (uintptr_t)to_e - (uintptr_t)to_s)
+ panic("patchfunc: sizes do not match (from=%p)", from_s);
+
+ memcpy(to_s, from_s, (uintptr_t)to_e - (uintptr_t)to_s);
+ alpha_pal_imb();
+
+ splx(s);
+}
+
+void
+alpha_patch(bool is_mp)
+{
+
+ /*
+ * We allow this function to be called multiple times
+ * (there is no harm in doing so), so long as other
+ * CPUs have not yet actually hatched to start running
+ * kernel code.
+ */
+
+ KASSERT(curcpu()->ci_flags & CPUF_PRIMARY);
+ KASSERT((cpus_running & ~(1UL << cpu_number())) == 0);
+
+#if defined(MULTIPROCESSOR)
+ if (is_mp) {
+ patchfunc(_membar_producer_mp, _membar_producer_mp_end,
+ _membar_producer, _membar_producer_end);
+ patchfunc(_membar_sync_mp, _membar_sync_mp_end,
+ _membar_sync, _membar_sync_end);
+ }
+#else
+ KASSERT(is_mp == false);
+#endif /* MULTIPROCESSOR */
+}
+/* $NetBSD: patch.c,v 1.2.2.2 2007/12/03 19:02:25 ad Exp $ */
+
+/*-
+ * Copyright (c) 2007 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Andrew Doran and Jason R. Thorpe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Patch kernel code at boot time, depending on available CPU features
+ * and configuration.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: patch.c,v 1.2.2.2 2007/12/03 19:02:25 ad Exp $");
+
+#include "opt_multiprocessor.h"
+
+#include <sys/types.h>
+#include <sys/systm.h>
+
+#include <machine/cpu.h>
+#include <machine/alpha.h>
+#include <machine/intr.h>
+
+void _membar_producer(void);
+void _membar_producer_end(void);
+void _membar_producer_mp(void);
+void _membar_producer_mp_end(void);
+
+void _membar_sync(void);
+void _membar_sync_end(void);
+void _membar_sync_mp(void);
+void _membar_sync_mp_end(void);
+
+static void __attribute__((__unused__))
+patchfunc(void *from_s, void *from_e, void *to_s, void *to_e)
+{
+ int s;
+
+ s = splhigh();
+
+ if ((uintptr_t)from_e - (uintptr_t)from_s !=
+ (uintptr_t)to_e - (uintptr_t)to_s)
+ panic("patchfunc: sizes do not match (from=%p)", from_s);
+
+ memcpy(to_s, from_s, (uintptr_t)to_e - (uintptr_t)to_s);
+ alpha_pal_imb();
+
+ splx(s);
+}
+
+void
+alpha_patch(bool is_mp)
+{
+
+ /*
+ * We allow this function to be called multiple times
+ * (there is no harm in doing so), so long as other
+ * CPUs have not yet actually hatched to start running
+ * kernel code.
+ */
+
+ KASSERT(curcpu()->ci_flags & CPUF_PRIMARY);
+ KASSERT((cpus_running & ~(1UL << cpu_number())) == 0);
+
+#if defined(MULTIPROCESSOR)
+ if (is_mp) {
+ patchfunc(_membar_producer_mp, _membar_producer_mp_end,
+ _membar_producer, _membar_producer_end);
+ patchfunc(_membar_sync_mp, _membar_sync_mp_end,
+ _membar_sync, _membar_sync_end);
+ }
+#else
+ KASSERT(is_mp == false);
+#endif /* MULTIPROCESSOR */
+}
View
19 sys/arch/alpha/alpha/pmap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.220.2.6 2007/12/03 18:34:30 ad Exp $ */
+/* $NetBSD: pmap.c,v 1.220.2.7 2007/12/03 19:02:25 ad Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -145,7 +145,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.220.2.6 2007/12/03 18:34:30 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.220.2.7 2007/12/03 19:02:25 ad Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -384,25 +384,14 @@ static struct pmap_asn_info pmap_asn_info[ALPHA_MAXPROCS];
* with the pmap already locked by the caller (which will be
* an interface function).
*/
-static struct lock pmap_main_lock;
+/* static struct lock pmap_main_lock; */
static struct simplelock pmap_all_pmaps_slock;
static struct simplelock pmap_growkernel_slock;
-#if defined(MULTIPROCESSOR) || defined(LOCKDEBUG)
-#define PMAP_MAP_TO_HEAD_LOCK() \
- spinlockmgr(&pmap_main_lock, LK_SHARED, NULL)
-#define PMAP_MAP_TO_HEAD_UNLOCK() \
- spinlockmgr(&pmap_main_lock, LK_RELEASE, NULL)
-#define PMAP_HEAD_TO_MAP_LOCK() \
- spinlockmgr(&pmap_main_lock, LK_EXCLUSIVE, NULL)
-#define PMAP_HEAD_TO_MAP_UNLOCK() \
- spinlockmgr(&pmap_main_lock, LK_RELEASE, NULL)
-#else
#define PMAP_MAP_TO_HEAD_LOCK() /* nothing */
#define PMAP_MAP_TO_HEAD_UNLOCK() /* nothing */
#define PMAP_HEAD_TO_MAP_LOCK() /* nothing */
#define PMAP_HEAD_TO_MAP_UNLOCK() /* nothing */
-#endif /* MULTIPROCESSOR || LOCKDEBUG */
#if defined(MULTIPROCESSOR)
/*
@@ -963,7 +952,7 @@ pmap_bootstrap(paddr_t ptaddr, u_int maxasn, u_long ncpuids)
/*
* Initialize the locks.
*/
- spinlockinit(&pmap_main_lock, "pmaplk", 0);
+ /* spinlockinit(&pmap_main_lock, "pmaplk", 0); */
simple_lock_init(&pmap_all_pmaps_slock);
/*
View
4 sys/arch/alpha/include/alpha.h
@@ -1,4 +1,4 @@
-/* $NetBSD: alpha.h,v 1.20.30.2 2007/12/03 18:34:31 ad Exp $ */
+/* $NetBSD: alpha.h,v 1.20.30.3 2007/12/03 19:02:29 ad Exp $ */
/*
* Copyright (c) 1982, 1990, 1993
@@ -151,8 +151,6 @@ void fpusave_proc(struct lwp *, int);
void alpha_patch(bool);
-void alpha_patch(bool);
-
/* Multiprocessor glue; cpu.c */
struct cpu_info;
View
19 sys/arch/alpha/include/intr.h
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.h,v 1.59.6.4 2007/12/03 18:34:32 ad Exp $ */
+/* $NetBSD: intr.h,v 1.59.6.5 2007/12/03 19:02:30 ad Exp $ */
/*-
* Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc.
@@ -115,23 +115,14 @@ struct scbvec {
*/
#define IPL_NONE 0 /* no interrupt level */
-#define IPL_SOFT 1 /* generic software interrupts */
+#define IPL_SOFTCLOCK 1 /* generic software interrupts */
+#define IPL_SOFTBIO 1 /* generic software interrupts */
+#define IPL_SOFTNET 1 /* generic software interrupts */
+#define IPL_SOFTSERIAL 1 /* generic software interrupts */
#define IPL_VM 2 /* interrupts that can alloc mem */
#define IPL_SCHED 3 /* clock interrupts */
#define IPL_HIGH 4 /* all interrupts */
-/* Aliases */
-#define IPL_SOFTCLOCK IPL_SOFT/* clock software interrupts */
-#define IPL_SOFTNET IPL_SOFT/* network software interrupts */
-#define IPL_SOFTSERIAL IPL_SOFT/* serial software interrupts */
-#define IPL_BIO IPL_VM /* block I/O interrupts */
-#define IPL_NET IPL_VM /* network interrupts */
-#define IPL_TTY IPL_VM /* terminal interrupts */
-#define IPL_LPT IPL_VM /* printer interrupts */
-#define IPL_SERIAL IPL_VM /* serial interrupts */
-#define IPL_IPI IPL_SCHED/* AARM, 5-2, II-B */
-#define IPL_CLOCK IPL_SCHED/* clock interrupt */
-
typedef int ipl_t;
typedef struct {
uint8_t _psl;
View
4 sys/arch/alpha/include/z8530var.h
@@ -1,4 +1,4 @@
-/* $NetBSD: z8530var.h,v 1.7.30.2 2007/12/03 18:34:33 ad Exp $ */
+/* $NetBSD: z8530var.h,v 1.7.30.3 2007/12/03 19:02:30 ad Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -116,5 +116,3 @@ void zs_write_data(struct zs_chanstate *cs, u_int val);
/* Interrupt priority for the SCC chip; needs to match ZSHARD_PRI. */
#define splzs() spltty()
#define IPL_ZS IPL_TTY
-#define IPL_ZS IPL_TTY
-#define IPL_ZS IPL_TTY
View
5 sys/arch/amd64/amd64/cpufunc.S
@@ -1,4 +1,4 @@
-/* $NetBSD: cpufunc.S,v 1.1.6.3 2007/12/03 18:34:36 ad Exp $ */
+/* $NetBSD: cpufunc.S,v 1.1.6.4 2007/12/03 19:02:31 ad Exp $ */
/*-
* Copyright (c) 1998, 2007 The NetBSD Foundation, Inc.
@@ -46,8 +46,6 @@
#include "opt_xen.h"
-#include "opt_xen.h"
-
#include "assym.h"
/* Small and slow, so align less. */
@@ -98,7 +96,6 @@ NENTRY(rcr2)
NENTRY(lcr3)
movq %rdi, %cr3
ret
-#endif
NENTRY(rcr3)
movq %cr3, %rax
View
5 sys/arch/amd64/amd64/db_interface.c
@@ -1,4 +1,4 @@
-/* $NetBSD: db_interface.c,v 1.7.4.3 2007/12/03 18:34:36 ad Exp $ */
+/* $NetBSD: db_interface.c,v 1.7.4.4 2007/12/03 19:02:32 ad Exp $ */
/*
* Mach Operating System
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.7.4.3 2007/12/03 18:34:36 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.7.4.4 2007/12/03 19:02:32 ad Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
@@ -118,7 +118,6 @@ db_suspend_others(void)
if (ddb_vec == 0)
return 1;
- x86_mp_online = ddb_mp_online;
__cpu_simple_lock(&db_lock);
if (ddb_cpu == NOCPU)
ddb_cpu = cpu_me;
View
6 sys/arch/amd64/amd64/db_memrw.c
@@ -1,4 +1,4 @@
-/* $NetBSD: db_memrw.c,v 1.3.30.2 2007/12/03 18:34:36 ad Exp $ */
+/* $NetBSD: db_memrw.c,v 1.3.30.3 2007/12/03 19:02:33 ad Exp $ */
/*-
* Copyright (c) 1996, 2000 The NetBSD Foundation, Inc.
@@ -58,9 +58,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_memrw.c,v 1.3.30.2 2007/12/03 18:34:36 ad Exp $");
-
-#include "opt_xen.h"
+__KERNEL_RCSID(0, "$NetBSD: db_memrw.c,v 1.3.30.3 2007/12/03 19:02:33 ad Exp $");
#include "opt_xen.h"
View
6 sys/arch/amd64/amd64/fpu.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fpu.c,v 1.17.6.2 2007/12/03 18:34:36 ad Exp $ */
+/* $NetBSD: fpu.c,v 1.17.6.3 2007/12/03 19:02:33 ad Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.17.6.2 2007/12/03 18:34:36 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.17.6.3 2007/12/03 19:02:33 ad Exp $");
#include "opt_multiprocessor.h"
@@ -179,9 +179,7 @@ fputrap(frame)
ksi.ksi_addr = (void *)frame->tf_rip;
ksi.ksi_code = x86fpflags_to_ksiginfo(statbits);
ksi.ksi_trap = statbits;
- KERNEL_LOCK(1, l);
(*l->l_proc->p_emul->e_trapsignal)(l, &ksi);
- KERNEL_UNLOCK_LAST(l);
}
static int
View
50 sys/arch/amd64/amd64/gdt.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gdt.c,v 1.10.4.3 2007/12/03 18:34:37 ad Exp $ */
+/* $NetBSD: gdt.c,v 1.10.4.4 2007/12/03 19:02:34 ad Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.10.4.3 2007/12/03 18:34:37 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.10.4.4 2007/12/03 19:02:34 ad Exp $");
#include "opt_multiprocessor.h"
#include "opt_xen.h"
@@ -64,11 +64,6 @@ __KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.10.4.3 2007/12/03 18:34:37 ad Exp $");
#endif
-#ifdef XEN
-#include <xen/hypervisor.h>
-#endif
-
-
int gdt_size; /* size of GDT in bytes */
int gdt_dyncount; /* number of dyn. allocated GDT entries in use */
int gdt_dynavail;
@@ -286,7 +281,6 @@ gdt_grow(void)
int
gdt_get_slot(void)
{
-#ifndef XEN
int slot;
struct sys_segment_descriptor *gdt;
@@ -447,43 +441,3 @@ r Xen.
lgdt_finish();
}
#endif
-
-#ifdef XEN
-void
-lgdt(desc)
- struct region_descriptor *desc;
-{
- paddr_t frames[16];
- int i;
- vaddr_t va;
-
- /*
- * XXX: Xen even checks descriptors AFTER limit.
- * Zero out last frame after limit if needed.
- */
- va = desc->rd_base + desc->rd_limit + 1;
- __PRINTK(("memset 0x%lx -> 0x%lx\n", va, roundup(va, PAGE_SIZE)));
- memset((void *) va, 0, roundup(va, PAGE_SIZE) - va);
- for (i = 0; i < roundup(desc->rd_limit,PAGE_SIZE) >> PAGE_SHIFT; i++) {
- /*
- * The lgdt instr uses virtual addresses, do some translation fo
-r Xen.
- * Mark pages R/O too, else Xen will refuse to use them
- */
-
- frames[i] = ((paddr_t) xpmap_ptetomach(
- (pt_entry_t *) (desc->rd_base + (i << PAGE_SHIFT
-))))
- >> PAGE_SHIFT;
- __PRINTK(("frames[%d] = 0x%lx (pa 0x%lx)\n", i, frames[i],
- xpmap_mtop(frames[i] << PAGE_SHIFT)));
- pmap_pte_clearbits(kvtopte(desc->rd_base + (i << PAGE_SHIFT)),
- PG_RW);
- }
- __PRINTK(("HYPERVISOR_set_gdt(%d)\n", (desc->rd_limit + 1) >> 3));
-
- if (HYPERVISOR_set_gdt(frames, (desc->rd_limit + 1) >> 3))
- panic("lgdt(): HYPERVISOR_set_gdt() failed");
- lgdt_finish();
-}
-#endif
View
46 sys/arch/amd64/amd64/genassym.cf
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.8.4.5 2007/12/03 18:34:37 ad Exp $
+# $NetBSD: genassym.cf,v 1.8.4.6 2007/12/03 19:02:34 ad Exp $
#
# Copyright (c) 1998, 2006, 2007 The NetBSD Foundation, Inc.
@@ -138,10 +138,6 @@ ifdef XEN
include <xen/xen3-public/xen.h>
endif
-ifdef XEN
-include <xen/xen3-public/xen.h>
-endif
-
include <x86/busdefs.h>
define LSRUN LSRUN
@@ -291,27 +287,32 @@ define LINUX32_RT_SF_HANDLER offsetof(struct linux32_rt_sigframe, sf_handler)
define LINUX32_RT_SF_UC offsetof(struct linux32_rt_sigframe, sf_uc)
define LINUX32_SYS_rt_sigreturn LINUX32_SYS_rt_sigreturn
define LINUX32_SYS_sigreturn LINUX32_SYS_sigreturn
-define LINUX32_SYS_exit LINUX32_SYS_exit
+define LINUX32_SYS_exit LINUX32_SYS_netbsd32_exit
endif
-define IS_RECURSE offsetof(struct intrsource, is_recurse)
-define IS_RESUME offsetof(struct intrsource, is_resume)
-define IS_EVCNT offsetof(struct intrsource, is_evcnt.ev_count)
-define IS_HANDLERS offsetof(struct intrsource, is_handlers)
-define IS_PIC offsetof(struct intrsource, is_pic)
-define IS_FLAGS offsetof(struct intrsource, is_flags)
-define IS_PIN offsetof(struct intrsource, is_pin)
-define IS_TYPE offsetof(struct intrsource, is_type)
-define IS_MAXLEVEL offsetof(struct intrsource, is_maxlevel)
+ifdef XEN
+define SIZEOF_IPLSOURCE sizeof(struct iplsource)
+define IS_RECURSE offsetof(struct iplsource, ipl_recurse)
+define IS_RESUME offsetof(struct iplsource, ipl_resume)
+define IS_HANDLERS offsetof(struct iplsource, ipl_handlers)
+define EV_EVCNTL offsetof(struct evcnt, ev_count)
+else
+define IS_RECURSE offsetof(struct intrsource, is_recurse)
+define IS_RESUME offsetof(struct intrsource, is_resume)
+define IS_EVCNT offsetof(struct intrsource, is_evcnt.ev_count)
+define IS_HANDLERS offsetof(struct intrsource, is_handlers)
+define IS_PIC offsetof(struct intrsource, is_pic)
+define IS_FLAGS offsetof(struct intrsource, is_flags)
+define IS_PIN offsetof(struct intrsource, is_pin)
+define IS_TYPE offsetof(struct intrsource, is_type)
+define IS_MAXLEVEL offsetof(struct intrsource, is_maxlevel)
define IS_LWP offsetof(struct intrsource, is_lwp)
+endif
define IPL_NONE IPL_NONE
define IPL_CLOCK IPL_CLOCK
define IPL_HIGH IPL_HIGH
-
-define IPL_SOFTNET IPL_SOFTNET
-define IPL_SOFTCLOCK IPL_SOFTCLOCK
-define IPL_SOFTSERIAL IPL_SOFTSERIAL
+define IPL_IPI IPL_IPI
define LIR_IPI LIR_IPI
define LIR_TIMER LIR_TIMER
@@ -359,13 +360,6 @@ define XEN_NR_PT_FRAMES offsetof(struct start_info, nr_pt_frames)
define __HYPERVISOR_iret __HYPERVISOR_iret
endif
-ifdef XEN
-define EVTCHN_UPCALL_MASK offsetof(struct vcpu_info, evtchn_upcall_mask)
-define XEN_PT_BASE offsetof(struct start_info, pt_base)
-define XEN_NR_PT_FRAMES offsetof(struct start_info, nr_pt_frames)
-define __HYPERVISOR_iret __HYPERVISOR_iret
-endif
-
define NKL4_KIMG_ENTRIES NKL4_KIMG_ENTRIES
define NKL3_KIMG_ENTRIES NKL3_KIMG_ENTRIES
define NKL2_KIMG_ENTRIES NKL2_KIMG_ENTRIES
View
63 sys/arch/amd64/amd64/locore.S
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.S,v 1.20.4.7 2007/12/03 18:34:38 ad Exp $ */
+/* $NetBSD: locore.S,v 1.20.4.8 2007/12/03 19:02:35 ad Exp $ */
/*
* Copyright-o-rama!
@@ -51,52 +51,6 @@
*/
/*
- * Copyright (c) 2007 Manuel Bouyer.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Manuel Bouyer.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-/*
- * Copyright (c) 2006 Mathieu Ropert <mro@adviseo.fr>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
* Copyright (c) 2001 Wasabi Systems, Inc.
* All rights reserved.
*
@@ -211,15 +165,6 @@
#include <machine/asm.h>
-/*
- * override user-land alignment before including asm.h
- */
-#define ALIGN_DATA .align 8
-#define ALIGN_TEXT .align 16,0x90
-#define _ALIGN_TEXT ALIGN_TEXT
-
-#include <machine/asm.h>
-
#include "opt_ddb.h"
#include "opt_ddbparam.h"
#include "opt_realmem.h"
@@ -982,11 +927,13 @@ ENTRY(cpu_switchto)
jne 5f
/*
- * Restore cr0 (including FPU state). Raise the IPL to IPL_HIGH.
+ * Restore cr0 (including FPU state). Raise the IPL to IPL_IPI.
* FPU IPIs can alter the LWP's saved cr0. Dropping the priority
* is deferred until mi_switch(), when cpu_switchto() returns.
*/
-2: movl $IPL_HIGH,CPUVAR(ILEVEL)
+2:
+#ifndef XEN
+ movl $IPL_IPI,CPUVAR(ILEVEL)
movl PCB_CR0(%r14),%ecx
movq %cr0,%rdx
View
80 sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.52.2.11 2007/12/03 18:34:38 ad Exp $ */
+/* $NetBSD: machdep.c,v 1.52.2.12 2007/12/03 19:02:36 ad Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007
@@ -85,53 +85,6 @@
*/
-/*
- * Copyright (c) 2006 Mathieu Ropert <mro@adviseo.fr>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
- * Copyright (c) 2007 Manuel Bouyer.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Manuel Bouyer.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-
/*-
* Copyright (c) 1982, 1987, 1990 The Regents of the University of California.
* All rights reserved.
@@ -167,9 +120,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.52.2.11 2007/12/03 18:34:38 ad Exp $");
-
-/* #define XENDEBUG_LOW */
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.52.2.12 2007/12/03 19:02:36 ad Exp $");
/* #define XENDEBUG_LOW */
@@ -1390,14 +1341,6 @@ init_x86_64(paddr_t first_avail)
avail_end = IOM_END + trunc_page(KBTOB(biosextmem));
}
-#else /* XEN */
- kern_end = KERNBASE + first_avail;
- physmem = xen_start_info.nr_pages;
-
- uvm_page_physload(atop(avail_start),
- atop(avail_end), atop(avail_start),
- atop(avail_end), VM_FREELIST_DEFAULT);
-#endif /* !XEN */
/*
* If we have 16M of RAM or less, just put it all on
@@ -1589,10 +1532,6 @@ init_x86_64(paddr_t first_avail)
}
-#ifdef XEN
- HYPERVISOR_reboot();
-#else
-
/*
* XXXfvdl todo: acpi wakeup code.
*/
@@ -1638,7 +1577,6 @@ init_x86_64(paddr_t first_avail)
set_sys_segment(GDT_ADDR_SYS(gdtstore, GLDT_SEL), ldtstore,
LDT_SIZE - 1, SDT_SYSLDT, SEL_KPL, 0);
#endif
-#endif /* XEN */
set_mem_segment(GDT_ADDR_MEM(gdtstore, GUCODE_SEL), 0,
x86_btop(VM_MAXUSER_ADDRESS) - 1, SDT_MEMERA, SEL_UPL, 1, 0, 1);
@@ -1777,9 +1715,13 @@ init_x86_64(paddr_t first_avail)
}
#endif
+#ifndef XEN
intr_default_setup();
+#else
+ events_default_setup();
+#endif
- splraise(IPL_IPI);
+ splraise(IPL_HIGH);
x86_enable_intr();
x86_init();
@@ -1938,7 +1880,6 @@ cpu_setmcontext(struct lwp *l, const mcontext_t *mcp, unsigned int flags)
return 0;
}
-#endif /* !XEN */
int
check_mcontext(struct lwp *l, const mcontext_t *mcp, struct trapframe *tf)
@@ -2015,6 +1956,13 @@ check_mcontext(struct lwp *l, const mcontext_t *mcp, struct trapframe *tf)
return 0;
}
+void
+cpu_initclocks(void)
+{
+ (*initclock_func)();
+}
+
+#ifndef XEN
/*
* Allocate an IDT vector slot within the given range.
* XXX needs locking to avoid MP allocation races.
View
135 sys/arch/amd64/amd64/spl.S
@@ -1,4 +1,4 @@
-/* $NetBSD: spl.S,v 1.6.6.6 2007/12/03 18:34:39 ad Exp $ */
+/* $NetBSD: spl.S,v 1.6.6.7 2007/12/03 19:02:37 ad Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -84,11 +84,71 @@
.text
+#ifndef XEN
/*
- * int splraise(int s);
+ * softintr()
+ *
+ * Switch to the LWP assigned to handle interrupts from the given
+ * source. We borrow the VM context from the interrupted LWP.
+ *
+ * On entry:
+ *
+ * %rax intrsource
+ * %r13 address to return to
+ */
+IDTVEC(softintr)
+ pushq $_C_LABEL(softintr_ret) /* set up struct switchframe */
+ pushq %rbx
+ pushq %r12
+ pushq %r13
+ pushq %r14
+ pushq %r15
+ movl $IPL_HIGH,CPUVAR(ILEVEL)
+ movq CPUVAR(CURLWP),%r15
+ movq IS_LWP(%rax),%rdi /* switch to handler LWP */
+ movq L_ADDR(%rdi),%rdx
+ movq L_ADDR(%r15),%rcx
+ movq %rdi,CPUVAR(CURLWP)
+ movq %rsp,PCB_RSP(%rcx)
+ movq %rbp,PCB_RBP(%rcx)
+ movq PCB_RSP0(%rdx),%rsp /* onto new stack */
+ sti
+ movq %r15,%rdi /* interrupted LWP */
+ movl IS_MAXLEVEL(%rax),%esi /* ipl to run at */
+ call _C_LABEL(softint_dispatch)/* run handlers */
+ movq L_ADDR(%r15),%rcx
+ movq PCB_RSP(%rcx),%rsp
+ movq %r15,CPUVAR(CURLWP)
+ popq %r15 /* unwind switchframe */
+ addq $(5 * 8),%rsp
+ cli
+ jmp *%r13 /* back to splx/doreti */
+
+/*
+ * softintr_ret()
+ *
+ * Trampoline function that gets returned to by cpu_switchto() when
+ * an interrupt handler blocks. On entry:
+ *
+ * %rax prevlwp from cpu_switchto()
*/
- .align 32
+NENTRY(softintr_ret)
+ movl $0, L_CTXSWTCH(%rax) /* %rax from cpu_switchto */
+ cli
+ jmp *%r13 /* back to splx/doreti */
+/*
+ * void softint_trigger(uintptr_t machdep);
+ *
+ * Software interrupt registration.
+ */
+NENTRY(softint_trigger)
+ orl %edi,CPUVAR(IPENDING) /* atomic on local cpu */
+ ret
+
+/*
+ * int splraise(int s);
+ */
ENTRY(splraise)
movl CPUVAR(ILEVEL),%eax
cmpl %edi,%eax
@@ -261,72 +321,3 @@ NENTRY(call_evtchn_do_event)
decl CPUVAR(IDEPTH)
ret
#endif
-
-/*
- * softintr()
- *
- * Switch to the LWP assigned to handle interrupts from the given
- * source. We borrow the VM context from the interrupted LWP.
- *
- * On entry:
- *
- * %rax intrsource
- * %r13 address to return to
- */
-IDTVEC(softintr)
- pushq $_C_LABEL(softintr_ret) /* set up struct switchframe */
- pushq %rbx
- pushq %r12
- pushq %r13
- pushq %r14
- pushq %r15
- movl $IPL_HIGH,CPUVAR(ILEVEL)
- movq CPUVAR(CURLWP),%r15
- movq IS_LWP(%rax),%rdi /* switch to handler LWP */
- movq L_ADDR(%rdi),%rdx
- movq L_ADDR(%r15),%rcx
- movq %rdi,CPUVAR(CURLWP)
- movq %rsp,PCB_RSP(%rcx)
- movq %rbp,PCB_RBP(%rcx)
- movq PCB_RSP0(%rdx),%rsp /* onto new stack */
- sti
- movq %r15,%rdi /* interrupted LWP */
- movl IS_MAXLEVEL(%rax),%esi /* ipl to run at */
- call _C_LABEL(softint_dispatch)/* run handlers */
- movq L_ADDR(%r15),%rcx
- movq PCB_RSP(%rcx),%rsp
- movq %r15,CPUVAR(CURLWP)
- popq %r15 /* unwind switchframe */
- addq $(5 * 8),%rsp
- cli
- jmp *%r13 /* back to splx/doreti */
-
-/*
- * softintr_ret()
- *
- * Trampoline function that gets returned to by cpu_switchto() when
- * an interrupt handler blocks. On entry:
- *
- * %rax prevlwp from cpu_switchto()
- */
-NENTRY(softintr_ret)
- cmpl $-1, CPUVAR(MTX_COUNT) /* preserve priority until return: */
- jne 1f /* keep IPL raised if this is */
- movl CPUVAR(ILEVEL),%edx /* the last spin mutex held */
- movl %edx,CPUVAR(MTX_OLDSPL) /* by the current CPU. */
-1:
- movq L_MUTEX(%rax),%rdi /* %eax from cpu_switchto */
- call _C_LABEL(mutex_spin_exit)/* unlock the old LWP */
- cli
- jmp *%r13 /* back to splx/doreti */
-
-/*
- * void softint_trigger(uintptr_t machdep);
- *
- * Software interrupt registration.
- */
- .align 32
-
-NENTRY(softint_trigger)
- orl %edi,CPUVAR(IPENDING) /* atomic on local cpu */
- ret
View
13 sys/arch/amd64/amd64/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.30.2.6 2007/12/03 18:34:40 ad Exp $ */
+/* $NetBSD: trap.c,v 1.30.2.7 2007/12/03 19:02:37 ad Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.30.2.6 2007/12/03 18:34:40 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.30.2.7 2007/12/03 19:02:37 ad Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -639,14 +639,5 @@ frame_dump(struct trapframe *tf)
for (i = 0, p = (unsigned long *) tf; i < 20; i ++, p += 4)
printf(" 0x%.16lx 0x%.16lx 0x%.16lx 0x%.16lx\n", *p, p[1], p[2], p[3]);
printf("\n");
- printf("cs %p ds %p es %p fs %p gs %p ss %p\n",
- tf->tf_cs & 0xffff, tf->tf_ds & 0xffff, tf->tf_es & 0xffff,
- tf->tf_fs & 0xffff, tf->tf_gs & 0xffff, tf->tf_ss & 0xffff);
-
- printf("\n");
- printf("Stack dump:\n");
- for (i = 0, p = (unsigned long *) tf; i < 20; i ++, p += 4)
- printf(" 0x%.16lx 0x%.16lx 0x%.16lx 0x%.16lx\n", *p, p[1], p[2], p[3]);
- printf("\n");
}
#endif
View
144 sys/arch/amd64/amd64/vector.S
@@ -1,4 +1,4 @@
-/* $NetBSD: vector.S,v 1.10.6.9 2007/12/03 18:34:40 ad Exp $ */
+/* $NetBSD: vector.S,v 1.10.6.10 2007/12/03 19:02:38 ad Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -448,7 +448,6 @@ IDTVEC(intr_lapic_tlb_mcast)
movq %rax, %cr3
jmp 2b
-#ifndef XEN
/*
* Broadcast TLB shootdown handler for kernel_pmap.
*/
@@ -856,3 +855,144 @@ _C_LABEL(ioapic_level_stubs):
.quad _C_LABEL(Xintr_ioapic_level31), _C_LABEL(Xrecurse_ioapic_level31)
.quad _C_LABEL(Xresume_ioapic_level31)
#endif
+
+#else /* !XEN */
+/* Resume/recurse procedures for spl() */
+#define XENINTRSTUB(name, num, early_ack, late_ack, mask, unmask, level_mask) \
+IDTVEC(recurse_/**/name/**/num) ;\
+ INTR_RECURSE_HWFRAME ;\
+ subq $8,%rsp ;\
+ pushq $T_ASTFLT /* trap # for doing ASTs */ ;\
+ INTRENTRY ;\
+IDTVEC(resume_/**/name/**/num) \
+ movq $IREENT_MAGIC,TF_ERR(%rsp) ;\
+ movl %ebx,%r13d ;\
+ movq CPUVAR(ISOURCES) + (num) * 8, %r14 ;\
+1: \
+ pushq %r13 ;\
+ movl $num,CPUVAR(ILEVEL) ;\
+ STI(si,di) ;\
+ incl CPUVAR(IDEPTH) ;\
+ movq IS_HANDLERS(%r14),%rbx ;\
+6: \
+ movq IH_ARG(%rbx),%rdi ;\
+ movq %rsp,%rsi ;\
+ call *IH_FUN(%rbx) /* call it */ ;\
+ movq IH_IPL_NEXT(%rbx),%rbx /* next handler in chain */ ;\
+ testq %rbx,%rbx ;\
+ jnz 6b ;\
+5: \
+ CLI(si,di) ;\
+ unmask(num) /* unmask it in hardware */ ;\
+ late_ack(num) ;\
+ CLI(si,di) ;\
+ jmp _C_LABEL(Xdoreti) /* lower spl and do ASTs */ ;\
+
+# The unmask func for Xen events
+#define hypervisor_asm_unmask(num) \
+ movq $num, %rdi ;\
+ call _C_LABEL(hypervisor_enable_ipl)
+
+XENINTRSTUB(xenev,0,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,1,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,2,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,3,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,4,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,5,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,6,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,7,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,8,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,9,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,10,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,11,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,12,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,13,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,14,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,15,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,16,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,17,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,18,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,19,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,20,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,21,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,22,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,23,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,24,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,25,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,26,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,27,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,28,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,29,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,30,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+XENINTRSTUB(xenev,31,voidop,voidop,voidop,hypervisor_asm_unmask,voidop)
+
+.globl _C_LABEL(xenev_stubs)
+_C_LABEL(xenev_stubs):
+ .quad _C_LABEL(Xrecurse_xenev0), _C_LABEL(Xresume_xenev0)
+ .quad _C_LABEL(Xrecurse_xenev1) ,_C_LABEL(Xresume_xenev1)
+ .quad _C_LABEL(Xrecurse_xenev2) ,_C_LABEL(Xresume_xenev2)
+ .quad _C_LABEL(Xrecurse_xenev3) ,_C_LABEL(Xresume_xenev3)
+ .quad _C_LABEL(Xrecurse_xenev4) ,_C_LABEL(Xresume_xenev4)
+ .quad _C_LABEL(Xrecurse_xenev5) ,_C_LABEL(Xresume_xenev5)
+ .quad _C_LABEL(Xrecurse_xenev6) ,_C_LABEL(Xresume_xenev6)
+ .quad _C_LABEL(Xrecurse_xenev7) ,_C_LABEL(Xresume_xenev7)
+ .quad _C_LABEL(Xrecurse_xenev8) ,_C_LABEL(Xresume_xenev8)
+ .quad _C_LABEL(Xrecurse_xenev9) ,_C_LABEL(Xresume_xenev9)
+ .quad _C_LABEL(Xrecurse_xenev10), _C_LABEL(Xresume_xenev10)
+ .quad _C_LABEL(Xrecurse_xenev11), _C_LABEL(Xresume_xenev11)
+ .quad _C_LABEL(Xrecurse_xenev12), _C_LABEL(Xresume_xenev12)
+ .quad _C_LABEL(Xrecurse_xenev13), _C_LABEL(Xresume_xenev13)
+ .quad _C_LABEL(Xrecurse_xenev14), _C_LABEL(Xresume_xenev14)
+ .quad _C_LABEL(Xrecurse_xenev15), _C_LABEL(Xresume_xenev15)
+ .quad _C_LABEL(Xrecurse_xenev16), _C_LABEL(Xresume_xenev16)
+ .quad _C_LABEL(Xrecurse_xenev17), _C_LABEL(Xresume_xenev17)
+ .quad _C_LABEL(Xrecurse_xenev18), _C_LABEL(Xresume_xenev18)
+ .quad _C_LABEL(Xrecurse_xenev19), _C_LABEL(Xresume_xenev19)
+ .quad _C_LABEL(Xrecurse_xenev20), _C_LABEL(Xresume_xenev20)
+ .quad _C_LABEL(Xrecurse_xenev21), _C_LABEL(Xresume_xenev21)
+ .quad _C_LABEL(Xrecurse_xenev22), _C_LABEL(Xresume_xenev22)
+ .quad _C_LABEL(Xrecurse_xenev23), _C_LABEL(Xresume_xenev23)
+ .quad _C_LABEL(Xrecurse_xenev24), _C_LABEL(Xresume_xenev24)
+ .quad _C_LABEL(Xrecurse_xenev25), _C_LABEL(Xresume_xenev25)
+ .quad _C_LABEL(Xrecurse_xenev26), _C_LABEL(Xresume_xenev26)
+ .quad _C_LABEL(Xrecurse_xenev27), _C_LABEL(Xresume_xenev27)
+ .quad _C_LABEL(Xrecurse_xenev28), _C_LABEL(Xresume_xenev28)
+ .quad _C_LABEL(Xrecurse_xenev29), _C_LABEL(Xresume_xenev29)
+ .quad _C_LABEL(Xrecurse_xenev30), _C_LABEL(Xresume_xenev30)
+ .quad _C_LABEL(Xrecurse_xenev31), _C_LABEL(Xresume_xenev31)
+
+# Xen callbacks
+
+# Hypervisor callback
+NENTRY(hypervisor_callback)
+ movq (%rsp),%rcx
+ movq 8(%rsp),%r11
+ addq $16,%rsp
+ pushq $0 # Dummy error code
+ pushq $T_ASTFLT
+ INTRENTRY
+ # sti??
+ movq %rsp, %rdi
+ subq $8, %rdi; /* don't forget if_ppl */
+ call do_hypervisor_callback
+ testb $SEL_RPL,TF_CS(%rsp)
+ jz 1f
+ jmp doreti_checkast
+1:
+ INTRFASTEXIT
+
+# Panic?
+NENTRY(failsafe_callback)
+ movq (%rsp),%rcx
+ movq 8(%rsp),%r11
+ addq $16,%rsp
+ pushq $0
+ pushq $T_ASTFLT
+ INTRENTRY
+ movq %rsp, %rdi
+ subq $8, %rdi; /* don't forget if_ppl */
+ call xen_failsafe_handler
+ INTRFASTEXIT
+# jmp HYPERVISOR_iret
+
+#endif /* !XEN */
View
25 sys/arch/amd64/conf/GENERIC
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.134.2.8 2007/12/03 18:34:40 ad Exp $
+# $NetBSD: GENERIC,v 1.134.2.9 2007/12/03 19:02:40 ad Exp $
#
# GENERIC machine description file
#
@@ -22,7 +22,7 @@ include "arch/amd64/conf/std.amd64"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary
-#ident "GENERIC-$Revision: 1.134.2.8 $"
+#ident "GENERIC-$Revision: 1.134.2.9 $"
maxusers 32 # estimated number of users
@@ -109,6 +109,7 @@ options COMPAT_40 # NetBSD 4.0 compatibility.
options COMPAT_43 # and 4.3BSD
#options COMPAT_386BSD_MBRPART # recognize old partition ID
+options COMPAT_OSSAUDIO
options COMPAT_NETBSD32
#options COMPAT_LINUX
#options COMPAT_LINUX32 # req. COMPAT_LINUX and COMPAT_NETBSD32
@@ -397,9 +398,6 @@ iic* at nfsmb?
# Intel Core's on-die Thermal sensor
options INTEL_CORETEMP
-# Intel Core's on-die Thermal sensor
-options INTEL_CORETEMP
-
# Intel ICH SMBus controller
ichsmb* at pci? dev ? function ?
iic* at ichsmb?
@@ -551,7 +549,6 @@ wd* at atabus? drive ? flags 0x0000
atapibus* at atapi?
-
# ATA RAID configuration support, as found on some Promise controllers.
pseudo-device ataraid
ld* at ataraid? vendtype ? unit ?
@@ -726,10 +723,6 @@ wsmouse* at ums? mux 0
uep* at uhub? port ?
wsmouse* at uep? mux 0
-# USB eGalax touch-panel
-uep* at uhub? port ?
-wsmouse* at uep? mux 0
-
# USB Keyboards
ukbd* at uhidev? reportid ?
wskbd* at ukbd? console ? mux 1
@@ -765,9 +758,6 @@ irframe* at uirda?
stuirda* at uhub? port ? configuration ? interface ?
irframe* at stuirda?
-stuirda* at uhub? port ? configuration ? interface ?
-irframe* at stuirda?
-
# SigmaTel STIr4200 USB/IrDA Bridge
ustir* at uhub? port ?
irframe* at ustir?
@@ -835,9 +825,6 @@ usscanner* at uhub? port ?
# Topfield TF5000PVR range of DVB recorders
utoppy* at uhub? port ?
-# Topfield TF5000PVR range of DVB recorders
-utoppy* at uhub? port ?
-
# Y@P firmware loader
uyap* at uhub? port ?
@@ -918,9 +905,6 @@ midi* at pcppi? # MIDI interface to the PC speaker
# The spkr driver provides a simple tone interface to the built in speaker.
#spkr0 at pcppi? # PC speaker
-# USB generic serial port (e.g., data over cellular)
-ugensa* at uhub? port ?
-ucom* at ugensa?
# FM-Radio devices
# PCI radio devices
@@ -1050,9 +1034,6 @@ pseudo-device wsfont
# pseudo audio device driver
pseudo-device pad
-# pseudo audio device driver
-pseudo-device pad
-
options FILEASSOC # fileassoc(9) - required for Veriexec
# Veriexec
View
456 sys/arch/amd64/conf/INSTALL_XEN3_DOMU
@@ -0,0 +1,456 @@
+# $NetBSD: INSTALL_XEN3_DOMU,v 1.2.4.2 2007/12/03 19:02:42 ad Exp $
+
+include "arch/amd64/conf/std.xen"
+
+options MAXPHYS=32768 #xbd doesn't handle 64k transfers
+
+
+#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
+
+# Enable the hooks used for initializing the root memory-disk.
+options MEMORY_DISK_HOOKS
+options MEMORY_DISK_IS_ROOT # force root on memory disk
+options MEMORY_DISK_SERVER=0 # no userspace memory disk support
+options MEMORY_DISK_ROOT_SIZE=10000 # size of memory disk, in blocks
+
+maxusers 32 # estimated number of users
+
+# CPU-related options.
+#options MATH_EMULATE # floating point emulation
+#options VM86 # virtual 8086 emulation
+#options USER_LDT # user-settable LDT; used by WINE
+
+# Standard system options
+
+options INSECURE # disable kernel security levels
+
+options RTC_OFFSET=0 # hardware clock is this many mins. west of GMT
+#options NTP # NTP phase/frequency locked loop
+
+#options KTRACE # system call tracing via ktrace(1)
+
+#options SYSVMSG # System V-like message queues
+#options SYSVSEM # System V-like semaphores
+#options SYSVSHM # System V-like memory sharing
+#options SHMMAXPGS=2048 # 2048 pages is the default
+
+#options LKM # loadable kernel modules
+
+options USERCONF # userconf(4) support
+options PIPE_SOCKETPAIR # smaller, but slower pipe(2)
+#options SYSCTL_INCLUDE_DESCR # Include sysctl descriptions in kernel
+
+# Diagnostic/debugging support options
+options DIAGNOSTIC # expensive kernel consistency checks
+options DEBUG # expensive debugging checks/support
+#options KMEMSTATS # kernel memory statistics (vmstat -m)
+options DDB # in-kernel debugger
+#options DDB_ONPANIC=1 # see also sysctl(8): `ddb.onpanic'
+options DDB_HISTORY_SIZE=512 # enable history editing in DDB
+#options KGDB # remote debugger
+#options KGDB_DEVNAME="\"com\"",KGDB_DEVADDR=0x3f8,KGDB_DEVRATE=9600
+makeoptions DEBUG="-g" # compile full symbol table
+makeoptions COPTS="-O2 -fno-omit-frame-pointer"
+options DDB_COMMANDONENTER="trace;show registers"
+
+
+# Compatibility options
+options COMPAT_40 # NetBSD 4.0
+
+#options COMPAT_SVR4 # binary compatibility with SVR4
+#options COMPAT_IBCS2 # binary compatibility with SCO and ISC
+#options COMPAT_LINUX # binary compatibility with Linux
+#options COMPAT_FREEBSD # binary compatibility with FreeBSD
+options COMPAT_BSDPTY # /dev/[pt]ty?? ptys.
+
+# File systems
+file-system FFS # UFS
+file-system EXT2FS # second extended file system (linux)
+#file-system LFS # log-structured file system
+file-system MFS # memory file system
+file-system NFS # Network File System client
+file-system NTFS # Windows/NT Filesystem
+file-system CD9660 # ISO 9660 + Rock Ridge file system
+file-system MSDOSFS # MS-DOS file system
+#file-system FDESC # /dev/fd
+file-system KERNFS # /kern
+#file-system NULLFS # loopback file system
+#file-system PORTAL # portal filesystem (still experimental)
+#file-system PROCFS # /proc
+#file-system UMAPFS # NULLFS + uid and gid remapping
+#file-system UNION # union file system
+#file-system PTYFS # /dev/pts/N support
+#file-system TMPFS # Efficient memory file-system
+
+# Filesystem options
+#options QUOTA # UFS quotas
+#options NFSSERVER # Network File System server
+#options NFS_V2_ONLY # Exclude NFS3 code to save space
+options FFS_NO_SNAPSHOT # No FFS snapshot support
+#options EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
+ # immutable) behave as system flags.
+
+# Networking options
+#options GATEWAY # packet forwarding
+options INET # IP + ICMP + TCP + UDP
+options INET6 # IPv6
+#options MROUTING # IP multicast routing
+#options PIM # Protocol Independent Multicast
+#options ISO,TPIP # OSI
+#options EON # OSI tunneling over IP
+#options NETATALK # AppleTalk networking protocols
+#options PPP_BSDCOMP # BSD-Compress compression support for PPP
+#options PPP_DEFLATE # Deflate compression support for PPP
+#options PPP_FILTER # Active filter support for PPP (requires bpf)
+#options PFIL_HOOKS # pfil(9) packet filter hooks
+#options TCP_DEBUG # Record last TCP_NDEBUG packets with SO_DEBUG
+
+config netbsd root on ? type ?
+#config netbsd root on wd0a type ffs
+#config netbsd root on xennet0 type nfs
+
+mainbus0 at root
+
+hypervisor* at mainbus? # Xen hypervisor
+
+xencons* at hypervisor? # Xen virtual console
+
+vcpu* at hypervisor? # Xen virtual CPUs
+
+xenbus* at hypervisor? # Xen virtual bus
+xennet* at xenbus? # Xen virtual network interface
+xbd* at xenbus? # Xen virtual block device
+
+# Pseudo-Devices
+
+# disk/mass storage pseudo-devices
+#pseudo-device ccd 4 # concatenated/striped disk devices
+pseudo-device raid 8 # RAIDframe disk driver
+options RAID_AUTOCONFIG # auto-configuration of RAID components
+#pseudo-device fss 4 # file system snapshot device
+pseudo-device md 1 # memory disk device (ramdisk)
+#pseudo-device vnd # disk-like interface to files
+
+# network pseudo-devices
+pseudo-device bpfilter # Berkeley packet filter
+#pseudo-device ipfilter # IP filter (firewall) and NAT
+pseudo-device loop # network loopback
+#pseudo-device ppp # Point-to-Point Protocol
+#pseudo-device sl # Serial Line IP
+#pseudo-device strip # Starmode Radio IP (Metricom)
+#pseudo-device tun # network tunneling over tty
+#pseudo-device gre # generic L3 over IP tunnel
+
+# miscellaneous pseudo-devices
+pseudo-device pty 2 # pseudo-terminals (Sysinst needs two)
+#pseudo-device sequencer 1 # MIDI sequencer
+# rnd works; RND_COM does not on port i386 yet.
+pseudo-device rnd # /dev/random and in-kernel generator
+#options RND_COM # use "com" randomness as well (BROKEN)
+
+# a pseudo device needed for Coda # also needs CODA (above)
+#pseudo-device vcoda 4 # coda minicache <-> venus comm.
+# $NetBSD: INSTALL_XEN3_DOMU,v 1.2.4.2 2007/12/03 19:02:42 ad Exp $
+
+include "arch/amd64/conf/std.xen"
+
+options MAXPHYS=32768 #xbd doesn't handle 64k transfers
+
+
+#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
+
+# Enable the hooks used for initializing the root memory-disk.
+options MEMORY_DISK_HOOKS
+options MEMORY_DISK_IS_ROOT # force root on memory disk
+options MEMORY_DISK_SERVER=0 # no userspace memory disk support
+options MEMORY_DISK_ROOT_SIZE=10000 # size of memory disk, in blocks
+
+maxusers 32 # estimated number of users
+
+# CPU-related options.
+#options MATH_EMULATE # floating point emulation
+#options VM86 # virtual 8086 emulation
+#options USER_LDT # user-settable LDT; used by WINE
+
+# Standard system options
+
+options INSECURE # disable kernel security levels
+
+options RTC_OFFSET=0 # hardware clock is this many mins. west of GMT
+#options NTP # NTP phase/frequency locked loop
+
+#options KTRACE # system call tracing via ktrace(1)
+
+#options SYSVMSG # System V-like message queues
+#options SYSVSEM # System V-like semaphores
+#options SYSVSHM # System V-like memory sharing
+#options SHMMAXPGS=2048 # 2048 pages is the default
+
+#options LKM # loadable kernel modules
+
+options USERCONF # userconf(4) support
+options PIPE_SOCKETPAIR # smaller, but slower pipe(2)
+#options SYSCTL_INCLUDE_DESCR # Include sysctl descriptions in kernel
+
+# Diagnostic/debugging support options
+options DIAGNOSTIC # expensive kernel consistency checks
+options DEBUG # expensive debugging checks/support
+#options KMEMSTATS # kernel memory statistics (vmstat -m)
+options DDB # in-kernel debugger
+#options DDB_ONPANIC=1 # see also sysctl(8): `ddb.onpanic'
+options DDB_HISTORY_SIZE=512 # enable history editing in DDB
+#options KGDB # remote debugger
+#options KGDB_DEVNAME="\"com\"",KGDB_DEVADDR=0x3f8,KGDB_DEVRATE=9600
+makeoptions DEBUG="-g" # compile full symbol table
+makeoptions COPTS="-O2 -fno-omit-frame-pointer"
+options DDB_COMMANDONENTER="trace;show registers"
+
+
+# Compatibility options
+options COMPAT_40 # NetBSD 4.0
+
+#options COMPAT_SVR4 # binary compatibility with SVR4
+#options COMPAT_IBCS2 # binary compatibility with SCO and ISC
+#options COMPAT_LINUX # binary compatibility with Linux
+#options COMPAT_FREEBSD # binary compatibility with FreeBSD
+options COMPAT_BSDPTY # /dev/[pt]ty?? ptys.
+
+# File systems
+file-system FFS # UFS
+file-system EXT2FS # second extended file system (linux)
+#file-system LFS # log-structured file system
+file-system MFS # memory file system
+file-system NFS # Network File System client
+file-system NTFS # Windows/NT Filesystem
+file-system CD9660 # ISO 9660 + Rock Ridge file system
+file-system MSDOSFS # MS-DOS file system
+#file-system FDESC # /dev/fd
+file-system KERNFS # /kern
+#file-system NULLFS # loopback file system
+#file-system PORTAL # portal filesystem (still experimental)
+#file-system PROCFS # /proc
+#file-system UMAPFS # NULLFS + uid and gid remapping
+#file-system UNION # union file system
+#file-system PTYFS # /dev/pts/N support
+#file-system TMPFS # Efficient memory file-system
+
+# Filesystem options
+#options QUOTA # UFS quotas
+#options NFSSERVER # Network File System server
+#options NFS_V2_ONLY # Exclude NFS3 code to save space
+options FFS_NO_SNAPSHOT # No FFS snapshot support
+#options EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
+ # immutable) behave as system flags.
+
+# Networking options
+#options GATEWAY # packet forwarding
+options INET # IP + ICMP + TCP + UDP
+options INET6 # IPv6
+#options MROUTING # IP multicast routing
+#options PIM # Protocol Independent Multicast
+#options ISO,TPIP # OSI
+#options EON # OSI tunneling over IP
+#options NETATALK # AppleTalk networking protocols
+#options PPP_BSDCOMP # BSD-Compress compression support for PPP
+#options PPP_DEFLATE # Deflate compression support for PPP
+#options PPP_FILTER # Active filter support for PPP (requires bpf)
+#options PFIL_HOOKS # pfil(9) packet filter hooks
+#options TCP_DEBUG # Record last TCP_NDEBUG packets with SO_DEBUG
+
+config netbsd root on ? type ?
+#config netbsd root on wd0a type ffs
+#config netbsd root on xennet0 type nfs
+
+mainbus0 at root
+
+hypervisor* at mainbus? # Xen hypervisor
+
+xencons* at hypervisor? # Xen virtual console
+
+vcpu* at hypervisor? # Xen virtual CPUs
+
+xenbus* at hypervisor? # Xen virtual bus
+xennet* at xenbus? # Xen virtual network interface
+xbd* at xenbus? # Xen virtual block device
+
+# Pseudo-Devices
+
+# disk/mass storage pseudo-devices
+#pseudo-device ccd 4 # concatenated/striped disk devices
+pseudo-device raid 8 # RAIDframe disk driver
+options RAID_AUTOCONFIG # auto-configuration of RAID components
+#pseudo-device fss 4 # file system snapshot device
+pseudo-device md 1 # memory disk device (ramdisk)
+#pseudo-device vnd # disk-like interface to files
+
+# network pseudo-devices
+pseudo-device bpfilter # Berkeley packet filter
+#pseudo-device ipfilter # IP filter (firewall) and NAT
+pseudo-device loop # network loopback
+#pseudo-device ppp # Point-to-Point Protocol
+#pseudo-device sl # Serial Line IP
+#pseudo-device strip # Starmode Radio IP (Metricom)
+#pseudo-device tun # network tunneling over tty
+#pseudo-device gre # generic L3 over IP tunnel
+
+# miscellaneous pseudo-devices
+pseudo-device pty 2 # pseudo-terminals (Sysinst needs two)
+#pseudo-device sequencer 1 # MIDI sequencer
+# rnd works; RND_COM does not on port i386 yet.
+pseudo-device rnd # /dev/random and in-kernel generator
+#options RND_COM # use "com" randomness as well (BROKEN)
+
+# a pseudo device needed for Coda # also needs CODA (above)
+#pseudo-device vcoda 4 # coda minicache <-> venus comm.
+# $NetBSD: INSTALL_XEN3_DOMU,v 1.2.4.2 2007/12/03 19:02:42 ad Exp $
+
+include "arch/amd64/conf/std.xen"
+
+options MAXPHYS=32768 #xbd doesn't handle 64k transfers
+
+
+#options INCLUDE_CONFIG_FILE # embed config file in kernel binary
+
+# Enable the hooks used for initializing the root memory-disk.
+options MEMORY_DISK_HOOKS
+options MEMORY_DISK_IS_ROOT # force root on memory disk
+options MEMORY_DISK_SERVER=0 # no userspace memory disk support
+options MEMORY_DISK_ROOT_SIZE=10000 # size of memory disk, in blocks
+
+maxusers 32 # estimated number of users
+
+# CPU-related options.
+#options MATH_EMULATE # floating point emulation
+#options VM86 # virtual 8086 emulation
+#options USER_LDT # user-settable LDT; used by WINE
+
+# Standard system options
+
+options INSECURE # disable kernel security levels
+
+options RTC_OFFSET=0 # hardware clock is this many mins. west of GMT
+#options NTP # NTP phase/frequency locked loop
+
+#options KTRACE # system call tracing via ktrace(1)
+
+#options SYSVMSG # System V-like message queues
+#options SYSVSEM # System V-like semaphores
+#options SYSVSHM # System V-like memory sharing
+#options SHMMAXPGS=2048 # 2048 pages is the default
+
+#options LKM # loadable kernel modules
+
+options USERCONF # userconf(4) support
+options PIPE_SOCKETPAIR # smaller, but slower pipe(2)
+#options SYSCTL_INCLUDE_DESCR # Include sysctl descriptions in kernel
+
+# Diagnostic/debugging support options
+options DIAGNOSTIC # expensive kernel consistency checks
+options DEBUG # expensive debugging checks/support
+#options KMEMSTATS # kernel memory statistics (vmstat -m)
+options DDB # in-kernel debugger
+#options DDB_ONPANIC=1 # see also sysctl(8): `ddb.onpanic'
+options DDB_HISTORY_SIZE=512 # enable history editing in DDB
+#options KGDB # remote debugger
+#options KGDB_DEVNAME="\"com\"",KGDB_DEVADDR=0x3f8,KGDB_DEVRATE=9600
+makeoptions DEBUG="-g" # compile full symbol table
+makeoptions COPTS="-O2 -fno-omit-frame-pointer"
+options DDB_COMMANDONENTER="trace;show registers"
+
+
+# Compatibility options
+options COMPAT_40 # NetBSD 4.0
+
+#options COMPAT_SVR4 # binary compatibility with SVR4
+#options COMPAT_IBCS2 # binary compatibility with SCO and ISC
+#options COMPAT_LINUX # binary compatibility with Linux
+#options COMPAT_FREEBSD # binary compatibility with FreeBSD
+options COMPAT_BSDPTY # /dev/[pt]ty?? ptys.
+
+# File systems
+file-system FFS # UFS
+file-system EXT2FS # second extended file system (linux)
+#file-system LFS # log-structured file system
+file-system MFS # memory file system
+file-system NFS # Network File System client
+file-system NTFS # Windows/NT Filesystem
+file-system CD9660 # ISO 9660 + Rock Ridge file system
+file-system MSDOSFS # MS-DOS file system
+#file-system FDESC # /dev/fd
+file-system KERNFS # /kern
+#file-system NULLFS # loopback file system
+#file-system PORTAL # portal filesystem (still experimental)
+#file-system PROCFS # /proc
+#file-system UMAPFS # NULLFS + uid and gid remapping
+#file-system UNION # union file system
+#file-system PTYFS # /dev/pts/N support
+#file-system TMPFS # Efficient memory file-system
+
+# Filesystem options
+#options QUOTA # UFS quotas
+#options NFSSERVER # Network File System server
+#options NFS_V2_ONLY # Exclude NFS3 code to save space
+options FFS_NO_SNAPSHOT # No FFS snapshot support
+#options EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
+ # immutable) behave as system flags.
+
+# Networking options
+#options GATEWAY # packet forwarding
+options INET # IP + ICMP + TCP + UDP
+options INET6 # IPv6
+#options MROUTING # IP multicast routing
+#options PIM # Protocol Independent Multicast
+#options ISO,TPIP # OSI
+#options EON # OSI tunneling over IP
+#options NETATALK # AppleTalk networking protocols
+#options PPP_BSDCOMP # BSD-Compress compression support for PPP
+#options PPP_DEFLATE # Deflate compression support for PPP
+#options PPP_FILTER # Active filter support for PPP (requires bpf)
+#options PFIL_HOOKS # pfil(9) packet filter hooks
+#options TCP_DEBUG # Record last TCP_NDEBUG packets with SO_DEBUG
+
+config netbsd root on ? type ?
+#config netbsd root on wd0a type ffs
+#config netbsd root on xennet0 type nfs
+
+mainbus0 at root
+
+hypervisor* at mainbus? # Xen hypervisor
+
+xencons* at hypervisor? # Xen virtual console
+
+vcpu* at hypervisor? # Xen virtual CPUs
+
+xenbus* at hypervisor? # Xen virtual bus
+xennet* at xenbus? # Xen virtual network interface
+xbd* at xenbus? # Xen virtual block device
+
+# Pseudo-Devices
+
+# disk/mass storage pseudo-devices
+#pseudo-device ccd 4 # concatenated/striped disk devices
+pseudo-device raid 8 # RAIDframe disk driver
+options RAID_AUTOCONFIG # auto-configuration of RAID components
+#pseudo-device fss 4 # file system snapshot device
+pseudo-device md 1 # memory disk device (ramdisk)
+#pseudo-device vnd # disk-like interface to files
+
+# network pseudo-devices
+pseudo-device bpfilter # Berkeley packet filter
+#pseudo-device ipfilter # IP filter (firewall) and NAT
+pseudo-device loop # network loopback
+#pseudo-device ppp # Point-to-Point Protocol
+#pseudo-device sl # Serial Line IP
+#pseudo-device strip # Starmode Radio IP (Metricom)
+#pseudo-device tun # network tunneling over tty
+#pseudo-device gre # generic L3 over IP tunnel
+
+# miscellaneous pseudo-devices
+pseudo-device pty 2 # pseudo-terminals (Sysinst needs two)
+#pseudo-device sequencer 1 # MIDI sequencer
+# rnd works; RND_COM does not on port i386 yet.
+pseudo-device rnd # /dev/random and in-kernel generator
+#options RND_COM # use "com" randomness as well (BROKEN)
+
+# a pseudo device needed for Coda # also needs CODA (above)
+#pseudo-device vcoda 4 # coda minicache <-> venus comm.
View
2,202 sys/arch/amd64/conf/XEN3_DOM0
@@ -0,0 +1,2202 @@
+# $NetBSD: XEN3_DOM0,v 1.2.4.2 2007/12/03 19:02:44 ad Exp $
+
+include "arch/amd64/conf/std.xen"
+
+options INCLUDE_CONFIG_FILE # embed config file in kernel binary
+
+#options UVMHIST
+#options UVMHIST_PRINT