Port-amd64 archive

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

Re: u3g for XEN3_DOM0 ?



On Sat, Sep 11, 2021 at 11:25:17AM -0400, Greg Troxel wrote:
> The diff from GENERIC looks ok too.
> 
> Longer term, it would be nice if all differences were commented.  But
> this looks like good progress.

I made progress here. Here is the diff against GENERIC.
acpicpu, sysbeep (with a mystery remaining), vga, genfb and drm 
are disabled because they depend on code that is marked !xenpv.

--- GENERIC
+++ XEN3_DOM0
@@ -1,31 +1,23 @@
-# $NetBSD: GENERIC,v 1.589 2021/05/17 04:07:42 yamaguchi Exp $
-#
-# GENERIC machine description file
-#
-# This machine description file is used to generate the default NetBSD
-# kernel.  The generic kernel does not include all options, subsystems
-# and device drivers, but should be useful for most applications.
-#
-# The machine description file can be customised for your specific
-# machine to reduce the kernel size and improve its performance.
-#
-# For further information on compiling NetBSD kernels, see the config(8)
-# man page.
+# $NetBSD: XEN3_DOM0,v 1.193 2021/06/29 10:22:34 nia Exp $
+
+# XEN3_DOM0 machine description file
 #
-# For further information on hardware support for this architecture, see
-# the intro(4) man page.  For further information about kernel options
-# for this architecture, see the options(4) man page.  For an explanation
-# of each device driver in this file see the section 4 man page for the
-# device.
+# This machine description file is used to generate a kernel to be
+# used as a PV dom0 under Xen.  It is similar to GENERIC in that it is
+# intended to be useful for most applications.  Generally, besides
+# changes that are specifically required for Xen (e.g., XENPV), it
+# should be similar to GENERIC.  Some differences are currently
+# necessary, such as drivers that fail under Xen but work in GENERIC,
+# for reasons that do not follow from Xen architecture.
 
-include        "arch/amd64/conf/std.amd64"
+include        "arch/amd64/conf/std.xen"
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident         "GENERIC-$Revision: 1.589 $"
+#ident         "XEN3_DOM0-$Revision: 1.193 $"
 
-maxusers       64              # estimated number of users
+maxusers       32              # estimated number of users
 
 # delay between "rebooting ..." message and hardware reset, in milliseconds
 #options       CPURESET_DELAY=2000
 
@@ -50,8 +42,23 @@
 # and can deal with holes in the memory layout.
 #options       PHYSMEM_MAX_SIZE=64     # max size of physical memory (in MB)
 #options       PHYSMEM_MAX_ADDR=2048   # don't use memory above this (in MB)
 
+## Xen-specific options
+
+options        XENPV           # PV dom0 support
+options        DOM0OPS
+options        MULTIPROCESSOR
+#options       NO_PREEMPTION   # needed if MULTIPROCESSOR is disabled
+
+#options       CONSDEVNAME="\"xencons\""
+#options       CONS_OVERRIDE
+
+## end Xen-specific options
+
+# boot messages with MPBIOS, acpi and ioapic can be quite large
+options        MSGBUFSIZE=24576
+
 # Standard system options
 
 options        INSECURE        # disable kernel security levels - X needs this
 
@@ -72,34 +79,17 @@
 options        USERCONF        # userconf(4) support
 #options       PIPE_SOCKETPAIR # smaller, but slower pipe(2)
 options        SYSCTL_INCLUDE_DESCR    # Include sysctl descriptions in kernel
 
-# CPU-related options
-options        USER_LDT        # User-settable LDT, used by Wine
-options        SVS             # Separate Virtual Space
-options        PCPU_IDT        # Per CPU IDTs
-
-# GCC Spectre variant 2 mitigation
-makeoptions    SPECTRE_V2_GCC_MITIGATION=1
-options        SPECTRE_V2_GCC_MITIGATION
-
 # CPU features
-acpicpu*       at cpu?         # ACPI CPU (including frequency scaling)
+#acpicpu*      at cpu?         # ACPI CPU (including frequency scaling)
+                               # needs x86_cpu_idle_halt in cpu.c (!xenpv)
 coretemp*      at cpu?         # Intel on-die thermal sensor
 est0           at cpu0         # Intel Enhanced SpeedStep (non-ACPI)
-hyperv0        at cpu0         # Microsoft Hyper-V
+#hyperv0       at cpu0         # Microsoft Hyper-V
 #odcm0         at cpu0         # On-demand clock modulation
 powernow0      at cpu0         # AMD PowerNow! and Cool'n'Quiet (non-ACPI)
-vmt0           at cpu0         # VMware Tools
-
-#Xen PV support for HVM guests
-options        XENPVHVM
-options        XEN
-hypervisor*    at mainbus?             # Xen hypervisor
-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
+#vmt0          at cpu0         # VMware Tools
 
 # Alternate buffer queue strategies for better responsiveness under high
 # disk I/O load.
 #options       BUFQ_READPRIO
