Sat Jul 4 21:02:16 2020 UTC ()
the x86 xen and non-xen modules are identical,
so remove the unneeded extra copies.
Xen kernels now use the same modules as native kernels.


(chs)
diff -r1.86 -r1.87 src/distrib/sets/lists/modules/md.amd64
diff -r1.86 -r1.87 src/distrib/sets/lists/modules/md.i386
diff -r1.1199 -r1.1200 src/share/mk/bsd.own.mk
diff -r1.143 -r1.144 src/sys/arch/x86/x86/x86_machdep.c
diff -r1.5 -r1.6 src/sys/modules/arch/archdirs.mk
diff -r1.1 -r0 src/sys/modules/arch/x86/amd64-xen/Makefile
diff -r1.2 -r0 src/sys/modules/arch/x86/amd64-xen/bsd.amd64-xen.mk
diff -r1.1 -r0 src/sys/modules/arch/x86/i386pae-xen/Makefile
diff -r1.2 -r0 src/sys/modules/arch/x86/i386pae-xen/bsd.i386pae-xen.mk

cvs diff -r1.86 -r1.87 src/distrib/sets/lists/modules/md.amd64 (expand / switch to unified diff)

--- src/distrib/sets/lists/modules/md.amd64 2020/03/12 15:04:13 1.86
+++ src/distrib/sets/lists/modules/md.amd64 2020/07/04 21:02:16 1.87
@@ -1,17 +1,14 @@ @@ -1,17 +1,14 @@
1# $NetBSD: md.amd64,v 1.86 2020/03/12 15:04:13 pgoyette Exp $ 1# $NetBSD: md.amd64,v 1.87 2020/07/04 21:02:16 chs Exp $
2# 
3# NOTE that there are two sets of files here: 
4# @MODULEDIR@ and amd64-xen 
5# 2#
6./@MODULEDIR@/acpiacad modules-base-kernel kmod 3./@MODULEDIR@/acpiacad modules-base-kernel kmod
7./@MODULEDIR@/acpiacad/acpiacad.kmod modules-base-kernel kmod 4./@MODULEDIR@/acpiacad/acpiacad.kmod modules-base-kernel kmod
8./@MODULEDIR@/acpibat modules-base-kernel kmod 5./@MODULEDIR@/acpibat modules-base-kernel kmod
9./@MODULEDIR@/acpibat/acpibat.kmod modules-base-kernel kmod 6./@MODULEDIR@/acpibat/acpibat.kmod modules-base-kernel kmod
10./@MODULEDIR@/acpibut modules-base-kernel kmod 7./@MODULEDIR@/acpibut modules-base-kernel kmod
11./@MODULEDIR@/acpibut/acpibut.kmod modules-base-kernel kmod 8./@MODULEDIR@/acpibut/acpibut.kmod modules-base-kernel kmod
12./@MODULEDIR@/acpicpu modules-base-kernel kmod 9./@MODULEDIR@/acpicpu modules-base-kernel kmod
13./@MODULEDIR@/acpicpu/acpicpu.kmod modules-base-kernel kmod 10./@MODULEDIR@/acpicpu/acpicpu.kmod modules-base-kernel kmod
14./@MODULEDIR@/acpidalb modules-base-kernel kmod 11./@MODULEDIR@/acpidalb modules-base-kernel kmod
15./@MODULEDIR@/acpidalb/acpidalb.kmod modules-base-kernel kmod 12./@MODULEDIR@/acpidalb/acpidalb.kmod modules-base-kernel kmod
16./@MODULEDIR@/acpifan modules-base-kernel kmod 13./@MODULEDIR@/acpifan modules-base-kernel kmod
17./@MODULEDIR@/acpifan/acpifan.kmod modules-base-kernel kmod 14./@MODULEDIR@/acpifan/acpifan.kmod modules-base-kernel kmod

cvs diff -r1.86 -r1.87 src/distrib/sets/lists/modules/md.i386 (expand / switch to unified diff)

