Skip to content

RFC Xen i386 paravirtualization support

Chris Wright lkml xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest35 patches 77 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/35Add XEN config options and disable unsupported config options.arch/i386/Kconfig drivers/xen/Kconfig kernel/Kconfig.hz +1 more+38 -60 replies
2/35Makefile support to build Xen subarcharch/i386/Makefile arch/i386/mach-xen/Makefile+12 -00 replies
3/35Add Xen interface header filesinclude/xen/interface/arch-x86_32.h include/xen/interface/event_channel.h include/xen/interface/features.h +13 more+2292 -00 replies
4/35Hypervisor interface header files.include/asm-i386/hypercall.h include/asm-i386/hypervisor.h+373 -05 replies
5/35Add sync bitopsinclude/asm-i386/bitops-fns.h include/asm-i386/bitops.h include/asm-i386/system.h+222 -1380 replies
6/35Add vmlinuz build target.arch/i386/Makefile arch/i386/boot/Makefile+12 -30 replies
7/35Make LOAD_OFFSET defined by subarcharch/i386/kernel/vmlinux.lds.S include/asm-i386/mach-default/mach_vmlinux.lds.h include/asm-i386/mach-xen/mach_vmlinux.lds.h+13 -17 replies
8/35Add Xen-specific memory management definitionsinclude/asm-i386/hypervisor.h include/asm-i386/mach-default/mach_page.h include/asm-i386/mach-xen/mach_page.h +1 more+108 -00 replies
9/35Change __FIXADDR_TOP to leave room for the hypervisor.include/asm-i386/fixmap.h include/asm-i386/mach-default/mach_fixmap.h include/asm-i386/mach-xen/mach_fixmap.h+23 -72 replies
10/35Add a new head.S start-of-day file for booting on Xen.arch/i386/Makefile arch/i386/mach-xen/Makefile arch/i386/mach-xen/head.S+191 -24 replies
11/35Add support for Xen to entry.S.arch/i386/kernel/entry.S+211 -172 replies
12/35Add start-of-day setup hooks to subarcharch/i386/kernel/setup.c include/asm-i386/hypervisor.h include/asm-i386/mach-default/mach_setup.h +4 more+121 -30 replies
13/35Support loading an initrd when running on Xenarch/i386/kernel/setup.c drivers/block/Kconfig+10 -12 replies
14/35subarch modify CPU capabilitiesarch/i386/kernel/cpu/common.c include/asm-i386/mach-default/mach_cpu.h include/asm-i386/mach-xen/mach_cpu.h +2 more+26 -03 replies
15/35subarch support for controlling interrupt deliveryinclude/asm-i386/mach-default/mach_system.h include/asm-i386/mach-xen/mach_system.h include/asm-i386/system.h+128 -190 replies
16/35subarch support for interrupt and exception gatesarch/i386/kernel/traps.c include/asm-i386/mach-default/mach_idt.h include/asm-i386/mach-xen/mach_idt.h +1 more+105 -482 replies
17/35Segment register changes for Xenarch/i386/kernel/process.c arch/i386/mm/fault.c include/asm-i386/mach-default/mach_segment.h +6 more+37 -63 replies
18/35Support gdt/idt/ldt handling on Xen.include/asm-i386/desc.h include/asm-i386/mach-default/mach_desc.h include/asm-i386/mach-xen/mach_desc.h+141 -603 replies
19/35subarch support for control register accessesinclude/asm-i386/mach-default/mach_system.h include/asm-i386/mach-xen/mach_system.h include/asm-i386/system.h+111 -582 replies
20/35subarch stack pointer updateinclude/asm-i386/mach-default/mach_processor.h include/asm-i386/mach-xen/mach_processor.h include/asm-i386/processor.h+20 -00 replies
21/35subarch TLB supportinclude/asm-i386/mach-default/mach_tlbflush.h include/asm-i386/mach-xen/mach_tlbflush.h include/asm-i386/tlbflush.h+85 -540 replies
22/35subarch suport for idle loop (NO_IDLE_HZ for Xen)drivers/xen/Kconfig include/asm-i386/mach-xen/setup_arch_post.h+32 -00 replies
23/35Add support for Xen event channels.arch/i386/kernel/Makefile arch/i386/mach-xen/evtchn.c drivers/xen/core/Makefile +3 more+1093 -23 replies
24/35subarch support for mask value for irq nubmersarch/i386/kernel/irq.c include/asm-i386/mach-default/irq_vectors.h include/asm-i386/mach-visws/irq_vectors.h +2 more+13 -30 replies
25/35Add Xen time abstractionsarch/i386/kernel/Makefile arch/i386/mach-xen/time.c+1050 -15 replies
26/35Add Xen subarch reboot supportarch/i386/kernel/Makefile arch/i386/mach-xen/reboot.c+266 -06 replies
27/35Add nosegneg capability to the vsyscall page notesarch/i386/kernel/vsyscall-note.S+29 -00 replies
28/35add support for Xen feature queriesarch/i386/mach-xen/Makefile arch/i386/mach-xen/features.c include/asm-i386/mach-xen/setup_arch_post.h +1 more+52 -11 reply
29/35Add the Xen virtual console driver.drivers/Makefile drivers/char/tty_io.c drivers/xen/Makefile +4 more+773 -16 replies
30/35Add generic_page_range() functioninclude/linux/mm.h mm/memory.c+95 -07 replies
31/35Add Xen grant table supportarch/i386/mach-xen/Makefile arch/i386/mach-xen/gnttab.c include/xen/gnttab.h+520 -12 replies
32/35Add Xen driver utility functions.drivers/xen/Makefile drivers/xen/util.c include/xen/driver_util.h+88 -01 reply
33/35Add the Xenbus sysfs and virtual device hotplug driver.arch/i386/mach-xen/reboot.c drivers/xen/Makefile drivers/xen/xenbus/Makefile +6 more+2832 -62 replies
34/35Add the Xen virtual network device driver.drivers/net/Kconfig drivers/xen/Kconfig.net drivers/xen/Makefile +4 more+1626 -03 replies
35/35Add Xen virtual block device driver.drivers/block/Kconfig drivers/xen/Kconfig.blk drivers/xen/Makefile +4 more+1302 -03 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 00/35] Xen i386 paravirtualization support