@@ -120,9 +110,9 @@
 #options       DDB_COMMANDONENTER="bt" # execute command when ddb is entered
 #options       DDB_ONPANIC=1   # see also sysctl(7): `ddb.onpanic'
 options        DDB_HISTORY_SIZE=512    # enable history editing in DDB
 #options       KGDB            # remote debugger
-#options       KGDB_DEVNAME="\"com\"",KGDB_DEVADDR=0x3f8,KGDB_DEVRATE=9600
+#options       KGDB_DEVNAME="\"com\"",KGDB_DEVADDR=0x2f8,KGDB_DEVRATE=57600
 makeoptions    DEBUG="-g"      # compile full symbol table for CTF
 options DDB_COMMANDONENTER="trace;show registers"
 #options       SYSCALL_STATS   # per syscall counts
 #options       SYSCALL_TIMES   # per syscall times
@@ -289,22 +279,35 @@
 #options       SPLASHSCREEN
 
 # Kernel root file system and dump configuration.
 config         netbsd  root on ? type ?
-#config                netbsd  root on sd0a type ffs
-#config                netbsd  root on ? type nfs
+#config                netbsd  root on wd0a type ffs
+#config                netbsd  root on xennet0 type nfs
 
 #
 # Device configuration
 #
 
+## Xen-specific options
+hypervisor*    at mainbus?             # Xen hypervisor
+
+vcpu*          at hypervisor?          # Xen virtual CPUs
+
+xenbus*        at hypervisor?          # Xen virtual bus
+
+xencons*       at hypervisor?          # Xen virtual console
+balloon*       at xenbus?              # Xen balloon device
+## end Xen-specific options
+
 # IPMI support
 ipmi0          at mainbus?
 ipmi_acpi*     at acpi?
 ipmi0          at ipmi_acpi?
 
 # ACPI will be used if present. If not it will fall back to MPBIOS
-acpi0          at mainbus0
+acpi0          at mainbus?             # ACPI access in PVH(VM) mode
+acpi0          at hypervisor?          # ACPI access in PV mode
+
 options        ACPI_SCANPCI            # find PCI roots using ACPI
 options        MPBIOS                  # configure CPUs and APICs using MPBIOS
 options        MPBIOS_SCANPCI          # MPBIOS configures PCI roots
 #options       PCI_INTR_FIXUP          # fixup PCI interrupt routing via ACPI
@@ -365,15 +368,18 @@
 
 # Basic Bus Support
 
 # PCI bus support
-pci*   at mainbus? bus ?
+pci*   at hypervisor? bus ?
 pci*   at pchb? bus ?
 pci*   at ppb? bus ?
 
+# MSIX bugs with XEN3_DOM0: kern/55667, kern/56291
+options NO_PCI_MSI_MSIX
+
 # PCI bridges
 pchb*  at pci? dev ? function ?        # PCI-Host bridges
-options        AGP_X86
+#options       AGP_X86                 # INTENTIONAL OMISSION - crashes reported with agp
 pcib*  at pci? dev ? function ?        # PCI-ISA bridges
 ppb*   at pci? dev ? function ?        # PCI-PCI bridges
 # XXX 'puc's aren't really bridges, but there's no better place for them here
 puc*   at pci? dev ? function ?        # PCI "universal" comm. cards
@@ -388,14 +394,21 @@
 fwhrng* at ichlpcib?           # Intel 82802 FWH Random Number Generator
 #hpet* at ichlpcib?
 tco*   at ichlpcib?            # TCO watch dog timer
 
+#agp*  at pchb?                        # INTENTIONAL OMISSION - crashes reported with agp
 aapic* at pci? dev ? function ?        # AMD 8131 IO apic
 
-agp*   at pchb?
+# pci backend devices, used for PCI pass-through. To export a PCI device
+# to a domU, the device has to be attached to the pciback driver in the dom0.
+# you can force a device to attach to the pciback driver in dom0 passing
+# pciback.hide=(bus:dev.fun)(bus:dev.func) to the dom0 kernel boot parameters.
+# bus and dev are 2-digits hex number, func is a single-digit number:
+# pciback.hide=(00:1a.0)(00:1a.1)(00:1a.7)
+pciback* at pci?                       # pci backend device
 
 # ISA bus support
-isa0   at mainbus?
+isa0   at hypervisor?
 isa0   at pcib?
 #isa0  at amdpcib?
 isa0   at ichlpcib?
 
@@ -416,20 +429,22 @@
 #options       PMS_DISABLE_POWERHOOK   # Disable PS/2 reset on resume
 options        PMS_SYNAPTICS_TOUCHPAD  # Enable support for Synaptics Touchpads
 options        PMS_ELANTECH_TOUCHPAD   # Enable support for Elantech Touchpads
 options        PMS_ALPS_TOUCHPAD       # Enable support for Alps Touchpads