--- src/distrib/sets/lists/modules/md.i386 2020/02/29 18:46:12 1.86
+++ src/distrib/sets/lists/modules/md.i386 2020/07/04 21:02:16 1.87
@@ -1,18 +1,15 @@ @@ -1,18 +1,15 @@
1# $NetBSD: md.i386,v 1.86 2020/02/29 18:46:12 skrll Exp $ 1# $NetBSD: md.i386,v 1.87 2020/07/04 21:02:16 chs Exp $
2# 2#
3# NOTE that there are two sets of files here: @MODULEDIR@ and i386pae-xen 
4# 
5 
6./@MODULEDIR@/acpiacad modules-base-kernel kmod 3./@MODULEDIR@/acpiacad modules-base-kernel kmod
7./@MODULEDIR@/acpiacad/acpiacad.kmod modules-base-kernel kmod 4./@MODULEDIR@/acpiacad/acpiacad.kmod modules-base-kernel kmod
8./@MODULEDIR@/acpibat modules-base-kernel kmod 5./@MODULEDIR@/acpibat modules-base-kernel kmod
9./@MODULEDIR@/acpibat/acpibat.kmod modules-base-kernel kmod 6./@MODULEDIR@/acpibat/acpibat.kmod modules-base-kernel kmod
10./@MODULEDIR@/acpibut modules-base-kernel kmod 7./@MODULEDIR@/acpibut modules-base-kernel kmod
11./@MODULEDIR@/acpibut/acpibut.kmod modules-base-kernel kmod 8./@MODULEDIR@/acpibut/acpibut.kmod modules-base-kernel kmod
12./@MODULEDIR@/acpicpu modules-base-kernel kmod 9./@MODULEDIR@/acpicpu modules-base-kernel kmod
13./@MODULEDIR@/acpicpu/acpicpu.kmod modules-base-kernel kmod 10./@MODULEDIR@/acpicpu/acpicpu.kmod modules-base-kernel kmod
14./@MODULEDIR@/acpidalb modules-base-kernel kmod 11./@MODULEDIR@/acpidalb modules-base-kernel kmod
15./@MODULEDIR@/acpidalb/acpidalb.kmod modules-base-kernel kmod 12./@MODULEDIR@/acpidalb/acpidalb.kmod modules-base-kernel kmod
16./@MODULEDIR@/acpifan modules-base-kernel kmod 13./@MODULEDIR@/acpifan modules-base-kernel kmod
17./@MODULEDIR@/acpifan/acpifan.kmod modules-base-kernel kmod 14./@MODULEDIR@/acpifan/acpifan.kmod modules-base-kernel kmod
18./@MODULEDIR@/acpilid modules-base-kernel kmod 15./@MODULEDIR@/acpilid modules-base-kernel kmod

cvs diff -r1.1199 -r1.1200 src/share/mk/bsd.own.mk (expand / switch to unified diff)

--- src/share/mk/bsd.own.mk 2020/06/06 22:06:42 1.1199
+++ src/share/mk/bsd.own.mk 2020/07/04 21:02:16 1.1200
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: bsd.own.mk,v 1.1199 2020/06/06 22:06:42 joerg Exp $ 1# $NetBSD: bsd.own.mk,v 1.1200 2020/07/04 21:02:16 chs Exp $
2 2
3# This needs to be before bsd.init.mk 3# This needs to be before bsd.init.mk
4.if defined(BSD_MK_COMPAT_FILE) 4.if defined(BSD_MK_COMPAT_FILE)
5.include <${BSD_MK_COMPAT_FILE}> 5.include <${BSD_MK_COMPAT_FILE}>
6.endif 6.endif
7 7
8.if !defined(_BSD_OWN_MK_) 8.if !defined(_BSD_OWN_MK_)
9_BSD_OWN_MK_=1 9_BSD_OWN_MK_=1
10 10
11MAKECONF?= /etc/mk.conf 11MAKECONF?= /etc/mk.conf
12.-include "${MAKECONF}" 12.-include "${MAKECONF}"
13 13
14# 14#
@@ -996,28 +996,27 @@ MK${var}:= yes @@ -996,28 +996,27 @@ MK${var}:= yes
996 || ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "aarch64" \ 996 || ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "aarch64" \
997 || ${MACHINE_ARCH} == "riscv64" || !empty(MACHINE_ARCH:Mearm*) 997 || ${MACHINE_ARCH} == "riscv64" || !empty(MACHINE_ARCH:Mearm*)
998MKCOMPAT?= yes 998MKCOMPAT?= yes
999.else 999.else
1000# Don't let this build where it really isn't supported. 1000# Don't let this build where it really isn't supported.
1001MKCOMPAT:= no 1001MKCOMPAT:= no
1002.endif 1002.endif
1003 1003
1004.if ${MKCOMPAT} == "no" 1004.if ${MKCOMPAT} == "no"
1005MKCOMPATTESTS:= no 1005MKCOMPATTESTS:= no
1006MKCOMPATX11:= no 1006MKCOMPATX11:= no
1007.endif 1007.endif
1008 1008
1009.if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386" \ 1009.if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" \
1010 || ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" \ 
1011 || (${MACHINE} == "evbppc" && ${MACHINE_ARCH} == "powerpc") 1010 || (${MACHINE} == "evbppc" && ${MACHINE_ARCH} == "powerpc")
1012MKCOMPATMODULES?= yes 1011MKCOMPATMODULES?= yes
1013.else 1012.else
1014MKCOMPATMODULES:= no 1013MKCOMPATMODULES:= no
1015.endif 1014.endif
1016 1015
1017# 1016#
1018# These platforms use softfloat by default. 1017# These platforms use softfloat by default.
1019# 1018#
1020.if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" 1019.if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el"
1021MKSOFTFLOAT?= yes 1020MKSOFTFLOAT?= yes
1022.endif 1021.endif
1023 1022

