Thu Apr 16 08:46:36 2020 UTC ()
Reorganise sources to make it possible to include Xen PVHVM support in
native kernels. Among others:
- move xen/include/amd64/hypercall.h to amd64/include/xen and
xen/include/i386/hypercall.h to i386/include/xen
- exclude some native files from the build for xenpv
- add xen to "machine" config statement for amd64 and i386
- split arch/xen/conf/files.xen to arch/xen/conf/files.xen (for pv drivers)
and arch/xen/conf/files.xen.pv (for full pv support)
- add GENERIC_XENHVM kernel config which includes GENERIC and add Xen PV
drivers.
(bouyer)
diff -r1.73.6.3 -r1.73.6.4 src/sys/arch/amd64/amd64/vector.S
diff -r0 -r1.1.2.1 src/sys/arch/amd64/conf/GENERIC_XENHVM
diff -r1.82 -r1.82.2.1 src/sys/arch/amd64/conf/Makefile.amd64
diff -r1.175.4.1 -r1.175.4.2 src/sys/arch/amd64/conf/XEN3_DOM0
diff -r1.115 -r1.115.4.1 src/sys/arch/amd64/conf/files.amd64
diff -r1.11 -r1.11.26.1 src/sys/arch/amd64/conf/std.amd64
diff -r1.11 -r1.11.10.1 src/sys/arch/amd64/conf/std.xen
diff -r0 -r1.1.2.1 src/sys/arch/amd64/include/xen/hypercalls.h
diff -r0 -r1.1.2.1 src/sys/arch/i386/conf/GENERIC_XENHVM
diff -r1.194 -r1.194.10.1 src/sys/arch/i386/conf/Makefile.i386
diff -r1.21.2.1 -r1.21.2.2 src/sys/arch/i386/conf/XEN3PAE_DOM0
diff -r1.401 -r1.401.6.1 src/sys/arch/i386/conf/files.i386
diff -r1.35 -r1.35.26.1 src/sys/arch/i386/conf/std.i386
diff -r1.825.4.1 -r1.825.4.2 src/sys/arch/i386/i386/machdep.c
diff -r1.85.6.4 -r1.85.6.5 src/sys/arch/i386/i386/vector.S
diff -r0 -r1.1.2.1 src/sys/arch/i386/include/xen/hypercalls.h
diff -r1.107.10.1 -r1.107.10.2 src/sys/arch/x86/conf/files.x86
diff -r1.61.6.2 -r1.61.6.3 src/sys/arch/x86/include/intr.h
diff -r1.12 -r1.12.10.1 src/sys/arch/x86/x86/cpu_ucode.c
diff -r1.10 -r1.10.6.1 src/sys/arch/x86/x86/cpu_ucode_amd.c
diff -r1.17 -r1.17.8.1 src/sys/arch/x86/x86/cpu_ucode_intel.c
diff -r1.76.6.1 -r1.76.6.2 src/sys/arch/x86/x86/lapic.c
diff -r1.3.12.1 -r1.3.12.2 src/sys/arch/x86/x86/mainbus.c
diff -r1.48 -r1.48.10.1 src/sys/arch/xen/conf/Makefile.xen
diff -r1.180.2.2 -r1.180.2.3 src/sys/arch/xen/conf/files.xen
diff -r0 -r1.1.2.1 src/sys/arch/xen/conf/files.xen.pv
diff -r1.10 -r1.10.10.1 src/sys/arch/xen/conf/std.xen
diff -r1.49.10.1 -r1.49.10.2 src/sys/arch/xen/include/hypervisor.h
diff -r1.53.6.1 -r1.53.6.2 src/sys/arch/xen/include/intr.h
diff -r1.42 -r1.42.6.1 src/sys/arch/xen/include/xenpmap.h
diff -r1.12 -r0 src/sys/arch/xen/include/amd64/hypercalls.h
diff -r1.19 -r0 src/sys/arch/xen/include/i386/hypercalls.h
diff -r1.36.8.1 -r1.36.8.2 src/sys/arch/xen/x86/hypervisor_machdep.c
diff -r1.21.2.4 -r1.21.2.5 src/sys/arch/xen/x86/xen_intr.c
diff -r1.35.6.2 -r1.35.6.3 src/sys/arch/xen/x86/xen_ipi.c
diff -r1.6 -r1.6.12.1 src/sys/arch/xen/x86/xen_mainbus.c
diff -r1.88.2.3 -r1.88.2.4 src/sys/arch/xen/xen/evtchn.c
diff -r1.109 -r1.109.2.1 src/sys/arch/xen/xen/if_xennet_xenbus.c
diff -r1.97 -r1.97.2.1 src/sys/arch/xen/xen/xbd_xenbus.c
diff -r1.22 -r1.22.10.1 src/sys/arch/xen/xen/xen_machdep.c
diff -r1.48 -r1.48.10.1 src/sys/arch/xen/xen/xencons.c
diff -r1.21 -r1.21.10.1 src/sys/arch/xen/xenbus/xenbus_comms.c
diff -r1.17 -r1.17.2.1 src/sys/arch/xen/xenbus/xenbus_dev.c
--- src/sys/arch/amd64/amd64/vector.S 2020/04/12 17:25:52 1.73.6.3
+++ src/sys/arch/amd64/amd64/vector.S 2020/04/16 08:46:34 1.73.6.4
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: vector.S,v 1.73.6.3 2020/04/12 17:25:52 bouyer Exp $ */ | | 1 | /* $NetBSD: vector.S,v 1.73.6.4 2020/04/16 08:46:34 bouyer Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Charles M. Hannum and by Andrew Doran. | | 8 | * by Charles M. Hannum and by Andrew Doran. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -74,50 +74,51 @@ | | | @@ -74,50 +74,51 @@ |
74 | #define ALIGN_TEXT .align 16,0x90 | | 74 | #define ALIGN_TEXT .align 16,0x90 |
75 | | | 75 | |
76 | #include <machine/i8259.h> | | 76 | #include <machine/i8259.h> |
77 | #include <machine/i82093reg.h> | | 77 | #include <machine/i82093reg.h> |
78 | #include <machine/i82489reg.h> | | 78 | #include <machine/i82489reg.h> |
79 | #include <machine/frameasm.h> | | 79 | #include <machine/frameasm.h> |
80 | #include <machine/segments.h> | | 80 | #include <machine/segments.h> |
81 | #include <machine/trap.h> | | 81 | #include <machine/trap.h> |
82 | #include <machine/specialreg.h> | | 82 | #include <machine/specialreg.h> |
83 | | | 83 | |
84 | #include "ioapic.h" | | 84 | #include "ioapic.h" |
85 | #include "lapic.h" | | 85 | #include "lapic.h" |
86 | #include "assym.h" | | 86 | #include "assym.h" |
87 | #ifndef XEN | | 87 | #ifndef XENPV |
88 | #include "hyperv.h" | | 88 | #include "hyperv.h" |
89 | #endif | | 89 | #endif |
90 | | | 90 | |
91 | .text | | 91 | .text |
92 | | | 92 | |
93 | /* | | 93 | /* |
94 | * Macros for interrupt entry, call to handler, and exit. | | 94 | * Macros for interrupt entry, call to handler, and exit. |
95 | * | | 95 | * |
96 | * XXX | | 96 | * XXX |
97 | * The interrupt frame is set up to look like a trap frame. This may be a | | 97 | * The interrupt frame is set up to look like a trap frame. This may be a |
98 | * waste. The only handler which needs a frame is the clock handler, and it | | 98 | * waste. The only handler which needs a frame is the clock handler, and it |
99 | * only needs a few bits. Xdoreti() needs a trap frame for handling ASTs, but | | 99 | * only needs a few bits. Xdoreti() needs a trap frame for handling ASTs, but |
100 | * it could easily convert the frame on demand. | | 100 | * it could easily convert the frame on demand. |
101 | * | | 101 | * |
102 | * The direct costs of setting up a trap frame are two pushq's (error code and | | 102 | * The direct costs of setting up a trap frame are two pushq's (error code and |
103 | * trap number), an addl to get rid of these, and pushing and popping the | | 103 | * trap number), an addl to get rid of these, and pushing and popping the |
104 | * callee-saved registers %esi, %edi, %ebx, and %ebp twice. | | 104 | * callee-saved registers %esi, %edi, %ebx, and %ebp twice. |
105 | * | | 105 | * |
106 | * If the interrupt frame is made more flexible, INTR can push %eax first and | | 106 | * If the interrupt frame is made more flexible, INTR can push %eax first and |
107 | * decide the ipending case with less overhead, e.g., by avoiding loading the | | 107 | * decide the ipending case with less overhead, e.g., by avoiding loading the |
108 | * segment registers. | | 108 | * segment registers. |
109 | */ | | 109 | */ |
110 | | | 110 | |
| | | 111 | #ifndef XENPV |
111 | #if NLAPIC > 0 | | 112 | #if NLAPIC > 0 |
112 | #ifdef MULTIPROCESSOR | | 113 | #ifdef MULTIPROCESSOR |
113 | IDTVEC(recurse_lapic_ipi) | | 114 | IDTVEC(recurse_lapic_ipi) |
114 | INTR_RECURSE_HWFRAME | | 115 | INTR_RECURSE_HWFRAME |
115 | pushq $0 | | 116 | pushq $0 |
116 | pushq $T_ASTFLT | | 117 | pushq $T_ASTFLT |
117 | INTR_RECURSE_ENTRY | | 118 | INTR_RECURSE_ENTRY |
118 | jmp 1f | | 119 | jmp 1f |
119 | IDTVEC_END(recurse_lapic_ipi) | | 120 | IDTVEC_END(recurse_lapic_ipi) |
120 | IDTVEC(handle_x2apic_ipi) | | 121 | IDTVEC(handle_x2apic_ipi) |
121 | movl $(MSR_X2APIC_BASE + MSR_X2APIC_EOI),%ecx | | 122 | movl $(MSR_X2APIC_BASE + MSR_X2APIC_EOI),%ecx |
122 | xorl %eax,%eax | | 123 | xorl %eax,%eax |
123 | xorl %edx,%edx | | 124 | xorl %edx,%edx |
| @@ -299,27 +300,26 @@ IDTVEC_END(resume_hyperv_hypercall) | | | @@ -299,27 +300,26 @@ IDTVEC_END(resume_hyperv_hypercall) |
299 | | | 300 | |
300 | TEXT_USER_BEGIN | | 301 | TEXT_USER_BEGIN |
301 | IDTVEC(intr_hyperv_hypercall) | | 302 | IDTVEC(intr_hyperv_hypercall) |
302 | pushq $0 | | 303 | pushq $0 |
303 | pushq $T_ASTFLT | | 304 | pushq $T_ASTFLT |
304 | INTRENTRY | | 305 | INTRENTRY |
305 | jmp _C_LABEL(Xhandle_hyperv_hypercall) | | 306 | jmp _C_LABEL(Xhandle_hyperv_hypercall) |
306 | IDTVEC_END(intr_hyperv_hypercall) | | 307 | IDTVEC_END(intr_hyperv_hypercall) |
307 | TEXT_USER_END | | 308 | TEXT_USER_END |
308 | #endif /* NHYPERV > 0 */ | | 309 | #endif /* NHYPERV > 0 */ |
309 | | | 310 | |
310 | #endif /* NLAPIC > 0 */ | | 311 | #endif /* NLAPIC > 0 */ |
311 | | | 312 | |
312 | #ifndef XENPV | | | |
313 | /* | | 313 | /* |
314 | * TLB shootdown handler. | | 314 | * TLB shootdown handler. |
315 | */ | | 315 | */ |
316 | IDTVEC(handle_lapic_tlb) | | 316 | IDTVEC(handle_lapic_tlb) |
317 | movq _C_LABEL(local_apic_va),%rax | | 317 | movq _C_LABEL(local_apic_va),%rax |
318 | movl $0,LAPIC_EOI(%rax) | | 318 | movl $0,LAPIC_EOI(%rax) |
319 | KCOV_DISABLE | | 319 | KCOV_DISABLE |
320 | callq _C_LABEL(pmap_tlb_intr) | | 320 | callq _C_LABEL(pmap_tlb_intr) |
321 | KCOV_ENABLE | | 321 | KCOV_ENABLE |
322 | INTRFASTEXIT | | 322 | INTRFASTEXIT |
323 | IDTVEC_END(handle_lapic_tlb) | | 323 | IDTVEC_END(handle_lapic_tlb) |
324 | IDTVEC(handle_x2apic_tlb) | | 324 | IDTVEC(handle_x2apic_tlb) |
325 | movl $(MSR_X2APIC_BASE + MSR_X2APIC_EOI),%ecx | | 325 | movl $(MSR_X2APIC_BASE + MSR_X2APIC_EOI),%ecx |
# $NetBSD: GENERIC_XENHVM,v 1.1.2.1 2020/04/16 08:46:34 bouyer Exp $
include "arch/amd64/conf/GENERIC"
options XENPVHVM
options XEN
no options SVS # Separate Virtual Space
options MAXPHYS=32768 #xbd doesn't handle 64k transfers
hypervisor* at mainbus? # Xen hypervisor
#vcpu* at hypervisor? # Xen virtual CPUs
xenbus* at hypervisor? # Xen virtual bus
xencons* at hypervisor? # Xen virtual console
xennet* at xenbus? # Xen virtual network interface
xbd* at xenbus? # Xen virtual block device
--- src/sys/arch/amd64/conf/Makefile.amd64 2020/04/04 07:03:57 1.82
+++ src/sys/arch/amd64/conf/Makefile.amd64 2020/04/16 08:46:34 1.82.2.1
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: Makefile.amd64,v 1.82 2020/04/04 07:03:57 maxv Exp $ | | 1 | # $NetBSD: Makefile.amd64,v 1.82.2.1 2020/04/16 08:46:34 bouyer Exp $ |
2 | | | 2 | |
3 | # Makefile for NetBSD | | 3 | # Makefile for NetBSD |
4 | # | | 4 | # |
5 | # This makefile is constructed from a machine description: | | 5 | # This makefile is constructed from a machine description: |
6 | # config machineid | | 6 | # config machineid |
7 | # Most changes should be made in the machine description | | 7 | # Most changes should be made in the machine description |
8 | # /sys/arch/amd64/conf/``machineid'' | | 8 | # /sys/arch/amd64/conf/``machineid'' |
9 | # after which you should do | | 9 | # after which you should do |
10 | # config machineid | | 10 | # config machineid |
11 | # Machine generic makefile changes should be made in | | 11 | # Machine generic makefile changes should be made in |
12 | # /sys/arch/amd64/conf/Makefile.amd64 | | 12 | # /sys/arch/amd64/conf/Makefile.amd64 |
13 | # after which config should be rerun for all machines of that type. | | 13 | # after which config should be rerun for all machines of that type. |
14 | # | | 14 | # |
| @@ -67,26 +67,28 @@ KCSANFLAGS= -fsanitize=thread | | | @@ -67,26 +67,28 @@ KCSANFLAGS= -fsanitize=thread |
67 | KCSANFLAGS.${f}= # empty | | 67 | KCSANFLAGS.${f}= # empty |
68 | .endfor | | 68 | .endfor |
69 | CFLAGS+= ${KCSANFLAGS.${.IMPSRC:T}:U${KCSANFLAGS}} | | 69 | CFLAGS+= ${KCSANFLAGS.${.IMPSRC:T}:U${KCSANFLAGS}} |
70 | .endif | | 70 | .endif |
71 | | | 71 | |
72 | .if ${KMSAN:U0} > 0 && ${HAVE_LLVM:Uno} == "yes" | | 72 | .if ${KMSAN:U0} > 0 && ${HAVE_LLVM:Uno} == "yes" |
73 | KMSANFLAGS= -fsanitize=kernel-memory | | 73 | KMSANFLAGS= -fsanitize=kernel-memory |
74 | .for f in subr_msan.c | | 74 | .for f in subr_msan.c |
75 | KMSANFLAGS.${f}= # empty | | 75 | KMSANFLAGS.${f}= # empty |
76 | .endfor | | 76 | .endfor |
77 | CFLAGS+= ${KMSANFLAGS.${.IMPSRC:T}:U${KMSANFLAGS}} | | 77 | CFLAGS+= ${KMSANFLAGS.${.IMPSRC:T}:U${KMSANFLAGS}} |
78 | .endif | | 78 | .endif |
79 | | | 79 | |
| | | 80 | EXTRA_INCLUDES= -I$S/external/mit/xen-include-public/dist/ |
| | | 81 | |
80 | ## | | 82 | ## |
81 | ## (3) libkern and compat | | 83 | ## (3) libkern and compat |
82 | ## | | 84 | ## |
83 | OPT_MODULAR= %MODULAR% | | 85 | OPT_MODULAR= %MODULAR% |
84 | | | 86 | |
85 | ## | | 87 | ## |
86 | ## (4) local objects, compile rules, and dependencies | | 88 | ## (4) local objects, compile rules, and dependencies |
87 | ## | | 89 | ## |
88 | | | 90 | |
89 | ## | | 91 | ## |
90 | ## (5) link settings | | 92 | ## (5) link settings |
91 | ## | | 93 | ## |
92 | TEXTADDR?= 0xffffffff80200000 | | 94 | TEXTADDR?= 0xffffffff80200000 |
--- src/sys/arch/amd64/conf/XEN3_DOM0 2020/04/12 21:20:16 1.175.4.1
+++ src/sys/arch/amd64/conf/XEN3_DOM0 2020/04/16 08:46:34 1.175.4.2
| @@ -1,28 +1,28 @@ | | | @@ -1,28 +1,28 @@ |
1 | # $NetBSD: XEN3_DOM0,v 1.175.4.1 2020/04/12 21:20:16 bouyer Exp $ | | 1 | # $NetBSD: XEN3_DOM0,v 1.175.4.2 2020/04/16 08:46:34 bouyer Exp $ |
2 | | | 2 | |
3 | include "arch/amd64/conf/std.xen" | | 3 | include "arch/amd64/conf/std.xen" |
4 | | | 4 | |
5 | options XENPV # PV dom0 support | | 5 | options XENPV # PV dom0 support |
6 | #options MULTIPROCESSOR # (not yet - dom0 stuff is not MP-safe) | | 6 | #options MULTIPROCESSOR # (not yet - dom0 stuff is not MP-safe) |
7 | options NO_PREEMPTION | | 7 | options NO_PREEMPTION |
8 | | | 8 | |
9 | options INCLUDE_CONFIG_FILE # embed config file in kernel binary | | 9 | options INCLUDE_CONFIG_FILE # embed config file in kernel binary |
10 | | | 10 | |
11 | #options UVMHIST | | 11 | #options UVMHIST |
12 | #options UVMHIST_PRINT | | 12 | #options UVMHIST_PRINT |
13 | #options SYSCALL_DEBUG | | 13 | #options SYSCALL_DEBUG |
14 | | | 14 | |
15 | #ident "XEN3_DOM0-$Revision: 1.175.4.1 $" | | 15 | #ident "XEN3_DOM0-$Revision: 1.175.4.2 $" |
16 | | | 16 | |
17 | maxusers 32 # estimated number of users | | 17 | maxusers 32 # estimated number of users |
18 | | | 18 | |
19 | # | | 19 | # |
20 | options DOM0OPS | | 20 | options DOM0OPS |
21 | | | 21 | |
22 | # boot messages with MPBIOS, acpi and ioapic can be quite large | | 22 | # boot messages with MPBIOS, acpi and ioapic can be quite large |
23 | options MSGBUFSIZE=24576 | | 23 | options MSGBUFSIZE=24576 |
24 | | | 24 | |
25 | # CPU features | | 25 | # CPU features |
26 | est0 at cpu0 # Intel Enhanced SpeedStep (non-ACPI) | | 26 | est0 at cpu0 # Intel Enhanced SpeedStep (non-ACPI) |
27 | powernow0 at cpu0 # AMD PowerNow! and Cool'n'Quiet (non-ACPI) | | 27 | powernow0 at cpu0 # AMD PowerNow! and Cool'n'Quiet (non-ACPI) |
28 | | | 28 | |
| @@ -214,26 +214,27 @@ acpiec* at acpi? # ACPI Embedded Contr | | | @@ -214,26 +214,27 @@ acpiec* at acpi? # ACPI Embedded Contr |
214 | acpiecdt* at acpi? # ACPI Embedded Controller (early) | | 214 | acpiecdt* at acpi? # ACPI Embedded Controller (early) |
215 | acpilid* at acpi? # ACPI Lid Switch | | 215 | acpilid* at acpi? # ACPI Lid Switch |
216 | acpitz* at acpi? # ACPI Thermal Zone | | 216 | acpitz* at acpi? # ACPI Thermal Zone |
217 | aibs* at acpi? # ASUSTeK AI Booster hardware monitor | | 217 | aibs* at acpi? # ASUSTeK AI Booster hardware monitor |
218 | hpqlb* at acpi? # HP Quick Launch Buttons | | 218 | hpqlb* at acpi? # HP Quick Launch Buttons |
219 | pckbc* at acpi? # PC keyboard controller | | 219 | pckbc* at acpi? # PC keyboard controller |
220 | pcppi* at acpi? # AT-style speaker sound | | 220 | pcppi* at acpi? # AT-style speaker sound |
221 | | | 221 | |
222 | # PCI bus support | | 222 | # PCI bus support |
223 | pci* at hypervisor? bus ? | | 223 | pci* at hypervisor? bus ? |
224 | pci* at pchb? bus ? | | 224 | pci* at pchb? bus ? |
225 | ppb* at pci? dev ? function ? # PCI-PCI bridges | | 225 | ppb* at pci? dev ? function ? # PCI-PCI bridges |
226 | pci* at ppb? bus ? | | 226 | pci* at ppb? bus ? |
| | | 227 | options NO_PCI_MSI_MSIX |
227 | | | 228 | |
228 | # pci backend devices, used for PCI pass-through. To export a PCI device | | 229 | # pci backend devices, used for PCI pass-through. To export a PCI device |
229 | # to a domU, the device has to be attached to the pciback driver in the dom0. | | 230 | # to a domU, the device has to be attached to the pciback driver in the dom0. |
230 | # you can force a device to attach to the pciback driver in dom0 passing | | 231 | # you can force a device to attach to the pciback driver in dom0 passing |
231 | # pciback.hide=(bus:dev.fun)(bus:dev.func) to the dom0 kernel boot parameters. | | 232 | # pciback.hide=(bus:dev.fun)(bus:dev.func) to the dom0 kernel boot parameters. |
232 | # bus and dev are 2-digits hex number, func is a single-digit number: | | 233 | # bus and dev are 2-digits hex number, func is a single-digit number: |
233 | # pciback.hide=(00:1a.0)(00:1a.1)(00:1a.7) | | 234 | # pciback.hide=(00:1a.0)(00:1a.1)(00:1a.7) |
234 | pciback* at pci? # pci backend device | | 235 | pciback* at pci? # pci backend device |
235 | | | 236 | |
236 | # PCI bridges | | 237 | # PCI bridges |
237 | ichlpcib* at pci? dev ? function ? # Intel ICH PCI-ISA w/ timecounter, | | 238 | ichlpcib* at pci? dev ? function ? # Intel ICH PCI-ISA w/ timecounter, |
238 | # watchdog and SpeedStep support | | 239 | # watchdog and SpeedStep support |
239 | pcib* at pci? dev ? function ? # PCI-ISA bridges | | 240 | pcib* at pci? dev ? function ? # PCI-ISA bridges |
--- src/sys/arch/amd64/conf/files.amd64 2020/01/09 00:42:24 1.115
+++ src/sys/arch/amd64/conf/files.amd64 2020/04/16 08:46:34 1.115.4.1
| @@ -1,20 +1,18 @@ | | | @@ -1,20 +1,18 @@ |
1 | # $NetBSD: files.amd64,v 1.115 2020/01/09 00:42:24 manu Exp $ | | 1 | # $NetBSD: files.amd64,v 1.115.4.1 2020/04/16 08:46:34 bouyer Exp $ |
2 | # | | 2 | # |
3 | # new style config file for amd64 architecture | | 3 | # new style config file for amd64 architecture |
4 | # | | 4 | # |
5 | | | 5 | |
6 | ifndef xen | | | |
7 | | | | |
8 | # maxpartitions must be first item in files.${ARCH}.newconf | | 6 | # maxpartitions must be first item in files.${ARCH}.newconf |
9 | maxpartitions 16 | | 7 | maxpartitions 16 |
10 | | | 8 | |
11 | maxusers 2 16 128 | | 9 | maxusers 2 16 128 |
12 | | | 10 | |
13 | # delay before cpu_reset() for reboot. | | 11 | # delay before cpu_reset() for reboot. |
14 | defparam CPURESET_DELAY | | 12 | defparam CPURESET_DELAY |
15 | | | 13 | |
16 | # The REAL{BASE,EXT}MEM options | | 14 | # The REAL{BASE,EXT}MEM options |
17 | defparam opt_realmem.h REALBASEMEM REALEXTMEM | | 15 | defparam opt_realmem.h REALBASEMEM REALEXTMEM |
18 | | | 16 | |
19 | # The PHYSMEM_MAX_{SIZE,ADDR} optionms | | 17 | # The PHYSMEM_MAX_{SIZE,ADDR} optionms |
20 | defparam opt_physmem.h PHYSMEM_MAX_ADDR PHYSMEM_MAX_SIZE | | 18 | defparam opt_physmem.h PHYSMEM_MAX_ADDR PHYSMEM_MAX_SIZE |
| @@ -27,47 +25,47 @@ defflag opt_spectre.h SPECTRE_V2_GCC_MIT | | | @@ -27,47 +25,47 @@ defflag opt_spectre.h SPECTRE_V2_GCC_MIT |
27 | # with the i386 (they include the opt_*.h for these) | | 25 | # with the i386 (they include the opt_*.h for these) |
28 | # | | 26 | # |
29 | | | 27 | |
30 | defflag USER_LDT | | 28 | defflag USER_LDT |
31 | defflag eisa.h EISA | | 29 | defflag eisa.h EISA |
32 | | | 30 | |
33 | # Start code | | 31 | # Start code |
34 | file arch/amd64/amd64/locore.S machdep | | 32 | file arch/amd64/amd64/locore.S machdep |
35 | file arch/amd64/amd64/vector.S machdep | | 33 | file arch/amd64/amd64/vector.S machdep |
36 | file arch/amd64/amd64/copy.S machdep | | 34 | file arch/amd64/amd64/copy.S machdep |
37 | file arch/amd64/amd64/spl.S machdep | | 35 | file arch/amd64/amd64/spl.S machdep |
38 | | | 36 | |
39 | file arch/amd64/amd64/amd64_trap.S machdep | | 37 | file arch/amd64/amd64/amd64_trap.S machdep |
40 | file arch/amd64/amd64/autoconf.c machdep | | 38 | file arch/amd64/amd64/autoconf.c machdep & !xenpv |
41 | file arch/amd64/amd64/busfunc.S machdep | | 39 | file arch/amd64/amd64/busfunc.S machdep |
42 | file arch/amd64/amd64/cpu_in_cksum.S (inet | inet6) & cpu_in_cksum | | 40 | file arch/amd64/amd64/cpu_in_cksum.S (inet | inet6) & cpu_in_cksum |
43 | file arch/amd64/amd64/cpufunc.S machdep | | 41 | file arch/amd64/amd64/cpufunc.S machdep |
44 | file arch/amd64/amd64/db_disasm.c ddb | | 42 | file arch/amd64/amd64/db_disasm.c ddb |
45 | file arch/amd64/amd64/db_interface.c ddb | | 43 | file arch/amd64/amd64/db_interface.c ddb |
46 | file arch/amd64/amd64/db_machdep.c ddb | | 44 | file arch/amd64/amd64/db_machdep.c ddb |
47 | file arch/amd64/amd64/kobj_machdep.c modular | | 45 | file arch/amd64/amd64/kobj_machdep.c modular |
48 | file kern/subr_disk_mbr.c disk | | 46 | file kern/subr_disk_mbr.c disk |
49 | file arch/amd64/amd64/gdt.c machdep | | 47 | file arch/amd64/amd64/gdt.c machdep |
50 | file arch/amd64/amd64/machdep.c machdep | | 48 | file arch/amd64/amd64/machdep.c machdep |
51 | file arch/amd64/amd64/prekern.c kaslr | | 49 | file arch/amd64/amd64/prekern.c kaslr |
52 | file arch/amd64/amd64/process_machdep.c machdep | | 50 | file arch/amd64/amd64/process_machdep.c machdep |
53 | file arch/amd64/amd64/trap.c machdep | | 51 | file arch/amd64/amd64/trap.c machdep |
54 | file arch/x86/x86/fpu.c machdep | | 52 | file arch/x86/x86/fpu.c machdep |
55 | file arch/x86/x86/dbregs.c machdep | | 53 | file arch/x86/x86/dbregs.c machdep |
56 | file arch/x86/x86/spectre.c machdep | | 54 | file arch/x86/x86/spectre.c machdep & !xenpv |
57 | file arch/amd64/amd64/lock_stubs.S machdep | | 55 | file arch/amd64/amd64/lock_stubs.S machdep |
58 | file dev/cons.c machdep | | 56 | file dev/cons.c machdep |
59 | | | 57 | |
60 | file arch/amd64/amd64/mptramp.S multiprocessor | | 58 | file arch/amd64/amd64/mptramp.S multiprocessor & !xenpv |
61 | | | 59 | |
62 | # | | 60 | # |
63 | # Stack-less Just-In-Time compiler | | 61 | # Stack-less Just-In-Time compiler |
64 | # | | 62 | # |
65 | | | 63 | |
66 | include "external/bsd/sljit/conf/files.sljit" | | 64 | include "external/bsd/sljit/conf/files.sljit" |
67 | | | 65 | |
68 | # | | 66 | # |
69 | # Machine-independent SCSI drivers | | 67 | # Machine-independent SCSI drivers |
70 | # | | 68 | # |
71 | | | 69 | |
72 | include "dev/scsipi/files.scsipi" | | 70 | include "dev/scsipi/files.scsipi" |
73 | | | 71 | |
| @@ -81,29 +79,30 @@ include "dev/ata/files.ata" | | | @@ -81,29 +79,30 @@ include "dev/ata/files.ata" |
81 | file dev/md_root.c memory_disk_hooks | | 79 | file dev/md_root.c memory_disk_hooks |
82 | | | 80 | |
83 | # | | 81 | # |
84 | # Machine-independent I2O drivers | | 82 | # Machine-independent I2O drivers |
85 | # | | 83 | # |
86 | | | 84 | |
87 | include "dev/i2o/files.i2o" | | 85 | include "dev/i2o/files.i2o" |
88 | | | 86 | |
89 | # | | 87 | # |
90 | # System bus types | | 88 | # System bus types |
91 | # | | 89 | # |
92 | | | 90 | |
93 | # XXX BIOS32 only if something that uses it is configured! | | 91 | # XXX BIOS32 only if something that uses it is configured! |
94 | device mainbus: isabus, pcibus, bios32, acpibus, cpubus, ioapicbus, ipmibus | | 92 | device mainbus: isabus, pcibus, bios32, acpibus, cpubus, ioapicbus, |
| | | 93 | ipmibus, hypervisorbus |
95 | attach mainbus at root | | 94 | attach mainbus at root |
96 | file arch/amd64/amd64/amd64_mainbus.c mainbus | | 95 | file arch/amd64/amd64/amd64_mainbus.c mainbus & !xenpv |
97 | file arch/x86/x86/mainbus.c mainbus | | 96 | file arch/x86/x86/mainbus.c mainbus |
98 | | | 97 | |
99 | # | | 98 | # |
100 | # PCI-only drivers | | 99 | # PCI-only drivers |
101 | # XXX MUST BE INCLUDED BEFORE files.isa, as long as files.isa attaches | | 100 | # XXX MUST BE INCLUDED BEFORE files.isa, as long as files.isa attaches |
102 | # XXX devices to 'pci'. | | 101 | # XXX devices to 'pci'. |
103 | # | | 102 | # |
104 | | | 103 | |
105 | include "dev/pci/files.pci" | | 104 | include "dev/pci/files.pci" |
106 | defparam PCI_CONF_MODE | | 105 | defparam PCI_CONF_MODE |
107 | include "dev/pci/files.agp" | | 106 | include "dev/pci/files.agp" |
108 | | | 107 | |
109 | # x86 specific PCI hardware | | 108 | # x86 specific PCI hardware |
| @@ -176,23 +175,22 @@ file arch/amd64/amd64/rbus_machdep.c car | | | @@ -176,23 +175,22 @@ file arch/amd64/amd64/rbus_machdep.c car |
176 | # Machine-independent PCMCIA drivers | | 175 | # Machine-independent PCMCIA drivers |
177 | # | | 176 | # |
178 | include "dev/pcmcia/files.pcmcia" | | 177 | include "dev/pcmcia/files.pcmcia" |
179 | | | 178 | |
180 | include "dev/usb/files.usb" | | 179 | include "dev/usb/files.usb" |
181 | | | 180 | |
182 | include "dev/bluetooth/files.bluetooth" | | 181 | include "dev/bluetooth/files.bluetooth" |
183 | | | 182 | |
184 | include "dev/sdmmc/files.sdmmc" | | 183 | include "dev/sdmmc/files.sdmmc" |
185 | | | 184 | |
186 | include "dev/ieee1394/files.ieee1394" | | 185 | include "dev/ieee1394/files.ieee1394" |
187 | include "dev/apm/files.apm" | | 186 | include "dev/apm/files.apm" |
188 | include "dev/acpi/files.acpi" | | 187 | include "dev/acpi/files.acpi" |
189 | file arch/amd64/acpi/acpi_wakeup_low.S acpi | | 188 | file arch/amd64/acpi/acpi_wakeup_low.S acpi & !xenpv |
190 | | | 189 | |
191 | # Microsoft Hyper-V | | 190 | # Microsoft Hyper-V |
192 | include "dev/hyperv/files.hyperv" | | 191 | include "dev/hyperv/files.hyperv" |
193 | | | 192 | |
194 | attach vmbus at acpinodebus with vmbus_acpi | | 193 | attach vmbus at acpinodebus with vmbus_acpi |
195 | file dev/acpi/vmbus_acpi.c vmbus_acpi | | 194 | file dev/acpi/vmbus_acpi.c vmbus_acpi |
196 | | | 195 | |
197 | include "arch/amd64/conf/majors.amd64" | | 196 | include "arch/amd64/conf/majors.amd64" |
198 | endif #xen | | | |
--- src/sys/arch/amd64/conf/std.amd64 2017/01/12 05:24:36 1.11
+++ src/sys/arch/amd64/conf/std.amd64 2020/04/16 08:46:34 1.11.26.1
| @@ -1,22 +1,24 @@ | | | @@ -1,22 +1,24 @@ |
1 | # $NetBSD: std.amd64,v 1.11 2017/01/12 05:24:36 ryo Exp $ | | 1 | # $NetBSD: std.amd64,v 1.11.26.1 2020/04/16 08:46:34 bouyer Exp $ |
2 | # | | 2 | # |
3 | # standard, required NetBSD/amd64 'options' | | 3 | # standard, required NetBSD/amd64 'options' |
4 | | | 4 | |
5 | machine amd64 x86 | | 5 | machine amd64 x86 xen |
6 | include "conf/std" # MI standard options | | 6 | include "conf/std" # MI standard options |
7 | | | 7 | |
8 | options CPU_IN_CKSUM | | 8 | options CPU_IN_CKSUM |
9 | options EXEC_ELF64 # exec ELF binaries | | 9 | options EXEC_ELF64 # exec ELF binaries |
10 | options EXEC_SCRIPT # exec #! scripts | | 10 | options EXEC_SCRIPT # exec #! scripts |
11 | options MTRR | | 11 | options MTRR |
12 | options MULTIPROCESSOR | | 12 | options MULTIPROCESSOR |
13 | | | 13 | |
14 | options CHILD_MAX=1024 # 160 is too few | | 14 | options CHILD_MAX=1024 # 160 is too few |
15 | options OPEN_MAX=1024 # 128 is too few | | 15 | options OPEN_MAX=1024 # 128 is too few |
16 | | | 16 | |
| | | 17 | options __XEN_INTERFACE_VERSION__=0x00030208 # Xen 3.1 interface |
| | | 18 | |
17 | mainbus0 at root | | 19 | mainbus0 at root |
18 | cpu* at mainbus? | | 20 | cpu* at mainbus? |
19 | ioapic* at mainbus? apid ? | | 21 | ioapic* at mainbus? apid ? |
20 | | | 22 | |
21 | # Atheros HAL options | | 23 | # Atheros HAL options |
22 | include "external/isc/atheros_hal/conf/std.ath_hal" | | 24 | include "external/isc/atheros_hal/conf/std.ath_hal" |
--- src/sys/arch/amd64/conf/std.xen 2019/02/04 18:14:53 1.11
+++ src/sys/arch/amd64/conf/std.xen 2020/04/16 08:46:34 1.11.10.1
| @@ -1,19 +1,20 @@ | | | @@ -1,19 +1,20 @@ |
1 | # $NetBSD: std.xen,v 1.11 2019/02/04 18:14:53 cherry Exp $ | | 1 | # $NetBSD: std.xen,v 1.11.10.1 2020/04/16 08:46:34 bouyer Exp $ |
2 | # NetBSD: std.i386,v 1.24 2003/02/26 21:33:36 fvdl Exp | | 2 | # NetBSD: std.i386,v 1.24 2003/02/26 21:33:36 fvdl Exp |
3 | # | | 3 | # |
4 | # standard, required NetBSD/i386 'options' | | 4 | # standard, required NetBSD/i386 'options' |
5 | | | 5 | |
6 | machine xen amd64 | | 6 | machine xen amd64 x86 |
7 | include "conf/std" # MI standard options | | 7 | include "conf/std" # MI standard options |
| | | 8 | include "arch/xen/conf/files.xen.pv" |
8 | | | 9 | |
9 | options XEN #Xen support | | 10 | options XEN #Xen support |
10 | options __XEN_INTERFACE_VERSION__=0x00030208 # Xen 3.1 interface | | 11 | options __XEN_INTERFACE_VERSION__=0x00030208 # Xen 3.1 interface |
11 | #options __XEN_INTERFACE_VERSION__=0x00030205 # Xen 3.1 interface | | 12 | #options __XEN_INTERFACE_VERSION__=0x00030205 # Xen 3.1 interface |
12 | | | 13 | |
13 | options CPU_IN_CKSUM | | 14 | options CPU_IN_CKSUM |
14 | options EXEC_ELF64 # exec ELF binaries | | 15 | options EXEC_ELF64 # exec ELF binaries |
15 | options EXEC_SCRIPT # exec #! scripts | | 16 | options EXEC_SCRIPT # exec #! scripts |
16 | options MTRR | | 17 | options MTRR |
17 | | | 18 | |
18 | options CHILD_MAX=1024 # 160 is too few | | 19 | options CHILD_MAX=1024 # 160 is too few |
19 | options OPEN_MAX=1024 # 128 is too few | | 20 | options OPEN_MAX=1024 # 128 is too few |
/* $NetBSD: hypercalls.h,v 1.1.2.1 2020/04/16 08:46:34 bouyer Exp $ */
/******************************************************************************
* hypercall.h
*
* Linux-specific hypervisor handling.
*
* Copyright (c) 2002-2004, K A Fraser
*
* 64-bit updates:
* Benjamin Liu <benjamin.liu@intel.com>
* Jun Nakajima <jun.nakajima@intel.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation; or, when distributed
* separately from the Linux kernel or incorporated into other
* software packages, subject to the following license:
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this source file (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy, modify,
* merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#ifndef __HYPERCALL_H__
#define __HYPERCALL_H__
#define __STR(x) #x
#define STR(x) __STR(x)
#define HYPERCALL_STR(name) \
"call hypercall_page + ("STR(__HYPERVISOR_##name)" * 32)"
#define _hypercall0(type, name) \
({ \
long __res; \
asm volatile ( \
HYPERCALL_STR(name) \
: "=a" (__res) \
: \
: "memory" ); \
(type)__res; \
})
#define _hypercall1(type, name, a1) \
({ \
long __res, __ign1; \
asm volatile ( \
HYPERCALL_STR(name) \
: "=a" (__res), "=D" (__ign1) \
: "1" ((long)(a1)) \
: "memory" ); \
(type)__res; \
})
#define _hypercall2(type, name, a1, a2) \
({ \
long __res, __ign1, __ign2; \
asm volatile ( \
HYPERCALL_STR(name) \
: "=a" (__res), "=D" (__ign1), "=S" (__ign2) \
: "1" ((long)(a1)), "2" ((long)(a2)) \
: "memory" ); \
(type)__res; \
})
#define _hypercall3(type, name, a1, a2, a3) \
({ \
long __res, __ign1, __ign2, __ign3; \
asm volatile ( \
HYPERCALL_STR(name) \
: "=a" (__res), "=D" (__ign1), "=S" (__ign2), \
"=d" (__ign3) \
: "1" ((long)(a1)), "2" ((long)(a2)), \
"3" ((long)(a3)) \
: "memory" ); \
(type)__res; \
})
#define _hypercall4(type, name, a1, a2, a3, a4) \
({ \
long __res, __ign1, __ign2, __ign3; \
asm volatile ( \
"movq %7,%%r10; " \
HYPERCALL_STR(name) \
: "=a" (__res), "=D" (__ign1), "=S" (__ign2), \
"=d" (__ign3) \
: "1" ((long)(a1)), "2" ((long)(a2)), \
"3" ((long)(a3)), "g" ((long)(a4)) \
: "memory", "r10" ); \
(type)__res; \
})
#define _hypercall5(type, name, a1, a2, a3, a4, a5) \
({ \
long __res, __ign1, __ign2, __ign3; \
asm volatile ( \
"movq %7,%%r10; movq %8,%%r8; " \
HYPERCALL_STR(name) \
: "=a" (__res), "=D" (__ign1), "=S" (__ign2), \
"=d" (__ign3) \
: "1" ((long)(a1)), "2" ((long)(a2)), \
"3" ((long)(a3)), "g" ((long)(a4)), \
"g" ((long)(a5)) \
: "memory", "r10", "r8" ); \
(type)__res; \
})
static inline int
HYPERVISOR_set_trap_table(
trap_info_t *table)
{
return _hypercall1(int, set_trap_table, table);
}
static inline int
HYPERVISOR_mmu_update(
mmu_update_t *req, int count, int *success_count, domid_t domid)
{
return _hypercall4(int, mmu_update, req, count, success_count, domid);
}
static inline int
HYPERVISOR_mmuext_op(
struct mmuext_op *op, int count, int *success_count, domid_t domid)
{
return _hypercall4(int, mmuext_op, op, count, success_count, domid);
}
static inline int
HYPERVISOR_set_gdt(
unsigned long *frame_list, int entries)
{
return _hypercall2(int, set_gdt, frame_list, entries);
}
static inline int
HYPERVISOR_stack_switch(
unsigned long ss, unsigned long esp)
{
return _hypercall2(int, stack_switch, ss, esp);
}
static inline int
HYPERVISOR_set_callbacks(
unsigned long event_address, unsigned long failsafe_address,
unsigned long syscall_address)
{
return _hypercall3(int, set_callbacks,
event_address, failsafe_address, syscall_address);
}
static inline int
HYPERVISOR_fpu_taskswitch(
int set)
{
return _hypercall1(int, fpu_taskswitch, set);
}
static inline int
HYPERVISOR_sched_op_compat(
int cmd, unsigned long arg)
{
return _hypercall2(int, sched_op_compat, cmd, arg);
}
static inline int
HYPERVISOR_sched_op(
int cmd, void *arg)
{
return _hypercall2(int, sched_op, cmd, arg);
}
static inline long
HYPERVISOR_set_timer_op(
u64 timeout)
{
return _hypercall1(long, set_timer_op, timeout);
}
static inline int
HYPERVISOR_platform_op(
struct xen_platform_op *platform_op)
{
platform_op->interface_version = XENPF_INTERFACE_VERSION;
return _hypercall1(int, platform_op, platform_op);
}
static inline int
HYPERVISOR_set_debugreg(
int reg, unsigned long value)
{
return _hypercall2(int, set_debugreg, reg, value);
}
static inline unsigned long
HYPERVISOR_get_debugreg(
int reg)
{
return _hypercall1(unsigned long, get_debugreg, reg);
}
static inline int
HYPERVISOR_update_descriptor(
unsigned long ma, unsigned long word)
{
return _hypercall2(int, update_descriptor, ma, word);
}
static inline int
HYPERVISOR_memory_op(
unsigned int cmd, void *arg)
{
return _hypercall2(int, memory_op, cmd, arg);
}
static inline int
HYPERVISOR_multicall(
multicall_entry_t *call_list, int nr_calls)
{
return _hypercall2(int, multicall, call_list, nr_calls);
}
static inline int
HYPERVISOR_update_va_mapping(
unsigned long va, unsigned long new_val, unsigned long flags)
{
return _hypercall3(int, update_va_mapping, va, new_val, flags);
}
static inline int
HYPERVISOR_event_channel_op(evtchn_op_t *op)
{
KASSERT(op != NULL);
#if __XEN_INTERFACE_VERSION__ < 0x00030202
return _hypercall1(int, event_channel_op, op);
#else
return _hypercall2(int, event_channel_op, op->cmd, &op->u);
#endif
}
static inline int
HYPERVISOR_acm_op(
int cmd, void *arg)
{
return _hypercall2(int, acm_op, cmd, arg);
}
static inline int
HYPERVISOR_xen_version(
int cmd, void *arg)
{
return _hypercall2(int, xen_version, cmd, arg);
}
static inline int
HYPERVISOR_console_io(
int cmd, int count, char *str)
{
return _hypercall3(int, console_io, cmd, count, str);
}
static inline int
HYPERVISOR_physdev_op(void *op)
{
return _hypercall1(int, physdev_op_compat, op);
}
static inline int
HYPERVISOR_grant_table_op(
unsigned int cmd, void *uop, unsigned int count)
{
return _hypercall3(int, grant_table_op, cmd, uop, count);
}
static inline int
HYPERVISOR_update_va_mapping_otherdomain(
unsigned long va, unsigned long new_val, unsigned long flags,
domid_t domid)
{
return _hypercall4(int, update_va_mapping_otherdomain, va,
new_val, flags, domid);
}
static inline int
HYPERVISOR_vm_assist(
unsigned int cmd, unsigned int type)
{
return _hypercall2(int, vm_assist, cmd, type);
}
static inline int
HYPERVISOR_vcpu_op(
int cmd, int vcpuid, void *extra_args)
{
return _hypercall3(int, vcpu_op, cmd, vcpuid, extra_args);
}
static inline int
HYPERVISOR_set_segment_base(
int reg, unsigned long value)
{
return _hypercall2(int, set_segment_base, reg, value);
}
static inline int
HYPERVISOR_suspend(
unsigned long srec)
{
#if __XEN_INTERFACE_VERSION__ >= 0x00030201
struct sched_shutdown shutdown_reason = {
.reason = SHUTDOWN_suspend,
};
return _hypercall3(int, sched_op, SCHEDOP_shutdown,
&shutdown_reason, srec);
#else
return _hypercall3(int, sched_op, SCHEDOP_shutdown,
SHUTDOWN_suspend, srec);
#endif
}
static inline long
HYPERVISOR_yield(
void)
{
return _hypercall2(int, sched_op, SCHEDOP_yield, 0);
}
static inline long
HYPERVISOR_block(
void)
{
return _hypercall2(int, sched_op, SCHEDOP_block, 0);
}
static inline long
HYPERVISOR_shutdown(
void)
{
#if __XEN_INTERFACE_VERSION__ >= 0x00030201
struct sched_shutdown shutdown_reason = {
.reason = SHUTDOWN_poweroff,
};
return _hypercall2(int, sched_op, SCHEDOP_shutdown,
&shutdown_reason);
#else
- return _hypercall2(int, sched_op, SCHEDOP_shutdown, SHUTDOWN_poweroff);
#endif
}
static inline long
HYPERVISOR_crash(
void)
{
#if __XEN_INTERFACE_VERSION__ >= 0x00030201
struct sched_shutdown shutdown_reason = {
.reason = SHUTDOWN_crash,
};
return _hypercall2(int, sched_op, SCHEDOP_shutdown,
&shutdown_reason);
#else
return _hypercall2(int, sched_op, SCHEDOP_shutdown, SHUTDOWN_crash);
#endif
}
static inline long
HYPERVISOR_reboot(
void)
{
#if __XEN_INTERFACE_VERSION__ >= 0x00030201
struct sched_shutdown shutdown_reason = {
.reason = SHUTDOWN_reboot,
};
return _hypercall2(int, sched_op, SCHEDOP_shutdown,
&shutdown_reason);
#else
return _hypercall2(int, sched_op, SCHEDOP_shutdown, SHUTDOWN_reboot);
#endif
}
static inline int
HYPERVISOR_nmi_op(
unsigned long op, void *arg)
{
return _hypercall2(int, nmi_op, op, arg);
}
static inline long
HYPERVISOR_hvm_op(
int op, void *arg)
{
return _hypercall2(long, hvm_op, op, arg);
}
static inline int
HYPERVISOR_callback_op(
int cmd, void *arg)
{
return _hypercall2(int, callback_op, cmd, arg);
}
static inline int
HYPERVISOR_xenoprof_op(
int op, void *arg)
{
return _hypercall2(int, xenoprof_op, op, arg);
}
static inline int
HYPERVISOR_kexec_op(
unsigned long op, void *args)
{
return _hypercall2(int, kexec_op, op, args);
}
#if __XEN_INTERFACE_VERSION__ < 0x00030204
static inline int
HYPERVISOR_dom0_op(
dom0_op_t *dom0_op)
{
dom0_op->interface_version = DOM0_INTERFACE_VERSION;
return _hypercall1(int, dom0_op, dom0_op);
}
#endif /* __XEN_INTERFACE_VERSION__ */
#include <xen/include/public/arch-x86/xen-mca.h>
static inline int
HYPERVISOR_machine_check(struct xen_mc *mc)
{
mc->interface_version = XEN_MCA_INTERFACE_VERSION;
return _hypercall1(int, mca, mc);
}
static inline int
HYPERVISOR_sysctl(void *sysctl)
{
return _hypercall1(int, sysctl, sysctl);
}
#endif /* __HYPERCALL_H__ */
# $NetBSD: GENERIC_XENHVM,v 1.1.2.1 2020/04/16 08:46:34 bouyer Exp $
include "arch/i386/conf/GENERIC"
options XENPVHVM
options XEN
options MAXPHYS=32768 #xbd doesn't handle 64k transfers
hypervisor* at mainbus? # Xen hypervisor
#vcpu* at hypervisor? # Xen virtual CPUs
xenbus* at hypervisor? # Xen virtual bus
xencons* at hypervisor? # Xen virtual console
xennet* at xenbus? # Xen virtual network interface
xbd* at xenbus? # Xen virtual block device
--- src/sys/arch/i386/conf/Makefile.i386 2018/09/22 12:24:02 1.194
+++ src/sys/arch/i386/conf/Makefile.i386 2020/04/16 08:46:34 1.194.10.1
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: Makefile.i386,v 1.194 2018/09/22 12:24:02 rin Exp $ | | 1 | # $NetBSD: Makefile.i386,v 1.194.10.1 2020/04/16 08:46:34 bouyer Exp $ |
2 | | | 2 | |
3 | # Makefile for NetBSD | | 3 | # Makefile for NetBSD |
4 | # | | 4 | # |
5 | # This makefile is constructed from a machine description: | | 5 | # This makefile is constructed from a machine description: |
6 | # config machineid | | 6 | # config machineid |
7 | # Most changes should be made in the machine description | | 7 | # Most changes should be made in the machine description |
8 | # /sys/arch/i386/conf/``machineid'' | | 8 | # /sys/arch/i386/conf/``machineid'' |
9 | # after which you should do | | 9 | # after which you should do |
10 | # config machineid | | 10 | # config machineid |
11 | # Machine generic makefile changes should be made in | | 11 | # Machine generic makefile changes should be made in |
12 | # /sys/arch/i386/conf/Makefile.i386 | | 12 | # /sys/arch/i386/conf/Makefile.i386 |
13 | # after which config should be rerun for all machines of that type. | | 13 | # after which config should be rerun for all machines of that type. |
14 | # | | 14 | # |
| @@ -34,26 +34,27 @@ GENASSYM_CONF= ${I386}/i386/genassym.cf | | | @@ -34,26 +34,27 @@ GENASSYM_CONF= ${I386}/i386/genassym.cf |
34 | ## | | 34 | ## |
35 | ## (2) compile settings | | 35 | ## (2) compile settings |
36 | ## | | 36 | ## |
37 | DEFCOPTS= -O2 -fno-omit-frame-pointer | | 37 | DEFCOPTS= -O2 -fno-omit-frame-pointer |
38 | CPPFLAGS+= -Di386 | | 38 | CPPFLAGS+= -Di386 |
39 | CFLAGS+= -msoft-float | | 39 | CFLAGS+= -msoft-float |
40 | ## no-sse implies no-sse2 but not no-avx | | 40 | ## no-sse implies no-sse2 but not no-avx |
41 | CFLAGS+= -mno-mmx -mno-sse -mno-avx | | 41 | CFLAGS+= -mno-mmx -mno-sse -mno-avx |
42 | | | 42 | |
43 | .if ${SPECTRE_V2_GCC_MITIGATION:U0} > 0 && ${HAVE_GCC:U0} > 0 | | 43 | .if ${SPECTRE_V2_GCC_MITIGATION:U0} > 0 && ${HAVE_GCC:U0} > 0 |
44 | CFLAGS+= -mindirect-branch=thunk | | 44 | CFLAGS+= -mindirect-branch=thunk |
45 | CFLAGS+= -mindirect-branch-register | | 45 | CFLAGS+= -mindirect-branch-register |
46 | .endif | | 46 | .endif |
| | | 47 | EXTRA_INCLUDES= -I$S/external/mit/xen-include-public/dist/ |
47 | | | 48 | |
48 | ## | | 49 | ## |
49 | ## (3) libkern and compat | | 50 | ## (3) libkern and compat |
50 | ## | | 51 | ## |
51 | OPT_MODULAR= %MODULAR% | | 52 | OPT_MODULAR= %MODULAR% |
52 | | | 53 | |
53 | ## | | 54 | ## |
54 | ## (4) local objects, compile rules, and dependencies | | 55 | ## (4) local objects, compile rules, and dependencies |
55 | ## | | 56 | ## |
56 | MD_OBJS= locore.o copy.o spl.o vector.o lock_stubs.o | | 57 | MD_OBJS= locore.o copy.o spl.o vector.o lock_stubs.o |
57 | MD_CFILES= | | 58 | MD_CFILES= |
58 | MD_SFILES= ${I386}/i386/locore.S ${I386}/i386/copy.S ${I386}/i386/spl.S \ | | 59 | MD_SFILES= ${I386}/i386/locore.S ${I386}/i386/copy.S ${I386}/i386/spl.S \ |
59 | ${I386}/i386/vector.S ${I386}/i386/lock_stubs.S | | 60 | ${I386}/i386/vector.S ${I386}/i386/lock_stubs.S |
--- src/sys/arch/i386/conf/XEN3PAE_DOM0 2020/04/08 17:56:08 1.21.2.1
+++ src/sys/arch/i386/conf/XEN3PAE_DOM0 2020/04/16 08:46:34 1.21.2.2
| @@ -1,21 +1,22 @@ | | | @@ -1,21 +1,22 @@ |
1 | # $NetBSD: XEN3PAE_DOM0,v 1.21.2.1 2020/04/08 17:56:08 bouyer Exp $ | | 1 | # $NetBSD: XEN3PAE_DOM0,v 1.21.2.2 2020/04/16 08:46:34 bouyer Exp $ |
2 | # | | 2 | # |
3 | # XEN3_0: Xen 3.0 domain0 kernel | | 3 | # XEN3_0: Xen 3.0 domain0 kernel |
4 | | | 4 | |
5 | include "arch/xen/conf/std.xen" | | 5 | include "arch/xen/conf/std.xen" |
6 | | | 6 | |
7 | options XENPV # PV dom0 support | | 7 | options XENPV # PV dom0 support |
8 | #options MULTIPROCESSOR # (not yet - dom0 stuff is not MP-safe) | | 8 | #options MULTIPROCESSOR # (not yet - dom0 stuff is not MP-safe) |
| | | 9 | options NO_PREEMPTION |
9 | | | 10 | |
10 | options INCLUDE_CONFIG_FILE # embed config file in kernel binary | | 11 | options INCLUDE_CONFIG_FILE # embed config file in kernel binary |
11 | | | 12 | |
12 | #options UVMHIST | | 13 | #options UVMHIST |
13 | #options UVMHIST_PRINT | | 14 | #options UVMHIST_PRINT |
14 | #options SYSCALL_DEBUG | | 15 | #options SYSCALL_DEBUG |
15 | | | 16 | |
16 | maxusers 32 # estimated number of users | | 17 | maxusers 32 # estimated number of users |
17 | | | 18 | |
18 | # | | 19 | # |
19 | options XEN | | 20 | options XEN |
20 | options PAE | | 21 | options PAE |
21 | #options __XEN_INTERFACE_VERSION__=0x00030205 # Xen 3.1 interface | | 22 | #options __XEN_INTERFACE_VERSION__=0x00030205 # Xen 3.1 interface |
| @@ -202,26 +203,27 @@ xenbus* at hypervisor? # Xen virtual b | | | @@ -202,26 +203,27 @@ xenbus* at hypervisor? # Xen virtual b |
202 | | | 203 | |
203 | xencons* at hypervisor? # Xen virtual console | | 204 | xencons* at hypervisor? # Xen virtual console |
204 | #xennet* at hypervisor? # Xen virtual network interface | | 205 | #xennet* at hypervisor? # Xen virtual network interface |
205 | balloon* at xenbus? # Xen balloon device | | 206 | balloon* at xenbus? # Xen balloon device |
206 | | | 207 | |
207 | #xbd* at hypervisor? # Xen virtual block device | | 208 | #xbd* at hypervisor? # Xen virtual block device |
208 | #wd* at hypervisor? # Xen vbd (wd identity) | | 209 | #wd* at hypervisor? # Xen vbd (wd identity) |
209 | #sd* at hypervisor? # Xen vbd (sd identity) | | 210 | #sd* at hypervisor? # Xen vbd (sd identity) |
210 | #cd* at hypervisor? # Xen vbd (cd identity) | | 211 | #cd* at hypervisor? # Xen vbd (cd identity) |
211 | | | 212 | |
212 | # PCI bus support | | 213 | # PCI bus support |
213 | pci* at hypervisor? bus ? | | 214 | pci* at hypervisor? bus ? |
214 | pci* at pchb? bus ? | | 215 | pci* at pchb? bus ? |
| | | 216 | options NO_PCI_MSI_MSIX |
215 | | | 217 | |
216 | # PCI bridges | | 218 | # PCI bridges |
217 | ichlpcib* at pci? dev ? function ? # Intel ICH PCI-ISA w/ timecounter, | | 219 | ichlpcib* at pci? dev ? function ? # Intel ICH PCI-ISA w/ timecounter, |
218 | # watchdog and SpeedStep support | | 220 | # watchdog and SpeedStep support |
219 | pcib* at pci? dev ? function ? # PCI-ISA bridges | | 221 | pcib* at pci? dev ? function ? # PCI-ISA bridges |
220 | pchb* at pci? dev ? function ? # PCI-Host bridges | | 222 | pchb* at pci? dev ? function ? # PCI-Host bridges |
221 | options AGP_X86 | | 223 | options AGP_X86 |
222 | ppb* at pci? dev ? function ? # PCI-PCI bridges | | 224 | ppb* at pci? dev ? function ? # PCI-PCI bridges |
223 | # XXX 'puc's aren't really bridges, but there's no better place for them here | | 225 | # XXX 'puc's aren't really bridges, but there's no better place for them here |
224 | puc* at pci? dev ? function ? # PCI "universal" comm. cards | | 226 | puc* at pci? dev ? function ? # PCI "universal" comm. cards |
225 | | | 227 | |
226 | agp* at pchb? | | 228 | agp* at pchb? |
227 | | | 229 | |
--- src/sys/arch/i386/conf/files.i386 2019/10/18 01:38:28 1.401
+++ src/sys/arch/i386/conf/files.i386 2020/04/16 08:46:34 1.401.6.1
| @@ -1,20 +1,18 @@ | | | @@ -1,20 +1,18 @@ |
1 | # $NetBSD: files.i386,v 1.401 2019/10/18 01:38:28 manu Exp $ | | 1 | # $NetBSD: files.i386,v 1.401.6.1 2020/04/16 08:46:34 bouyer Exp $ |
2 | # | | 2 | # |
3 | # new style config file for i386 architecture | | 3 | # new style config file for i386 architecture |
4 | # | | 4 | # |
5 | | | 5 | |
6 | ifndef xen | | | |
7 | | | | |
8 | # maxpartitions must be first item in files.${ARCH}.newconf | | 6 | # maxpartitions must be first item in files.${ARCH}.newconf |
9 | maxpartitions 8 | | 7 | maxpartitions 8 |
10 | | | 8 | |
11 | maxusers 2 16 128 | | 9 | maxusers 2 16 128 |
12 | | | 10 | |
13 | defparam opt_kernbase.h KERNBASE | | 11 | defparam opt_kernbase.h KERNBASE |
14 | | | 12 | |
15 | # delay before cpu_reset() for reboot. | | 13 | # delay before cpu_reset() for reboot. |
16 | defparam CPURESET_DELAY | | 14 | defparam CPURESET_DELAY |
17 | | | 15 | |
18 | # Obsolete Xbox support | | 16 | # Obsolete Xbox support |
19 | obsolete defflag XBOX | | 17 | obsolete defflag XBOX |
20 | | | 18 | |
| @@ -43,51 +41,51 @@ defflag opt_spectre.h SPECTRE_V2_GCC_MIT | | | @@ -43,51 +41,51 @@ defflag opt_spectre.h SPECTRE_V2_GCC_MIT |
43 | | | 41 | |
44 | # Beep on halt | | 42 | # Beep on halt |
45 | defflag opt_beep.h BEEP_ONHALT | | 43 | defflag opt_beep.h BEEP_ONHALT |
46 | defparam opt_beep.h BEEP_ONHALT_COUNT=3 | | 44 | defparam opt_beep.h BEEP_ONHALT_COUNT=3 |
47 | defparam opt_beep.h BEEP_ONHALT_PITCH=1500 | | 45 | defparam opt_beep.h BEEP_ONHALT_PITCH=1500 |
48 | defparam opt_beep.h BEEP_ONHALT_PERIOD=250 | | 46 | defparam opt_beep.h BEEP_ONHALT_PERIOD=250 |
49 | | | 47 | |
50 | # Multiboot support | | 48 | # Multiboot support |
51 | defflag opt_multiboot.h MULTIBOOT | | 49 | defflag opt_multiboot.h MULTIBOOT |
52 | obsolete defparam MULTIBOOT_SYMTAB_SPACE | | 50 | obsolete defparam MULTIBOOT_SYMTAB_SPACE |
53 | file arch/i386/i386/multiboot.c multiboot | | 51 | file arch/i386/i386/multiboot.c multiboot |
54 | file arch/x86/x86/multiboot2.c multiboot | | 52 | file arch/x86/x86/multiboot2.c multiboot |
55 | | | 53 | |
56 | file arch/i386/i386/autoconf.c | | 54 | file arch/i386/i386/autoconf.c !xenpv |
57 | file arch/i386/i386/aout_machdep.c exec_aout | | 55 | file arch/i386/i386/aout_machdep.c exec_aout |
58 | file arch/i386/i386/busfunc.S | | 56 | file arch/i386/i386/busfunc.S |
59 | file arch/i386/i386/cpufunc.S | | 57 | file arch/i386/i386/cpufunc.S |
60 | file arch/i386/i386/cpu_in_cksum.S (inet | inet6) & cpu_in_cksum | | 58 | file arch/i386/i386/cpu_in_cksum.S (inet | inet6) & cpu_in_cksum |
61 | file arch/i386/i386/db_disasm.c ddb | | 59 | file arch/i386/i386/db_disasm.c ddb |
62 | file arch/i386/i386/db_interface.c ddb | | 60 | file arch/i386/i386/db_interface.c ddb |
63 | file arch/i386/i386/db_machdep.c ddb | | 61 | file arch/i386/i386/db_machdep.c ddb |
64 | file arch/i386/i386/dumpsys.c | | 62 | file arch/i386/i386/dumpsys.c |
65 | file kern/subr_disk_mbr.c disk | | 63 | file kern/subr_disk_mbr.c disk |
66 | file kern/subr_spldebug.c spldebug | | 64 | file kern/subr_spldebug.c spldebug |
67 | file arch/i386/i386/gdt.c | | 65 | file arch/i386/i386/gdt.c |
68 | file arch/i386/i386/i386func.S | | 66 | file arch/i386/i386/i386func.S !xenpv |
69 | file arch/i386/i386/kobj_machdep.c modular | | 67 | file arch/i386/i386/kobj_machdep.c modular |
70 | file arch/i386/i386/machdep.c | | 68 | file arch/i386/i386/machdep.c |
71 | file arch/i386/i386/longrun.c | | 69 | file arch/i386/i386/longrun.c |
72 | file arch/i386/i386/mtrr_k6.c mtrr | | 70 | file arch/i386/i386/mtrr_k6.c mtrr |
73 | file arch/i386/i386/process_machdep.c | | 71 | file arch/i386/i386/process_machdep.c |
74 | file arch/i386/i386/trap.c | | 72 | file arch/i386/i386/trap.c |
75 | file dev/cons.c | | 73 | file dev/cons.c |
76 | file arch/x86/x86/fpu.c | | 74 | file arch/x86/x86/fpu.c |
77 | file arch/x86/x86/dbregs.c | | 75 | file arch/x86/x86/dbregs.c |
78 | file arch/x86/x86/spectre.c | | 76 | file arch/x86/x86/spectre.c |
79 | | | 77 | |
80 | file arch/i386/i386/mptramp.S multiprocessor | | 78 | file arch/i386/i386/mptramp.S multiprocessor & ! xenpv |
81 | | | 79 | |
82 | file crypto/des/arch/i386/des_enc.S des | | 80 | file crypto/des/arch/i386/des_enc.S des |
83 | file crypto/des/arch/i386/des_cbc.S des | | 81 | file crypto/des/arch/i386/des_cbc.S des |
84 | | | 82 | |
85 | file crypto/blowfish/arch/i386/bf_enc.S blowfish | | 83 | file crypto/blowfish/arch/i386/bf_enc.S blowfish |
86 | file crypto/blowfish/arch/i386/bf_cbc.S blowfish & !i386_cpu | | 84 | file crypto/blowfish/arch/i386/bf_cbc.S blowfish & !i386_cpu |
87 | | | 85 | |
88 | # | | 86 | # |
89 | # Stack-less Just-In-Time compiler | | 87 | # Stack-less Just-In-Time compiler |
90 | # | | 88 | # |
91 | | | 89 | |
92 | include "external/bsd/sljit/conf/files.sljit" | | 90 | include "external/bsd/sljit/conf/files.sljit" |
93 | | | 91 | |
| @@ -118,29 +116,29 @@ define bioscall | | | @@ -118,29 +116,29 @@ define bioscall |
118 | file arch/i386/i386/bioscall.S bioscall needs-flag | | 116 | file arch/i386/i386/bioscall.S bioscall needs-flag |
119 | | | 117 | |
120 | # i386 specific mainbus attributes | | 118 | # i386 specific mainbus attributes |
121 | define apmbus {} | | 119 | define apmbus {} |
122 | define pnpbiosbus {} | | 120 | define pnpbiosbus {} |
123 | | | 121 | |
124 | # | | 122 | # |
125 | # System bus types | | 123 | # System bus types |
126 | # | | 124 | # |
127 | | | 125 | |
128 | # XXX BIOS32 only if something that uses it is configured! | | 126 | # XXX BIOS32 only if something that uses it is configured! |
129 | device mainbus: isabus, eisabus, mcabus, pcibus, bios32, acpibus, | | 127 | device mainbus: isabus, eisabus, mcabus, pcibus, bios32, acpibus, |
130 | cpubus, ioapicbus, apmbus, pnpbiosbus, ipmibus, | | 128 | cpubus, ioapicbus, apmbus, pnpbiosbus, ipmibus, |
131 | bioscall | | 129 | bioscall, hypervisorbus |
132 | attach mainbus at root | | 130 | attach mainbus at root |
133 | file arch/i386/i386/i386_mainbus.c mainbus | | 131 | file arch/i386/i386/i386_mainbus.c mainbus & !xenpv |
134 | file arch/x86/x86/mainbus.c mainbus | | 132 | file arch/x86/x86/mainbus.c mainbus |
135 | | | 133 | |
136 | # | | 134 | # |
137 | # PCI-only drivers | | 135 | # PCI-only drivers |
138 | # XXX MUST BE INCLUDED BEFORE files.isa, as long as files.isa attaches | | 136 | # XXX MUST BE INCLUDED BEFORE files.isa, as long as files.isa attaches |
139 | # XXX devices to 'pci'. | | 137 | # XXX devices to 'pci'. |
140 | # | | 138 | # |
141 | include "dev/pci/files.pci" | | 139 | include "dev/pci/files.pci" |
142 | include "dev/pci/files.agp" | | 140 | include "dev/pci/files.agp" |
143 | file arch/i386/pci/pcibios.c pcibios | | 141 | file arch/i386/pci/pcibios.c pcibios |
144 | file arch/i386/pci/pci_intr_fixup.c pcibios & pci_intr_fixup | | 142 | file arch/i386/pci/pci_intr_fixup.c pcibios & pci_intr_fixup |
145 | file arch/i386/pci/piix.c pcibios & pci_intr_fixup | | 143 | file arch/i386/pci/piix.c pcibios & pci_intr_fixup |
146 | file arch/i386/pci/opti82c558.c pcibios & pci_intr_fixup | | 144 | file arch/i386/pci/opti82c558.c pcibios & pci_intr_fixup |
| @@ -394,33 +392,32 @@ include "dev/pcmcia/files.pcmcia" | | | @@ -394,33 +392,32 @@ include "dev/pcmcia/files.pcmcia" |
394 | | | 392 | |
395 | | | 393 | |
396 | include "dev/usb/files.usb" | | 394 | include "dev/usb/files.usb" |
397 | | | 395 | |
398 | include "dev/bluetooth/files.bluetooth" | | 396 | include "dev/bluetooth/files.bluetooth" |
399 | | | 397 | |
400 | include "dev/sdmmc/files.sdmmc" | | 398 | include "dev/sdmmc/files.sdmmc" |
401 | | | 399 | |
402 | include "dev/ieee1394/files.ieee1394" | | 400 | include "dev/ieee1394/files.ieee1394" |
403 | | | 401 | |
404 | include "arch/i386/pnpbios/files.pnpbios" | | 402 | include "arch/i386/pnpbios/files.pnpbios" |
405 | | | 403 | |
406 | include "dev/acpi/files.acpi" | | 404 | include "dev/acpi/files.acpi" |
407 | file arch/i386/acpi/acpi_wakeup_low.S acpi | | 405 | file arch/i386/acpi/acpi_wakeup_low.S acpi & !xenpv |
408 | | | 406 | |
409 | # Microsoft Hyper-V | | 407 | # Microsoft Hyper-V |
410 | include "dev/hyperv/files.hyperv" | | 408 | include "dev/hyperv/files.hyperv" |
411 | | | 409 | |
412 | attach vmbus at acpinodebus with vmbus_acpi | | 410 | attach vmbus at acpinodebus with vmbus_acpi |
413 | file dev/acpi/vmbus_acpi.c vmbus_acpi | | 411 | file dev/acpi/vmbus_acpi.c vmbus_acpi |
414 | | | 412 | |
415 | # Obsolete vesabios/vesafb flags | | 413 | # Obsolete vesabios/vesafb flags |
416 | obsolete defflag opt_vesabios.h VESABIOSVERBOSE | | 414 | obsolete defflag opt_vesabios.h VESABIOSVERBOSE |
417 | obsolete defparam opt_vesafb.h VESAFB_WIDTH VESAFB_HEIGHT VESAFB_DEPTH | | 415 | obsolete defparam opt_vesafb.h VESAFB_WIDTH VESAFB_HEIGHT VESAFB_DEPTH |
418 | obsolete defflag opt_vesafb.h VESAFB_PM | | 416 | obsolete defflag opt_vesafb.h VESAFB_PM |
419 | | | 417 | |
420 | # AMD Geode LX Security Block | | 418 | # AMD Geode LX Security Block |
421 | device glxsb: opencrypto | | 419 | device glxsb: opencrypto |
422 | attach glxsb at pci | | 420 | attach glxsb at pci |
423 | file arch/i386/pci/glxsb.c glxsb | | 421 | file arch/i386/pci/glxsb.c glxsb |
424 | | | 422 | |
425 | include "arch/i386/conf/majors.i386" | | 423 | include "arch/i386/conf/majors.i386" |
426 | endif #xen | | | |
--- src/sys/arch/i386/conf/std.i386 2017/01/12 05:24:36 1.35
+++ src/sys/arch/i386/conf/std.i386 2020/04/16 08:46:34 1.35.26.1
| @@ -1,27 +1,28 @@ | | | @@ -1,27 +1,28 @@ |
1 | # $NetBSD: std.i386,v 1.35 2017/01/12 05:24:36 ryo Exp $ | | 1 | # $NetBSD: std.i386,v 1.35.26.1 2020/04/16 08:46:34 bouyer Exp $ |
2 | # | | 2 | # |
3 | # standard, required NetBSD/i386 'options' | | 3 | # standard, required NetBSD/i386 'options' |
4 | | | 4 | |
5 | machine i386 x86 | | 5 | machine i386 x86 xen |
6 | include "conf/std" # MI standard options | | 6 | include "conf/std" # MI standard options |
7 | | | 7 | |
8 | options CPU_IN_CKSUM | | 8 | options CPU_IN_CKSUM |
9 | options EXEC_AOUT # exec a.out binaries | | 9 | options EXEC_AOUT # exec a.out binaries |
10 | options EXEC_ELF32 # exec ELF binaries | | 10 | options EXEC_ELF32 # exec ELF binaries |
11 | options EXEC_SCRIPT # exec #! scripts | | 11 | options EXEC_SCRIPT # exec #! scripts |
12 | #options CRYPTO_MD_DES_ENC # machine-dependent code for DES | | 12 | #options CRYPTO_MD_DES_ENC # machine-dependent code for DES |
13 | #options CRYPTO_MD_DES_CBC # machine-dependent DES CBC code | | 13 | #options CRYPTO_MD_DES_CBC # machine-dependent DES CBC code |
14 | #options CRYPTO_MD_BF_ENC # machine-dependent code for BF_encrypt | | 14 | #options CRYPTO_MD_BF_ENC # machine-dependent code for BF_encrypt |
15 | #options CRYPTO_MD_BF_CBC # careful: uses bswapl, requires 486 | | 15 | #options CRYPTO_MD_BF_CBC # careful: uses bswapl, requires 486 |
16 | options MULTIPROCESSOR # multiprocessor support | | 16 | options MULTIPROCESSOR # multiprocessor support |
17 | options MPBIOS # configure CPUs and APICs using MPBIOS | | 17 | options MPBIOS # configure CPUs and APICs using MPBIOS |
18 | | | 18 | |
19 | options CHILD_MAX=1024 # 160 is too few | | 19 | options CHILD_MAX=1024 # 160 is too few |
20 | options OPEN_MAX=1024 # 128 is too few | | 20 | options OPEN_MAX=1024 # 128 is too few |
| | | 21 | options __XEN_INTERFACE_VERSION__=0x00030208 # Xen 3.1 interface |
21 | | | 22 | |
22 | mainbus0 at root | | 23 | mainbus0 at root |
23 | cpu* at mainbus? | | 24 | cpu* at mainbus? |
24 | ioapic* at mainbus? | | 25 | ioapic* at mainbus? |
25 | | | 26 | |
26 | # Atheros HAL options | | 27 | # Atheros HAL options |
27 | include "external/isc/atheros_hal/conf/std.ath_hal" | | 28 | include "external/isc/atheros_hal/conf/std.ath_hal" |
--- src/sys/arch/i386/i386/machdep.c 2020/04/09 16:12:50 1.825.4.1
+++ src/sys/arch/i386/i386/machdep.c 2020/04/16 08:46:34 1.825.4.2
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: machdep.c,v 1.825.4.1 2020/04/09 16:12:50 bouyer Exp $ */ | | 1 | /* $NetBSD: machdep.c,v 1.825.4.2 2020/04/16 08:46:34 bouyer Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009, 2017 | | 4 | * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009, 2017 |
5 | * The NetBSD Foundation, Inc. | | 5 | * 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 Charles M. Hannum, by Jason R. Thorpe of the Numerical Aerospace | | 9 | * by Charles M. Hannum, by Jason R. Thorpe of the Numerical Aerospace |
10 | * Simulation Facility NASA Ames Research Center, by Julio M. Merino Vidal, | | 10 | * Simulation Facility NASA Ames Research Center, by Julio M. Merino Vidal, |
11 | * by Andrew Doran, and by Maxime Villard. | | 11 | * by Andrew Doran, and by Maxime Villard. |
12 | * | | 12 | * |
13 | * Redistribution and use in source and binary forms, with or without | | 13 | * Redistribution and use in source and binary forms, with or without |
14 | * modification, are permitted provided that the following conditions | | 14 | * modification, are permitted provided that the following conditions |
| @@ -57,27 +57,27 @@ | | | @@ -57,27 +57,27 @@ |
57 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 57 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
58 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 58 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
59 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 59 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
60 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 60 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
61 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 61 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
62 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 62 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
63 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 63 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
64 | * SUCH DAMAGE. | | 64 | * SUCH DAMAGE. |
65 | * | | 65 | * |
66 | * @(#)machdep.c 7.4 (Berkeley) 6/3/91 | | 66 | * @(#)machdep.c 7.4 (Berkeley) 6/3/91 |
67 | */ | | 67 | */ |
68 | | | 68 | |
69 | #include <sys/cdefs.h> | | 69 | #include <sys/cdefs.h> |
70 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.825.4.1 2020/04/09 16:12:50 bouyer Exp $"); | | 70 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.825.4.2 2020/04/16 08:46:34 bouyer Exp $"); |
71 | | | 71 | |
72 | #include "opt_beep.h" | | 72 | #include "opt_beep.h" |
73 | #include "opt_compat_freebsd.h" | | 73 | #include "opt_compat_freebsd.h" |
74 | #include "opt_compat_netbsd.h" | | 74 | #include "opt_compat_netbsd.h" |
75 | #include "opt_cpureset_delay.h" | | 75 | #include "opt_cpureset_delay.h" |
76 | #include "opt_ddb.h" | | 76 | #include "opt_ddb.h" |
77 | #include "opt_kgdb.h" | | 77 | #include "opt_kgdb.h" |
78 | #include "opt_mtrr.h" | | 78 | #include "opt_mtrr.h" |
79 | #include "opt_modular.h" | | 79 | #include "opt_modular.h" |
80 | #include "opt_multiboot.h" | | 80 | #include "opt_multiboot.h" |
81 | #include "opt_multiprocessor.h" | | 81 | #include "opt_multiprocessor.h" |
82 | #include "opt_physmem.h" | | 82 | #include "opt_physmem.h" |
83 | #include "opt_realmem.h" | | 83 | #include "opt_realmem.h" |
| @@ -978,27 +978,27 @@ initgdt(union descriptor *tgdt) | | | @@ -978,27 +978,27 @@ initgdt(union descriptor *tgdt) |
978 | #endif | | 978 | #endif |
979 | | | 979 | |
980 | /* make gdt gates and memory segments */ | | 980 | /* make gdt gates and memory segments */ |
981 | setsegment(&gdtstore[GCODE_SEL].sd, 0, 0xfffff, | | 981 | setsegment(&gdtstore[GCODE_SEL].sd, 0, 0xfffff, |
982 | SDT_MEMERA, SEL_KPL, 1, 1); | | 982 | SDT_MEMERA, SEL_KPL, 1, 1); |
983 | setsegment(&gdtstore[GDATA_SEL].sd, 0, 0xfffff, | | 983 | setsegment(&gdtstore[GDATA_SEL].sd, 0, 0xfffff, |
984 | SDT_MEMRWA, SEL_KPL, 1, 1); | | 984 | SDT_MEMRWA, SEL_KPL, 1, 1); |
985 | setsegment(&gdtstore[GUCODE_SEL].sd, 0, x86_btop(I386_MAX_EXE_ADDR) - 1, | | 985 | setsegment(&gdtstore[GUCODE_SEL].sd, 0, x86_btop(I386_MAX_EXE_ADDR) - 1, |
986 | SDT_MEMERA, SEL_UPL, 1, 1); | | 986 | SDT_MEMERA, SEL_UPL, 1, 1); |
987 | setsegment(&gdtstore[GUCODEBIG_SEL].sd, 0, 0xfffff, | | 987 | setsegment(&gdtstore[GUCODEBIG_SEL].sd, 0, 0xfffff, |
988 | SDT_MEMERA, SEL_UPL, 1, 1); | | 988 | SDT_MEMERA, SEL_UPL, 1, 1); |
989 | setsegment(&gdtstore[GUDATA_SEL].sd, 0, 0xfffff, | | 989 | setsegment(&gdtstore[GUDATA_SEL].sd, 0, 0xfffff, |
990 | SDT_MEMRWA, SEL_UPL, 1, 1); | | 990 | SDT_MEMRWA, SEL_UPL, 1, 1); |
991 | #if NBIOSCALL > 0 | | 991 | #if NBIOSCALL > 0 && !defined(XENPV) |
992 | /* bios trampoline GDT entries */ | | 992 | /* bios trampoline GDT entries */ |
993 | setsegment(&gdtstore[GBIOSCODE_SEL].sd, 0, 0xfffff, | | 993 | setsegment(&gdtstore[GBIOSCODE_SEL].sd, 0, 0xfffff, |
994 | SDT_MEMERA, SEL_KPL, 0, 0); | | 994 | SDT_MEMERA, SEL_KPL, 0, 0); |
995 | setsegment(&gdtstore[GBIOSDATA_SEL].sd, 0, 0xfffff, | | 995 | setsegment(&gdtstore[GBIOSDATA_SEL].sd, 0, 0xfffff, |
996 | SDT_MEMRWA, SEL_KPL, 0, 0); | | 996 | SDT_MEMRWA, SEL_KPL, 0, 0); |
997 | #endif | | 997 | #endif |
998 | setsegment(&gdtstore[GCPU_SEL].sd, &cpu_info_primary, | | 998 | setsegment(&gdtstore[GCPU_SEL].sd, &cpu_info_primary, |
999 | sizeof(struct cpu_info) - 1, SDT_MEMRWA, SEL_KPL, 1, 0); | | 999 | sizeof(struct cpu_info) - 1, SDT_MEMRWA, SEL_KPL, 1, 0); |
1000 | | | 1000 | |
1001 | #ifndef XENPV | | 1001 | #ifndef XENPV |
1002 | setregion(®ion, gdtstore, NGDT * sizeof(gdtstore[0]) - 1); | | 1002 | setregion(®ion, gdtstore, NGDT * sizeof(gdtstore[0]) - 1); |
1003 | lgdt(®ion); | | 1003 | lgdt(®ion); |
1004 | #else /* !XENPV */ | | 1004 | #else /* !XENPV */ |
| @@ -1124,31 +1124,31 @@ init_bootspace(void) | | | @@ -1124,31 +1124,31 @@ init_bootspace(void) |
1124 | /* Virtual address of the top level page */ | | 1124 | /* Virtual address of the top level page */ |
1125 | bootspace.pdir = (vaddr_t)(PDPpaddr + KERNBASE); | | 1125 | bootspace.pdir = (vaddr_t)(PDPpaddr + KERNBASE); |
1126 | } | | 1126 | } |
1127 | | | 1127 | |
1128 | void | | 1128 | void |
1129 | init386(paddr_t first_avail) | | 1129 | init386(paddr_t first_avail) |
1130 | { | | 1130 | { |
1131 | extern void consinit(void); | | 1131 | extern void consinit(void); |
1132 | int x; | | 1132 | int x; |
1133 | #ifndef XENPV | | 1133 | #ifndef XENPV |
1134 | extern paddr_t local_apic_pa; | | 1134 | extern paddr_t local_apic_pa; |
1135 | union descriptor *tgdt; | | 1135 | union descriptor *tgdt; |
1136 | struct region_descriptor region; | | 1136 | struct region_descriptor region; |
1137 | #endif | | | |
1138 | #if NBIOSCALL > 0 | | 1137 | #if NBIOSCALL > 0 |
1139 | extern int biostramp_image_size; | | 1138 | extern int biostramp_image_size; |
1140 | extern u_char biostramp_image[]; | | 1139 | extern u_char biostramp_image[]; |
1141 | #endif | | 1140 | #endif |
| | | 1141 | #endif /* !XENPV */ |
1142 | struct pcb *pcb; | | 1142 | struct pcb *pcb; |
1143 | | | 1143 | |
1144 | KASSERT(first_avail % PAGE_SIZE == 0); | | 1144 | KASSERT(first_avail % PAGE_SIZE == 0); |
1145 | | | 1145 | |
1146 | #ifdef XENPV | | 1146 | #ifdef XENPV |
1147 | KASSERT(HYPERVISOR_shared_info != NULL); | | 1147 | KASSERT(HYPERVISOR_shared_info != NULL); |
1148 | cpu_info_primary.ci_vcpu = &HYPERVISOR_shared_info->vcpu_info[0]; | | 1148 | cpu_info_primary.ci_vcpu = &HYPERVISOR_shared_info->vcpu_info[0]; |
1149 | #endif | | 1149 | #endif |
1150 | | | 1150 | |
1151 | uvm_lwp_setuarea(&lwp0, lwp0uarea); | | 1151 | uvm_lwp_setuarea(&lwp0, lwp0uarea); |
1152 | | | 1152 | |
1153 | cpu_probe(&cpu_info_primary); | | 1153 | cpu_probe(&cpu_info_primary); |
1154 | cpu_init_msrs(&cpu_info_primary, true); | | 1154 | cpu_init_msrs(&cpu_info_primary, true); |
--- src/sys/arch/i386/i386/vector.S 2020/04/12 17:25:52 1.85.6.4
+++ src/sys/arch/i386/i386/vector.S 2020/04/16 08:46:34 1.85.6.5
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: vector.S,v 1.85.6.4 2020/04/12 17:25:52 bouyer Exp $ */ | | 1 | /* $NetBSD: vector.S,v 1.85.6.5 2020/04/16 08:46:34 bouyer Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright 2002 (c) Wasabi Systems, Inc. | | 4 | * Copyright 2002 (c) Wasabi Systems, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Written by Frank van der Linden for Wasabi Systems, Inc. | | 7 | * Written by Frank van der Linden for Wasabi Systems, Inc. |
8 | * | | 8 | * |
9 | * Redistribution and use in source and binary forms, with or without | | 9 | * Redistribution and use in source and binary forms, with or without |
10 | * modification, are permitted provided that the following conditions | | 10 | * modification, are permitted provided that the following conditions |
11 | * are met: | | 11 | * are met: |
12 | * 1. Redistributions of source code must retain the above copyright | | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * 2. Redistributions in binary form must reproduce the above copyright | | 14 | * 2. Redistributions in binary form must reproduce the above copyright |
| @@ -55,47 +55,47 @@ | | | @@ -55,47 +55,47 @@ |
55 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 55 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
56 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 56 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
57 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 57 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
58 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 58 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
59 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 59 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
60 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 60 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
61 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 61 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
62 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 62 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
63 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 63 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
64 | * POSSIBILITY OF SUCH DAMAGE. | | 64 | * POSSIBILITY OF SUCH DAMAGE. |
65 | */ | | 65 | */ |
66 | | | 66 | |
67 | #include <machine/asm.h> | | 67 | #include <machine/asm.h> |
68 | __KERNEL_RCSID(0, "$NetBSD: vector.S,v 1.85.6.4 2020/04/12 17:25:52 bouyer Exp $"); | | 68 | __KERNEL_RCSID(0, "$NetBSD: vector.S,v 1.85.6.5 2020/04/16 08:46:34 bouyer Exp $"); |
69 | | | 69 | |
70 | #include "opt_ddb.h" | | 70 | #include "opt_ddb.h" |
71 | #include "opt_multiprocessor.h" | | 71 | #include "opt_multiprocessor.h" |
72 | #include "opt_xen.h" | | 72 | #include "opt_xen.h" |
73 | #include "opt_dtrace.h" | | 73 | #include "opt_dtrace.h" |
74 | | | 74 | |
75 | #include <machine/i8259.h> | | 75 | #include <machine/i8259.h> |
76 | #include <machine/i82093reg.h> | | 76 | #include <machine/i82093reg.h> |
77 | #include <machine/i82489reg.h> | | 77 | #include <machine/i82489reg.h> |
78 | #include <machine/frameasm.h> | | 78 | #include <machine/frameasm.h> |
79 | #include <machine/segments.h> | | 79 | #include <machine/segments.h> |
80 | #include <machine/specialreg.h> | | 80 | #include <machine/specialreg.h> |
81 | #include <machine/trap.h> | | 81 | #include <machine/trap.h> |
82 | #ifdef XEN | | 82 | #ifdef XEN |
83 | #include <xen/xen.h> | | 83 | #include <xen/xen.h> |
84 | #endif | | 84 | #endif |
85 | | | 85 | |
86 | #include "ioapic.h" | | 86 | #include "ioapic.h" |
87 | #include "lapic.h" | | 87 | #include "lapic.h" |
88 | #ifndef XEN | | 88 | #ifndef XENPV |
89 | #include "hyperv.h" | | 89 | #include "hyperv.h" |
90 | #endif | | 90 | #endif |
91 | | | 91 | |
92 | #include "assym.h" | | 92 | #include "assym.h" |
93 | | | 93 | |
94 | /* | | 94 | /* |
95 | * Macros for interrupt entry, call to handler, and exit. | | 95 | * Macros for interrupt entry, call to handler, and exit. |
96 | * | | 96 | * |
97 | * XXX | | 97 | * XXX |
98 | * The interrupt frame is set up to look like a trap frame. This may be a | | 98 | * The interrupt frame is set up to look like a trap frame. This may be a |
99 | * waste. The only handler which needs a frame is the clock handler, and it | | 99 | * waste. The only handler which needs a frame is the clock handler, and it |
100 | * only needs a few bits. Xdoreti() needs a trap frame for handling ASTs, but | | 100 | * only needs a few bits. Xdoreti() needs a trap frame for handling ASTs, but |
101 | * it could easily convert the frame on demand. | | 101 | * it could easily convert the frame on demand. |
/* $NetBSD: hypercalls.h,v 1.1.2.1 2020/04/16 08:46:34 bouyer Exp $ */
/*
* Copyright (c) 2006 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.
*
* 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.
*
*/
/*
*
* Communication to/from hypervisor.
*
* Copyright (c) 2002-2004, K A Fraser
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this source file (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy, modify,
* merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#ifndef _XENI386_HYPERVISOR_H_
#define _XENI386_HYPERVISOR_H_
/*
* Assembler stubs for hyper-calls.
*/
#include <machine/pte.h> /* pt_entry_t */
/* hypercall via the hypercall call page */
#define __str(x) #x
#define _str(x) __str(x)
#define _hypercall(name, input_const, output_const) \
__asm volatile ( \
"call hypercall_page + ("_str(name)" * 32)" \
: output_const \
: input_const \
: "memory" )
#define _harg(...) __VA_ARGS__
static __inline int
HYPERVISOR_set_trap_table(trap_info_t *table)
{
int ret;
unsigned long ign1;
_hypercall(__HYPERVISOR_set_trap_table, _harg("1" (table)),
_harg("=a" (ret), "=b" (ign1)));
return ret;
}
static __inline int
HYPERVISOR_set_gdt(unsigned long *frame_list, int entries)
{
int ret;
unsigned long ign1, ign2;
_hypercall(__HYPERVISOR_set_gdt, _harg("1" (frame_list), "2" (entries)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
return ret;
}
static __inline int
HYPERVISOR_stack_switch(unsigned long ss, unsigned long esp)
{
int ret;
unsigned long ign1, ign2;
_hypercall(__HYPERVISOR_stack_switch, _harg("1" (ss), "2" (esp)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
return ret;
}
static __inline int
HYPERVISOR_set_callbacks(
unsigned long event_selector, unsigned long event_address,
unsigned long failsafe_selector, unsigned long failsafe_address)
{
int ret;
unsigned long ign1, ign2, ign3, ign4;
_hypercall(__HYPERVISOR_set_callbacks,
_harg("1" (event_selector),"2" (event_address),
"3" (failsafe_selector), "4" (failsafe_address)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)));
return ret;
}
#if __XEN_INTERFACE_VERSION__ < 0x00030204
static __inline int
HYPERVISOR_dom0_op(dom0_op_t *dom0_op)
{
int ret;
unsigned long ign1;
dom0_op->interface_version = DOM0_INTERFACE_VERSION;
_hypercall(__HYPERVISOR_dom0_op, _harg("1" (dom0_op)),
_harg("=a" (ret), "=b" (ign1)));
return ret;
}
#endif /* __XEN_INTERFACE_VERSION__ */
static __inline int
HYPERVISOR_set_debugreg(int reg, unsigned long value)
{
int ret;
unsigned long ign1, ign2;
_hypercall(__HYPERVISOR_set_debugreg, _harg("1" (reg), "2" (value)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
return ret;
}
static __inline unsigned long
HYPERVISOR_get_debugreg(int reg)
{
unsigned long ret;
unsigned long ign1;
_hypercall(__HYPERVISOR_get_debugreg, _harg("1" (reg)),
_harg("=a" (ret), "=b" (ign1)));
return ret;
}
#include <xen/include/public/arch-x86/xen-mca.h>
static __inline int
HYPERVISOR_machine_check(struct xen_mc *mc)
{
int ret;
unsigned long ign1;
mc->interface_version = XEN_MCA_INTERFACE_VERSION;
_hypercall(__HYPERVISOR_mca, _harg("1" (mc)),
_harg("=a" (ret), "=b" (ign1)));
return ret;
}
static __inline int
HYPERVISOR_hvm_op(int cmd, void *arg)
{
int ret;
unsigned long ign1, ign2;
_hypercall(__HYPERVISOR_hvm_op, _harg("1" (cmd), "2" (arg)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
return ret;
}
static __inline int
HYPERVISOR_mmu_update(mmu_update_t *req, int count, int *success_count,
domid_t domid)
{
int ret;
unsigned long ign1, ign2, ign3, ign4;
_hypercall(__HYPERVISOR_mmu_update,
_harg("1" (req), "2" (count), "3" (success_count), "4" (domid)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)));
return ret;
}
static __inline int
HYPERVISOR_mmuext_op(struct mmuext_op *op, int count, int *success_count,
domid_t domid)
{
int ret;
unsigned long ign1, ign2, ign3, ign4;
_hypercall(__HYPERVISOR_mmuext_op,
_harg("1" (op), "2" (count), "3" (success_count), "4" (domid)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)));
return ret;
}
static __inline int
HYPERVISOR_fpu_taskswitch(int set)
{
long ret;
long ign1;
_hypercall(__HYPERVISOR_fpu_taskswitch, _harg("1" (set)),
_harg("=a" (ret), "=b" (ign1)));
return ret;
}
static __inline int
HYPERVISOR_update_descriptor(uint64_t ma, uint32_t word1, uint32_t word2)
{
int ret;
unsigned long ign1, ign2, ign3, ign4;
int ma1 = ma & 0xffffffff;
int ma2 = (ma >> 32) & 0xffffffff;
_hypercall(__HYPERVISOR_update_descriptor,
_harg("1" (ma1), "2" (ma2), "3" (word1), "4" (word2)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)));
return ret;
}
static __inline int
HYPERVISOR_memory_op(unsigned int cmd, void *arg)
{
int ret;
unsigned long ign1, ign2;
_hypercall(__HYPERVISOR_memory_op, _harg("1" (cmd), "2" (arg)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
return ret;
}
#ifdef XENPV
static __inline int
HYPERVISOR_update_va_mapping(unsigned long page_nr, pt_entry_t new_val,
unsigned long flags)
{
int ret;
unsigned long ign1, ign2, ign3, ign4;
unsigned long pte_low, pte_hi;
pte_low = new_val & 0xffffffff;
pte_hi = new_val >> 32;
_hypercall(__HYPERVISOR_update_va_mapping,
_harg("1" (page_nr), "2" (pte_low), "3" (pte_hi), "4" (flags)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4)));
#ifdef notdef
if (__predict_false(ret < 0))
panic("Failed update VA mapping: %08lx, %08lx, %08lx",
page_nr, new_val, flags);
#endif
return ret;
}
static __inline int
HYPERVISOR_update_va_mapping_otherdomain(unsigned long page_nr,
pt_entry_t new_val, unsigned long flags, domid_t domid)
{
int ret;
unsigned long ign1, ign2, ign3, ign4, ign5;
unsigned long pte_low, pte_hi;
pte_low = new_val & 0xffffffff;
pte_hi = new_val >> 32;
_hypercall(__HYPERVISOR_update_va_mapping_otherdomain,
_harg("1" (page_nr), "2" (pte_low), "3" (pte_hi), "4" (flags), "5" (domid)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3), "=S" (ign4),
"=D" (ign5)));
return ret;
}
#endif /* XENPV */
static __inline int
HYPERVISOR_xen_version(int cmd, void *arg)
{
int ret;
unsigned long ign1, ign2;
_hypercall(__HYPERVISOR_xen_version, _harg("1" (cmd), "2" (arg)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
return ret;
}
static __inline int
HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count)
{
int ret;
unsigned long ign1, ign2, ign3;
_hypercall(__HYPERVISOR_grant_table_op,
_harg("1" (cmd), "2" (uop), "3" (count)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)));
return ret;
}
static __inline int
HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args)
{
long ret;
unsigned long ign1, ign2, ign3;
_hypercall(__HYPERVISOR_vcpu_op,
_harg("1" (cmd), "2" (vcpuid), "3" (extra_args)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)));
return ret;
}
static __inline long
HYPERVISOR_yield(void)
{
long ret;
unsigned long ign1, ign2;
_hypercall(__HYPERVISOR_sched_op, _harg("1" (SCHEDOP_yield), "2" (0)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
return ret;
}
static __inline long
HYPERVISOR_block(void)
{
long ret;
unsigned long ign1, ign2;
_hypercall(__HYPERVISOR_sched_op, _harg("1" (SCHEDOP_block), "2" (0)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
return ret;
}
static __inline long
HYPERVISOR_shutdown(void)
{
long ret;
unsigned long ign1, ign2;
#if __XEN_INTERFACE_VERSION__ >= 0x00030201
struct sched_shutdown shutdown_reason = {
.reason = SHUTDOWN_poweroff
};
_hypercall(__HYPERVISOR_sched_op,
_harg("1" (SCHEDOP_shutdown), "2" (&shutdown_reason)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
#else
_hypercall(__HYPERVISOR_sched_op,
_harg("1" (SCHEDOP_shutdown), "2" (SHUTDOWN_poweroff)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
#endif
return ret;
}
static __inline long
HYPERVISOR_crash(void)
{
long ret;
unsigned long ign1, ign2;
#if __XEN_INTERFACE_VERSION__ >= 0x00030201
struct sched_shutdown shutdown_reason = {
.reason = SHUTDOWN_crash
};
_hypercall(__HYPERVISOR_sched_op,
_harg("1" (SCHEDOP_shutdown), "2" (&shutdown_reason)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
#else
_hypercall(__HYPERVISOR_sched_op,
_harg("1" (SCHEDOP_shutdown), "2" (SHUTDOWN_crash)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
#endif
return ret;
}
static __inline long
HYPERVISOR_reboot(void)
{
long ret;
unsigned long ign1, ign2;
#if __XEN_INTERFACE_VERSION__ >= 0x00030201
struct sched_shutdown shutdown_reason = {
.reason = SHUTDOWN_reboot
};
_hypercall(__HYPERVISOR_sched_op,
_harg("1" (SCHEDOP_shutdown), "2" (&shutdown_reason)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
#else
_hypercall(__HYPERVISOR_sched_op,
_harg("1" (SCHEDOP_shutdown), "2" (SHUTDOWN_reboot)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
#endif
return ret;
}
static __inline long
HYPERVISOR_suspend(unsigned long srec)
{
long ret;
unsigned long ign1, ign2, ign3;
#if __XEN_INTERFACE_VERSION__ >= 0x00030201
struct sched_shutdown shutdown_reason = {
.reason = SHUTDOWN_suspend
};
_hypercall(__HYPERVISOR_sched_op,
_harg("1" (SCHEDOP_shutdown), "2" (&shutdown_reason), "3" (srec)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)));
#else
_hypercall(__HYPERVISOR_sched_op,
_harg("1" (SCHEDOP_shutdown), "2" (SHUTDOWN_suspend), "3" (srec)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)));
#endif
return ret;
}
static __inline long
HYPERVISOR_set_timer_op(uint64_t timeout)
{
long ret;
unsigned long timeout_hi = (unsigned long)(timeout>>32);
unsigned long timeout_lo = (unsigned long)timeout;
unsigned long ign1, ign2;
_hypercall(__HYPERVISOR_set_timer_op,
_harg("1" (timeout_lo), "2" (timeout_hi)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
return ret;
}
static __inline int
HYPERVISOR_platform_op(struct xen_platform_op *platform_op)
{
int ret;
unsigned long ign1;
platform_op->interface_version = XENPF_INTERFACE_VERSION;
_hypercall(__HYPERVISOR_platform_op, _harg("1" (platform_op)),
_harg("=a" (ret), "=b" (ign1)));
return ret;
}
static __inline int
HYPERVISOR_multicall(void *call_list, int nr_calls)
{
int ret;
unsigned long ign1, ign2;
_hypercall(__HYPERVISOR_multicall,
_harg("1" (call_list), "2" (nr_calls)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
return ret;
}
static __inline int
HYPERVISOR_event_channel_op(evtchn_op_t *op)
{
int ret;
unsigned long ign1;
#if __XEN_INTERFACE_VERSION__ < 0x00030202
_hypercall(__HYPERVISOR_event_channel_op, _harg("1" (op)),
_harg("=a" (ret), "=b" (ign1)));
#else
unsigned long ign2;
_hypercall(__HYPERVISOR_event_channel_op, _harg("1" (op->cmd), "2" (&op->u)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
#endif
return ret;
}
static __inline int
HYPERVISOR_console_io(int cmd, int count, char *str)
{
int ret;
unsigned long ign1, ign2, ign3;
_hypercall(__HYPERVISOR_console_io,
_harg("1" (cmd), "2" (count), "3" (str)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2), "=d" (ign3)));
return ret;
}
static __inline int
HYPERVISOR_physdev_op(void *physdev_op)
{
int ret;
unsigned long ign1;
_hypercall(__HYPERVISOR_physdev_op, _harg("1" (physdev_op)),
_harg("=a" (ret), "=b" (ign1)));
return ret;
}
static __inline int
HYPERVISOR_vm_assist(unsigned int cmd, unsigned int type)
{
int ret;
unsigned long ign1, ign2;
_hypercall(__HYPERVISOR_vm_assist, _harg("1" (cmd), "2" (type)),
_harg("=a" (ret), "=b" (ign1), "=c" (ign2)));
return ret;
}
static __inline int
HYPERVISOR_sysctl(void *sysctl)
{
int ret;
unsigned long ign1;
_hypercall(__HYPERVISOR_sysctl, _harg("1" (sysctl)),
_harg("=a" (ret), "=b" (ign1)));
return ret;
}
#endif /* _XENI386_HYPERVISOR_H_ */
--- src/sys/arch/x86/conf/files.x86 2020/04/11 18:26:07 1.107.10.1
+++ src/sys/arch/x86/conf/files.x86 2020/04/16 08:46:34 1.107.10.2
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: files.x86,v 1.107.10.1 2020/04/11 18:26:07 bouyer Exp $ | | 1 | # $NetBSD: files.x86,v 1.107.10.2 2020/04/16 08:46:34 bouyer Exp $ |
2 | | | 2 | |
3 | # options for MP configuration through the MP spec | | 3 | # options for MP configuration through the MP spec |
4 | defflag opt_mpbios.h MPBIOS MPDEBUG MPBIOS_SCANPCI | | 4 | defflag opt_mpbios.h MPBIOS MPDEBUG MPBIOS_SCANPCI |
5 | defparam opt_mpbios.h MPVERBOSE | | 5 | defparam opt_mpbios.h MPVERBOSE |
6 | | | 6 | |
7 | # MTRR support | | 7 | # MTRR support |
8 | defflag MTRR | | 8 | defflag MTRR |
9 | | | 9 | |
10 | # Interrupt debug | | 10 | # Interrupt debug |
11 | defflag opt_intrdebug.h INTRDEBUG | | 11 | defflag opt_intrdebug.h INTRDEBUG |
12 | | | 12 | |
13 | # PCI fixup options | | 13 | # PCI fixup options |
14 | defflag opt_pcifixup.h PCI_ADDR_FIXUP PCI_BUS_FIXUP | | 14 | defflag opt_pcifixup.h PCI_ADDR_FIXUP PCI_BUS_FIXUP |
| @@ -25,28 +25,28 @@ defflag SVS | | | @@ -25,28 +25,28 @@ defflag SVS |
25 | define cpubus { [apid = -1] } | | 25 | define cpubus { [apid = -1] } |
26 | define cpufeaturebus {} | | 26 | define cpufeaturebus {} |
27 | define ioapicbus { [apid = -1] } | | 27 | define ioapicbus { [apid = -1] } |
28 | | | 28 | |
29 | # BIOS32 routines | | 29 | # BIOS32 routines |
30 | define bios32 | | 30 | define bios32 |
31 | file arch/x86/x86/bios32.c bios32 needs-flag | | 31 | file arch/x86/x86/bios32.c bios32 needs-flag |
32 | | | 32 | |
33 | # | | 33 | # |
34 | # CPU features | | 34 | # CPU features |
35 | # | | 35 | # |
36 | device cpu: cpufeaturebus | | 36 | device cpu: cpufeaturebus |
37 | attach cpu at cpubus | | 37 | attach cpu at cpubus |
38 | file arch/x86/x86/cpu.c cpu | | 38 | file arch/x86/x86/cpu.c cpu & !xenpv |
39 | file arch/x86/x86/cpu_rng.c cpu | | 39 | file arch/x86/x86/cpu_rng.c cpu | vcpu |
40 | | | 40 | |
41 | device acpicpu: acpi | | 41 | device acpicpu: acpi |
42 | attach acpicpu at cpufeaturebus | | 42 | attach acpicpu at cpufeaturebus |
43 | file dev/acpi/acpi_cpu.c acpicpu | | 43 | file dev/acpi/acpi_cpu.c acpicpu |
44 | file dev/acpi/acpi_cpu_cstate.c acpicpu | | 44 | file dev/acpi/acpi_cpu_cstate.c acpicpu |
45 | file dev/acpi/acpi_cpu_pstate.c acpicpu | | 45 | file dev/acpi/acpi_cpu_pstate.c acpicpu |
46 | file dev/acpi/acpi_cpu_tstate.c acpicpu | | 46 | file dev/acpi/acpi_cpu_tstate.c acpicpu |
47 | file arch/x86/acpi/acpi_cpu_md.c acpicpu | | 47 | file arch/x86/acpi/acpi_cpu_md.c acpicpu |
48 | | | 48 | |
49 | device coretemp: sysmon_envsys | | 49 | device coretemp: sysmon_envsys |
50 | attach coretemp at cpufeaturebus | | 50 | attach coretemp at cpufeaturebus |
51 | file arch/x86/x86/coretemp.c coretemp | | 51 | file arch/x86/x86/coretemp.c coretemp |
52 | | | 52 | |
| @@ -72,54 +72,54 @@ attach viac7temp at cpufeaturebus | | | @@ -72,54 +72,54 @@ attach viac7temp at cpufeaturebus |
72 | file arch/x86/x86/viac7temp.c viac7temp | | 72 | file arch/x86/x86/viac7temp.c viac7temp |
73 | | | 73 | |
74 | device vmt: sysmon_power, sysmon_taskq | | 74 | device vmt: sysmon_power, sysmon_taskq |
75 | attach vmt at cpufeaturebus | | 75 | attach vmt at cpufeaturebus |
76 | file arch/x86/x86/vmt.c vmt | | 76 | file arch/x86/x86/vmt.c vmt |
77 | | | 77 | |
78 | device hyperv | | 78 | device hyperv |
79 | attach hyperv at cpufeaturebus | | 79 | attach hyperv at cpufeaturebus |
80 | file arch/x86/x86/hyperv.c hyperv needs-flag | | 80 | file arch/x86/x86/hyperv.c hyperv needs-flag |
81 | | | 81 | |
82 | file arch/x86/x86/apic.c ioapic | lapic | | 82 | file arch/x86/x86/apic.c ioapic | lapic |
83 | file arch/x86/x86/bus_dma.c machdep | | 83 | file arch/x86/x86/bus_dma.c machdep |
84 | file arch/x86/x86/bus_space.c machdep | | 84 | file arch/x86/x86/bus_space.c machdep |
85 | file arch/x86/x86/consinit.c machdep | | 85 | file arch/x86/x86/consinit.c machdep & !xenpv |
86 | file arch/x86/x86/core_machdep.c coredump | | 86 | file arch/x86/x86/core_machdep.c coredump |
87 | file arch/x86/x86/cpu_topology.c machdep | | 87 | file arch/x86/x86/cpu_topology.c machdep |
88 | file arch/x86/x86/db_memrw.c ddb | kgdb | | 88 | file arch/x86/x86/db_memrw.c ddb | kgdb |
89 | file arch/x86/x86/db_trace.c ddb | | 89 | file arch/x86/x86/db_trace.c ddb |
90 | file arch/x86/x86/efi.c machdep | | 90 | file arch/x86/x86/efi.c machdep |
91 | file arch/x86/x86/errata.c machdep | | 91 | file arch/x86/x86/errata.c machdep |
92 | file arch/x86/x86/genfb_machdep.c machdep | | 92 | file arch/x86/x86/genfb_machdep.c machdep |
93 | file arch/x86/x86/identcpu.c machdep | | 93 | file arch/x86/x86/identcpu.c machdep |
94 | file arch/x86/x86/i8259.c machdep | | 94 | file arch/x86/x86/i8259.c machdep & (!xenpv | dom0ops) |
95 | file arch/x86/x86/intr.c machdep | | 95 | file arch/x86/x86/intr.c machdep & !xenpv |
96 | file arch/x86/x86/x86_softintr.c machdep | | 96 | file arch/x86/x86/x86_softintr.c machdep |
97 | file arch/x86/x86/kgdb_machdep.c kgdb | | 97 | file arch/x86/x86/kgdb_machdep.c kgdb |
98 | file arch/x86/x86/nmi.c machdep | | 98 | file arch/x86/x86/nmi.c machdep |
99 | file arch/x86/x86/idt.c machdep | | 99 | file arch/x86/x86/idt.c machdep |
100 | file arch/x86/x86/ipi.c machdep | | 100 | file arch/x86/x86/ipi.c machdep & ( !xenpv | dom0ops ) |
101 | file arch/x86/x86/mtrr_i686.c mtrr | | 101 | file arch/x86/x86/mtrr_i686.c mtrr & !xenpv |
102 | file arch/x86/x86/patch.c machdep | | 102 | file arch/x86/x86/patch.c machdep & !xenpv |
103 | file arch/x86/x86/platform.c machdep | | 103 | file arch/x86/x86/platform.c machdep |
104 | file arch/x86/x86/pmap.c machdep | | 104 | file arch/x86/x86/pmap.c machdep |
105 | file arch/x86/x86/x86_tlb.c machdep | | 105 | file arch/x86/x86/x86_tlb.c machdep |
106 | file arch/x86/x86/procfs_machdep.c procfs | | 106 | file arch/x86/x86/procfs_machdep.c procfs |
107 | file arch/x86/x86/svs.c machdep & svs | | 107 | file arch/x86/x86/svs.c machdep & svs |
108 | file arch/x86/x86/sys_machdep.c machdep | | 108 | file arch/x86/x86/sys_machdep.c machdep |
109 | file arch/x86/x86/syscall.c machdep | | 109 | file arch/x86/x86/syscall.c machdep |
110 | file arch/x86/x86/tsc.c machdep | | 110 | file arch/x86/x86/tsc.c machdep |
111 | file arch/x86/x86/vm_machdep.c machdep | | 111 | file arch/x86/x86/vm_machdep.c machdep |
112 | file arch/x86/x86/x86_autoconf.c machdep | | 112 | file arch/x86/x86/x86_autoconf.c machdep & !xenpv |
113 | file arch/x86/x86/x86_userconf.c userconf | | 113 | file arch/x86/x86/x86_userconf.c userconf |
114 | file arch/x86/x86/x86_machdep.c machdep | | 114 | file arch/x86/x86/x86_machdep.c machdep |
115 | | | 115 | |
116 | file uvm/pmap/pmap_pvt.c machdep | | 116 | file uvm/pmap/pmap_pvt.c machdep |
117 | | | 117 | |
118 | file arch/x86/x86/cpu_ucode.c cpu_ucode needs-flag | | 118 | file arch/x86/x86/cpu_ucode.c cpu_ucode needs-flag |
119 | file arch/x86/x86/cpu_ucode_amd.c cpu_ucode needs-flag | | 119 | file arch/x86/x86/cpu_ucode_amd.c cpu_ucode needs-flag |
120 | file arch/x86/x86/cpu_ucode_intel.c cpu_ucode needs-flag | | 120 | file arch/x86/x86/cpu_ucode_intel.c cpu_ucode needs-flag |
121 | file arch/x86/x86/compat_60_cpu_ucode.c compat_60 & cpu_ucode | | 121 | file arch/x86/x86/compat_60_cpu_ucode.c compat_60 & cpu_ucode |
122 | | | 122 | |
123 | define lapic | | 123 | define lapic |
124 | file arch/x86/x86/lapic.c lapic needs-flag | | 124 | file arch/x86/x86/lapic.c lapic needs-flag |
125 | | | 125 | |
| @@ -127,34 +127,34 @@ device ioapic: lapic | | | @@ -127,34 +127,34 @@ device ioapic: lapic |
127 | attach ioapic at ioapicbus | | 127 | attach ioapic at ioapicbus |
128 | file arch/x86/x86/ioapic.c ioapic needs-flag | | 128 | file arch/x86/x86/ioapic.c ioapic needs-flag |
129 | | | 129 | |
130 | # MP configuration using Intel SMP specification 1.4 | | 130 | # MP configuration using Intel SMP specification 1.4 |
131 | file arch/x86/x86/mpbios.c mpbios | | 131 | file arch/x86/x86/mpbios.c mpbios |
132 | | | 132 | |
133 | # MP configuration using either ACPI or Intel SMP specification 1.4 | | 133 | # MP configuration using either ACPI or Intel SMP specification 1.4 |
134 | file arch/x86/x86/mp.c acpi | mpbios | | 134 | file arch/x86/x86/mp.c acpi | mpbios |
135 | | | 135 | |
136 | # MP configuration using ACPI | | 136 | # MP configuration using ACPI |
137 | file arch/x86/x86/mpacpi.c acpi | | 137 | file arch/x86/x86/mpacpi.c acpi |
138 | | | 138 | |
139 | file arch/x86/acpi/acpi_pdc.c acpi | | 139 | file arch/x86/acpi/acpi_pdc.c acpi |
140 | file arch/x86/acpi/acpi_wakeup.c acpi | | 140 | file arch/x86/acpi/acpi_wakeup.c acpi & !xenpv |
141 | file arch/x86/acpi/acpi_machdep.c acpi | | 141 | file arch/x86/acpi/acpi_machdep.c acpi |
142 | | | 142 | |
143 | file arch/x86/isa/isa_machdep.c | | 143 | file arch/x86/isa/isa_machdep.c isa |
144 | | | 144 | |
145 | # PC clock | | 145 | # PC clock |
146 | file arch/x86/isa/clock.c | | 146 | file arch/x86/isa/clock.c !xenpv |
147 | file arch/x86/isa/rtc.c | | 147 | file arch/x86/isa/rtc.c isa |
148 | | | 148 | |
149 | # Stubs for x86 routines not included in the system | | 149 | # Stubs for x86 routines not included in the system |
150 | file arch/x86/x86/x86_stub.c | | 150 | file arch/x86/x86/x86_stub.c |
151 | | | 151 | |
152 | # IPMI device | | 152 | # IPMI device |
153 | file arch/x86/x86/x86_ipmi.c ipmi needs-flag | | 153 | file arch/x86/x86/x86_ipmi.c ipmi needs-flag |
154 | | | 154 | |
155 | file arch/x86/x86/vga_post.c vga_post | | 155 | file arch/x86/x86/vga_post.c vga_post |
156 | | | 156 | |
157 | file arch/x86/pci/pci_machdep.c pci | | 157 | file arch/x86/pci/pci_machdep.c pci |
158 | #file arch/x86/pci/pci_ranges.c pci | | 158 | #file arch/x86/pci/pci_ranges.c pci |
159 | file arch/x86/pci/pci_intr_machdep.c pci | | 159 | file arch/x86/pci/pci_intr_machdep.c pci |
160 | file arch/x86/pci/pci_msi_machdep.c pci & ! no_pci_msi_msix | | 160 | file arch/x86/pci/pci_msi_machdep.c pci & ! no_pci_msi_msix |
--- src/sys/arch/x86/include/intr.h 2020/04/11 18:26:07 1.61.6.2
+++ src/sys/arch/x86/include/intr.h 2020/04/16 08:46:35 1.61.6.3
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: intr.h,v 1.61.6.2 2020/04/11 18:26:07 bouyer Exp $ */ | | 1 | /* $NetBSD: intr.h,v 1.61.6.3 2020/04/16 08:46:35 bouyer Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1998, 2001, 2006, 2007, 2008, 2019 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 1998, 2001, 2006, 2007, 2008, 2019 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Charles M. Hannum, and by Jason R. Thorpe. | | 8 | * by Charles M. Hannum, and by Jason R. Thorpe. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -37,26 +37,31 @@ | | | @@ -37,26 +37,31 @@ |
37 | #define __HAVE_PREEMPTION | | 37 | #define __HAVE_PREEMPTION |
38 | #endif /* !defined(NO_PREEMPTION) */ | | 38 | #endif /* !defined(NO_PREEMPTION) */ |
39 | | | 39 | |
40 | #ifdef _KERNEL | | 40 | #ifdef _KERNEL |
41 | #include <sys/types.h> | | 41 | #include <sys/types.h> |
42 | #else | | 42 | #else |
43 | #include <stdbool.h> | | 43 | #include <stdbool.h> |
44 | #endif | | 44 | #endif |
45 | | | 45 | |
46 | #include <sys/evcnt.h> | | 46 | #include <sys/evcnt.h> |
47 | #include <sys/queue.h> | | 47 | #include <sys/queue.h> |
48 | #include <machine/intrdefs.h> | | 48 | #include <machine/intrdefs.h> |
49 | | | 49 | |
| | | 50 | #ifdef XEN |
| | | 51 | #include <xen/include/public/xen.h> |
| | | 52 | #include <xen/include/public/event_channel.h> |
| | | 53 | #endif /* XEN */ |
| | | 54 | |
50 | #ifndef _LOCORE | | 55 | #ifndef _LOCORE |
51 | #include <machine/pic.h> | | 56 | #include <machine/pic.h> |
52 | | | 57 | |
53 | /* | | 58 | /* |
54 | * Struct describing an interrupt source for a CPU. struct cpu_info | | 59 | * Struct describing an interrupt source for a CPU. struct cpu_info |
55 | * has an array of MAX_INTR_SOURCES of these. The index in the array | | 60 | * has an array of MAX_INTR_SOURCES of these. The index in the array |
56 | * is equal to the stub number of the stubcode as present in vector.s | | 61 | * is equal to the stub number of the stubcode as present in vector.s |
57 | * | | 62 | * |
58 | * The primary CPU's array of interrupt sources has its first 16 | | 63 | * The primary CPU's array of interrupt sources has its first 16 |
59 | * entries reserved for legacy ISA irq handlers. This means that | | 64 | * entries reserved for legacy ISA irq handlers. This means that |
60 | * they have a 1:1 mapping for arrayindex:irq_num. This is not | | 65 | * they have a 1:1 mapping for arrayindex:irq_num. This is not |
61 | * true for interrupts that come in through IO APICs, to find | | 66 | * true for interrupts that come in through IO APICs, to find |
62 | * their source, go through ci->ci_isources[index].is_pic | | 67 | * their source, go through ci->ci_isources[index].is_pic |
--- src/sys/arch/x86/x86/cpu_ucode.c 2019/02/11 14:59:33 1.12
+++ src/sys/arch/x86/x86/cpu_ucode.c 2020/04/16 08:46:35 1.12.10.1
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: cpu_ucode.c,v 1.12 2019/02/11 14:59:33 cherry Exp $ */ | | 1 | /* $NetBSD: cpu_ucode.c,v 1.12.10.1 2020/04/16 08:46:35 bouyer Exp $ */ |
2 | /* | | 2 | /* |
3 | * Copyright (c) 2012 The NetBSD Foundation, Inc. | | 3 | * Copyright (c) 2012 The NetBSD Foundation, Inc. |
4 | * All rights reserved. | | 4 | * All rights reserved. |
5 | * | | 5 | * |
6 | * This code is derived from software contributed to The NetBSD Foundation | | 6 | * This code is derived from software contributed to The NetBSD Foundation |
7 | * by Christoph Egger. | | 7 | * by Christoph Egger. |
8 | * | | 8 | * |
9 | * Redistribution and use in source and binary forms, with or without | | 9 | * Redistribution and use in source and binary forms, with or without |
10 | * modification, are permitted provided that the following conditions | | 10 | * modification, are permitted provided that the following conditions |
11 | * are met: | | 11 | * are met: |
12 | * 1. Redistributions of source code must retain the above copyright | | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * 2. Redistributions in binary form must reproduce the above copyright | | 14 | * 2. Redistributions in binary form must reproduce the above copyright |
| @@ -19,27 +19,27 @@ | | | @@ -19,27 +19,27 @@ |
19 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 19 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
28 | * POSSIBILITY OF SUCH DAMAGE. | | 28 | * POSSIBILITY OF SUCH DAMAGE. |
29 | */ | | 29 | */ |
30 | | | 30 | |
31 | #include <sys/cdefs.h> | | 31 | #include <sys/cdefs.h> |
32 | __KERNEL_RCSID(0, "$NetBSD: cpu_ucode.c,v 1.12 2019/02/11 14:59:33 cherry Exp $"); | | 32 | __KERNEL_RCSID(0, "$NetBSD: cpu_ucode.c,v 1.12.10.1 2020/04/16 08:46:35 bouyer Exp $"); |
33 | | | 33 | |
34 | #if defined(_KERNEL_OPT) | | 34 | #if defined(_KERNEL_OPT) |
35 | #include "opt_cpu_ucode.h" | | 35 | #include "opt_cpu_ucode.h" |
36 | #include "opt_xen.h" | | 36 | #include "opt_xen.h" |
37 | #endif | | 37 | #endif |
38 | | | 38 | |
39 | #include <sys/param.h> | | 39 | #include <sys/param.h> |
40 | #include <sys/cpuio.h> | | 40 | #include <sys/cpuio.h> |
41 | #include <sys/cpu.h> | | 41 | #include <sys/cpu.h> |
42 | | | 42 | |
43 | #include <dev/firmload.h> | | 43 | #include <dev/firmload.h> |
44 | | | 44 | |
45 | #include <machine/cpuvar.h> | | 45 | #include <machine/cpuvar.h> |
| @@ -148,14 +148,14 @@ cpu_ucode_apply(const struct cpu_ucode * | | | @@ -148,14 +148,14 @@ cpu_ucode_apply(const struct cpu_ucode * |
148 | | | 148 | |
149 | op.cmd = XENPF_microcode_update; | | 149 | op.cmd = XENPF_microcode_update; |
150 | set_xen_guest_handle(op.u.microcode.data, sc->sc_blob); | | 150 | set_xen_guest_handle(op.u.microcode.data, sc->sc_blob); |
151 | op.u.microcode.length = sc->sc_blobsize; | | 151 | op.u.microcode.length = sc->sc_blobsize; |
152 | | | 152 | |
153 | error = -HYPERVISOR_platform_op(&op); | | 153 | error = -HYPERVISOR_platform_op(&op); |
154 | | | 154 | |
155 | if (sc->sc_blob) | | 155 | if (sc->sc_blob) |
156 | firmware_free(sc->sc_blob, sc->sc_blobsize); | | 156 | firmware_free(sc->sc_blob, sc->sc_blobsize); |
157 | sc->sc_blob = NULL; | | 157 | sc->sc_blob = NULL; |
158 | sc->sc_blobsize = 0; | | 158 | sc->sc_blobsize = 0; |
159 | return error; | | 159 | return error; |
160 | } | | 160 | } |
161 | #endif | | 161 | #endif /* XEN */ |
--- src/sys/arch/x86/x86/cpu_ucode_amd.c 2019/10/15 00:13:52 1.10
+++ src/sys/arch/x86/x86/cpu_ucode_amd.c 2020/04/16 08:46:35 1.10.6.1
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: cpu_ucode_amd.c,v 1.10 2019/10/15 00:13:52 chs Exp $ */ | | 1 | /* $NetBSD: cpu_ucode_amd.c,v 1.10.6.1 2020/04/16 08:46:35 bouyer Exp $ */ |
2 | /* | | 2 | /* |
3 | * Copyright (c) 2012 The NetBSD Foundation, Inc. | | 3 | * Copyright (c) 2012 The NetBSD Foundation, Inc. |
4 | * All rights reserved. | | 4 | * All rights reserved. |
5 | * | | 5 | * |
6 | * This code is derived from software contributed to The NetBSD Foundation | | 6 | * This code is derived from software contributed to The NetBSD Foundation |
7 | * by Christoph Egger. | | 7 | * by Christoph Egger. |
8 | * | | 8 | * |
9 | * Redistribution and use in source and binary forms, with or without | | 9 | * Redistribution and use in source and binary forms, with or without |
10 | * modification, are permitted provided that the following conditions | | 10 | * modification, are permitted provided that the following conditions |
11 | * are met: | | 11 | * are met: |
12 | * 1. Redistributions of source code must retain the above copyright | | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * 2. Redistributions in binary form must reproduce the above copyright | | 14 | * 2. Redistributions in binary form must reproduce the above copyright |
| @@ -19,27 +19,27 @@ | | | @@ -19,27 +19,27 @@ |
19 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 19 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
28 | * POSSIBILITY OF SUCH DAMAGE. | | 28 | * POSSIBILITY OF SUCH DAMAGE. |
29 | */ | | 29 | */ |
30 | | | 30 | |
31 | #include <sys/cdefs.h> | | 31 | #include <sys/cdefs.h> |
32 | __KERNEL_RCSID(0, "$NetBSD: cpu_ucode_amd.c,v 1.10 2019/10/15 00:13:52 chs Exp $"); | | 32 | __KERNEL_RCSID(0, "$NetBSD: cpu_ucode_amd.c,v 1.10.6.1 2020/04/16 08:46:35 bouyer Exp $"); |
33 | | | 33 | |
34 | #ifdef _KERNEL_OPT | | 34 | #ifdef _KERNEL_OPT |
35 | #include "opt_xen.h" | | 35 | #include "opt_xen.h" |
36 | #include "opt_cpu_ucode.h" | | 36 | #include "opt_cpu_ucode.h" |
37 | #endif | | 37 | #endif |
38 | | | 38 | |
39 | #include <sys/param.h> | | 39 | #include <sys/param.h> |
40 | #include <sys/conf.h> | | 40 | #include <sys/conf.h> |
41 | #include <sys/cpuio.h> | | 41 | #include <sys/cpuio.h> |
42 | #include <sys/cpu.h> | | 42 | #include <sys/cpu.h> |
43 | #include <sys/kmem.h> | | 43 | #include <sys/kmem.h> |
44 | #include <sys/xcall.h> | | 44 | #include <sys/xcall.h> |
45 | | | 45 | |
| @@ -128,27 +128,27 @@ cpu_ucode_amd_firmware_open(firmware_han | | | @@ -128,27 +128,27 @@ cpu_ucode_amd_firmware_open(firmware_han |
128 | if (fwname != NULL && fwname[0] != '\0') | | 128 | if (fwname != NULL && fwname[0] != '\0') |
129 | return firmware_open(fw_path, fwname, fwh); | | 129 | return firmware_open(fw_path, fwname, fwh); |
130 | | | 130 | |
131 | snprintf(_fwname, sizeof(_fwname), "microcode_amd_fam%xh.bin", | | 131 | snprintf(_fwname, sizeof(_fwname), "microcode_amd_fam%xh.bin", |
132 | amd_cpufamily()); | | 132 | amd_cpufamily()); |
133 | | | 133 | |
134 | error = firmware_open(fw_path, _fwname, fwh); | | 134 | error = firmware_open(fw_path, _fwname, fwh); |
135 | if (error == 0) | | 135 | if (error == 0) |
136 | return 0; | | 136 | return 0; |
137 | | | 137 | |
138 | return firmware_open(fw_path, "microcode_amd.bin", fwh); | | 138 | return firmware_open(fw_path, "microcode_amd.bin", fwh); |
139 | } | | 139 | } |
140 | | | 140 | |
141 | #ifndef XEN | | 141 | #ifndef XENPV |
142 | struct mc_buf { | | 142 | struct mc_buf { |
143 | uint8_t *mc_buf; | | 143 | uint8_t *mc_buf; |
144 | uint32_t mc_equiv_cpuid; | | 144 | uint32_t mc_equiv_cpuid; |
145 | struct mpbhdr *mc_mpbuf; | | 145 | struct mpbhdr *mc_mpbuf; |
146 | struct microcode_amd *mc_amd; | | 146 | struct microcode_amd *mc_amd; |
147 | int mc_error; | | 147 | int mc_error; |
148 | }; | | 148 | }; |
149 | | | 149 | |
150 | static void | | 150 | static void |
151 | cpu_apply_cb(void *arg0, void *arg1) | | 151 | cpu_apply_cb(void *arg0, void *arg1) |
152 | { | | 152 | { |
153 | int error = 0; | | 153 | int error = 0; |
154 | const struct cpu_ucode_softc *sc = arg0; | | 154 | const struct cpu_ucode_softc *sc = arg0; |
--- src/sys/arch/x86/x86/cpu_ucode_intel.c 2019/05/10 18:21:01 1.17
+++ src/sys/arch/x86/x86/cpu_ucode_intel.c 2020/04/16 08:46:35 1.17.8.1
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: cpu_ucode_intel.c,v 1.17 2019/05/10 18:21:01 maxv Exp $ */ | | 1 | /* $NetBSD: cpu_ucode_intel.c,v 1.17.8.1 2020/04/16 08:46:35 bouyer Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2012, 2019 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2012, 2019 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Matthias Drochner and Maxime Villard. | | 8 | * by Matthias Drochner and Maxime Villard. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -20,27 +20,27 @@ | | | @@ -20,27 +20,27 @@ |
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
29 | * POSSIBILITY OF SUCH DAMAGE. | | 29 | * POSSIBILITY OF SUCH DAMAGE. |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | #include <sys/cdefs.h> | | 32 | #include <sys/cdefs.h> |
33 | __KERNEL_RCSID(0, "$NetBSD: cpu_ucode_intel.c,v 1.17 2019/05/10 18:21:01 maxv Exp $"); | | 33 | __KERNEL_RCSID(0, "$NetBSD: cpu_ucode_intel.c,v 1.17.8.1 2020/04/16 08:46:35 bouyer Exp $"); |
34 | | | 34 | |
35 | #ifdef _KERNEL_OPT | | 35 | #ifdef _KERNEL_OPT |
36 | #include "opt_xen.h" | | 36 | #include "opt_xen.h" |
37 | #include "opt_cpu_ucode.h" | | 37 | #include "opt_cpu_ucode.h" |
38 | #endif | | 38 | #endif |
39 | | | 39 | |
40 | #include <sys/param.h> | | 40 | #include <sys/param.h> |
41 | #include <sys/conf.h> | | 41 | #include <sys/conf.h> |
42 | #include <sys/cpuio.h> | | 42 | #include <sys/cpuio.h> |
43 | #include <sys/cpu.h> | | 43 | #include <sys/cpu.h> |
44 | #include <sys/kmem.h> | | 44 | #include <sys/kmem.h> |
45 | | | 45 | |
46 | #include <machine/cpufunc.h> | | 46 | #include <machine/cpufunc.h> |
| @@ -96,27 +96,27 @@ cpu_ucode_intel_firmware_open(firmware_h | | | @@ -96,27 +96,27 @@ cpu_ucode_intel_firmware_open(firmware_h |
96 | return firmware_open(fw_path, fwname, fwh); | | 96 | return firmware_open(fw_path, fwname, fwh); |
97 | | | 97 | |
98 | cpu_signature = curcpu()->ci_signature; | | 98 | cpu_signature = curcpu()->ci_signature; |
99 | if (CPUID_TO_FAMILY(cpu_signature) < 6) | | 99 | if (CPUID_TO_FAMILY(cpu_signature) < 6) |
100 | return EOPNOTSUPP; | | 100 | return EOPNOTSUPP; |
101 | | | 101 | |
102 | intel_getcurrentucode(&ucodeversion, &platformid); | | 102 | intel_getcurrentucode(&ucodeversion, &platformid); |
103 | snprintf(cpuspec, sizeof(cpuspec), "%08x-%d", cpu_signature, | | 103 | snprintf(cpuspec, sizeof(cpuspec), "%08x-%d", cpu_signature, |
104 | platformid); | | 104 | platformid); |
105 | | | 105 | |
106 | return firmware_open(fw_path, cpuspec, fwh); | | 106 | return firmware_open(fw_path, cpuspec, fwh); |
107 | } | | 107 | } |
108 | | | 108 | |
109 | #ifndef XEN | | 109 | #ifndef XENPV |
110 | static int | | 110 | static int |
111 | cpu_ucode_intel_verify(struct cpu_ucode_softc *sc, | | 111 | cpu_ucode_intel_verify(struct cpu_ucode_softc *sc, |
112 | struct intel1_ucode_header *buf) | | 112 | struct intel1_ucode_header *buf) |
113 | { | | 113 | { |
114 | uint32_t data_size, total_size, payload_size, ext_size; | | 114 | uint32_t data_size, total_size, payload_size, ext_size; |
115 | uint32_t sum; | | 115 | uint32_t sum; |
116 | int i; | | 116 | int i; |
117 | | | 117 | |
118 | if ((buf->uh_header_ver != 1) || (buf->uh_loader_rev != 1)) | | 118 | if ((buf->uh_header_ver != 1) || (buf->uh_loader_rev != 1)) |
119 | return EINVAL; | | 119 | return EINVAL; |
120 | | | 120 | |
121 | /* | | 121 | /* |
122 | * Data size. | | 122 | * Data size. |
--- src/sys/arch/x86/x86/lapic.c 2020/04/08 17:59:16 1.76.6.1
+++ src/sys/arch/x86/x86/lapic.c 2020/04/16 08:46:35 1.76.6.2
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: lapic.c,v 1.76.6.1 2020/04/08 17:59:16 bouyer Exp $ */ | | 1 | /* $NetBSD: lapic.c,v 1.76.6.2 2020/04/16 08:46:35 bouyer Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2000, 2008 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2000, 2008 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by RedBack Networks Inc. | | 8 | * by RedBack Networks Inc. |
9 | * | | 9 | * |
10 | * Author: Bill Sommerfeld | | 10 | * Author: Bill Sommerfeld |
11 | * | | 11 | * |
12 | * Redistribution and use in source and binary forms, with or without | | 12 | * Redistribution and use in source and binary forms, with or without |
13 | * modification, are permitted provided that the following conditions | | 13 | * modification, are permitted provided that the following conditions |
14 | * are met: | | 14 | * are met: |
| @@ -22,35 +22,37 @@ | | | @@ -22,35 +22,37 @@ |
22 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 22 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
23 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 23 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
24 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 24 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
31 | * POSSIBILITY OF SUCH DAMAGE. | | 31 | * POSSIBILITY OF SUCH DAMAGE. |
32 | */ | | 32 | */ |
33 | | | 33 | |
34 | #include <sys/cdefs.h> | | 34 | #include <sys/cdefs.h> |
35 | __KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.76.6.1 2020/04/08 17:59:16 bouyer Exp $"); | | 35 | __KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.76.6.2 2020/04/16 08:46:35 bouyer Exp $"); |
36 | | | 36 | |
37 | #include "acpica.h" | | 37 | #include "acpica.h" |
38 | #include "ioapic.h" | | 38 | #include "ioapic.h" |
39 | #include "opt_acpi.h" | | 39 | #include "opt_acpi.h" |
40 | #include "opt_ddb.h" | | 40 | #include "opt_ddb.h" |
41 | #include "opt_mpbios.h" /* for MPDEBUG */ | | 41 | #include "opt_mpbios.h" /* for MPDEBUG */ |
42 | #include "opt_multiprocessor.h" | | 42 | #include "opt_multiprocessor.h" |
43 | #include "opt_ntp.h" | | 43 | #include "opt_ntp.h" |
| | | 44 | #include "opt_xen.h" |
| | | 45 | |
44 | | | 46 | |
45 | #include <sys/param.h> | | 47 | #include <sys/param.h> |
46 | #include <sys/proc.h> | | 48 | #include <sys/proc.h> |
47 | #include <sys/systm.h> | | 49 | #include <sys/systm.h> |
48 | #include <sys/device.h> | | 50 | #include <sys/device.h> |
49 | #include <sys/timetc.h> | | 51 | #include <sys/timetc.h> |
50 | | | 52 | |
51 | #include <uvm/uvm_extern.h> | | 53 | #include <uvm/uvm_extern.h> |
52 | | | 54 | |
53 | #include <dev/ic/i8253reg.h> | | 55 | #include <dev/ic/i8253reg.h> |
54 | | | 56 | |
55 | #include <machine/cpu.h> | | 57 | #include <machine/cpu.h> |
56 | #include <machine/cpu_counter.h> | | 58 | #include <machine/cpu_counter.h> |
| @@ -60,26 +62,27 @@ __KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1. | | | @@ -60,26 +62,27 @@ __KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1. |
60 | #include <machine/vmparam.h> | | 62 | #include <machine/vmparam.h> |
61 | #include <machine/mpacpi.h> | | 63 | #include <machine/mpacpi.h> |
62 | #include <machine/mpbiosvar.h> | | 64 | #include <machine/mpbiosvar.h> |
63 | #include <machine/pcb.h> | | 65 | #include <machine/pcb.h> |
64 | #include <machine/specialreg.h> | | 66 | #include <machine/specialreg.h> |
65 | #include <machine/segments.h> | | 67 | #include <machine/segments.h> |
66 | #include <x86/x86/tsc.h> | | 68 | #include <x86/x86/tsc.h> |
67 | #include <x86/i82093var.h> | | 69 | #include <x86/i82093var.h> |
68 | | | 70 | |
69 | #include <machine/apicvar.h> | | 71 | #include <machine/apicvar.h> |
70 | #include <machine/i82489reg.h> | | 72 | #include <machine/i82489reg.h> |
71 | #include <machine/i82489var.h> | | 73 | #include <machine/i82489var.h> |
72 | | | 74 | |
| | | 75 | #ifndef XENPV |
73 | #if NACPICA > 0 | | 76 | #if NACPICA > 0 |
74 | #include <dev/acpi/acpica.h> | | 77 | #include <dev/acpi/acpica.h> |
75 | #include <dev/acpi/acpivar.h> | | 78 | #include <dev/acpi/acpivar.h> |
76 | #endif | | 79 | #endif |
77 | | | 80 | |
78 | #ifdef DDB | | 81 | #ifdef DDB |
79 | #include <machine/db_machdep.h> | | 82 | #include <machine/db_machdep.h> |
80 | #ifdef MULTIPROCESSOR | | 83 | #ifdef MULTIPROCESSOR |
81 | #ifdef __x86_64__ | | 84 | #ifdef __x86_64__ |
82 | typedef void (vector)(void); | | 85 | typedef void (vector)(void); |
83 | extern vector Xintr_x2apic_ddbipi; | | 86 | extern vector Xintr_x2apic_ddbipi; |
84 | extern int ddb_vec; | | 87 | extern int ddb_vec; |
85 | #endif | | 88 | #endif |
| @@ -953,13 +956,19 @@ lapic_dump(void) | | | @@ -953,13 +956,19 @@ lapic_dump(void) |
953 | apic_format_redir(device_xname(ci->ci_dev), where, (idx), \ | | 956 | apic_format_redir(device_xname(ci->ci_dev), where, (idx), \ |
954 | APIC_VECTYPE_LAPIC_LVT, 0, lapic_readreg(lvtreg)) | | 957 | APIC_VECTYPE_LAPIC_LVT, 0, lapic_readreg(lvtreg)) |
955 | | | 958 | |
956 | APIC_LVT_PRINT(ci, "cmci", 0, LAPIC_LVT_CMCI); | | 959 | APIC_LVT_PRINT(ci, "cmci", 0, LAPIC_LVT_CMCI); |
957 | APIC_LVT_PRINT(ci, "timer", 0, LAPIC_LVT_TIMER); | | 960 | APIC_LVT_PRINT(ci, "timer", 0, LAPIC_LVT_TIMER); |
958 | APIC_LVT_PRINT(ci, "thermal", 0, LAPIC_LVT_THERM); | | 961 | APIC_LVT_PRINT(ci, "thermal", 0, LAPIC_LVT_THERM); |
959 | APIC_LVT_PRINT(ci, "pcint", 0, LAPIC_LVT_PCINT); | | 962 | APIC_LVT_PRINT(ci, "pcint", 0, LAPIC_LVT_PCINT); |
960 | APIC_LVT_PRINT(ci, "lint", 0, LAPIC_LVT_LINT0); | | 963 | APIC_LVT_PRINT(ci, "lint", 0, LAPIC_LVT_LINT0); |
961 | APIC_LVT_PRINT(ci, "lint", 1, LAPIC_LVT_LINT1); | | 964 | APIC_LVT_PRINT(ci, "lint", 1, LAPIC_LVT_LINT1); |
962 | APIC_LVT_PRINT(ci, "err", 0, LAPIC_LVT_ERR); | | 965 | APIC_LVT_PRINT(ci, "err", 0, LAPIC_LVT_ERR); |
963 | | | 966 | |
964 | #undef APIC_LVT_PRIINT | | 967 | #undef APIC_LVT_PRIINT |
965 | } | | 968 | } |
| | | 969 | #else /* XENPV */ |
| | | 970 | void |
| | | 971 | lapic_boot_init(paddr_t lapic_base) |
| | | 972 | { |
| | | 973 | } |
| | | 974 | #endif /* XENPV */ |
--- src/sys/arch/x86/x86/mainbus.c 2020/04/11 21:21:49 1.3.12.1
+++ src/sys/arch/x86/x86/mainbus.c 2020/04/16 08:46:35 1.3.12.2
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: mainbus.c,v 1.3.12.1 2020/04/11 21:21:49 bouyer Exp $ */ | | 1 | /* $NetBSD: mainbus.c,v 1.3.12.2 2020/04/16 08:46:35 bouyer Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2018 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2018 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -18,38 +18,39 @@ | | | @@ -18,38 +18,39 @@ |
18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
26 | * POSSIBILITY OF SUCH DAMAGE. | | 26 | * POSSIBILITY OF SUCH DAMAGE. |
27 | */ | | 27 | */ |
28 | | | 28 | |
29 | #include <sys/cdefs.h> | | 29 | #include <sys/cdefs.h> |
30 | | | 30 | |
31 | __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.3.12.1 2020/04/11 21:21:49 bouyer Exp $"); | | 31 | __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.3.12.2 2020/04/16 08:46:35 bouyer Exp $"); |
32 | | | 32 | |
33 | #include <sys/param.h> | | 33 | #include <sys/param.h> |
34 | #include <sys/systm.h> | | 34 | #include <sys/systm.h> |
35 | #include <sys/device.h> | | 35 | #include <sys/device.h> |
36 | #include <sys/reboot.h> | | 36 | #include <sys/reboot.h> |
37 | | | 37 | |
38 | #include <dev/pci/pcivar.h> | | 38 | #include <dev/pci/pcivar.h> |
39 | | | 39 | |
40 | #include <machine/cpuvar.h> | | 40 | #include <machine/cpuvar.h> |
41 | #include <machine/mpbiosvar.h> | | 41 | #include <machine/mpbiosvar.h> |
42 | #include <machine/mpacpi.h> | | 42 | #include <machine/mpacpi.h> |
| | | 43 | #include <xen/hypervisor.h> |
43 | | | 44 | |
44 | #include "pci.h" | | 45 | #include "pci.h" |
45 | #include "isa.h" | | 46 | #include "isa.h" |
46 | #include "isadma.h" | | 47 | #include "isadma.h" |
47 | #include "acpica.h" | | 48 | #include "acpica.h" |
48 | #include "ipmi.h" | | 49 | #include "ipmi.h" |
49 | | | 50 | |
50 | #include "opt_acpi.h" | | 51 | #include "opt_acpi.h" |
51 | #include "opt_mpbios.h" | | 52 | #include "opt_mpbios.h" |
52 | #include "opt_pcifixup.h" | | 53 | #include "opt_pcifixup.h" |
53 | | | 54 | |
54 | #if NACPICA > 0 | | 55 | #if NACPICA > 0 |
55 | #include <dev/acpi/acpivar.h> | | 56 | #include <dev/acpi/acpivar.h> |
| @@ -86,30 +87,26 @@ CFATTACH_DECL2_NEW(mainbus, sizeof(struc | | | @@ -86,30 +87,26 @@ CFATTACH_DECL2_NEW(mainbus, sizeof(struc |
86 | NULL, NULL, | | 87 | NULL, NULL, |
87 | mainbus_rescan, mainbus_childdetached); | | 88 | mainbus_rescan, mainbus_childdetached); |
88 | | | 89 | |
89 | #if defined(__i386__) && !defined(XENPV) | | 90 | #if defined(__i386__) && !defined(XENPV) |
90 | void i386_mainbus_childdetached(device_t, device_t); | | 91 | void i386_mainbus_childdetached(device_t, device_t); |
91 | int i386_mainbus_rescan(device_t, const char *, const int *); | | 92 | int i386_mainbus_rescan(device_t, const char *, const int *); |
92 | void i386_mainbus_attach(device_t, device_t, void *); | | 93 | void i386_mainbus_attach(device_t, device_t, void *); |
93 | #endif | | 94 | #endif |
94 | | | 95 | |
95 | #if defined(__x86_64__) && !defined(XENPV) | | 96 | #if defined(__x86_64__) && !defined(XENPV) |
96 | void amd64_mainbus_attach(device_t, device_t, void *); | | 97 | void amd64_mainbus_attach(device_t, device_t, void *); |
97 | #endif | | 98 | #endif |
98 | | | 99 | |
99 | #if defined(XEN) | | | |
100 | void xen_mainbus_attach(device_t, device_t, void *); | | | |
101 | #endif | | | |
102 | | | | |
103 | static int | | 100 | static int |
104 | mainbus_cpu_print(void *aux, const char *busname) | | 101 | mainbus_cpu_print(void *aux, const char *busname) |
105 | { | | 102 | { |
106 | char *cpuname = aux; | | 103 | char *cpuname = aux; |
107 | | | 104 | |
108 | if (busname) | | 105 | if (busname) |
109 | aprint_normal("%s at %s", cpuname, busname); | | 106 | aprint_normal("%s at %s", cpuname, busname); |
110 | return UNCONF; | | 107 | return UNCONF; |
111 | } | | 108 | } |
112 | | | 109 | |
113 | /* | | 110 | /* |
114 | * On x86, CPUs can be enumerated and attached to mainbus in mainly two ways | | 111 | * On x86, CPUs can be enumerated and attached to mainbus in mainly two ways |
115 | * depending on the platform (configuration): via MP BIOS tables, and via | | 112 | * depending on the platform (configuration): via MP BIOS tables, and via |
--- src/sys/arch/xen/conf/Makefile.xen 2019/02/02 12:32:54 1.48
+++ src/sys/arch/xen/conf/Makefile.xen 2020/04/16 08:46:35 1.48.10.1
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: Makefile.xen,v 1.48 2019/02/02 12:32:54 cherry Exp $ | | 1 | # $NetBSD: Makefile.xen,v 1.48.10.1 2020/04/16 08:46:35 bouyer Exp $ |
2 | # NetBSD: Makefile.i386,v 1.132 2003/07/05 16:56:10 simonb Exp | | 2 | # NetBSD: Makefile.i386,v 1.132 2003/07/05 16:56:10 simonb Exp |
3 | | | 3 | |
4 | # Makefile for NetBSD | | 4 | # Makefile for NetBSD |
5 | # | | 5 | # |
6 | # This makefile is constructed from a machine description: | | 6 | # This makefile is constructed from a machine description: |
7 | # config machineid | | 7 | # config machineid |
8 | # Most changes should be made in the machine description | | 8 | # Most changes should be made in the machine description |
9 | # /sys/arch/xen/conf/``machineid'' | | 9 | # /sys/arch/xen/conf/``machineid'' |
10 | # after which you should do | | 10 | # after which you should do |
11 | # config machineid | | 11 | # config machineid |
12 | # Machine generic makefile changes should be made in | | 12 | # Machine generic makefile changes should be made in |
13 | # /sys/arch/xen/conf/Makefile.xen | | 13 | # /sys/arch/xen/conf/Makefile.xen |
14 | # after which config should be rerun for all machines of that type. | | 14 | # after which config should be rerun for all machines of that type. |
| @@ -57,55 +57,57 @@ CFLAGS+= ${${ACTIVE_CC} == "gcc":? -mno | | | @@ -57,55 +57,57 @@ CFLAGS+= ${${ACTIVE_CC} == "gcc":? -mno |
57 | DEFCOPTS= -O2 -fno-omit-frame-pointer | | 57 | DEFCOPTS= -O2 -fno-omit-frame-pointer |
58 | CFLAGS+= -msoft-float | | 58 | CFLAGS+= -msoft-float |
59 | CFLAGS+= -mno-mmx -mno-sse -mno-avx | | 59 | CFLAGS+= -mno-mmx -mno-sse -mno-avx |
60 | .endif | | 60 | .endif |
61 | | | 61 | |
62 | ## | | 62 | ## |
63 | ## (3) libkern and compat | | 63 | ## (3) libkern and compat |
64 | ## | | 64 | ## |
65 | OPT_MODULAR= %MODULAR% | | 65 | OPT_MODULAR= %MODULAR% |
66 | | | 66 | |
67 | ## | | 67 | ## |
68 | ## (4) local objects, compile rules, and dependencies | | 68 | ## (4) local objects, compile rules, and dependencies |
69 | ## | | 69 | ## |
70 | MD_OBJS= locore.o spl.o copy.o vector.o | | 70 | |
71 | .if ${XEN_BUILD} == amd64 | | 71 | MD_OBJS= |
72 | MD_OBJS+= amd64_trap.o | | 72 | .if ${XEN_BUILD} == i386 |
| | | 73 | MD_OBJS+= locore.o spl.o copy.o vector.o lock_stubs.o |
73 | .endif | | 74 | .endif |
74 | MD_CFILES= | | 75 | MD_CFILES= |
75 | | | 76 | |
76 | MD_SFILES= $S/arch/${XEN_BUILD}/${XEN_BUILD}/locore.S \ | | 77 | MD_SFILES= |
| | | 78 | .if ${XEN_BUILD} == i386 |
| | | 79 | MD_SFILES+= $S/arch/${XEN_BUILD}/${XEN_BUILD}/locore.S \ |
77 | $S/arch/${XEN_BUILD}/${XEN_BUILD}/spl.S \ | | 80 | $S/arch/${XEN_BUILD}/${XEN_BUILD}/spl.S \ |
78 | $S/arch/${XEN_BUILD}/${XEN_BUILD}/vector.S \ | | 81 | $S/arch/${XEN_BUILD}/${XEN_BUILD}/vector.S \ |
79 | $S/arch/${XEN_BUILD}/${XEN_BUILD}/copy.S | | 82 | $S/arch/${XEN_BUILD}/${XEN_BUILD}/copy.S \ |
| | | 83 | $S/arch/${XEN_BUILD}/${XEN_BUILD}/lock_stubs.S |
80 | | | 84 | |
81 | .if ${XEN_BUILD} == amd64 | | | |
82 | MD_SFILES+= $S/arch/${XEN_BUILD}/${XEN_BUILD}/amd64_trap.S | | | |
83 | .endif | | 85 | .endif |
84 | | | 86 | |
| | | 87 | .if ${XEN_BUILD} == i386 |
85 | copy.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/copy.S assym.h | | 88 | copy.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/copy.S assym.h |
86 | ${NORMAL_S} | | 89 | ${NORMAL_S} |
87 | | | 90 | |
88 | locore.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/locore.S assym.h | | 91 | locore.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/locore.S assym.h |
89 | ${NORMAL_S} | | 92 | ${NORMAL_S} |
90 | | | 93 | |
91 | spl.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/spl.S assym.h | | 94 | spl.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/spl.S assym.h |
92 | ${NORMAL_S} | | 95 | ${NORMAL_S} |
93 | | | 96 | |
94 | vector.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/vector.S assym.h | | 97 | vector.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/vector.S assym.h |
95 | ${NORMAL_S} | | 98 | ${NORMAL_S} |
96 | | | 99 | |
97 | .if ${XEN_BUILD} == amd64 | | 100 | lock_stubs.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/lock_stubs.S assym.h |
98 | amd64_trap.o: $S/arch/${XEN_BUILD}/${XEN_BUILD}/amd64_trap.S assym.h | | | |
99 | ${NORMAL_S} | | 101 | ${NORMAL_S} |
100 | .endif | | 102 | .endif |
101 | | | 103 | |
102 | .ifndef noBEGIN | | 104 | .ifndef noBEGIN |
103 | .if !make(obj) && !make(clean) && !make(cleandir) | | 105 | .if !make(obj) && !make(clean) && !make(cleandir) |
104 | .BEGIN:: | | 106 | .BEGIN:: |
105 | .for A in ${XEN_MACHINE_ARCHS} | | 107 | .for A in ${XEN_MACHINE_ARCHS} |
106 | -@rm -f ${A} && \ | | 108 | -@rm -f ${A} && \ |
107 | ln -s $S/arch/${A}/include ${A} | | 109 | ln -s $S/arch/${A}/include ${A} |
108 | .endfor | | 110 | .endfor |
109 | -@rm -rf xen-ma && \ | | 111 | -@rm -rf xen-ma && \ |
110 | mkdir xen-ma && ln -s ../${XEN_BUILD} xen-ma/machine | | 112 | mkdir xen-ma && ln -s ../${XEN_BUILD} xen-ma/machine |
111 | -@rm -f machine && \ | | 113 | -@rm -f machine && \ |
--- src/sys/arch/xen/conf/files.xen 2020/04/14 16:53:57 1.180.2.2
+++ src/sys/arch/xen/conf/files.xen 2020/04/16 08:46:35 1.180.2.3
| @@ -1,411 +1,46 @@ | | | @@ -1,411 +1,46 @@ |
1 | # $NetBSD: files.xen,v 1.180.2.2 2020/04/14 16:53:57 bouyer Exp $ | | 1 | # $NetBSD: files.xen,v 1.180.2.3 2020/04/16 08:46:35 bouyer Exp $ |
2 | # NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp | | | |
3 | # NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp | | | |
4 | | | 2 | |
5 | ifdef i386 | | 3 | defflag opt_xen.h XEN XENPVH XENPVHVM |
6 | maxpartitions 8 | | | |
7 | else | | | |
8 | maxpartitions 16 | | | |
9 | endif | | | |
10 | | | 4 | |
11 | maxusers 2 16 128 | | 5 | file arch/xen/x86/hypervisor_machdep.c xen |
| | | 6 | file arch/xen/x86/xen_intr.c xen |
| | | 7 | file arch/xen/xen/xen_machdep.c xen |
| | | 8 | file arch/xen/xen/evtchn.c xen |
| | | 9 | file arch/xen/xen/xengnt.c xen |
| | | 10 | file arch/xen/x86/xen_ipi.c multiprocessor & xen |
| | | 11 | file arch/xen/x86/xen_mainbus.c xen |
12 | | | 12 | |
13 | defparam opt_kernbase.h KERNBASE | | | |
14 | | | 13 | |
15 | # options for MP configuration through the MP spec | | | |
16 | defflag opt_mpbios.h MPBIOS MPVERBOSE MPDEBUG MPBIOS_SCANPCI | | | |
17 | | | | |
18 | # Interrupt debug | | | |
19 | defflag opt_intrdebug.h INTRDEBUG | | | |
20 | | | | |
21 | # delay before cpu_reset() for reboot. | | | |
22 | defparam CPURESET_DELAY | | | |
23 | | | | |
24 | # splraise()/spllower() debug | | | |
25 | defflag opt_spldebug.h SPLDEBUG | | | |
26 | | | | |
27 | # Beep on halt | | | |
28 | defflag opt_beep.h BEEP_ONHALT | | | |
29 | defparam opt_beep.h BEEP_ONHALT_COUNT=3 | | | |
30 | defparam opt_beep.h BEEP_ONHALT_PITCH=1500 | | | |
31 | defparam opt_beep.h BEEP_ONHALT_PERIOD=250 | | | |
32 | | | | |
33 | # PCI fixup options | | | |
34 | defflag opt_pcifixup.h PCI_ADDR_FIXUP PCI_BUS_FIXUP | | | |
35 | PCI_INTR_FIXUP PCI_INTR_FIXUP_FORCE | | | |
36 | | | | |
37 | defparam PCI_CONF_MODE | | | |
38 | | | | |
39 | file arch/xen/x86/autoconf.c xenpv | | | |
40 | ifdef i386 | | | |
41 | file arch/i386/i386/autoconf.c xenpvhvm | | | |
42 | file arch/i386/i386/aout_machdep.c exec_aout | | | |
43 | file arch/i386/i386/i386func.S machdep & xenpvhvm | | | |
44 | file arch/i386/i386/busfunc.S | | | |
45 | file arch/i386/i386/cpufunc.S | | | |
46 | file arch/i386/i386/cpu_in_cksum.S (inet | inet6) & cpu_in_cksum | | | |
47 | file arch/i386/i386/db_disasm.c ddb | | | |
48 | file arch/i386/i386/db_interface.c ddb | | | |
49 | file arch/i386/i386/db_machdep.c ddb | | | |
50 | file arch/i386/i386/dumpsys.c | | | |
51 | file arch/i386/i386/gdt.c | | | |
52 | file arch/i386/i386/kobj_machdep.c modular | | | |
53 | file arch/i386/i386/machdep.c | | | |
54 | file arch/i386/i386/longrun.c | | | |
55 | file arch/i386/i386/mtrr_k6.c mtrr | | | |
56 | file arch/i386/i386/process_machdep.c | | | |
57 | file arch/i386/i386/trap.c | | | |
58 | file arch/i386/i386/lock_stubs.S | | | |
59 | | | | |
60 | file crypto/des/arch/i386/des_enc.S des | | | |
61 | file crypto/des/arch/i386/des_cbc.S des | | | |
62 | | | | |
63 | file crypto/blowfish/arch/i386/bf_enc.S blowfish | | | |
64 | file crypto/blowfish/arch/i386/bf_cbc.S blowfish | | | |
65 | | | | |
66 | elifdef amd64 | | | |
67 | file arch/amd64/amd64/autoconf.c xenpvhvm | | | |
68 | file arch/amd64/amd64/busfunc.S | | | |
69 | file arch/amd64/amd64/cpufunc.S | | | |
70 | file arch/amd64/amd64/cpu_in_cksum.S (inet | inet6) & cpu_in_cksum | | | |
71 | file arch/amd64/amd64/db_disasm.c ddb | | | |
72 | file arch/amd64/amd64/db_interface.c ddb | | | |
73 | file arch/amd64/amd64/db_machdep.c ddb | | | |
74 | file arch/amd64/amd64/kobj_machdep.c modular | | | |
75 | file arch/amd64/amd64/gdt.c | | | |
76 | file arch/amd64/amd64/machdep.c | | | |
77 | file arch/amd64/amd64/process_machdep.c | | | |
78 | file arch/amd64/amd64/trap.c | | | |
79 | file arch/amd64/amd64/lock_stubs.S | | | |
80 | endif | | | |
81 | | | | |
82 | file kern/subr_disk_mbr.c disk | | | |
83 | file uvm/pmap/pmap_pvt.c | | | |
84 | file arch/x86/x86/db_memrw.c ddb | kgdb | | | |
85 | file arch/x86/x86/db_trace.c ddb | | | |
86 | file arch/x86/x86/efi.c machdep | | | |
87 | file arch/x86/x86/errata.c machdep | | | |
88 | file arch/x86/x86/fpu.c | | | |
89 | file arch/x86/x86/dbregs.c | | | |
90 | file arch/xen/x86/hypervisor_machdep.c | | | |
91 | file arch/x86/x86/kgdb_machdep.c kgdb | | | |
92 | file arch/x86/x86/mtrr_i686.c mtrr & (dom0ops | xenpvhvm) | | | |
93 | file arch/x86/x86/syscall.c | | | |
94 | file arch/xen/x86/x86_xpmap.c xenpv | | | |
95 | file arch/xen/x86/xen_pmap.c xenpv | | | |
96 | file arch/xen/x86/xen_intr.c | | | |
97 | file arch/xen/x86/xenfunc.c xenpv | | | |
98 | | | | |
99 | file arch/x86/x86/cpu_ucode.c dom0ops & cpu_ucode needs-flag | | | |
100 | file arch/x86/x86/cpu_ucode_amd.c dom0ops & cpu_ucode needs-flag | | | |
101 | file arch/x86/x86/cpu_ucode_intel.c dom0ops & cpu_ucode needs-flag | | | |
102 | file arch/x86/x86/compat_60_cpu_ucode.c compat_60 & dom0ops & cpu_ucode | | | |
103 | | | | |
104 | | | | |
105 | file arch/xen/xen/xen_machdep.c | | | |
106 | | | | |
107 | file arch/xen/xen/clock.c xenpv | | | |
108 | file arch/x86/isa/clock.c xenpvhvm | | | |
109 | file arch/x86/isa/rtc.c dom0ops | xenpvhvm | | | |
110 | file arch/xen/xen/evtchn.c | | | |
111 | | | | |
112 | file arch/xen/xen/xengnt.c | | | |
113 | | | | |
114 | file arch/x86/x86/cpu_rng.c | | | |
115 | | | | |
116 | file dev/cons.c | | | |
117 | | | | |
118 | | | | |
119 | # | | | |
120 | # Stack-less Just-In-Time compiler | | | |
121 | # | | | |
122 | | | | |
123 | include "external/bsd/sljit/conf/files.sljit" | | | |
124 | | | | |
125 | # | | | |
126 | # Machine-independent SCSI drivers | | | |
127 | # | | | |
128 | | | | |
129 | include "dev/scsipi/files.scsipi" | | | |
130 | | | | |
131 | # | | | |
132 | # Machine-independent ATA drivers | | | |
133 | # | | | |
134 | | | | |
135 | include "dev/ata/files.ata" | | | |
136 | | | | |
137 | # Memory Disk for install floppy | | | |
138 | file dev/md_root.c memory_disk_hooks | | | |
139 | | | | |
140 | file arch/x86/x86/bus_dma.c machdep | | | |
141 | file arch/x86/x86/core_machdep.c coredump | | | |
142 | file arch/xen/x86/xen_bus_dma.c machdep & xenpv | | | |
143 | file arch/x86/x86/bus_space.c machdep | | | |
144 | file arch/xen/x86/consinit.c machdep & xenpv | | | |
145 | file arch/x86/x86/consinit.c machdep & xenpvhvm | | | |
146 | file arch/x86/x86/identcpu.c machdep | | | |
147 | file arch/xen/x86/pintr.c machdep & dom0ops & xenpv | | | |
148 | file arch/xen/x86/xen_ipi.c multiprocessor & xenpv | | | |
149 | file arch/x86/x86/idt.c machdep | | | |
150 | file arch/x86/x86/intr.c machdep & xenpvhvm | | | |
151 | file arch/x86/x86/x86_softintr.c machdep | | | |
152 | file arch/x86/x86/ipi.c xenpvhvm | | | |
153 | file arch/x86/x86/patch.c machdep & ! xenpv | | | |
154 | file arch/x86/x86/pmap.c machdep | | | |
155 | file arch/x86/x86/x86_tlb.c machdep | | | |
156 | file arch/x86/x86/procfs_machdep.c procfs | | | |
157 | file arch/x86/x86/sys_machdep.c machdep | | | |
158 | file arch/x86/x86/tsc.c machdep | | | |
159 | file arch/x86/x86/vm_machdep.c machdep | | | |
160 | file arch/x86/x86/x86_autoconf.c machdep & xenpvhvm | | | |
161 | file arch/x86/x86/x86_machdep.c machdep | | | |
162 | file arch/x86/x86/platform.c machdep | | | |
163 | | | | |
164 | include "arch/xen/conf/files.compat" | | | |
165 | | | | |
166 | # BIOS32 routines | | | |
167 | define bios32 | | | |
168 | file arch/x86/x86/bios32.c bios32 needs-flag | | | |
169 | | | | |
170 | # xen specific mainbus attributes | | | |
171 | define cpubus { [apid = -1] } | | | |
172 | define cpufeaturebus {} | | | |
173 | define ioapicbus { [apid = -1] } | | | |
174 | define apmbus {} | | | |
175 | define pnpbiosbus {} | | | |
176 | define hypervisorbus {} | | 14 | define hypervisorbus {} |
177 | define xendevbus {} | | 15 | define xendevbus {} |
178 | | | 16 | |
179 | # | | | |
180 | # System bus types | | | |
181 | # | | | |
182 | | | | |
183 | device mainbus: isabus, pcibus, cpubus, ioapicbus, hypervisorbus, bios32, ipmibus, acpibus | | | |
184 | attach mainbus at root | | | |
185 | file arch/xen/x86/xen_mainbus.c mainbus | | | |
186 | ifdef amd64 | | | |
187 | file arch/amd64/amd64/amd64_mainbus.c mainbus & xenpvhvm | | | |
188 | elifdef i386 | | | |
189 | file arch/i386/i386/i386_mainbus.c mainbus & xenpvhvm | | | |
190 | file dev/eisa/eisabusprint.c xenpvhvm | | | |
191 | endif | | | |
192 | file arch/x86/x86/mainbus.c mainbus | | | |
193 | | | | |
194 | # Xen hypervisor | | 17 | # Xen hypervisor |
195 | device hypervisor { [apid = -1]}: isabus, pcibus, sysmon_power, xendevbus, acpibus | | 18 | device hypervisor { [apid = -1]}: isabus, pcibus, sysmon_power, xendevbus, acpibus |
196 | attach hypervisor at hypervisorbus | | 19 | attach hypervisor at hypervisorbus |
197 | file arch/xen/xen/hypervisor.c hypervisor needs-flag | | 20 | file arch/xen/xen/hypervisor.c hypervisor needs-flag |
198 | file arch/xen/xen/shutdown_xenbus.c hypervisor | | 21 | file arch/xen/xen/shutdown_xenbus.c hypervisor |
199 | | | 22 | |
200 | # Xenbus | | 23 | # Xenbus |
201 | device xenbus {[id = -1]} | | 24 | device xenbus {[id = -1]} |
202 | attach xenbus at xendevbus | | 25 | attach xenbus at xendevbus |
203 | file arch/xen/xenbus/xenbus_client.c xenbus needs-flag | | 26 | file arch/xen/xenbus/xenbus_client.c xenbus needs-flag |
204 | file arch/xen/xenbus/xenbus_comms.c xenbus needs-flag | | 27 | file arch/xen/xenbus/xenbus_comms.c xenbus needs-flag |
205 | file arch/xen/xenbus/xenbus_dev.c xenbus needs-flag | | 28 | file arch/xen/xenbus/xenbus_dev.c xenbus needs-flag |
206 | file arch/xen/xenbus/xenbus_probe.c xenbus needs-flag | | 29 | file arch/xen/xenbus/xenbus_probe.c xenbus needs-flag |
207 | file arch/xen/xenbus/xenbus_xs.c xenbus needs-flag | | 30 | file arch/xen/xenbus/xenbus_xs.c xenbus needs-flag |
208 | | | 31 | |
209 | # Xen console support | | 32 | # Xen console support |
210 | device xencons: tty | | 33 | device xencons: tty |
211 | attach xencons at xendevbus | | 34 | attach xencons at xendevbus |
212 | file arch/xen/xen/xencons.c xencons needs-flag | | 35 | file arch/xen/xen/xencons.c xencons needs-flag |
213 | | | 36 | |
214 | # Xen event peudo-device | | | |
215 | defpseudo xenevt | | | |
216 | defpseudo xvif | | | |
217 | defpseudo xbdback | | | |
218 | | | | |
219 | # Xen Network driver | | 37 | # Xen Network driver |
220 | device xennet: arp, ether, ifnet | | 38 | device xennet: arp, ether, ifnet |
221 | attach xennet at xenbus | | 39 | attach xennet at xenbus |
222 | file arch/xen/xen/if_xennet_xenbus.c xennet needs-flag | | 40 | file arch/xen/xen/if_xennet_xenbus.c xennet needs-flag |
| | | 41 | file arch/xen/xen/xennet_checksum.c xvif | xennet |
223 | | | 42 | |
224 | # Xen Block device driver and wd/sd/cd identities | | 43 | # Xen Block device driver and wd/sd/cd identities |
225 | device xbd: disk | | 44 | device xbd: disk |
226 | attach xbd at xenbus | | 45 | attach xbd at xenbus |
227 | file arch/xen/xen/xbd_xenbus.c xbd | | 46 | file arch/xen/xen/xbd_xenbus.c xbd |
228 | | | | |
229 | # PCI frontend | | | |
230 | device xpci: pcibus | | | |
231 | attach xpci at xenbus with xpci_xenbus | | | |
232 | file arch/xen/xen/xpci_xenbus.c xpci_xenbus | | | |
233 | | | | |
234 | # Xen Balloon driver | | | |
235 | device balloon | | | |
236 | attach balloon at xenbus | | | |
237 | file arch/xen/xen/balloon.c balloon | | | |
238 | | | | |
239 | # Non-Xen specific devices and options | | | |
240 | | | | |
241 | include "dev/pckbport/files.pckbport" | | | |
242 | | | | |
243 | # | | | |
244 | # Machine-independent PCI devices | | | |
245 | # | | | |
246 | include "dev/i2o/files.i2o" | | | |
247 | include "dev/pci/files.pci" | | | |
248 | include "dev/pci/files.agp" | | | |
249 | file arch/x86/pci/pciide_machdep.c pciide_common | | | |
250 | | | | |
251 | device pciback {unit = -1} | | | |
252 | attach pciback at pci | | | |
253 | file arch/xen/xen/pciback.c pciback | | | |
254 | | | | |
255 | | | | |
256 | # x86 specific PCI hardware | | | |
257 | include "arch/x86/pci/files.pci" | | | |
258 | | | | |
259 | # | | | |
260 | # Machine-independent ISA devices | | | |
261 | # | | | |
262 | include "dev/isa/files.isa" | | | |
263 | | | | |
264 | include "dev/usb/files.usb" | | | |
265 | | | | |
266 | include "dev/ieee1394/files.ieee1394" | | | |
267 | | | | |
268 | device fdc {drive = -1} #XXX | | | |
269 | | | | |
270 | include "dev/apm/files.apm" | | | |
271 | | | | |
272 | include "dev/acpi/files.acpi" | | | |
273 | file arch/xen/xen/xen_acpi_machdep.c acpi & xenpv | | | |
274 | file arch/x86/x86/mpacpi.c acpi | | | |
275 | file arch/x86/x86/i8259.c xenpvhvm | dom0ops | | | |
276 | | | | |
277 | # Stubs for x86 routines not included in the system | | | |
278 | file arch/x86/x86/x86_stub.c | | | |
279 | | | | |
280 | # MP configuration using Intel SMP specification 1.4 | | | |
281 | file arch/x86/x86/mpbios.c mpbios | | | |
282 | | | | |
283 | # MP configuration using either ACPI or Intel SMP specification 1.4 | | | |
284 | file arch/x86/x86/mp.c acpi | mpbios | | | |
285 | | | | |
286 | file arch/x86/pci/pci_bus_fixup.c pci_bus_fixup | | | |
287 | file arch/x86/pci/pci_addr_fixup.c pci_addr_fixup | | | |
288 | | | | |
289 | file arch/x86/x86/apic.c ioapic | | | |
290 | file arch/x86/x86/nmi.c | | | |
291 | | | | |
292 | file arch/x86/acpi/acpi_machdep.c acpi | | | |
293 | file arch/x86/acpi/acpi_pdc.c acpi | | | |
294 | | | | |
295 | device ioapic | | | |
296 | attach ioapic at ioapicbus | | | |
297 | file arch/x86/x86/ioapic.c ioapic needs-flag | | | |
298 | | | | |
299 | #IPMI device | | | |
300 | file arch/x86/x86/x86_ipmi.c ipmi needs-flag | | | |
301 | | | | |
302 | # CPUs | | | |
303 | # | | | |
304 | device cpu: cpufeaturebus | | | |
305 | attach cpu at cpubus | | | |
306 | | | | |
307 | device vcpu | | | |
308 | attach vcpu at xendevbus | | | |
309 | file arch/xen/x86/cpu.c xenpv & vcpu | | | |
310 | file arch/x86/x86/cpu.c xenpvhvm | | | |
311 | | | | |
312 | # CPU features | | | |
313 | # | | | |
314 | device est | | | |
315 | attach est at cpufeaturebus | | | |
316 | file arch/x86/x86/est.c est | | | |
317 | file arch/x86/x86/intel_busclock.c est | | | |
318 | | | | |
319 | device powernow | | | |
320 | attach powernow at cpufeaturebus | | | |
321 | file arch/x86/x86/powernow.c powernow | | | |
322 | | | | |
323 | # | | | |
324 | # Compatibility modules | | | |
325 | # | | | |
326 | | | | |
327 | ifdef i386 | | | |
328 | | | | |
329 | # Binary compatibility with previous NetBSD releases (COMPAT_XX) | | | |
330 | file arch/i386/i386/compat_13_machdep.c compat_13 | | | |
331 | file arch/i386/i386/compat_16_machdep.c compat_16 | | | |
332 | | | | |
333 | # Linux binary compatibility (COMPAT_LINUX) | | | |
334 | include "compat/linux/files.linux" | | | |
335 | include "compat/linux/arch/i386/files.linux_i386" | | | |
336 | file arch/i386/i386/linux_sigcode.S compat_linux | | | |
337 | file arch/i386/i386/linux_syscall.c compat_linux | | | |
338 | file arch/x86/x86/linux_trap.c compat_linux | | | |
339 | | | | |
340 | # FreeBSD binary compatibility (COMPAT_FREEBSD) | | | |
341 | include "compat/freebsd/files.freebsd" | | | |
342 | | | | |
343 | elifdef amd64 | | | |
344 | | | | |
345 | # Binary compatibility with previous NetBSD releases (COMPAT_XX) | | | |
346 | file arch/amd64/amd64/compat_16_machdep.c compat_16 | | | |
347 | | | | |
348 | # NetBSD/i386 32-bit binary compatibility (COMPAT_NETBSD32) | | | |
349 | include "compat/netbsd32/files.netbsd32" | | | |
350 | file arch/amd64/amd64/netbsd32_machdep.c compat_netbsd32 | | | |
351 | file arch/amd64/amd64/netbsd32_machdep_13.c compat_netbsd32 & compat_13 | | | |
352 | file arch/amd64/amd64/netbsd32_machdep_16.c compat_netbsd32 & compat_16 | | | |
353 | file arch/amd64/amd64/netbsd32_sigcode.S compat_netbsd32 & compat_16 | | | |
354 | file arch/amd64/amd64/netbsd32_syscall.c compat_netbsd32 | | | |
355 | | | | |
356 | # Linux compatibility (COMPAT_LINUX) | | | |
357 | include "compat/linux/files.linux" | | | |
358 | include "compat/linux/arch/amd64/files.linux_amd64" | | | |
359 | file arch/amd64/amd64/linux_sigcode.S compat_linux | | | |
360 | file arch/amd64/amd64/linux_syscall.c compat_linux | | | |
361 | file arch/x86/x86/linux_trap.c compat_linux | | | |
362 | # Linux 32 bit compatibility (COMPAT_LINUX32) | | | |
363 | include "compat/linux32/files.linux32" | | | |
364 | include "compat/linux32/arch/amd64/files.linux32_amd64" | | | |
365 | file arch/amd64/amd64/linux32_sigcode.S compat_linux32 | | | |
366 | file arch/amd64/amd64/linux32_syscall.c compat_linux32 | | | |
367 | endif | | | |
368 | | | | |
369 | # OSS audio driver compatibility | | | |
370 | include "compat/ossaudio/files.ossaudio" | | | |
371 | | | | |
372 | # Bluetooth | | | |
373 | include "dev/bluetooth/files.bluetooth" | | | |
374 | | | | |
375 | include "dev/sdmmc/files.sdmmc" | | | |
376 | | | | |
377 | # | | | |
378 | # CARDBUS | | | |
379 | # | | | |
380 | include "dev/cardbus/files.cardbus" | | | |
381 | ifdef i386 | | | |
382 | file arch/i386/i386/rbus_machdep.c cardbus | | | |
383 | elifdef amd64 | | | |
384 | file arch/amd64/amd64/rbus_machdep.c cardbus | | | |
385 | endif | | | |
386 | | | | |
387 | # this wants to be probed as late as possible. | | | |
388 | # | | | |
389 | # Machine-independent PCMCIA drivers | | | |
390 | # | | | |
391 | include "dev/pcmcia/files.pcmcia" | | | |
392 | | | | |
393 | # Domain-0 operations | | | |
394 | defflag opt_xen.h DOM0OPS XENPV | | | |
395 | file arch/xen/xen/privcmd.c dom0ops | | | |
396 | file arch/xen/x86/xen_shm_machdep.c dom0ops | | | |
397 | file arch/x86/pci/pci_machdep.c (xenpvhvm | hypervisor) & pci & ( dom0ops | xenpvhvm ) | | | |
398 | file arch/x86/pci/pci_intr_machdep.c (xenpvhvm | hypervisor) & pci | | | |
399 | file arch/x86/pci/pci_msi_machdep.c hypervisor & xenpvhvm & pci & ! no_pci_msi_msix | | | |
400 | file arch/x86/pci/msipic.c hypervisor & xenpvhvm & pci & ! no_pci_msi_msix | | | |
401 | file arch/x86/isa/isa_machdep.c (xenpvhvm | hypervisor) & ( dom0ops | xenpvhvm ) | | | |
402 | file arch/xen/xen/xenevt.c xenevt & (dom0ops | xenpvhvm) | | | |
403 | file arch/xen/xen/xennetback_xenbus.c xvif | | | |
404 | file arch/xen/xen/xennet_checksum.c xvif | xennet | | | |
405 | file arch/xen/xen/xbdback_xenbus.c xbdback | | | |
406 | | | | |
407 | ifdef i386 | | | |
408 | include "arch/i386/conf/majors.i386" | | | |
409 | elifdef amd64 | | | |
410 | include "arch/amd64/conf/majors.amd64" | | | |
411 | endif | | | |
# $NetBSD: files.xen.pv,v 1.1.2.1 2020/04/16 08:46:35 bouyer Exp $
file arch/xen/x86/autoconf.c xenpv
file arch/xen/x86/x86_xpmap.c xenpv
file arch/xen/x86/xen_pmap.c xenpv
file arch/xen/x86/xenfunc.c xenpv
file arch/xen/xen/xen_acpi_machdep.c acpi & xenpv
file arch/xen/xen/clock.c xenpv
file arch/xen/x86/xen_bus_dma.c machdep & xenpv
file arch/xen/x86/consinit.c machdep & xenpv
file arch/xen/x86/pintr.c machdep & dom0ops & xenpv
#
# System bus types
#
# Xen event peudo-device
defpseudo xenevt
defpseudo xvif
defpseudo xbdback
# PCI frontend
device xpci: pcibus
attach xpci at xenbus with xpci_xenbus
file arch/xen/xen/xpci_xenbus.c xpci_xenbus
# Xen Balloon driver
device balloon
attach balloon at xenbus
file arch/xen/xen/balloon.c balloon
device pciback {unit = -1}
attach pciback at pci
file arch/xen/xen/pciback.c pciback
device vcpu
attach vcpu at xendevbus
file arch/xen/x86/cpu.c xenpv & vcpu
# Domain-0 operations
defflag opt_xen.h DOM0OPS XENPV
file arch/xen/xen/privcmd.c dom0ops
file arch/xen/x86/xen_shm_machdep.c dom0ops
file arch/xen/xen/xenevt.c xenevt & (dom0ops | xenpvhvm)
file arch/xen/xen/xennetback_xenbus.c xvif
file arch/xen/xen/xbdback_xenbus.c xbdback
--- src/sys/arch/xen/conf/Attic/std.xen 2019/02/04 18:14:53 1.10
+++ src/sys/arch/xen/conf/Attic/std.xen 2020/04/16 08:46:35 1.10.10.1
| @@ -1,20 +1,21 @@ | | | @@ -1,20 +1,21 @@ |
1 | # $NetBSD: std.xen,v 1.10 2019/02/04 18:14:53 cherry Exp $ | | 1 | # $NetBSD: std.xen,v 1.10.10.1 2020/04/16 08:46:35 bouyer Exp $ |
2 | # NetBSD: std.i386,v 1.24 2003/02/26 21:33:36 fvdl Exp | | 2 | # NetBSD: std.i386,v 1.24 2003/02/26 21:33:36 fvdl Exp |
3 | # | | 3 | # |
4 | # standard, required NetBSD/i386 'options' | | 4 | # standard, required NetBSD/i386 'options' |
5 | | | 5 | |
6 | machine xen i386 | | 6 | machine xen i386 x86 |
7 | include "conf/std" # MI standard options | | 7 | include "conf/std" # MI standard options |
| | | 8 | include "arch/xen/conf/files.xen.pv" |
8 | | | 9 | |
9 | options __XEN_INTERFACE_VERSION__=0x00030208 # Xen 3.1 interface | | 10 | options __XEN_INTERFACE_VERSION__=0x00030208 # Xen 3.1 interface |
10 | | | 11 | |
11 | options EXEC_AOUT # exec a.out binaries | | 12 | options EXEC_AOUT # exec a.out binaries |
12 | options EXEC_ELF32 # exec ELF binaries | | 13 | options EXEC_ELF32 # exec ELF binaries |
13 | options EXEC_SCRIPT # exec #! scripts | | 14 | options EXEC_SCRIPT # exec #! scripts |
14 | | | 15 | |
15 | options CPU_IN_CKSUM | | 16 | options CPU_IN_CKSUM |
16 | #options CRYPTO_MD_DES_ENC # machine-dependent code for DES | | 17 | #options CRYPTO_MD_DES_ENC # machine-dependent code for DES |
17 | #options CRYPTO_MD_DES_CBC # machine-dependent DES CBC code | | 18 | #options CRYPTO_MD_DES_CBC # machine-dependent DES CBC code |
18 | #options CRYPTO_MD_BF_ENC # machine-dependent code for BF_encrypt | | 19 | #options CRYPTO_MD_BF_ENC # machine-dependent code for BF_encrypt |
19 | #options CRYPTO_MD_BF_CBC # careful: uses bswapl, requires 486 | | 20 | #options CRYPTO_MD_BF_CBC # careful: uses bswapl, requires 486 |
20 | | | 21 | |
--- src/sys/arch/xen/include/hypervisor.h 2020/04/12 17:25:52 1.49.10.1
+++ src/sys/arch/xen/include/hypervisor.h 2020/04/16 08:46:35 1.49.10.2
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: hypervisor.h,v 1.49.10.1 2020/04/12 17:25:52 bouyer Exp $ */ | | 1 | /* $NetBSD: hypervisor.h,v 1.49.10.2 2020/04/16 08:46:35 bouyer Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2006 Manuel Bouyer. | | 4 | * Copyright (c) 2006 Manuel Bouyer. |
5 | * | | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions | | 7 | * modification, are permitted provided that the following conditions |
8 | * are met: | | 8 | * are met: |
9 | * 1. Redistributions of source code must retain the above copyright | | 9 | * 1. Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * 2. Redistributions in binary form must reproduce the above copyright | | 11 | * 2. Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | | 13 | * documentation and/or other materials provided with the distribution. |
14 | * | | 14 | * |
| @@ -48,26 +48,28 @@ | | | @@ -48,26 +48,28 @@ |
48 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | | 48 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
49 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | | 49 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
50 | * IN THE SOFTWARE. | | 50 | * IN THE SOFTWARE. |
51 | */ | | 51 | */ |
52 | | | 52 | |
53 | | | 53 | |
54 | #ifndef _XEN_HYPERVISOR_H_ | | 54 | #ifndef _XEN_HYPERVISOR_H_ |
55 | #define _XEN_HYPERVISOR_H_ | | 55 | #define _XEN_HYPERVISOR_H_ |
56 | | | 56 | |
57 | #include "opt_xen.h" | | 57 | #include "opt_xen.h" |
58 | #include "isa.h" | | 58 | #include "isa.h" |
59 | #include "pci.h" | | 59 | #include "pci.h" |
60 | | | 60 | |
| | | 61 | void xen_mainbus_attach(device_t, device_t, void *); |
| | | 62 | |
61 | struct hypervisor_attach_args { | | 63 | struct hypervisor_attach_args { |
62 | const char *haa_busname; | | 64 | const char *haa_busname; |
63 | }; | | 65 | }; |
64 | | | 66 | |
65 | struct xencons_attach_args { | | 67 | struct xencons_attach_args { |
66 | const char *xa_device; | | 68 | const char *xa_device; |
67 | }; | | 69 | }; |
68 | | | 70 | |
69 | struct xen_npx_attach_args { | | 71 | struct xen_npx_attach_args { |
70 | const char *xa_device; | | 72 | const char *xa_device; |
71 | }; | | 73 | }; |
72 | | | 74 | |
73 | | | 75 | |
| @@ -98,27 +100,27 @@ struct xen_npx_attach_args { | | | @@ -98,27 +100,27 @@ struct xen_npx_attach_args { |
98 | /* Undo namespace damage from xen/include/public/io/ring.h | | 100 | /* Undo namespace damage from xen/include/public/io/ring.h |
99 | * The proper fix is to get upstream to stop assuming that all OSs use | | 101 | * The proper fix is to get upstream to stop assuming that all OSs use |
100 | * mb(), rmb(), wmb(). | | 102 | * mb(), rmb(), wmb(). |
101 | */ | | 103 | */ |
102 | #undef xen_mb | | 104 | #undef xen_mb |
103 | #undef xen_rmb | | 105 | #undef xen_rmb |
104 | #undef xen_wmb | | 106 | #undef xen_wmb |
105 | | | 107 | |
106 | #define xen_mb() membar_sync() | | 108 | #define xen_mb() membar_sync() |
107 | #define xen_rmb() membar_producer() | | 109 | #define xen_rmb() membar_producer() |
108 | #define xen_wmb() membar_consumer() | | 110 | #define xen_wmb() membar_consumer() |
109 | #endif /* __XEN_INTERFACE_VERSION */ | | 111 | #endif /* __XEN_INTERFACE_VERSION */ |
110 | | | 112 | |
111 | #include <machine/hypercalls.h> | | 113 | #include <machine/xen/hypercalls.h> |
112 | | | 114 | |
113 | #undef u8 | | 115 | #undef u8 |
114 | #undef u16 | | 116 | #undef u16 |
115 | #undef u32 | | 117 | #undef u32 |
116 | #undef u64 | | 118 | #undef u64 |
117 | #undef s8 | | 119 | #undef s8 |
118 | #undef s16 | | 120 | #undef s16 |
119 | #undef s32 | | 121 | #undef s32 |
120 | #undef s64 | | 122 | #undef s64 |
121 | | | 123 | |
122 | | | 124 | |
123 | | | 125 | |
124 | /* | | 126 | /* |
--- src/sys/arch/xen/include/intr.h 2020/04/12 17:25:52 1.53.6.1
+++ src/sys/arch/xen/include/intr.h 2020/04/16 08:46:35 1.53.6.2
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: intr.h,v 1.53.6.1 2020/04/12 17:25:52 bouyer Exp $ */ | | 1 | /* $NetBSD: intr.h,v 1.53.6.2 2020/04/16 08:46:35 bouyer Exp $ */ |
2 | /* NetBSD intr.h,v 1.15 2004/10/31 10:39:34 yamt Exp */ | | 2 | /* NetBSD intr.h,v 1.15 2004/10/31 10:39:34 yamt Exp */ |
3 | | | 3 | |
4 | /*- | | 4 | /*- |
5 | * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. | | 5 | * Copyright (c) 1998, 2001 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 Charles M. Hannum, and by Jason R. Thorpe. | | 9 | * by Charles M. Hannum, and by Jason R. Thorpe. |
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 |
| @@ -23,27 +23,27 @@ | | | @@ -23,27 +23,27 @@ |
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 | #ifndef _XEN_INTR_H_ | | 33 | #ifndef _XEN_INTR_H_ |
34 | #define _XEN_INTR_H_ | | 34 | #define _XEN_INTR_H_ |
35 | | | 35 | |
36 | #include <machine/intrdefs.h> | | 36 | #include <xen/intrdefs.h> |
37 | | | 37 | |
38 | #ifndef _LOCORE | | 38 | #ifndef _LOCORE |
39 | #include <xen/include/public/xen.h> | | 39 | #include <xen/include/public/xen.h> |
40 | #include <xen/include/public/event_channel.h> | | 40 | #include <xen/include/public/event_channel.h> |
41 | #include <x86/intr.h> | | 41 | #include <x86/intr.h> |
42 | #include <xen/xen.h> | | 42 | #include <xen/xen.h> |
43 | #include <xen/hypervisor.h> | | 43 | #include <xen/hypervisor.h> |
44 | #include <machine/pic.h> | | 44 | #include <machine/pic.h> |
45 | #include <sys/evcnt.h> | | 45 | #include <sys/evcnt.h> |
46 | | | 46 | |
47 | #include "opt_xen.h" | | 47 | #include "opt_xen.h" |
48 | | | 48 | |
49 | | | 49 | |
--- src/sys/arch/xen/include/xenpmap.h 2019/10/30 07:40:06 1.42
+++ src/sys/arch/xen/include/xenpmap.h 2020/04/16 08:46:35 1.42.6.1
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: xenpmap.h,v 1.42 2019/10/30 07:40:06 maxv Exp $ */ | | 1 | /* $NetBSD: xenpmap.h,v 1.42.6.1 2020/04/16 08:46:35 bouyer Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * | | 4 | * |
5 | * Copyright (c) 2004 Christian Limpach. | | 5 | * Copyright (c) 2004 Christian Limpach. |
6 | * All rights reserved. | | 6 | * All rights reserved. |
7 | * | | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | | 9 | * modification, are permitted provided that the following conditions |
10 | * are met: | | 10 | * are met: |
11 | * 1. Redistributions of source code must retain the above copyright | | 11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. | | 12 | * notice, this list of conditions and the following disclaimer. |
13 | * 2. Redistributions in binary form must reproduce the above copyright | | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the | | 14 | * notice, this list of conditions and the following disclaimer in the |
| @@ -112,27 +112,26 @@ static __inline void | | | @@ -112,27 +112,26 @@ static __inline void |
112 | xpmap_ptom_unmap(paddr_t ppa) | | 112 | xpmap_ptom_unmap(paddr_t ppa) |
113 | { | | 113 | { |
114 | xpmap_phys_to_machine_mapping[ppa >> PAGE_SHIFT] = INVALID_P2M_ENTRY; | | 114 | xpmap_phys_to_machine_mapping[ppa >> PAGE_SHIFT] = INVALID_P2M_ENTRY; |
115 | } | | 115 | } |
116 | | | 116 | |
117 | static __inline bool | | 117 | static __inline bool |
118 | xpmap_ptom_isvalid(paddr_t ppa) | | 118 | xpmap_ptom_isvalid(paddr_t ppa) |
119 | { | | 119 | { |
120 | return ( | | 120 | return ( |
121 | xpmap_phys_to_machine_mapping[ppa >> PAGE_SHIFT] | | 121 | xpmap_phys_to_machine_mapping[ppa >> PAGE_SHIFT] |
122 | != INVALID_P2M_ENTRY); | | 122 | != INVALID_P2M_ENTRY); |
123 | } | | 123 | } |
124 | | | 124 | |
125 | #endif /* XENPV */ | | | |
126 | | | 125 | |
127 | static inline void | | 126 | static inline void |
128 | MULTI_update_va_mapping( | | 127 | MULTI_update_va_mapping( |
129 | multicall_entry_t *mcl, vaddr_t va, | | 128 | multicall_entry_t *mcl, vaddr_t va, |
130 | pt_entry_t new_val, unsigned long flags) | | 129 | pt_entry_t new_val, unsigned long flags) |
131 | { | | 130 | { |
132 | mcl->op = __HYPERVISOR_update_va_mapping; | | 131 | mcl->op = __HYPERVISOR_update_va_mapping; |
133 | mcl->args[0] = va; | | 132 | mcl->args[0] = va; |
134 | #if defined(__x86_64__) | | 133 | #if defined(__x86_64__) |
135 | mcl->args[1] = new_val; | | 134 | mcl->args[1] = new_val; |
136 | mcl->args[2] = flags; | | 135 | mcl->args[2] = flags; |
137 | #else | | 136 | #else |
138 | mcl->args[1] = (new_val & 0xffffffff); | | 137 | mcl->args[1] = (new_val & 0xffffffff); |
| @@ -160,15 +159,16 @@ MULTI_update_va_mapping_otherdomain( | | | @@ -160,15 +159,16 @@ MULTI_update_va_mapping_otherdomain( |
160 | #endif | | 159 | #endif |
161 | } | | 160 | } |
162 | #if defined(__x86_64__) | | 161 | #if defined(__x86_64__) |
163 | #define MULTI_UVMFLAGS_INDEX 2 | | 162 | #define MULTI_UVMFLAGS_INDEX 2 |
164 | #define MULTI_UVMDOMID_INDEX 3 | | 163 | #define MULTI_UVMDOMID_INDEX 3 |
165 | #else | | 164 | #else |
166 | #define MULTI_UVMFLAGS_INDEX 3 | | 165 | #define MULTI_UVMFLAGS_INDEX 3 |
167 | #define MULTI_UVMDOMID_INDEX 4 | | 166 | #define MULTI_UVMDOMID_INDEX 4 |
168 | #endif | | 167 | #endif |
169 | | | 168 | |
170 | #if defined(__x86_64__) | | 169 | #if defined(__x86_64__) |
171 | void xen_set_user_pgd(paddr_t); | | 170 | void xen_set_user_pgd(paddr_t); |
172 | #endif | | 171 | #endif |
| | | 172 | #endif /* XENPV */ |
173 | | | 173 | |
174 | #endif /* _XEN_XENPMAP_H_ */ | | 174 | #endif /* _XEN_XENPMAP_H_ */ |
--- src/sys/arch/xen/x86/hypervisor_machdep.c 2020/04/12 17:25:52 1.36.8.1
+++ src/sys/arch/xen/x86/hypervisor_machdep.c 2020/04/16 08:46:35 1.36.8.2
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: hypervisor_machdep.c,v 1.36.8.1 2020/04/12 17:25:52 bouyer Exp $ */ | | 1 | /* $NetBSD: hypervisor_machdep.c,v 1.36.8.2 2020/04/16 08:46:35 bouyer Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * | | 4 | * |
5 | * Copyright (c) 2004 Christian Limpach. | | 5 | * Copyright (c) 2004 Christian Limpach. |
6 | * All rights reserved. | | 6 | * All rights reserved. |
7 | * | | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | | 9 | * modification, are permitted provided that the following conditions |
10 | * are met: | | 10 | * are met: |
11 | * 1. Redistributions of source code must retain the above copyright | | 11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. | | 12 | * notice, this list of conditions and the following disclaimer. |
13 | * 2. Redistributions in binary form must reproduce the above copyright | | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the | | 14 | * notice, this list of conditions and the following disclaimer in the |
| @@ -44,38 +44,39 @@ | | | @@ -44,38 +44,39 @@ |
44 | * all copies or substantial portions of the Software. | | 44 | * all copies or substantial portions of the Software. |
45 | * | | 45 | * |
46 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | | 46 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
47 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | | 47 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
48 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | | 48 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
49 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | | 49 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
50 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | | 50 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
51 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | | 51 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
52 | * DEALINGS IN THE SOFTWARE. | | 52 | * DEALINGS IN THE SOFTWARE. |
53 | */ | | 53 | */ |
54 | | | 54 | |
55 | | | 55 | |
56 | #include <sys/cdefs.h> | | 56 | #include <sys/cdefs.h> |
57 | __KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.36.8.1 2020/04/12 17:25:52 bouyer Exp $"); | | 57 | __KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.36.8.2 2020/04/16 08:46:35 bouyer Exp $"); |
58 | | | 58 | |
59 | #include <sys/param.h> | | 59 | #include <sys/param.h> |
60 | #include <sys/systm.h> | | 60 | #include <sys/systm.h> |
61 | #include <sys/kmem.h> | | 61 | #include <sys/kmem.h> |
62 | | | 62 | |
63 | #include <uvm/uvm_extern.h> | | 63 | #include <uvm/uvm_extern.h> |
64 | | | 64 | |
65 | #include <machine/vmparam.h> | | 65 | #include <machine/vmparam.h> |
66 | #include <machine/pmap.h> | | 66 | #include <machine/pmap.h> |
67 | | | 67 | |
68 | #include <xen/xen.h> | | 68 | #include <xen/xen.h> |
| | | 69 | #include <xen/intr.h> |
69 | #include <xen/hypervisor.h> | | 70 | #include <xen/hypervisor.h> |
70 | #include <xen/evtchn.h> | | 71 | #include <xen/evtchn.h> |
71 | #include <xen/xenpmap.h> | | 72 | #include <xen/xenpmap.h> |
72 | | | 73 | |
73 | #include "opt_xen.h" | | 74 | #include "opt_xen.h" |
74 | #include "isa.h" | | 75 | #include "isa.h" |
75 | #include "pci.h" | | 76 | #include "pci.h" |
76 | | | 77 | |
77 | #ifdef XENPV | | 78 | #ifdef XENPV |
78 | /* | | 79 | /* |
79 | * arch-dependent p2m frame lists list (L3 and L2) | | 80 | * arch-dependent p2m frame lists list (L3 and L2) |
80 | * used by Xen for save/restore mappings | | 81 | * used by Xen for save/restore mappings |
81 | */ | | 82 | */ |
--- src/sys/arch/xen/x86/xen_intr.c 2020/04/14 16:52:35 1.21.2.4
+++ src/sys/arch/xen/x86/xen_intr.c 2020/04/16 08:46:35 1.21.2.5
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: xen_intr.c,v 1.21.2.4 2020/04/14 16:52:35 bouyer Exp $ */ | | 1 | /* $NetBSD: xen_intr.c,v 1.21.2.5 2020/04/16 08:46:35 bouyer Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Charles M. Hannum, and by Jason R. Thorpe. | | 8 | * by Charles M. Hannum, and by Jason R. Thorpe. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -20,36 +20,37 @@ | | | @@ -20,36 +20,37 @@ |
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
29 | * POSSIBILITY OF SUCH DAMAGE. | | 29 | * POSSIBILITY OF SUCH DAMAGE. |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | #include <sys/cdefs.h> | | 32 | #include <sys/cdefs.h> |
33 | __KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.21.2.4 2020/04/14 16:52:35 bouyer Exp $"); | | 33 | __KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.21.2.5 2020/04/16 08:46:35 bouyer Exp $"); |
34 | | | 34 | |
35 | #include "opt_multiprocessor.h" | | 35 | #include "opt_multiprocessor.h" |
36 | | | 36 | |
37 | #include <sys/param.h> | | 37 | #include <sys/param.h> |
38 | #include <sys/kernel.h> | | 38 | #include <sys/kernel.h> |
39 | #include <sys/kmem.h> | | 39 | #include <sys/kmem.h> |
40 | #include <sys/cpu.h> | | 40 | #include <sys/cpu.h> |
41 | #include <sys/device.h> | | 41 | #include <sys/device.h> |
42 | | | 42 | |
| | | 43 | #include <xen/intr.h> |
43 | #include <xen/evtchn.h> | | 44 | #include <xen/evtchn.h> |
44 | #include <xen/xenfunc.h> | | 45 | #include <xen/xenfunc.h> |
45 | | | 46 | |
46 | #include <uvm/uvm.h> | | 47 | #include <uvm/uvm.h> |
47 | | | 48 | |
48 | #include <machine/cpu.h> | | 49 | #include <machine/cpu.h> |
49 | #include <machine/intr.h> | | 50 | #include <machine/intr.h> |
50 | | | 51 | |
51 | #include "acpica.h" | | 52 | #include "acpica.h" |
52 | #include "ioapic.h" | | 53 | #include "ioapic.h" |
53 | #include "lapic.h" | | 54 | #include "lapic.h" |
54 | #include "pci.h" | | 55 | #include "pci.h" |
55 | | | 56 | |
| @@ -434,27 +435,27 @@ xintr_string(intr_handle_t ih, char *buf | | | @@ -434,27 +435,27 @@ xintr_string(intr_handle_t ih, char *buf |
434 | | | 435 | |
435 | /* | | 436 | /* |
436 | * Create an interrupt id such as "ioapic0 pin 9". This interrupt id is used | | 437 | * Create an interrupt id such as "ioapic0 pin 9". This interrupt id is used |
437 | * by MI code and intrctl(8). | | 438 | * by MI code and intrctl(8). |
438 | */ | | 439 | */ |
439 | const char * xen_intr_create_intrid(int legacy_irq, struct pic *pic, | | 440 | const char * xen_intr_create_intrid(int legacy_irq, struct pic *pic, |
440 | int pin, char *buf, size_t len); | | 441 | int pin, char *buf, size_t len); |
441 | | | 442 | |
442 | const char * | | 443 | const char * |
443 | xen_intr_create_intrid(int legacy_irq, struct pic *pic, int pin, char *buf, size_t len) | | 444 | xen_intr_create_intrid(int legacy_irq, struct pic *pic, int pin, char *buf, size_t len) |
444 | { | | 445 | { |
445 | int ih = 0; | | 446 | int ih = 0; |
446 | | | 447 | |
447 | #if NPCI > 0 | | 448 | #if NPCI > 0 && defined(XENPV) |
448 | #if defined(__HAVE_PCI_MSI_MSIX) | | 449 | #if defined(__HAVE_PCI_MSI_MSIX) |
449 | if ((pic->pic_type == PIC_MSI) || (pic->pic_type == PIC_MSIX)) { | | 450 | if ((pic->pic_type == PIC_MSI) || (pic->pic_type == PIC_MSIX)) { |
450 | uint64_t pih; | | 451 | uint64_t pih; |
451 | int dev, vec; | | 452 | int dev, vec; |
452 | | | 453 | |
453 | dev = msipic_get_devid(pic); | | 454 | dev = msipic_get_devid(pic); |
454 | vec = pin; | | 455 | vec = pin; |
455 | pih = __SHIFTIN((uint64_t)dev, MSI_INT_DEV_MASK) | | 456 | pih = __SHIFTIN((uint64_t)dev, MSI_INT_DEV_MASK) |
456 | | __SHIFTIN((uint64_t)vec, MSI_INT_VEC_MASK) | | 457 | | __SHIFTIN((uint64_t)vec, MSI_INT_VEC_MASK) |
457 | | APIC_INT_VIA_MSI; | | 458 | | APIC_INT_VIA_MSI; |
458 | if (pic->pic_type == PIC_MSI) | | 459 | if (pic->pic_type == PIC_MSI) |
459 | MSI_INT_MAKE_MSI(pih); | | 460 | MSI_INT_MAKE_MSI(pih); |
460 | else if (pic->pic_type == PIC_MSIX) | | 461 | else if (pic->pic_type == PIC_MSIX) |
--- src/sys/arch/xen/x86/xen_ipi.c 2020/04/12 17:17:38 1.35.6.2
+++ src/sys/arch/xen/x86/xen_ipi.c 2020/04/16 08:46:35 1.35.6.3
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: xen_ipi.c,v 1.35.6.2 2020/04/12 17:17:38 bouyer Exp $ */ | | 1 | /* $NetBSD: xen_ipi.c,v 1.35.6.3 2020/04/16 08:46:35 bouyer Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2011, 2019 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2011, 2019 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Cherry G. Mathew <cherry@zyx.in> | | 8 | * by Cherry G. Mathew <cherry@zyx.in> |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -23,30 +23,30 @@ | | | @@ -23,30 +23,30 @@ |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
29 | * POSSIBILITY OF SUCH DAMAGE. | | 29 | * POSSIBILITY OF SUCH DAMAGE. |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | #include <sys/cdefs.h> /* RCS ID macro */ | | 32 | #include <sys/cdefs.h> /* RCS ID macro */ |
33 | | | 33 | |
34 | /* | | 34 | /* |
35 | * Based on: x86/ipi.c | | 35 | * Based on: x86/ipi.c |
36 | * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.35.6.2 2020/04/12 17:17:38 bouyer Exp $"); | | 36 | * __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.35.6.3 2020/04/16 08:46:35 bouyer Exp $"); |
37 | */ | | 37 | */ |
38 | | | 38 | |
39 | __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.35.6.2 2020/04/12 17:17:38 bouyer Exp $"); | | 39 | __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v 1.35.6.3 2020/04/16 08:46:35 bouyer Exp $"); |
40 | | | 40 | |
41 | #include "opt_ddb.h" | | 41 | #include "opt_ddb.h" |
42 | | | 42 | |
43 | #include <sys/types.h> | | 43 | #include <sys/types.h> |
44 | | | 44 | |
45 | #include <sys/atomic.h> | | 45 | #include <sys/atomic.h> |
46 | #include <sys/cpu.h> | | 46 | #include <sys/cpu.h> |
47 | #include <sys/mutex.h> | | 47 | #include <sys/mutex.h> |
48 | #include <sys/device.h> | | 48 | #include <sys/device.h> |
49 | #include <sys/xcall.h> | | 49 | #include <sys/xcall.h> |
50 | #include <sys/ipi.h> | | 50 | #include <sys/ipi.h> |
51 | #include <sys/errno.h> | | 51 | #include <sys/errno.h> |
52 | #include <sys/systm.h> | | 52 | #include <sys/systm.h> |
| @@ -64,64 +64,66 @@ __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v | | | @@ -64,64 +64,66 @@ __KERNEL_RCSID(0, "$NetBSD: xen_ipi.c,v |
64 | #ifdef DDB | | 64 | #ifdef DDB |
65 | extern void ddb_ipi(struct trapframe); | | 65 | extern void ddb_ipi(struct trapframe); |
66 | static void xen_ipi_ddb(struct cpu_info *, struct intrframe *); | | 66 | static void xen_ipi_ddb(struct cpu_info *, struct intrframe *); |
67 | #endif | | 67 | #endif |
68 | | | 68 | |
69 | static void xen_ipi_halt(struct cpu_info *, struct intrframe *); | | 69 | static void xen_ipi_halt(struct cpu_info *, struct intrframe *); |
70 | static void xen_ipi_synch_fpu(struct cpu_info *, struct intrframe *); | | 70 | static void xen_ipi_synch_fpu(struct cpu_info *, struct intrframe *); |
71 | static void xen_ipi_xcall(struct cpu_info *, struct intrframe *); | | 71 | static void xen_ipi_xcall(struct cpu_info *, struct intrframe *); |
72 | static void xen_ipi_hvcb(struct cpu_info *, struct intrframe *); | | 72 | static void xen_ipi_hvcb(struct cpu_info *, struct intrframe *); |
73 | static void xen_ipi_generic(struct cpu_info *, struct intrframe *); | | 73 | static void xen_ipi_generic(struct cpu_info *, struct intrframe *); |
74 | static void xen_ipi_ast(struct cpu_info *, struct intrframe *); | | 74 | static void xen_ipi_ast(struct cpu_info *, struct intrframe *); |
75 | static void xen_ipi_kpreempt(struct cpu_info *ci, struct intrframe *); | | 75 | static void xen_ipi_kpreempt(struct cpu_info *ci, struct intrframe *); |
76 | | | 76 | |
77 | static void (*ipifunc[XEN_NIPIS])(struct cpu_info *, struct intrframe *) = | | 77 | static void (*xen_ipifunc[XEN_NIPIS])(struct cpu_info *, struct intrframe *) = |
78 | { /* In order of priority (see: xen/include/intrdefs.h */ | | 78 | { /* In order of priority (see: xen/include/intrdefs.h */ |
79 | xen_ipi_halt, | | 79 | xen_ipi_halt, |
80 | xen_ipi_synch_fpu, | | 80 | xen_ipi_synch_fpu, |
81 | #ifdef DDB | | 81 | #ifdef DDB |
82 | xen_ipi_ddb, | | 82 | xen_ipi_ddb, |
83 | #else | | 83 | #else |
84 | NULL, | | 84 | NULL, |
85 | #endif | | 85 | #endif |
86 | xen_ipi_xcall, | | 86 | xen_ipi_xcall, |
87 | xen_ipi_hvcb, | | 87 | xen_ipi_hvcb, |
88 | xen_ipi_generic, | | 88 | xen_ipi_generic, |
89 | xen_ipi_ast, | | 89 | xen_ipi_ast, |
90 | xen_ipi_kpreempt | | 90 | xen_ipi_kpreempt |
91 | }; | | 91 | }; |
92 | | | 92 | |
93 | static int | | 93 | static int |
94 | xen_ipi_handler(void *arg) | | 94 | xen_ipi_handler(void *arg) |
95 | { | | 95 | { |
96 | uint32_t pending; | | 96 | uint32_t pending; |
97 | int bit; | | 97 | int bit; |
98 | struct cpu_info *ci; | | 98 | struct cpu_info *ci; |
99 | struct intrframe *regs; | | 99 | struct intrframe *regs; |
100 | | | 100 | |
101 | ci = curcpu(); | | 101 | ci = curcpu(); |
102 | regs = arg; | | 102 | regs = arg; |
| | | 103 | |
| | | 104 | KASSERT(ci == arg); |
103 | | | 105 | |
104 | pending = atomic_swap_32(&ci->ci_ipis, 0); | | 106 | pending = atomic_swap_32(&ci->ci_ipis, 0); |
105 | | | 107 | |
106 | KDASSERT((pending >> XEN_NIPIS) == 0); | | 108 | KDASSERT((pending >> XEN_NIPIS) == 0); |
107 | while ((bit = ffs(pending)) != 0) { | | 109 | while ((bit = ffs(pending)) != 0) { |
108 | bit--; | | 110 | bit--; |
109 | pending &= ~(1 << bit); | | 111 | pending &= ~(1 << bit); |
110 | ci->ci_ipi_events[bit].ev_count++; | | 112 | ci->ci_ipi_events[bit].ev_count++; |
111 | if (ipifunc[bit] != NULL) { | | 113 | if (xen_ipifunc[bit] != NULL) { |
112 | (*ipifunc[bit])(ci, regs); | | 114 | (*xen_ipifunc[bit])(ci, regs); |
113 | } else { | | 115 | } else { |
114 | panic("ipifunc[%d] unsupported!\n", bit); | | 116 | panic("xen_ipifunc[%d] unsupported!\n", bit); |
115 | /* NOTREACHED */ | | 117 | /* NOTREACHED */ |
116 | } | | 118 | } |
117 | } | | 119 | } |
118 | | | 120 | |
119 | return 0; | | 121 | return 0; |
120 | } | | 122 | } |
121 | | | 123 | |
122 | /* Must be called once for every cpu that expects to send/recv ipis */ | | 124 | /* Must be called once for every cpu that expects to send/recv ipis */ |
123 | void | | 125 | void |
124 | xen_ipi_init(void) | | 126 | xen_ipi_init(void) |
125 | { | | 127 | { |
126 | cpuid_t vcpu; | | 128 | cpuid_t vcpu; |
127 | evtchn_port_t evtchn; | | 129 | evtchn_port_t evtchn; |
| @@ -286,67 +288,68 @@ xen_ipi_xcall(struct cpu_info *ci, struc | | | @@ -286,67 +288,68 @@ xen_ipi_xcall(struct cpu_info *ci, struc |
286 | | | 288 | |
287 | xc_ipi_handler(); | | 289 | xc_ipi_handler(); |
288 | } | | 290 | } |
289 | | | 291 | |
290 | static void | | 292 | static void |
291 | xen_ipi_ast(struct cpu_info *ci, struct intrframe *intrf) | | 293 | xen_ipi_ast(struct cpu_info *ci, struct intrframe *intrf) |
292 | { | | 294 | { |
293 | KASSERT(ci != NULL); | | 295 | KASSERT(ci != NULL); |
294 | KASSERT(intrf != NULL); | | 296 | KASSERT(intrf != NULL); |
295 | | | 297 | |
296 | aston(ci->ci_onproc); | | 298 | aston(ci->ci_onproc); |
297 | } | | 299 | } |
298 | | | 300 | |
| | | 301 | static void |
| | | 302 | xen_ipi_generic(struct cpu_info *ci, struct intrframe *intrf) |
| | | 303 | { |
| | | 304 | KASSERT(ci != NULL); |
| | | 305 | KASSERT(intrf != NULL); |
| | | 306 | ipi_cpu_handler(); |
| | | 307 | } |
| | | 308 | |
| | | 309 | static void |
| | | 310 | xen_ipi_hvcb(struct cpu_info *ci, struct intrframe *intrf) |
| | | 311 | { |
| | | 312 | KASSERT(ci != NULL); |
| | | 313 | KASSERT(intrf != NULL); |
| | | 314 | KASSERT(ci == curcpu()); |
| | | 315 | KASSERT(!ci->ci_vcpu->evtchn_upcall_mask); |
| | | 316 | |
| | | 317 | hypervisor_force_callback(); |
| | | 318 | } |
| | | 319 | |
| | | 320 | static void |
| | | 321 | xen_ipi_kpreempt(struct cpu_info *ci, struct intrframe * intrf) |
| | | 322 | { |
| | | 323 | softint_trigger(1 << SIR_PREEMPT); |
| | | 324 | } |
| | | 325 | |
| | | 326 | #ifdef XENPV |
299 | void | | 327 | void |
300 | xc_send_ipi(struct cpu_info *ci) | | 328 | xc_send_ipi(struct cpu_info *ci) |
301 | { | | 329 | { |
302 | | | 330 | |
303 | KASSERT(kpreempt_disabled()); | | 331 | KASSERT(kpreempt_disabled()); |
304 | KASSERT(curcpu() != ci); | | 332 | KASSERT(curcpu() != ci); |
305 | if (ci) { | | 333 | if (ci) { |
306 | if (0 != xen_send_ipi(ci, XEN_IPI_XCALL)) { | | 334 | if (0 != xen_send_ipi(ci, XEN_IPI_XCALL)) { |
307 | panic("xen_send_ipi(XEN_IPI_XCALL) failed\n"); | | 335 | panic("xen_send_ipi(XEN_IPI_XCALL) failed\n"); |
308 | } | | 336 | } |
309 | } else { | | 337 | } else { |
310 | xen_broadcast_ipi(XEN_IPI_XCALL); | | 338 | xen_broadcast_ipi(XEN_IPI_XCALL); |
311 | } | | 339 | } |
312 | } | | 340 | } |
313 | | | 341 | |
314 | static void | | | |
315 | xen_ipi_generic(struct cpu_info *ci, struct intrframe *intrf) | | | |
316 | { | | | |
317 | KASSERT(ci != NULL); | | | |
318 | KASSERT(intrf != NULL); | | | |
319 | | | | |
320 | ipi_cpu_handler(); | | | |
321 | } | | | |
322 | | | | |
323 | void | | 342 | void |
324 | cpu_ipi(struct cpu_info *ci) | | 343 | cpu_ipi(struct cpu_info *ci) |
325 | { | | 344 | { |
326 | KASSERT(kpreempt_disabled()); | | 345 | KASSERT(kpreempt_disabled()); |
327 | KASSERT(curcpu() != ci); | | 346 | KASSERT(curcpu() != ci); |
328 | if (ci) { | | 347 | if (ci) { |
329 | if (0 != xen_send_ipi(ci, XEN_IPI_GENERIC)) { | | 348 | if (0 != xen_send_ipi(ci, XEN_IPI_GENERIC)) { |
330 | panic("xen_send_ipi(XEN_IPI_GENERIC) failed\n"); | | 349 | panic("xen_send_ipi(XEN_IPI_GENERIC) failed\n"); |
331 | } | | 350 | } |
332 | } else { | | 351 | } else { |
333 | xen_broadcast_ipi(XEN_IPI_GENERIC); | | 352 | xen_broadcast_ipi(XEN_IPI_GENERIC); |
334 | } | | 353 | } |
335 | } | | 354 | } |
336 | | | 355 | #endif /* XENPV */ |
337 | static void | | | |
338 | xen_ipi_hvcb(struct cpu_info *ci, struct intrframe *intrf) | | | |
339 | { | | | |
340 | KASSERT(ci != NULL); | | | |
341 | KASSERT(intrf != NULL); | | | |
342 | KASSERT(ci == curcpu()); | | | |
343 | KASSERT(!ci->ci_vcpu->evtchn_upcall_mask); | | | |
344 | | | | |
345 | hypervisor_force_callback(); | | | |
346 | } | | | |
347 | | | | |
348 | static void | | | |
349 | xen_ipi_kpreempt(struct cpu_info *ci, struct intrframe * intrf) | | | |
350 | { | | | |
351 | softint_trigger(1 << SIR_PREEMPT); | | | |
352 | } | | | |
--- src/sys/arch/xen/x86/xen_mainbus.c 2019/02/14 08:18:26 1.6
+++ src/sys/arch/xen/x86/xen_mainbus.c 2020/04/16 08:46:35 1.6.12.1
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: xen_mainbus.c,v 1.6 2019/02/14 08:18:26 cherry Exp $ */ | | 1 | /* $NetBSD: xen_mainbus.c,v 1.6.12.1 2020/04/16 08:46:35 bouyer Exp $ */ |
2 | /* NetBSD: mainbus.c,v 1.19 2017/05/23 08:54:39 nonaka Exp */ | | 2 | /* NetBSD: mainbus.c,v 1.19 2017/05/23 08:54:39 nonaka Exp */ |
3 | /* NetBSD: mainbus.c,v 1.53 2003/10/27 14:11:47 junyoung Exp */ | | 3 | /* NetBSD: mainbus.c,v 1.53 2003/10/27 14:11:47 junyoung Exp */ |
4 | | | 4 | |
5 | /* | | 5 | /* |
6 | * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. | | 6 | * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. |
7 | * | | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | | 9 | * modification, are permitted provided that the following conditions |
10 | * are met: | | 10 | * are met: |
11 | * 1. Redistributions of source code must retain the above copyright | | 11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. | | 12 | * notice, this list of conditions and the following disclaimer. |
13 | * 2. Redistributions in binary form must reproduce the above copyright | | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the | | 14 | * notice, this list of conditions and the following disclaimer in the |
| @@ -23,27 +23,27 @@ | | | @@ -23,27 +23,27 @@ |
23 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | | 23 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | | 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
25 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | | 25 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
26 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | | 26 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
27 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | | 27 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
28 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 28 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | | 31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
33 | */ | | 33 | */ |
34 | | | 34 | |
35 | #include <sys/cdefs.h> | | 35 | #include <sys/cdefs.h> |
36 | __KERNEL_RCSID(0, "$NetBSD: xen_mainbus.c,v 1.6 2019/02/14 08:18:26 cherry Exp $"); | | 36 | __KERNEL_RCSID(0, "$NetBSD: xen_mainbus.c,v 1.6.12.1 2020/04/16 08:46:35 bouyer Exp $"); |
37 | | | 37 | |
38 | #include <sys/param.h> | | 38 | #include <sys/param.h> |
39 | #include <sys/systm.h> | | 39 | #include <sys/systm.h> |
40 | #include <sys/device.h> | | 40 | #include <sys/device.h> |
41 | | | 41 | |
42 | #include <sys/bus.h> | | 42 | #include <sys/bus.h> |
43 | | | 43 | |
44 | #include "hypervisor.h" | | 44 | #include "hypervisor.h" |
45 | #include "pci.h" | | 45 | #include "pci.h" |
46 | | | 46 | |
47 | #include "opt_xen.h" | | 47 | #include "opt_xen.h" |
48 | #include "opt_mpbios.h" | | 48 | #include "opt_mpbios.h" |
49 | #include "opt_pcifixup.h" | | 49 | #include "opt_pcifixup.h" |
| @@ -89,75 +89,60 @@ int mp_isa_bus = -1; /* XXX */ | | | @@ -89,75 +89,60 @@ int mp_isa_bus = -1; /* XXX */ |
89 | int mp_eisa_bus = -1; /* XXX */ | | 89 | int mp_eisa_bus = -1; /* XXX */ |
90 | | | 90 | |
91 | #ifdef MPVERBOSE | | 91 | #ifdef MPVERBOSE |
92 | int mp_verbose = 1; | | 92 | int mp_verbose = 1; |
93 | #else /* MPVERBOSE */ | | 93 | #else /* MPVERBOSE */ |
94 | int mp_verbose = 0; | | 94 | int mp_verbose = 0; |
95 | #endif /* MPVERBOSE */ | | 95 | #endif /* MPVERBOSE */ |
96 | #endif /* defined(MPBIOS) || NACPICA > 0 */ | | 96 | #endif /* defined(MPBIOS) || NACPICA > 0 */ |
97 | #endif /* NPCI > 0 */ | | 97 | #endif /* NPCI > 0 */ |
98 | | | 98 | |
99 | extern bool acpi_present; | | 99 | extern bool acpi_present; |
100 | extern bool mpacpi_active; | | 100 | extern bool mpacpi_active; |
101 | | | 101 | |
102 | int xen_mainbus_match(device_t, cfdata_t, void *); | | | |
103 | void xen_mainbus_attach(device_t, device_t, void *); | | 102 | void xen_mainbus_attach(device_t, device_t, void *); |
104 | int xen_mainbus_print(void *, const char *); | | 103 | static int xen_mainbus_print(void *, const char *); |
105 | | | 104 | |
106 | union xen_mainbus_attach_args { | | 105 | union xen_mainbus_attach_args { |
107 | const char *mba_busname; /* first elem of all */ | | 106 | const char *mba_busname; /* first elem of all */ |
108 | struct cpu_attach_args mba_caa; | | 107 | struct cpu_attach_args mba_caa; |
109 | #if NHYPERVISOR > 0 | | 108 | #if NHYPERVISOR > 0 |
110 | struct hypervisor_attach_args mba_haa; | | 109 | struct hypervisor_attach_args mba_haa; |
111 | #endif | | 110 | #endif |
112 | #if NIPMI > 0 | | 111 | #if NIPMI > 0 |
113 | struct ipmi_attach_args mba_ipmi; | | 112 | struct ipmi_attach_args mba_ipmi; |
114 | #endif | | 113 | #endif |
115 | }; | | 114 | }; |
116 | | | 115 | |
117 | /* | | 116 | /* |
118 | * Probe for the mainbus; always succeeds. | | | |
119 | */ | | | |
120 | int | | | |
121 | xen_mainbus_match(device_t parent, cfdata_t match, void *aux) | | | |
122 | { | | | |
123 | | | | |
124 | return 1; | | | |
125 | } | | | |
126 | | | | |
127 | /* | | | |
128 | * Attach the mainbus. | | 117 | * Attach the mainbus. |
129 | */ | | 118 | */ |
130 | void | | 119 | void |
131 | xen_mainbus_attach(device_t parent, device_t self, void *aux) | | 120 | xen_mainbus_attach(device_t parent, device_t self, void *aux) |
132 | { | | 121 | { |
133 | #if NIPMI > 0 || NHYPERVISOR > 0 | | | |
134 | union xen_mainbus_attach_args mba; | | 122 | union xen_mainbus_attach_args mba; |
135 | #endif | | | |
136 | | | 123 | |
137 | #if NIPMI > 0 | | 124 | #if NIPMI > 0 && defined(XENPV) |
138 | memset(&mba.mba_ipmi, 0, sizeof(mba.mba_ipmi)); | | 125 | memset(&mba.mba_ipmi, 0, sizeof(mba.mba_ipmi)); |
139 | mba.mba_ipmi.iaa_iot = x86_bus_space_io; | | 126 | mba.mba_ipmi.iaa_iot = x86_bus_space_io; |
140 | mba.mba_ipmi.iaa_memt = x86_bus_space_mem; | | 127 | mba.mba_ipmi.iaa_memt = x86_bus_space_mem; |
141 | if (ipmi_probe(&mba.mba_ipmi)) | | 128 | if (ipmi_probe(&mba.mba_ipmi)) |
142 | config_found_ia(self, "ipmibus", &mba.mba_ipmi, 0); | | 129 | config_found_ia(self, "ipmibus", &mba.mba_ipmi, 0); |
143 | #endif | | 130 | #endif |
144 | | | 131 | |
145 | #if NHYPERVISOR > 0 | | | |
146 | mba.mba_haa.haa_busname = "hypervisor"; | | 132 | mba.mba_haa.haa_busname = "hypervisor"; |
147 | config_found_ia(self, "hypervisorbus", &mba.mba_haa, xen_mainbus_print); | | 133 | config_found_ia(self, "hypervisorbus", &mba.mba_haa, xen_mainbus_print); |
148 | #endif | | | |
149 | | | 134 | |
150 | /* save/restore for Xen */ | | 135 | /* save/restore for Xen */ |
151 | if (!pmf_device_register(self, NULL, NULL)) | | 136 | if (!pmf_device_register(self, NULL, NULL)) |
152 | aprint_error_dev(self, "couldn't establish power handler\n"); | | 137 | aprint_error_dev(self, "couldn't establish power handler\n"); |
153 | } | | 138 | } |
154 | | | 139 | |
155 | int | | 140 | static int |
156 | xen_mainbus_print(void *aux, const char *pnp) | | 141 | xen_mainbus_print(void *aux, const char *pnp) |
157 | { | | 142 | { |
158 | union xen_mainbus_attach_args *mba = aux; | | 143 | union xen_mainbus_attach_args *mba = aux; |
159 | | | 144 | |
160 | if (pnp) | | 145 | if (pnp) |
161 | aprint_normal("%s at %s", mba->mba_busname, pnp); | | 146 | aprint_normal("%s at %s", mba->mba_busname, pnp); |
162 | return UNCONF; | | 147 | return UNCONF; |
163 | } | | 148 | } |
--- src/sys/arch/xen/xen/evtchn.c 2020/04/12 17:25:53 1.88.2.3
+++ src/sys/arch/xen/xen/evtchn.c 2020/04/16 08:46:36 1.88.2.4
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: evtchn.c,v 1.88.2.3 2020/04/12 17:25:53 bouyer Exp $ */ | | 1 | /* $NetBSD: evtchn.c,v 1.88.2.4 2020/04/16 08:46:36 bouyer Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2006 Manuel Bouyer. | | 4 | * Copyright (c) 2006 Manuel Bouyer. |
5 | * | | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions | | 7 | * modification, are permitted provided that the following conditions |
8 | * are met: | | 8 | * are met: |
9 | * 1. Redistributions of source code must retain the above copyright | | 9 | * 1. Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * 2. Redistributions in binary form must reproduce the above copyright | | 11 | * 2. Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | | 13 | * documentation and/or other materials provided with the distribution. |
14 | * | | 14 | * |
| @@ -44,46 +44,46 @@ | | | @@ -44,46 +44,46 @@ |
44 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | | 44 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
45 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | | 45 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
46 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | | 46 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
47 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | | 47 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
48 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 48 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
49 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 49 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
50 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 50 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
51 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | | 51 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
52 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 52 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
53 | */ | | 53 | */ |
54 | | | 54 | |
55 | | | 55 | |
56 | #include <sys/cdefs.h> | | 56 | #include <sys/cdefs.h> |
57 | __KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.88.2.3 2020/04/12 17:25:53 bouyer Exp $"); | | 57 | __KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.88.2.4 2020/04/16 08:46:36 bouyer Exp $"); |
58 | | | 58 | |
59 | #include "opt_xen.h" | | 59 | #include "opt_xen.h" |
60 | #include "isa.h" | | 60 | #include "isa.h" |
61 | #include "pci.h" | | 61 | #include "pci.h" |
62 | | | 62 | |
63 | #include <sys/param.h> | | 63 | #include <sys/param.h> |
64 | #include <sys/cpu.h> | | 64 | #include <sys/cpu.h> |
65 | #include <sys/kernel.h> | | 65 | #include <sys/kernel.h> |
66 | #include <sys/systm.h> | | 66 | #include <sys/systm.h> |
67 | #include <sys/device.h> | | 67 | #include <sys/device.h> |
68 | #include <sys/proc.h> | | 68 | #include <sys/proc.h> |
69 | #include <sys/kmem.h> | | 69 | #include <sys/kmem.h> |
70 | #include <sys/reboot.h> | | 70 | #include <sys/reboot.h> |
71 | #include <sys/mutex.h> | | 71 | #include <sys/mutex.h> |
72 | #include <sys/interrupt.h> | | 72 | #include <sys/interrupt.h> |
73 | | | 73 | |
74 | #include <uvm/uvm.h> | | 74 | #include <uvm/uvm.h> |
75 | | | 75 | |
76 | #include <machine/intrdefs.h> | | 76 | #include <xen/intr.h> |
77 | | | 77 | |
78 | #include <xen/xen.h> | | 78 | #include <xen/xen.h> |
79 | #include <xen/hypervisor.h> | | 79 | #include <xen/hypervisor.h> |
80 | #include <xen/evtchn.h> | | 80 | #include <xen/evtchn.h> |
81 | #include <xen/xenfunc.h> | | 81 | #include <xen/xenfunc.h> |
82 | | | 82 | |
83 | /* | | 83 | /* |
84 | * This lock protects updates to the following mapping and reference-count | | 84 | * This lock protects updates to the following mapping and reference-count |
85 | * arrays. The lock does not need to be acquired to read the mapping tables. | | 85 | * arrays. The lock does not need to be acquired to read the mapping tables. |
86 | */ | | 86 | */ |
87 | static kmutex_t evtchn_lock; | | 87 | static kmutex_t evtchn_lock; |
88 | | | 88 | |
89 | /* event handlers */ | | 89 | /* event handlers */ |
--- src/sys/arch/xen/xen/if_xennet_xenbus.c 2020/04/07 11:47:06 1.109
+++ src/sys/arch/xen/xen/if_xennet_xenbus.c 2020/04/16 08:46:36 1.109.2.1
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: if_xennet_xenbus.c,v 1.109 2020/04/07 11:47:06 jdolecek Exp $ */ | | 1 | /* $NetBSD: if_xennet_xenbus.c,v 1.109.2.1 2020/04/16 08:46:36 bouyer Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2006 Manuel Bouyer. | | 4 | * Copyright (c) 2006 Manuel Bouyer. |
5 | * | | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions | | 7 | * modification, are permitted provided that the following conditions |
8 | * are met: | | 8 | * are met: |
9 | * 1. Redistributions of source code must retain the above copyright | | 9 | * 1. Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * 2. Redistributions in binary form must reproduce the above copyright | | 11 | * 2. Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | | 13 | * documentation and/or other materials provided with the distribution. |
14 | * | | 14 | * |
| @@ -71,27 +71,27 @@ | | | @@ -71,27 +71,27 @@ |
71 | * Purpose is to process the packets received from the outside. RX buffers | | 71 | * Purpose is to process the packets received from the outside. RX buffers |
72 | * are pre-allocated through xennet_alloc_rx_buffer(), during xennet autoconf | | 72 | * are pre-allocated through xennet_alloc_rx_buffer(), during xennet autoconf |
73 | * attach. During pre-allocation, frontend pushes requests in the I/O ring, in | | 73 | * attach. During pre-allocation, frontend pushes requests in the I/O ring, in |
74 | * preparation for incoming packets from backend. | | 74 | * preparation for incoming packets from backend. |
75 | * When RX packets need to be processed, backend takes the requests previously | | 75 | * When RX packets need to be processed, backend takes the requests previously |
76 | * offered by frontend and pushes the associated responses inside the I/O ring. | | 76 | * offered by frontend and pushes the associated responses inside the I/O ring. |
77 | * When done, it notifies frontend through an event notification, which will | | 77 | * When done, it notifies frontend through an event notification, which will |
78 | * asynchronously call xennet_handler() in frontend. | | 78 | * asynchronously call xennet_handler() in frontend. |
79 | * xennet_handler() processes the responses, generates the associated mbuf, and | | 79 | * xennet_handler() processes the responses, generates the associated mbuf, and |
80 | * passes it to the MI layer for further processing. | | 80 | * passes it to the MI layer for further processing. |
81 | */ | | 81 | */ |
82 | | | 82 | |
83 | #include <sys/cdefs.h> | | 83 | #include <sys/cdefs.h> |
84 | __KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.109 2020/04/07 11:47:06 jdolecek Exp $"); | | 84 | __KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.109.2.1 2020/04/16 08:46:36 bouyer Exp $"); |
85 | | | 85 | |
86 | #include "opt_xen.h" | | 86 | #include "opt_xen.h" |
87 | #include "opt_nfs_boot.h" | | 87 | #include "opt_nfs_boot.h" |
88 | | | 88 | |
89 | #include <sys/param.h> | | 89 | #include <sys/param.h> |
90 | #include <sys/device.h> | | 90 | #include <sys/device.h> |
91 | #include <sys/conf.h> | | 91 | #include <sys/conf.h> |
92 | #include <sys/kernel.h> | | 92 | #include <sys/kernel.h> |
93 | #include <sys/proc.h> | | 93 | #include <sys/proc.h> |
94 | #include <sys/systm.h> | | 94 | #include <sys/systm.h> |
95 | #include <sys/intr.h> | | 95 | #include <sys/intr.h> |
96 | #include <sys/rndsource.h> | | 96 | #include <sys/rndsource.h> |
97 | | | 97 | |
| @@ -107,26 +107,27 @@ __KERNEL_RCSID(0, "$NetBSD: if_xennet_xe | | | @@ -107,26 +107,27 @@ __KERNEL_RCSID(0, "$NetBSD: if_xennet_xe |
107 | #include <netinet/in.h> | | 107 | #include <netinet/in.h> |
108 | #include <nfs/rpcv2.h> | | 108 | #include <nfs/rpcv2.h> |
109 | #include <nfs/nfsproto.h> | | 109 | #include <nfs/nfsproto.h> |
110 | #include <nfs/nfs.h> | | 110 | #include <nfs/nfs.h> |
111 | #include <nfs/nfsmount.h> | | 111 | #include <nfs/nfsmount.h> |
112 | #include <nfs/nfsdiskless.h> | | 112 | #include <nfs/nfsdiskless.h> |
113 | #include <xen/if_xennetvar.h> | | 113 | #include <xen/if_xennetvar.h> |
114 | #endif /* defined(NFS_BOOT_BOOTSTATIC) */ | | 114 | #endif /* defined(NFS_BOOT_BOOTSTATIC) */ |
115 | | | 115 | |
116 | #include <xen/xennet_checksum.h> | | 116 | #include <xen/xennet_checksum.h> |
117 | | | 117 | |
118 | #include <uvm/uvm.h> | | 118 | #include <uvm/uvm.h> |
119 | | | 119 | |
| | | 120 | #include <xen/intr.h> |
120 | #include <xen/hypervisor.h> | | 121 | #include <xen/hypervisor.h> |
121 | #include <xen/evtchn.h> | | 122 | #include <xen/evtchn.h> |
122 | #include <xen/granttables.h> | | 123 | #include <xen/granttables.h> |
123 | #include <xen/include/public/io/netif.h> | | 124 | #include <xen/include/public/io/netif.h> |
124 | #include <xen/xenpmap.h> | | 125 | #include <xen/xenpmap.h> |
125 | | | 126 | |
126 | #include <xen/xenbus.h> | | 127 | #include <xen/xenbus.h> |
127 | #include "locators.h" | | 128 | #include "locators.h" |
128 | | | 129 | |
129 | #undef XENNET_DEBUG_DUMP | | 130 | #undef XENNET_DEBUG_DUMP |
130 | #undef XENNET_DEBUG | | 131 | #undef XENNET_DEBUG |
131 | | | 132 | |
132 | #ifdef XENNET_DEBUG | | 133 | #ifdef XENNET_DEBUG |
--- src/sys/arch/xen/xen/xbd_xenbus.c 2020/04/07 11:47:06 1.97
+++ src/sys/arch/xen/xen/xbd_xenbus.c 2020/04/16 08:46:36 1.97.2.1
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: xbd_xenbus.c,v 1.97 2020/04/07 11:47:06 jdolecek Exp $ */ | | 1 | /* $NetBSD: xbd_xenbus.c,v 1.97.2.1 2020/04/16 08:46:36 bouyer Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2006 Manuel Bouyer. | | 4 | * Copyright (c) 2006 Manuel Bouyer. |
5 | * | | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions | | 7 | * modification, are permitted provided that the following conditions |
8 | * are met: | | 8 | * are met: |
9 | * 1. Redistributions of source code must retain the above copyright | | 9 | * 1. Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * 2. Redistributions in binary form must reproduce the above copyright | | 11 | * 2. Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | | 13 | * documentation and/or other materials provided with the distribution. |
14 | * | | 14 | * |
| @@ -40,49 +40,50 @@ | | | @@ -40,49 +40,50 @@ |
40 | * - initiate request: xbdread/write/open/ioctl/.. | | 40 | * - initiate request: xbdread/write/open/ioctl/.. |
41 | * - depending on operation, it is handled directly by disk(9) subsystem or | | 41 | * - depending on operation, it is handled directly by disk(9) subsystem or |
42 | * goes through physio(9) first. | | 42 | * goes through physio(9) first. |
43 | * - the request is ultimately processed by xbd_diskstart() that prepares the | | 43 | * - the request is ultimately processed by xbd_diskstart() that prepares the |
44 | * xbd requests, post them in the ring I/O queue, then signal the backend. | | 44 | * xbd requests, post them in the ring I/O queue, then signal the backend. |
45 | * | | 45 | * |
46 | * When a response is available in the queue, the backend signals the frontend | | 46 | * When a response is available in the queue, the backend signals the frontend |
47 | * via its event channel. This triggers xbd_handler(), which will link back | | 47 | * via its event channel. This triggers xbd_handler(), which will link back |
48 | * the response to its request through the request ID, and mark the I/O as | | 48 | * the response to its request through the request ID, and mark the I/O as |
49 | * completed. | | 49 | * completed. |
50 | */ | | 50 | */ |
51 | | | 51 | |
52 | #include <sys/cdefs.h> | | 52 | #include <sys/cdefs.h> |
53 | __KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.97 2020/04/07 11:47:06 jdolecek Exp $"); | | 53 | __KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.97.2.1 2020/04/16 08:46:36 bouyer Exp $"); |
54 | | | 54 | |
55 | #include "opt_xen.h" | | 55 | #include "opt_xen.h" |
56 | | | 56 | |
57 | | | 57 | |
58 | #include <sys/param.h> | | 58 | #include <sys/param.h> |
59 | #include <sys/buf.h> | | 59 | #include <sys/buf.h> |
60 | #include <sys/bufq.h> | | 60 | #include <sys/bufq.h> |
61 | #include <sys/device.h> | | 61 | #include <sys/device.h> |
62 | #include <sys/disk.h> | | 62 | #include <sys/disk.h> |
63 | #include <sys/disklabel.h> | | 63 | #include <sys/disklabel.h> |
64 | #include <sys/conf.h> | | 64 | #include <sys/conf.h> |
65 | #include <sys/fcntl.h> | | 65 | #include <sys/fcntl.h> |
66 | #include <sys/kernel.h> | | 66 | #include <sys/kernel.h> |
67 | #include <sys/proc.h> | | 67 | #include <sys/proc.h> |
68 | #include <sys/systm.h> | | 68 | #include <sys/systm.h> |
69 | #include <sys/stat.h> | | 69 | #include <sys/stat.h> |
70 | #include <sys/vnode.h> | | 70 | #include <sys/vnode.h> |
71 | | | 71 | |
72 | #include <dev/dkvar.h> | | 72 | #include <dev/dkvar.h> |
73 | | | 73 | |
74 | #include <uvm/uvm.h> | | 74 | #include <uvm/uvm.h> |
75 | | | 75 | |
| | | 76 | #include <xen/intr.h> |
76 | #include <xen/hypervisor.h> | | 77 | #include <xen/hypervisor.h> |
77 | #include <xen/evtchn.h> | | 78 | #include <xen/evtchn.h> |
78 | #include <xen/granttables.h> | | 79 | #include <xen/granttables.h> |
79 | #include <xen/include/public/io/blkif.h> | | 80 | #include <xen/include/public/io/blkif.h> |
80 | #include <xen/include/public/io/protocols.h> | | 81 | #include <xen/include/public/io/protocols.h> |
81 | | | 82 | |
82 | #include <xen/xenbus.h> | | 83 | #include <xen/xenbus.h> |
83 | #include "locators.h" | | 84 | #include "locators.h" |
84 | | | 85 | |
85 | #undef XBD_DEBUG | | 86 | #undef XBD_DEBUG |
86 | #ifdef XBD_DEBUG | | 87 | #ifdef XBD_DEBUG |
87 | #define DPRINTF(x) printf x; | | 88 | #define DPRINTF(x) printf x; |
88 | #else | | 89 | #else |
--- src/sys/arch/xen/xen/xen_machdep.c 2019/03/09 08:42:25 1.22
+++ src/sys/arch/xen/xen/xen_machdep.c 2020/04/16 08:46:36 1.22.10.1
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: xen_machdep.c,v 1.22 2019/03/09 08:42:25 maxv Exp $ */ | | 1 | /* $NetBSD: xen_machdep.c,v 1.22.10.1 2020/04/16 08:46:36 bouyer Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2006 Manuel Bouyer. | | 4 | * Copyright (c) 2006 Manuel Bouyer. |
5 | * | | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions | | 7 | * modification, are permitted provided that the following conditions |
8 | * are met: | | 8 | * are met: |
9 | * 1. Redistributions of source code must retain the above copyright | | 9 | * 1. Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * 2. Redistributions in binary form must reproduce the above copyright | | 11 | * 2. Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | | 13 | * documentation and/or other materials provided with the distribution. |
14 | * | | 14 | * |
| @@ -43,40 +43,41 @@ | | | @@ -43,40 +43,41 @@ |
43 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | | 43 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
44 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | | 44 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
45 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | | 45 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
46 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | | 46 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
47 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 47 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
48 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 48 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
49 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 49 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
50 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | | 50 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
51 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 51 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
52 | */ | | 52 | */ |
53 | | | 53 | |
54 | | | 54 | |
55 | #include <sys/cdefs.h> | | 55 | #include <sys/cdefs.h> |
56 | __KERNEL_RCSID(0, "$NetBSD: xen_machdep.c,v 1.22 2019/03/09 08:42:25 maxv Exp $"); | | 56 | __KERNEL_RCSID(0, "$NetBSD: xen_machdep.c,v 1.22.10.1 2020/04/16 08:46:36 bouyer Exp $"); |
57 | | | 57 | |
58 | #include "opt_xen.h" | | 58 | #include "opt_xen.h" |
59 | | | 59 | |
60 | #include <sys/param.h> | | 60 | #include <sys/param.h> |
61 | #include <sys/systm.h> | | 61 | #include <sys/systm.h> |
62 | #include <sys/boot_flag.h> | | 62 | #include <sys/boot_flag.h> |
63 | #include <sys/mount.h> | | 63 | #include <sys/mount.h> |
64 | #include <sys/reboot.h> | | 64 | #include <sys/reboot.h> |
65 | #include <sys/timetc.h> | | 65 | #include <sys/timetc.h> |
66 | #include <sys/sysctl.h> | | 66 | #include <sys/sysctl.h> |
67 | #include <sys/pmf.h> | | 67 | #include <sys/pmf.h> |
68 | #include <sys/xcall.h> | | 68 | #include <sys/xcall.h> |
69 | | | 69 | |
| | | 70 | #include <xen/intr.h> |
70 | #include <xen/hypervisor.h> | | 71 | #include <xen/hypervisor.h> |
71 | #include <xen/shutdown_xenbus.h> | | 72 | #include <xen/shutdown_xenbus.h> |
72 | #include <xen/include/public/version.h> | | 73 | #include <xen/include/public/version.h> |
73 | | | 74 | |
74 | #define DPRINTK(x) printk x | | 75 | #define DPRINTK(x) printk x |
75 | #if 0 | | 76 | #if 0 |
76 | #define DPRINTK(x) | | 77 | #define DPRINTK(x) |
77 | #endif | | 78 | #endif |
78 | | | 79 | |
79 | u_int tsc_get_timecount(struct timecounter *); | | 80 | u_int tsc_get_timecount(struct timecounter *); |
80 | | | 81 | |
81 | bool xen_suspend_allow; | | 82 | bool xen_suspend_allow; |
82 | | | 83 | |
--- src/sys/arch/xen/xen/xencons.c 2019/02/02 12:32:55 1.48
+++ src/sys/arch/xen/xen/xencons.c 2020/04/16 08:46:36 1.48.10.1
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: xencons.c,v 1.48 2019/02/02 12:32:55 cherry Exp $ */ | | 1 | /* $NetBSD: xencons.c,v 1.48.10.1 2020/04/16 08:46:36 bouyer Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2006 Manuel Bouyer. | | 4 | * Copyright (c) 2006 Manuel Bouyer. |
5 | * | | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions | | 7 | * modification, are permitted provided that the following conditions |
8 | * are met: | | 8 | * are met: |
9 | * 1. Redistributions of source code must retain the above copyright | | 9 | * 1. Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * 2. Redistributions in binary form must reproduce the above copyright | | 11 | * 2. Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | | 13 | * documentation and/or other materials provided with the distribution. |
14 | * | | 14 | * |
| @@ -43,40 +43,41 @@ | | | @@ -43,40 +43,41 @@ |
43 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | | 43 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
44 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | | 44 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
45 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | | 45 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
46 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | | 46 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
47 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 47 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
48 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 48 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
49 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 49 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
50 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | | 50 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
51 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 51 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
52 | */ | | 52 | */ |
53 | | | 53 | |
54 | | | 54 | |
55 | #include <sys/cdefs.h> | | 55 | #include <sys/cdefs.h> |
56 | __KERNEL_RCSID(0, "$NetBSD: xencons.c,v 1.48 2019/02/02 12:32:55 cherry Exp $"); | | 56 | __KERNEL_RCSID(0, "$NetBSD: xencons.c,v 1.48.10.1 2020/04/16 08:46:36 bouyer Exp $"); |
57 | | | 57 | |
58 | #include "opt_xen.h" | | 58 | #include "opt_xen.h" |
59 | | | 59 | |
60 | #include <sys/param.h> | | 60 | #include <sys/param.h> |
61 | #include <sys/ioctl.h> | | 61 | #include <sys/ioctl.h> |
62 | #include <sys/proc.h> | | 62 | #include <sys/proc.h> |
63 | #include <sys/tty.h> | | 63 | #include <sys/tty.h> |
64 | #include <sys/systm.h> | | 64 | #include <sys/systm.h> |
65 | #include <sys/device.h> | | 65 | #include <sys/device.h> |
66 | #include <sys/conf.h> | | 66 | #include <sys/conf.h> |
67 | #include <sys/kauth.h> | | 67 | #include <sys/kauth.h> |
68 | #include <sys/kernel.h> | | 68 | #include <sys/kernel.h> |
69 | | | 69 | |
| | | 70 | #include <xen/intr.h> |
70 | #include <xen/xen.h> | | 71 | #include <xen/xen.h> |
71 | #include <xen/hypervisor.h> | | 72 | #include <xen/hypervisor.h> |
72 | #include <xen/evtchn.h> | | 73 | #include <xen/evtchn.h> |
73 | #include <uvm/uvm.h> | | 74 | #include <uvm/uvm.h> |
74 | #include <machine/pmap.h> | | 75 | #include <machine/pmap.h> |
75 | #include <xen/include/public/io/console.h> | | 76 | #include <xen/include/public/io/console.h> |
76 | | | 77 | |
77 | #include <dev/cons.h> | | 78 | #include <dev/cons.h> |
78 | | | 79 | |
79 | #ifdef DDB | | 80 | #ifdef DDB |
80 | #include <ddb/db_output.h> /* XXX for db_max_line */ | | 81 | #include <ddb/db_output.h> /* XXX for db_max_line */ |
81 | #endif | | 82 | #endif |
82 | | | 83 | |
--- src/sys/arch/xen/xenbus/xenbus_comms.c 2018/12/24 14:55:42 1.21
+++ src/sys/arch/xen/xenbus/xenbus_comms.c 2020/04/16 08:46:36 1.21.10.1
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: xenbus_comms.c,v 1.21 2018/12/24 14:55:42 cherry Exp $ */ | | 1 | /* $NetBSD: xenbus_comms.c,v 1.21.10.1 2020/04/16 08:46:36 bouyer Exp $ */ |
2 | /****************************************************************************** | | 2 | /****************************************************************************** |
3 | * xenbus_comms.c | | 3 | * xenbus_comms.c |
4 | * | | 4 | * |
5 | * Low level code to talks to Xen Store: ringbuffer and event channel. | | 5 | * Low level code to talks to Xen Store: ringbuffer and event channel. |
6 | * | | 6 | * |
7 | * Copyright (C) 2005 Rusty Russell, IBM Corporation | | 7 | * Copyright (C) 2005 Rusty Russell, IBM Corporation |
8 | * | | 8 | * |
9 | * This file may be distributed separately from the Linux kernel, or | | 9 | * This file may be distributed separately from the Linux kernel, or |
10 | * incorporated into other software packages, subject to the following license: | | 10 | * incorporated into other software packages, subject to the following license: |
11 | * | | 11 | * |
12 | * Permission is hereby granted, free of charge, to any person obtaining a copy | | 12 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
13 | * of this source file (the "Software"), to deal in the Software without | | 13 | * of this source file (the "Software"), to deal in the Software without |
14 | * restriction, including without limitation the rights to use, copy, modify, | | 14 | * restriction, including without limitation the rights to use, copy, modify, |
| @@ -19,36 +19,37 @@ | | | @@ -19,36 +19,37 @@ |
19 | * The above copyright notice and this permission notice shall be included in | | 19 | * The above copyright notice and this permission notice shall be included in |
20 | * all copies or substantial portions of the Software. | | 20 | * all copies or substantial portions of the Software. |
21 | * | | 21 | * |
22 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | | 22 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
23 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | | 23 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
24 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | | 24 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
25 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | | 25 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
26 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | | 26 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
27 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | | 27 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
28 | * IN THE SOFTWARE. | | 28 | * IN THE SOFTWARE. |
29 | */ | | 29 | */ |
30 | | | 30 | |
31 | #include <sys/cdefs.h> | | 31 | #include <sys/cdefs.h> |
32 | __KERNEL_RCSID(0, "$NetBSD: xenbus_comms.c,v 1.21 2018/12/24 14:55:42 cherry Exp $"); | | 32 | __KERNEL_RCSID(0, "$NetBSD: xenbus_comms.c,v 1.21.10.1 2020/04/16 08:46:36 bouyer Exp $"); |
33 | | | 33 | |
34 | #include <sys/types.h> | | 34 | #include <sys/types.h> |
35 | #include <sys/null.h> | | 35 | #include <sys/null.h> |
36 | #include <sys/errno.h> | | 36 | #include <sys/errno.h> |
37 | #include <sys/param.h> | | 37 | #include <sys/param.h> |
38 | #include <sys/proc.h> | | 38 | #include <sys/proc.h> |
39 | #include <sys/systm.h> | | 39 | #include <sys/systm.h> |
40 | | | 40 | |
41 | #include <xen/xen.h> /* for xendomain_is_dom0() */ | | 41 | #include <xen/xen.h> /* for xendomain_is_dom0() */ |
| | | 42 | #include <xen/intr.h> /* for xendomain_is_dom0() */ |
42 | #include <xen/hypervisor.h> | | 43 | #include <xen/hypervisor.h> |
43 | #include <xen/evtchn.h> | | 44 | #include <xen/evtchn.h> |
44 | #include <xen/xenbus.h> | | 45 | #include <xen/xenbus.h> |
45 | #include "xenbus_comms.h" | | 46 | #include "xenbus_comms.h" |
46 | | | 47 | |
47 | #undef XENDEBUG | | 48 | #undef XENDEBUG |
48 | #ifdef XENDEBUG | | 49 | #ifdef XENDEBUG |
49 | #define XENPRINTF(x) printf x | | 50 | #define XENPRINTF(x) printf x |
50 | #else | | 51 | #else |
51 | #define XENPRINTF(x) | | 52 | #define XENPRINTF(x) |
52 | #endif | | 53 | #endif |
53 | | | 54 | |
54 | static struct intrhand *ih; | | 55 | static struct intrhand *ih; |
--- src/sys/arch/xen/xenbus/xenbus_dev.c 2020/04/07 16:10:48 1.17
+++ src/sys/arch/xen/xenbus/xenbus_dev.c 2020/04/16 08:46:36 1.17.2.1
| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: xenbus_dev.c,v 1.17 2020/04/07 16:10:48 jdolecek Exp $ */ | | 1 | /* $NetBSD: xenbus_dev.c,v 1.17.2.1 2020/04/16 08:46:36 bouyer Exp $ */ |
2 | /* | | 2 | /* |
3 | * xenbus_dev.c | | 3 | * xenbus_dev.c |
4 | * | | 4 | * |
5 | * Driver giving user-space access to the kernel's xenbus connection | | 5 | * Driver giving user-space access to the kernel's xenbus connection |
6 | * to xenstore. | | 6 | * to xenstore. |
7 | * | | 7 | * |
8 | * Copyright (c) 2005, Christian Limpach | | 8 | * Copyright (c) 2005, Christian Limpach |
9 | * Copyright (c) 2005, Rusty Russell, IBM Corporation | | 9 | * Copyright (c) 2005, Rusty Russell, IBM Corporation |
10 | * | | 10 | * |
11 | * This file may be distributed separately from the Linux kernel, or | | 11 | * This file may be distributed separately from the Linux kernel, or |
12 | * incorporated into other software packages, subject to the following license: | | 12 | * incorporated into other software packages, subject to the following license: |
13 | * | | 13 | * |
14 | * Permission is hereby granted, free of charge, to any person obtaining a copy | | 14 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| @@ -21,45 +21,46 @@ | | | @@ -21,45 +21,46 @@ |
21 | * The above copyright notice and this permission notice shall be included in | | 21 | * The above copyright notice and this permission notice shall be included in |
22 | * all copies or substantial portions of the Software. | | 22 | * all copies or substantial portions of the Software. |
23 | * | | 23 | * |
24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | | 24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
25 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | | 25 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
26 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | | 26 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
27 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | | 27 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
28 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | | 28 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
29 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | | 29 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
30 | * IN THE SOFTWARE. | | 30 | * IN THE SOFTWARE. |
31 | */ | | 31 | */ |
32 | | | 32 | |
33 | #include <sys/cdefs.h> | | 33 | #include <sys/cdefs.h> |
34 | __KERNEL_RCSID(0, "$NetBSD: xenbus_dev.c,v 1.17 2020/04/07 16:10:48 jdolecek Exp $"); | | 34 | __KERNEL_RCSID(0, "$NetBSD: xenbus_dev.c,v 1.17.2.1 2020/04/16 08:46:36 bouyer Exp $"); |
35 | | | 35 | |
36 | #include "opt_xen.h" | | 36 | #include "opt_xen.h" |
37 | | | 37 | |
38 | #include <sys/types.h> | | 38 | #include <sys/types.h> |
39 | #include <sys/null.h> | | 39 | #include <sys/null.h> |
40 | #include <sys/errno.h> | | 40 | #include <sys/errno.h> |
41 | #include <sys/param.h> | | 41 | #include <sys/param.h> |
42 | #include <sys/proc.h> | | 42 | #include <sys/proc.h> |
43 | #include <sys/systm.h> | | 43 | #include <sys/systm.h> |
44 | #include <sys/dirent.h> | | 44 | #include <sys/dirent.h> |
45 | #include <sys/stat.h> | | 45 | #include <sys/stat.h> |
46 | #include <sys/tree.h> | | 46 | #include <sys/tree.h> |
47 | #include <sys/vnode.h> | | 47 | #include <sys/vnode.h> |
48 | #include <miscfs/specfs/specdev.h> | | 48 | #include <miscfs/specfs/specdev.h> |
49 | #include <miscfs/kernfs/kernfs.h> | | 49 | #include <miscfs/kernfs/kernfs.h> |
50 | | | 50 | |
51 | #include <xen/kernfs_machdep.h> | | 51 | #include <xen/kernfs_machdep.h> |
52 | | | 52 | |
| | | 53 | #include <xen/intr.h> |
53 | #include <xen/hypervisor.h> | | 54 | #include <xen/hypervisor.h> |
54 | #include <xen/xenbus.h> | | 55 | #include <xen/xenbus.h> |
55 | #include "xenbus_comms.h" | | 56 | #include "xenbus_comms.h" |
56 | | | 57 | |
57 | static int xenbus_dev_read(void *); | | 58 | static int xenbus_dev_read(void *); |
58 | static int xenbus_dev_write(void *); | | 59 | static int xenbus_dev_write(void *); |
59 | static int xenbus_dev_open(void *); | | 60 | static int xenbus_dev_open(void *); |
60 | static int xenbus_dev_close(void *); | | 61 | static int xenbus_dev_close(void *); |
61 | static int xsd_port_read(void *); | | 62 | static int xsd_port_read(void *); |
62 | | | 63 | |
63 | #define DIR_MODE (S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) | | 64 | #define DIR_MODE (S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) |
64 | #define PRIVCMD_MODE (S_IRUSR | S_IWUSR) | | 65 | #define PRIVCMD_MODE (S_IRUSR | S_IWUSR) |
65 | static const struct kernfs_fileop xenbus_fileops[] = { | | 66 | static const struct kernfs_fileop xenbus_fileops[] = { |