Unlike full virtualization in which the virtual machine provides the same platform interface as running natively on the hardware, paravirtualization requires modification to the guest operating system to work with the platform interface provided by the hypervisor.

Xen was designed with performance in mind. Calls to the hypervisor are minimized, batched if necessary, and non-critical codepaths are left unmodified in the case where the privileged instruction can be trapped and emulated by the hypervisor. The Xen API is designed to be OS agnostic and has had Linux, NetBSD, FreeBSD, Solaris, Plan9 and Netware ported to it. Xen also provides support for running directly on native hardware.

The following patch series provides the minimal support required to launch Xen paravirtual guests on standard x86 hardware running the Xen hypervisor. These patches effectively port the Linux kernel to run on the platform interface provided by Xen. This port is done as an i386 subarch.

With these patches you will be able to launch an unprivileged guest running the modified Linux kernel and unmodified userspace. This guest is x86, UP only, runs in shadow translated mode, and has no direct access to hardware. This simplifies the patchset to the minimum functionality needed to support a paravirtualized guest. It's worth noting that a fair amount of this patchset deals with paravirtualizing I/O, not just CPU-only. The additional missing functionality is primarily about full SMP support, optimizations such as direct writable page tables, and the management interface. Those refinements will be posted later.

At a high-level, the patches provide the following:

- Kconfig and Makefile changes required to support Xen
- subarch changes to allow more platform functionality to be implemented by an i386 subarch
- Xen subarch implementation
- start of day code for running in the hypervisor provided environment (paging enabled)
- basic Xen drivers to provide a fully functional guest

The Xen platform API encapsulates the following types of requirements:

- idt, gdt, ldt (descriptor table handling)
- cr2, fpu_taskswitch, debug registers (privileged register handling)
- mmu (page table, tlb, and cache handling)
- memory reservations
- time and timer
- vcpu (init, up/down vcpu)
- schedule (processor yield, shutdown, etc)
- event channel (generalized virtual interrupt handling)
- grant table (shared memory interface for high speed interdomain communication)
- block device I/O
- network device I/O
- console device I/O
- Xen feature map
- Xen version info

Thanks to those who provided early feedback to this patchset: Andi Kleen, Gerd Hoffmann, Jan Beulich, Rik van Riel, Stephen Tweedie, and the Xen team. And thanks to the Xen community: AMD, HP, IBM, Intel, Novell, Red Hat, Virtual Iron, XenSource -- see Xen changelog for full details.

Known issues:

CodingStyle conformance is still in progress
/proc interface needs to be replaced with something more appropriate entry.S cleanups are possible