Skip to content

RFC Xen i386 paravirtualization support

Chris Wright lkml netdev xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest33 patches 63 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/33Add apply_to_page_range() functioninclude/linux/mm.h mm/memory.c+99 -03 replies
2/33Add sync bitopsinclude/asm-i386/synch_bitops.h include/asm-i386/system.h+199 -04 replies
3/33Add nosegneg capability to the vsyscall page notesarch/i386/kernel/vsyscall-note.S+29 -00 replies
4/33Add XEN config options and disable unsupported config options.arch/i386/Kconfig arch/i386/Kconfig.cpu arch/i386/Kconfig.debug +3 more+41 -82 replies
5/33Makefile support to build Xen subarcharch/i386/Makefile arch/i386/mach-xen/Makefile+12 -04 replies
6/33Add Xen interface header filesinclude/xen/interface/arch-x86_32.h include/xen/interface/event_channel.h include/xen/interface/features.h +13 more+2174 -00 replies
7/33Hypervisor interface header files.include/asm-i386/hypercall.h include/asm-i386/hypervisor.h+378 -00 replies
8/33Add vmlinuz build target.arch/i386/Makefile arch/i386/boot/Makefile+12 -30 replies
9/33Add start-of-day setup hooks to subarcharch/i386/kernel/setup.c arch/i386/mach-default/Makefile arch/i386/mach-default/setup-memory.c +8 more+154 -535 replies
10/33add support for Xen feature queriesarch/i386/mach-xen/setup-xen.c drivers/Makefile drivers/xen/Makefile +4 more+61 -00 replies
11/33Add Xen-specific memory management definitionsarch/i386/mach-xen/Makefile arch/i386/mach-xen/memory.c include/asm-i386/mach-default/mach_page.h +2 more+113 -10 replies
12/33Change __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+25 -70 replies
13/33Add a new head.S start-of-day file for booting on Xen.arch/i386/Makefile arch/i386/kernel/head-cpu.S arch/i386/kernel/head.S +2 more+226 -672 replies
14/33subarch support for controlling interrupt deliveryarch/i386/mach-xen/Makefile arch/i386/mach-xen/interrupt.c include/asm-i386/irqflags.h +4 more+174 -580 replies
15/33move segment checks to subarcharch/i386/kernel/process.c arch/i386/mm/fault.c include/asm-i386/mach-default/mach_segment.h +5 more+31 -65 replies
16/33Add support for Xen to entry.S.arch/i386/kernel/asm-offsets.c arch/i386/kernel/entry.S arch/i386/mach-xen/setup-xen.c +1 more+169 -196 replies
17/33Support loading an initrd when running on Xenarch/i386/kernel/setup.c arch/i386/mach-xen/setup-xen.c include/asm-i386/setup.h+12 -10 replies
18/33Subarch support for CPUID instructionarch/i386/kernel/head-cpu.S include/asm-i386/mach-default/mach_processor.h include/asm-i386/mach-xen/mach_processor.h +1 more+27 -86 replies
19/33Support gdt/idt/ldt handling on Xen.arch/i386/mach-xen/memory.c include/asm-i386/desc.h include/asm-i386/mach-default/mach_desc.h +1 more+138 -520 replies
20/33subarch support for interrupt and exception gatesarch/i386/kernel/traps.c arch/i386/mach-xen/setup-xen.c include/asm-i386/mach-default/mach_idt.h +2 more+60 -270 replies
21/33subarch 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 -570 replies
22/33subarch stack pointer updateinclude/asm-i386/mach-default/mach_processor.h include/asm-i386/mach-xen/mach_processor.h include/asm-i386/processor.h+16 -00 replies
23/33subarch TLB supportinclude/asm-i386/mach-default/mach_tlbflush.h include/asm-i386/mach-xen/mach_tlbflush.h include/asm-i386/tlbflush.h+85 -542 replies
24/33Add support for Xen event channels.arch/i386/kernel/Makefile drivers/xen/core/evtchn.c include/asm-i386/mach-xen/irq_vectors.h +1 more+1110 -10 replies
25/33Implement timekeeping for Xenarch/i386/mach-default/Makefile arch/i386/mach-default/setup-time.c arch/i386/mach-default/setup.c +4 more+399 -162 replies
26/33subarch suport for idle loop (NO_IDLE_HZ for Xen)arch/i386/mach-xen/setup-xen.c drivers/xen/Kconfig drivers/xen/core/time.c +1 more+91 -00 replies
27/33Add the Xen virtual console driver.arch/i386/kernel/early_printk.c drivers/char/Kconfig drivers/xen/Makefile +4 more+824 -03 replies
28/33Add Xen grant table supportdrivers/xen/core/Makefile drivers/xen/core/gnttab.c include/xen/gnttab.h+534 -14 replies
29/33Add Xen driver utility functions.drivers/xen/Makefile drivers/xen/util.c include/xen/driver_util.h+88 -00 replies
30/33Add the Xenbus sysfs and virtual device hotplug driver.drivers/xen/Makefile drivers/xen/xenbus/Makefile drivers/xen/xenbus/xenbus_client.c +5 more+2782 -00 replies
31/33Add Xen subarch reboot supportarch/i386/kernel/Makefile drivers/xen/core/reboot.c+233 -01 reply
32/33Add the Xen virtual network device driver.drivers/net/Kconfig drivers/xen/Kconfig.net drivers/xen/Makefile +2 more+1606 -012 replies
33/33Add Xen virtual block device driver.drivers/block/Kconfig drivers/xen/Kconfig.blk drivers/xen/Makefile +4 more+1202 -06 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/33] 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.

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 all have reviewed earlier versions of these patches. -chris
--