cvs diff -r1.143 -r1.144 src/sys/arch/x86/x86/x86_machdep.c (expand / switch to unified diff)

--- src/sys/arch/x86/x86/x86_machdep.c 2020/05/21 21:12:30 1.143
+++ src/sys/arch/x86/x86/x86_machdep.c 2020/07/04 21:02:16 1.144
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: x86_machdep.c,v 1.143 2020/05/21 21:12:30 ad Exp $ */ 1/* $NetBSD: x86_machdep.c,v 1.144 2020/07/04 21:02:16 chs Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi, 4 * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi,
5 * Copyright (c) 2005, 2008, 2009, 2019 The NetBSD Foundation, Inc. 5 * Copyright (c) 2005, 2008, 2009, 2019 The NetBSD Foundation, Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * This code is derived from software contributed to The NetBSD Foundation 8 * This code is derived from software contributed to The NetBSD Foundation
9 * by Julio M. Merino Vidal, and Andrew Doran. 9 * by Julio M. Merino Vidal, and Andrew Doran.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE. 30 * POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.143 2020/05/21 21:12:30 ad Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.144 2020/07/04 21:02:16 chs Exp $");
35 35
36#include "opt_modular.h" 36#include "opt_modular.h"
37#include "opt_physmem.h" 37#include "opt_physmem.h"
38#include "opt_splash.h" 38#include "opt_splash.h"
39#include "opt_kaslr.h" 39#include "opt_kaslr.h"
40#include "opt_svs.h" 40#include "opt_svs.h"
41#include "opt_xen.h" 41#include "opt_xen.h"
42 42
43#include <sys/types.h> 43#include <sys/types.h>
44#include <sys/param.h> 44#include <sys/param.h>
45#include <sys/systm.h> 45#include <sys/systm.h>
46#include <sys/kcore.h> 46#include <sys/kcore.h>
47#include <sys/errno.h> 47#include <sys/errno.h>
@@ -90,30 +90,26 @@ __KERNEL_RCSID(0, "$NetBSD: x86_machdep. @@ -90,30 +90,26 @@ __KERNEL_RCSID(0, "$NetBSD: x86_machdep.
90#if defined(MEMORY_DISK_HOOKS) && defined(MEMORY_DISK_DYNAMIC) 90#if defined(MEMORY_DISK_HOOKS) && defined(MEMORY_DISK_DYNAMIC)
91#include <dev/md.h> 91#include <dev/md.h>
92#endif 92#endif
93 93
94void (*x86_cpu_idle)(void); 94void (*x86_cpu_idle)(void);
95static bool x86_cpu_idle_ipi; 95static bool x86_cpu_idle_ipi;
96static char x86_cpu_idle_text[16]; 96static char x86_cpu_idle_text[16];
97 97
98#ifdef XEN 98#ifdef XEN
99 99
100#include <xen/xen.h> 100#include <xen/xen.h>
101#include <xen/hypervisor.h> 101#include <xen/hypervisor.h>
102#endif 102#endif
103#ifdef XENPV 
104char module_machine_amd64_xen[] = "amd64-xen"; 
105char module_machine_i386pae_xen[] = "i386pae-xen"; 
106#endif 
107 103
108#ifndef XENPV 104#ifndef XENPV
109void (*delay_func)(unsigned int) = i8254_delay; 105void (*delay_func)(unsigned int) = i8254_delay;
110void (*x86_initclock_func)(void) = i8254_initclocks; 106void (*x86_initclock_func)(void) = i8254_initclocks;
111#else /* XENPV */ 107#else /* XENPV */
112void (*delay_func)(unsigned int) = xen_delay; 108void (*delay_func)(unsigned int) = xen_delay;
113void (*x86_initclock_func)(void) = xen_initclocks; 109void (*x86_initclock_func)(void) = xen_initclocks;
114#endif 110#endif
115 111
116 112
117/* --------------------------------------------------------------------- */ 113/* --------------------------------------------------------------------- */
118 114
119/* 115/*
@@ -214,35 +210,26 @@ mm_md_physacc(paddr_t pa, vm_prot_t prot @@ -214,35 +210,26 @@ mm_md_physacc(paddr_t pa, vm_prot_t prot
214 KAUTH_MACHDEP_UNMANAGEDMEM, NULL, NULL, NULL, NULL); 210 KAUTH_MACHDEP_UNMANAGEDMEM, NULL, NULL, NULL, NULL);
215} 211}
216 212
217#ifdef MODULAR 213#ifdef MODULAR
218/* 214/*
219 * Push any modules loaded by the boot loader. 215 * Push any modules loaded by the boot loader.
220 */ 216 */
221void 217void
222module_init_md(void) 218module_init_md(void)
223{ 219{
224 struct btinfo_modulelist *biml; 220 struct btinfo_modulelist *biml;
225 struct bi_modulelist_entry *bi, *bimax; 221 struct bi_modulelist_entry *bi, *bimax;
226 222
227 /* setup module path for XEN kernels */ 
228#ifdef XENPV 
229#ifdef __x86_64__ 
230 module_machine = module_machine_amd64_xen; 
231#else 
232 module_machine = module_machine_i386pae_xen; 
233#endif 
234#endif 
235 
236 biml = lookup_bootinfo(BTINFO_MODULELIST); 223 biml = lookup_bootinfo(BTINFO_MODULELIST);
237 if (biml == NULL) { 224 if (biml == NULL) {
238 aprint_debug("No module info at boot\n"); 225 aprint_debug("No module info at boot\n");
239 return; 226 return;
240 } 227 }
241 228
242 bi = (struct bi_modulelist_entry *)((uint8_t *)biml + sizeof(*biml)); 229 bi = (struct bi_modulelist_entry *)((uint8_t *)biml + sizeof(*biml));
243 bimax = bi + biml->num; 230 bimax = bi + biml->num;
244 for (; bi < bimax; bi++) { 231 for (; bi < bimax; bi++) {
245 switch (bi->type) { 232 switch (bi->type) {
246 case BI_MODULE_ELF: 233 case BI_MODULE_ELF:
247 aprint_debug("Prep module path=%s len=%d pa=%x\n", 234 aprint_debug("Prep module path=%s len=%d pa=%x\n",
248 bi->path, bi->len, bi->base); 235 bi->path, bi->len, bi->base);

cvs diff -r1.5 -r1.6 src/sys/modules/arch/archdirs.mk (expand / switch to unified diff)

--- src/sys/modules/arch/archdirs.mk 2020/06/27 06:50:00 1.5
+++ src/sys/modules/arch/archdirs.mk 2020/07/04 21:02:16 1.6
@@ -1,19 +1,11 @@ @@ -1,19 +1,11 @@
1# $NetBSD: archdirs.mk,v 1.5 2020/06/27 06:50:00 rin Exp $ 1# $NetBSD: archdirs.mk,v 1.6 2020/07/04 21:02:16 chs Exp $
2 2
3# list of subdirs used per-platform 3# list of subdirs used per-platform
4 4
5.if ${MACHINE} == "amd64" 
6ARCHDIR_SUBDIR= x86/amd64-xen 
7.endif 
8 
9.if ${MACHINE} == "i386" 
10ARCHDIR_SUBDIR= x86/i386pae-xen 
11.endif 
12 
13.if ${MACHINE_ARCH} == "powerpc" 5.if ${MACHINE_ARCH} == "powerpc"
14ARCHDIR_SUBDIR= powerpc/powerpc-ibm4xx powerpc/powerpc-booke 6ARCHDIR_SUBDIR= powerpc/powerpc-ibm4xx powerpc/powerpc-booke
15.endif 7.endif
16 8
17.if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el" 9.if ${MACHINE_ARCH} == "mips64eb" || ${MACHINE_ARCH} == "mips64el"
18ARCHDIR_SUBDIR= mips/mips-n32 10ARCHDIR_SUBDIR= mips/mips-n32
19.endif 11.endif

File Deleted: src/sys/modules/arch/x86/amd64-xen/Attic/Makefile

File Deleted: src/sys/modules/arch/x86/amd64-xen/Attic/bsd.amd64-xen.mk

File Deleted: src/sys/modules/arch/x86/i386pae-xen/Attic/Makefile

File Deleted: src/sys/modules/arch/x86/i386pae-xen/Attic/bsd.i386pae-xen.mk