-vga*           at pci? dev ? function ?
-genfb*         at pci? dev ? function ?
-options        VCONS_DRAW_INTR
-wsdisplay*     at vga? console ?
+#vga*          at pci? dev ? function ?# Needs acpi_md_vbios_reset 
+                                       # in acpi_wakeup.c (!xenpv)
+#genfb*        at pci? dev ? function ?# Needs acpi_md_vesa_modenum
+                                       # in acpi_wakeup.c (!xenpv)
+#options       VCONS_DRAW_INTR
+#wsdisplay*    at vga? console ?
 wsdisplay*     at wsemuldisplaydev?
 wskbd*         at pckbd? console ?
 wsmouse*       at pms? mux 0
 wsmouse*       at wsmousedev?
 
 attimer0       at isa?
 pcppi0         at isa?
-sysbeep0       at pcppi?
+#sysbeep0      at pcppi?       # Needs sysbeep_ca (from where?)
 
 # DRI legacy drivers
 #i915drm*      at drm?         # Intel i915, i945 DRM driver
 #mach64drm*    at drm?         # mach64 (3D Rage Pro, Rage) DRM driver
@@ -440,19 +455,20 @@
 #sisdrm*       at drm?         # SiS DRM driver
 #tdfxdrm*      at drm?         # 3dfx (voodoo) DRM driver
 
 # DRMKMS drivers
-i915drmkms*    at pci? dev ? function ?
-intelfb*       at intelfbbus?
+# all disabled: drm uses acpi_md_vesa_modenum in acpi_wakeup.c (!xenpv)
+#i915drmkms*   at pci? dev ? function ?        # also require disabled agp
+#intelfb*      at intelfbbus?
 
-radeon*        at pci? dev ? function ?
-radeondrmkmsfb* at radeonfbbus?
+#radeon*       at pci? dev ? function ?
+#radeondrmkmsfb* at radeonfbbus?
 
 #amdgpu*       at pci? dev ? function ?
 #amdgpufb*     at amdgpufbbus?
 
-nouveau*       at pci? dev ? function ?
-nouveaufb*     at nouveaufbbus?
+#nouveau*      at pci? dev ? function ?
+#nouveaufb*    at nouveaufbbus?
 
 # DRMUMS drivers
 #viadrmums*    at drm?
 
@@ -487,9 +503,12 @@
 com*   at cardbus? function ?  # Modems and serial cards
 
 # ISA serial interfaces
 #options       COM_HAYESP              # adds Hayes ESP serial board support
-com0   at isa? port 0x3f8 irq 4        # Standard PC serial ports
+# If a com port is used as Xen console it can't be used by the domain0 kernel
+# and there's no easy way to detect this yet. Leave com0 out as it's the
+# port usually used for serial console
+#com0  at isa? port 0x3f8 irq 4        # Standard PC serial ports
 com1   at isa? port 0x2f8 irq 3
 
 # Parallel Printer Interfaces
 
@@ -1100,29 +1119,8 @@
 # Middle Digital, Inc. PCI-Weasel serial console board control
 # devices (watchdog timer, etc.)
 weasel* at pci?
 
-# Virtio devices
-virtio* at pci? dev ? function ?       # Virtio PCI device
-viomb* at virtio?                      # Virtio memory balloon device
-ld*    at virtio?                      # Virtio disk device
-vioif* at virtio?                      # Virtio network device
-viornd* at virtio?                     # Virtio entropy device
-vioscsi* at virtio?                    # Virtio SCSI device
-#vio9p*        at virtio?                      # Virtio 9P device
-
-# Hyper-V devices
-vmbus*         at acpi?                # Hyper-V VMBus
-genfb*         at vmbus?               # Hyper-V Synthetic Video Framebuffer
-hvkbd*         at vmbus?               # Hyper-V Synthetic Keyboard
-wskbd*         at hvkbd? console ? mux 1
-hvn*           at vmbus?               # Hyper-V NetVSC
-hvs*           at vmbus?               # Hyper-V StorVSC
-hvheartbeat*   at vmbus?               # Hyper-V Heartbeat Service
-hvshutdown*    at vmbus?               # Hyper-V Guest Shutdown Service
-hvtimesync*    at vmbus?               # Hyper-V Time Synchronization Service
-#hvkvp*                at vmbus?               # Hyper-V Data Exchange Service
-
 # Pull in optional local configuration
 cinclude "arch/amd64/conf/GENERIC.local"
 
 
@@ -1217,4 +1215,10 @@
 options        PAX_MPROTECT=1          # PaX mprotect(2) restrictions
 options        PAX_MPROTECT_DEBUG=1    # PaX mprotect debug
 options        PAX_ASLR=1              # PaX Address Space Layout Randomization
 options        PAX_ASLR_DEBUG=1        # PaX ASLR debug
+
+# xen pseudo-devices
+pseudo-device  xenevt
+pseudo-device  xvif
+pseudo-device  xbdback
+



-- 
Emmanuel Dreyfus
manu%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index