CFT: replacing XENHVM kernel config with GENERIC + xenhvm.ko

Sean Bruno sean_bruno at
Tue Aug 27 22:51:02 UTC 2013

On Mon, 2013-08-26 at 22:08 -0700, Colin Percival wrote:
> Hi all,
> I've attached a patch which eliminates the XENHVM kernel configuration and
> instead allows FreeBSD to run under Xen/HVM with PV drivers by loading a
> new xenhvm.ko module from the boot loader.  This will mean that FreeBSD
> virtual machines running under Xen/HVM will be able to run "straight off
> the ISO" binaries; this will also mean they will be able to use FreeBSD
> Update to update the kernel.
> I have spent about 10 minutes testing this in Amazon EC2.  Please help me
> out by doing some more testing. ;-)
> The fine details:
> 1. I've created a new kernel module for i386 and amd64, "xenhvm", with all
> of the source files which were added via "options XENHVM" and "device xenpci".
> 2. I have removed those from sys/conf/files and sys/conf/options.*; those
> options are now meaningless.
> 3. I moved the "detect Xen and disable QEMU emulated devices" code from
> sys/amd64/amd64/machdep.c to the kernel module MOD_LOAD event handler.
> 4. I have made the PCPU values required by Xen/HVM support -- two unsigned
> ints -- unconditionally compiled in.  This is the only change to the GENERIC
> kernel.
> 5. I have removed the XENHVM kernel configuration files.
> Depending on feedback from freebsd-xen@ I hope to send this to freebsd-current
> for wider review later this week and then commit it before the FreeBSD 10.0
> code freeze starts on September 7th.

Seems like you've got a winner there.

$ uname -a
FreeBSD ujvl 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r254959M: Tue Aug 27
18:29:11 EDT 2013     sbruno at ujvl:/usr/obj/usr/src/sys/GENERIC  amd64
$ kldstat
Id Refs Address            Size     Name
 1   21 0xffffffff80200000 168eaa0  kernel
 2    1 0xffffffff8188f000 76ef8    xenhvm.ko
 3    1 0xffffffff81a12000 34e0     ums.ko
 4    1 0xffffffff81a16000 312c5    pf.ko
 5    1 0xffffffff81a48000 643d     nullfs.ko
 6    1 0xffffffff81a4f000 52c1     fdescfs.ko

Copyright (c) 1992-2013 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 10.0-CURRENT #0 r254959M: Tue Aug 27 18:29:11 EDT 2013
    sbruno at ujvl:/usr/obj/usr/src/sys/GENERIC amd64
FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
WARNING: WITNESS option enabled, expect reduced performance.
CPU: Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz (2400.05-MHz
K8-class CPU)
  Origin = "GenuineIntel"  Id = 0x206c2  Family = 0x6  Model = 0x2c
Stepping = 2


  AMD Features=0x28100800<SYSCALL,NX,RDTSCP,LM>
  AMD Features2=0x1<LAHF>
real memory  = 536870912 (512 MB)
avail memory = 490692608 (467 MB)
Event timer "LAPIC" quality 400
ACPI APIC Table: <Xen HVM>
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
FreeBSD/SMP: 1 package(s) x 2 core(s)
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP): APIC ID:  2
ioapic0: Changing APIC ID to 1
MADT: Forcing active-low polarity and level trigger for SCI
ioapic0 <Version 1.1> irqs 0-47 on motherboard
random: <Software, Yarrow> initialized
kbd1 at kbdmux0
acpi0: <Xen> on motherboard
acpi0: Power Button (fixed)
acpi0: Sleep Button (fixed)
acpi0: reservation of 0, a0000 (3) failed
cpu0: <ACPI CPU> on acpi0
cpu1: <ACPI CPU> on acpi0
attimer0: <AT timer> port 0x40-0x43 irq 0 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
atrtc0: <AT realtime clock> port 0x70-0x71 irq 8 on acpi0
Event timer "RTC" frequency 32768 Hz quality 0
Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
acpi_timer0: <32-bit timer at 3.579545MHz> port 0xb008-0xb00b on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
isab0: <PCI-ISA bridge> at device 1.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel PIIX3 WDMA2 controller> port
0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xc1a0-0xc1af at device 1.1 on pci0
ata0: <ATA channel> at channel 0 on atapci0
ata1: <ATA channel> at channel 1 on atapci0
uhci0: <Intel 82371SB (PIIX3) USB controller> port 0xc180-0xc19f irq 23
at device 1.2 on pci0
usbus0: controller did not stop
usbus0 on uhci0
pci0: <bridge> at device 1.3 (no driver attached)
vgapci0: <VGA-compatible display> mem
0xf0000000-0xf1ffffff,0xf3040000-0xf3040fff at device 2.0 on pci0
xenpci0: <Xen Platform Device> port 0xc000-0xc0ff mem
0xf2000000-0xf2ffffff irq 28 at device 3.0 on pci0
xenstore0: <XenStore> on xenpci0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: model IntelliMouse Explorer, device ID 4
fdc0: <floppy drive controller> port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on
fdc0: does not respond
device_attach: fdc0 attach returned 6
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
ppc0: <Parallel port> port 0x378-0x37f irq 7 on acpi0
ppc0: Generic chipset (NIBBLE-only) in COMPATIBLE mode
ppbus0: <Parallel port bus> on ppc0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
qpi0: <QPI system bus> on motherboard
orm0: <ISA Option ROM> at iomem 0xc9000-0xc97ff on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on
fdc0: No FDOUT register!
Timecounters tick every 10.000 msec
usbus0: 12Mbps Full Speed USB v1.0
xctrl0: <Xen Control Device> on xenstore0
ugen0.1: <Intel> at usbus0
uhub0: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
xenbusb_front0: <Xen Frontend Devices> on xenstore0
can't re-use a leaf (max_requests)!
xn0: <Virtual Network Interface> at device/vif/0 on xenbusb_front0
xn0: Ethernet address: 00:16:3e:0b:9b:56
xn1: <Virtual Network Interface> at device/vif/1 on xenbusb_front0
xn1: Ethernet address: 00:16:3e:50:c5:a7
xenbusb_back0: <Xen Backend Devices> on xenstore0
xn0: backend features: feature-sg feature-gso-tcp4
xn1: backend features: feature-sg feature-gso-tcp4
xbd0: 20480MB <Virtual Block Device> at device/vbd/768 on xenbusb_front0
xbd0: attaching as ada0
SMP: AP CPU #1 Launched!
WARNING: WITNESS option enabled, expect reduced performance.
uhub0: 2 ports with 2 removable, self powered
Root mount waiting for: usbus0
Root mount waiting for: usbus0
ugen0.2: <QEMU 0.10.2> at usbus0
Trying to mount root from ufs:/dev/ada0p2 [rw]...
xn0: 2 link states coalesced
ums0: <Endpoint1 Interrupt Pipe> on usbus0
ums0: 3 buttons and [Z] coordinates ID=0

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the freebsd-xen mailing list