Skip to content

Comet: Run PV in PVH container

Wei Liu xen-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest62 patches 2 repliesIn review
  2. v1 RFC74 patches 131 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/62x86/svm: Offer CPUID Faulting to AMD HVM guests as wellxen/arch/x86/hvm/svm/svm.c xen/arch/x86/msr.c+8 -10 replies
2/62xen/x86: report domain id on cpuidxen/arch/x86/traps.c xen/include/public/arch-x86/cpuid.h+7 -00 replies
3/62tools/libxc: remove extraneous newline in xc_dom_load_acpitools/libxc/xc_dom_core.c+1 -10 replies
4/62tools/libelf: fix elf notes check for PVH guestxen/arch/x86/hvm/dom0_build.c xen/common/libelf/libelf-dominfo.c+8 -50 replies
5/62tools/libxc: Multi modules supportstubdom/grub/kexec.c tools/helpers/init-xenstore-domain.c tools/libxc/include/xc_dom.h +4 more+175 -1130 replies
6/62xen/common: Widen the guest logging buffer slightlyxen/include/xen/sched.h+1 -10 replies
7/62x86/time: Print a more helpful error when a platform timer can't be foundxen/arch/x86/time.c+2 -10 replies
8/62x86/link: Introduce and use SECTION_ALIGNxen/arch/x86/xen.lds.S+13 -370 replies
9/62ACPICA: Make ACPI Power Management Timer (PM Timer) optional.xen/drivers/acpi/tables/tbfadt.c+3 -20 replies
10/62xen/domctl: Return arch_config via getdomaininfotools/libxc/include/xenctrl.h tools/libxc/xc_domain.c xen/arch/x86/domctl.c +1 more+6 -10 replies
11/62tools/ocaml: Expose arch_config in domaininfotools/ocaml/libs/xc/xenctrl.ml tools/ocaml/libs/xc/xenctrl.mli tools/ocaml/libs/xc/xenctrl_stubs.c+81 -20 replies
12/62tools/ocaml: Extend domain_create() to take arch_domainconfigtools/ocaml/libs/xc/xenctrl.ml tools/ocaml/libs/xc/xenctrl.mli tools/ocaml/libs/xc/xenctrl_stubs.c+22 -40 replies
13/62x86/fixmap: Modify fix_to_virt() to return a void pointerxen/arch/x86/acpi/lib.c xen/arch/x86/mm.c xen/arch/x86/mpparse.c +7 more+12 -130 replies
14/62x86: Common cpuid faulting supportxen/arch/x86/cpu/amd.c xen/arch/x86/cpu/common.c xen/arch/x86/cpu/intel.c +2 more+98 -820 replies
15/62x86/Kconfig: Options for Xen and PVH supportxen/arch/x86/Kconfig+17 -00 replies
16/62x86/link: Relocate program headersxen/arch/x86/xen.lds.S+13 -90 replies
17/62x86: introduce ELFNOTE macroxen/include/asm-x86/asm_defns.h+12 -00 replies
18/62x86: produce a binary that can be booted as PVH.gitignore xen/arch/x86/Makefile xen/arch/x86/boot/head.S +1 more+26 -10 replies
19/62x86/entry: Early PVH boot codexen/arch/x86/Makefile xen/arch/x86/boot/head.S xen/arch/x86/boot/x86_64.S +5 more+268 -40 replies
20/62x86/boot: Map more than the first 16MBxen/arch/x86/boot/x86_64.S+1 -20 replies
21/62x86/entry: Probe for Xen early during bootxen/arch/x86/guest/Makefile xen/arch/x86/guest/xen.c xen/arch/x86/setup.c +2 more+127 -00 replies
22/62x86/guest: Hypercall supportxen/arch/x86/guest/Makefile xen/arch/x86/guest/hypercall_page.S xen/arch/x86/guest/xen.c +3 more+179 -00 replies
23/62x86/shutdown: Support for using SCHEDOP_{shutdown, reboot}docs/misc/xen-command-line.markdown xen/arch/x86/shutdown.c xen/include/asm-x86/guest/hypercall.h+65 -40 replies
24/62x86/pvh: Retrieve memory map from Xenxen/arch/x86/e820.c xen/arch/x86/guest/pvh-boot.c xen/arch/x86/guest/xen.c +3 more+36 -30 replies
25/62xen/console: Introduce console=xenxen/drivers/char/console.c xen/include/asm-x86/guest/hypercall.h+59 -00 replies
26/62xen: introduce rangeset_claim_rangexen/common/rangeset.c xen/include/xen/rangeset.h+55 -10 replies
27/62xen/pvshim: keep track of used PFN rangesxen/arch/x86/guest/xen.c xen/arch/x86/setup.c xen/include/asm-x86/guest/xen.h+66 -00 replies
28/62x86/guest: map shared_info pagexen/arch/x86/guest/xen.c xen/include/asm-x86/fixmap.h xen/include/asm-x86/guest/xen.h+35 -00 replies
29/62xen/guest: fetch vCPU ID from Xenxen/arch/x86/guest/xen.c xen/arch/x86/smpboot.c xen/include/asm-x86/guest/xen.h+34 -00 replies
30/62x86/guest: map per-cpu vcpu_info area.xen/arch/x86/guest/xen.c xen/include/asm-x86/guest/hypercall.h xen/include/asm-x86/guest/xen.h+66 -00 replies
31/62x86: xen pv clock time sourcexen/arch/x86/time.c+89 -02 replies
32/62x86: APIC timer calibration when running as a guestxen/arch/x86/apic.c+30 -80 replies
33/62x86: read wallclock from Xen when running in pvh modexen/arch/x86/time.c+28 -40 replies
34/62x86: don't swallow the first command line item in guest modexen/arch/x86/setup.c+2 -20 replies
35/62x86/guest: setup event channel upcall vectorxen/arch/x86/guest/xen.c xen/include/asm-x86/guest/hypercall.h+58 -00 replies
36/62x86/guest: add PV console codexen/drivers/char/Makefile xen/drivers/char/xen_pv_console.c xen/include/asm-x86/fixmap.h +2 more+272 -00 replies
37/62x86/guest: use PV console for Xen/Dom0 I/Odocs/misc/xen-command-line.markdown xen/arch/x86/guest/xen.c xen/drivers/char/console.c+23 -10 replies
38/62x86/shim: Kconfig and command line optionsdocs/misc/xen-command-line.markdown xen/arch/x86/Kconfig xen/arch/x86/pv/Makefile +3 more+116 -00 replies
39/62tools/firmware: Build and install xen-shim.gitignore tools/firmware/Makefile tools/firmware/xen-dir/Makefile +2 more+172 -30 replies
40/62xen/x86: make VGA support selectabletools/firmware/xen-dir/shim.config xen/arch/x86/Kconfig xen/arch/x86/boot/build32.mk +8 more+39 -50 replies
41/62xen/pvh: do not mark the low 1MB as IO memxen/arch/x86/mm.c+7 -20 replies
42/62sched/null: skip vCPUs on the waitqueue that are blockedxen/common/sched_null.c+9 -20 replies
43/62xen/pvshim: skip Dom0-only domain builder partsxen/arch/x86/dom0_build.c xen/arch/x86/pv/dom0_build.c+6 -10 replies
44/62xen: mark xenstore/console pages as RAMxen/arch/x86/e820.c xen/arch/x86/guest/xen.c xen/common/page_alloc.c +2 more+80 -00 replies
45/62xen/pvshim: modify Dom0 builder in order to build a DomUxen/arch/x86/pv/dom0_build.c xen/arch/x86/pv/shim.c xen/include/asm-x86/dom0_build.h +1 more+126 -100 replies
46/62xen/pvshim: set correct domid valuexen/arch/x86/dom0_build.c xen/arch/x86/guest/xen.c xen/arch/x86/pv/shim.c +4 more+66 -60 replies
47/62xen/pvshim: forward evtchn ops between L0 Xen and L2 DomUxen/arch/x86/compat.c xen/arch/x86/guest/xen.c xen/arch/x86/pv/hypercall.c +7 more+402 -460 replies
48/62xen/pvshim: add grant table operationsxen/arch/x86/pv/shim.c xen/include/asm-x86/guest/hypercall.h+170 -00 replies
49/62x86/pv-shim: shadow PV console's page for L2 DomUxen/arch/x86/pv/shim.c xen/drivers/char/Makefile xen/drivers/char/console.c +2 more+209 -40 replies
50/62xen/pvshim: add migration supportxen/arch/x86/guest/xen.c xen/arch/x86/pv/shim.c xen/common/domain.c +5 more+197 -150 replies
51/62xen/pvshim: add shim_mem cmdline parameterdocs/misc/xen-command-line.markdown xen/arch/x86/dom0_build.c xen/arch/x86/pv/shim.c +1 more+85 -10 replies
52/62xen/pvshim: set max_pages to the value of tot_pagesxen/arch/x86/pv/shim.c+6 -00 replies
53/62xen/pvshim: support vCPU hotplugxen/arch/x86/pv/shim.c xen/common/domain.c xen/include/asm-x86/pv/shim.h +1 more+102 -120 replies
54/62xen/pvshim: memory hotplugxen/arch/x86/pv/shim.c xen/common/memory.c xen/include/asm-x86/pv/shim.h+143 -00 replies
55/62xen/shim: modify shim_mem parameter behaviourdocs/misc/xen-command-line.markdown xen/arch/x86/dom0_build.c xen/arch/x86/pv/shim.c+29 -280 replies
56/62xen/pvshim: use default position for the m2p mappingsxen/arch/x86/pv/dom0_build.c+2 -10 replies
57/62xen/shim: crash instead of reboot in shim modexen/arch/x86/shutdown.c xen/drivers/char/console.c+10 -10 replies
58/62xen/shim: allow DomU to have as many vcpus as availablexen/arch/x86/dom0_build.c xen/arch/x86/pv/dom0_build.c xen/arch/x86/setup.c+46 -140 replies
59/62libxl: pvshim: Provide first-class config settings to enable shim modetools/libxl/libxl.h tools/libxl/libxl_create.c tools/libxl/libxl_dom.c +2 more+77 -161 reply
60/62libxl: pvshim: Introduce pvshim_extratools/libxl/libxl.h tools/libxl/libxl_create.c tools/libxl/libxl_internal.h +1 more+7 -30 replies
61/62xl: pvshim: Provide and document xl configdocs/man/xl.cfg.pod.5.in tools/xl/xl_parse.c+49 -00 replies
62/62xl: Default guest mode changed from PV to PVH with PV shimtools/xl/xl_parse.c+10 -30 replies

Reviews trailers per patch

16 of 62 patches have a Reviewed-by or Acked-by.

PatchAndrew CooperWei LiuJan Beulich
1/62
2/62
3/62R-b
4/62R-b
5/62
6/62R-b
7/62R-b
8/62R-b
9/62
10/62R-b
11/62
12/62
13/62R-b
14/62
15/62
16/62
17/62
18/62
19/62
20/62
21/62
22/62
23/62R-b
24/62
25/62
26/62
27/62
28/62
29/62R-b
30/62
31/62
32/62R-b
33/62R-b
34/62
35/62
36/62
37/62
38/62
39/62
40/62R-b
41/62
42/62
43/62A-b
44/62
45/62
46/62
47/62
48/62
49/62
50/62
51/62
52/62A-b
53/62
54/62
55/62
56/62A-b
57/62A-b
58/62
59/62
60/62
61/62
62/62

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 00/62] Comet: Run PV in PVH container

Hi all

This is a patch series to run PV guest inside a PVH container. It should also support running under HVM mode but we've not extensively tested it. The future plan is for this to merge with the Vixen work Amazon did.

The series can be found at:

https://xenbits.xen.org/git-http/people/liuw/xen.git wip.pvshim-v2.3

The basic idea can be found at page 15 of the slides at [0]. This can be used to mitigate Meltdown as stated in [1].

The difference between Comet and Vixen is discussed somewhere else. Please consult those threads to pick the right short term solution.

This version now has a functional toolstack. A lot of comments in the previous version are addressed, but there are leftovers.

Instructions on using the shim:

1. Git clone the branch and configure as you normally would.
2. A xen-shim binary would be built and installed into Xen's firmware
directory, along side hvmloader and co.
3. Append the following options to guest config file
type = 'pvh'
pvshim = 1
pvshim_cmdline = "xxxx" # if any
pvshim_extra = "xxxx"
Please see xl manpage for more information.
I personally use
pvshim_cmdline="pv-shim console=xen,pv loglvl=all guest_loglvl=all apic_verbosity=debug e820-verbose sched=null"
to get more debugging output.
4. xl create -c guest.cfg

You should be able to see some Xen messages first and then guest kernel messages.

The patch series is split into three parts. Please see the markers.

# Host patches

c2b5d19366 x86/svm: Offer CPUID Faulting to AMD HVM guests as well de1db54d3d xen/x86: report domain id on cpuid
feaddf0628 tools/libxc: remove extraneous newline in xc_dom_load_acpi 2d73544d60 tools/libelf: fix elf notes check for PVH guest 605ecc28ab tools/libxc: Multi modules support
8daffd4bba xen/common: Widen the guest logging buffer slightly

# Shim patches

2008783b68 x86/time: Print a more helpful error when a platform timer can't be found aa43415bec x86/link: Introduce and use SECTION_ALIGN
53d943eeb8 ACPICA: Make ACPI Power Management Timer (PM Timer) optional. 030f8d0fd6 xen/domctl: Return arch_config via getdomaininfo
79fcb598ae tools/ocaml: Expose arch_config in domaininfo
990438cd5d tools/ocaml: Extend domain_create() to take arch_domainconfig bd2ccf4c6f x86/fixmap: Modify fix_to_virt() to return a void pointer 8c36939118 x86: Common cpuid faulting support
edcad6ef4b x86/Kconfig: Options for Xen and PVH support
a5446dbf31 x86/link: Relocate program headers
80b3a08f9c x86: introduce ELFNOTE macro
068933f37a x86: produce a binary that can be booted as PVH
3acd23e0a1 x86/entry: Early PVH boot code
cdd1de873d x86/boot: Map more than the first 16MB
3f6c1c33ec x86/entry: Probe for Xen early during boot
855856e857 x86/guest: Hypercall support
f204a73fef x86/shutdown: Support for using SCHEDOP_{shutdown,reboot} 3c9590135d x86/pvh: Retrieve memory map from Xen
85cfd2a735 xen/console: Introduce console=xen
47ad4ecf25 xen: introduce rangeset_claim_range
971b5c8d1f xen/pvshim: keep track of used PFN ranges
e3039f2df0 x86/guest: map shared_info page
3997881097 xen/guest: fetch vCPU ID from Xen
d693b10299 x86/guest: map per-cpu vcpu_info area.
c582962ac7 x86: xen pv clock time source
2e8afc1ead x86: APIC timer calibration when running as a guest b5a6e58ff3 x86: read wallclock from Xen when running in pvh mode bc3e5e866a x86: don't swallow the first command line item in guest mode 09cedc3af3 x86/guest: setup event channel upcall vector
8343a651ea x86/guest: add PV console code
ec8fb8f7a1 x86/guest: use PV console for Xen/Dom0 I/O
1ec222a153 x86/shim: Kconfig and command line options
0620686d72 tools/firmware: Build and install xen-shim
536339a994 xen/x86: make VGA support selectable
21f0a6ed97 xen/pvh: do not mark the low 1MB as IO mem
db104c0391 sched/null: skip vCPUs on the waitqueue that are blocked 549dba6a5a xen/pvshim: skip Dom0-only domain builder parts
1bba66e4c7 xen: mark xenstore/console pages as RAM
b907ed7322 xen/pvshim: modify Dom0 builder in order to build a DomU 867380c40e xen/pvshim: set correct domid value
d3682baafb xen/pvshim: forward evtchn ops between L0 Xen and L2 DomU 25f682b751 xen/pvshim: add grant table operations
c538c7f635 x86/pv-shim: shadow PV console's page for L2 DomU 85d142a053 xen/pvshim: add migration support
92612a97ef xen/pvshim: add shim_mem cmdline parameter
1f64261cca xen/pvshim: set max_pages to the value of tot_pages f9f9265f0e xen/pvshim: support vCPU hotplug
7f723b6dff xen/pvshim: memory hotplug
5016c05fc9 xen/shim: modify shim_mem parameter behaviour
4f4cf3304a xen/pvshim: use default position for the m2p mappings c7bde74df9 xen/shim: crash instead of reboot in shim mode
f842ed539a xen/shim: allow DomU to have as many vcpus as available

# Toolstack patches

5c43c5721c libxl: pvshim: Provide first-class config settings to enable shim mode 6833537050 libxl: pvshim: Introduce pvshim_extra
c128981e73 xl: pvshim: Provide and document xl config
4689dc2e29 xl: Default guest mode changed from PV to PVH with PV shim

Wei.

[0] https://www.slideshare.net/xen_com_mgr/xpdds17-keynote-towards-a-configurable-and-slimmer-x86-hypervisor-wei-liu-citrix
[1] https://xenbits.xen.org/xsa/advisory-254.html

 .gitignore                            |   5 +
 docs/man/xl.cfg.pod.5.in              |  35 ++
 docs/misc/xen-command-line.markdown   |  36 +-
 stubdom/grub/kexec.c                  |   7 +-
 tools/firmware/Makefile               |   9 +
 tools/firmware/xen-dir/Makefile       |  59 +++
 tools/firmware/xen-dir/shim.config    |  85 +++
 tools/helpers/init-xenstore-domain.c  |   4 +-
 tools/libxc/include/xc_dom.h          |  48 +-
 tools/libxc/include/xenctrl.h         |   1 +
 tools/libxc/xc_dom_compat_linux.c     |   2 +-
 tools/libxc/xc_dom_core.c             | 154 ++++--
 tools/libxc/xc_dom_x86.c              |  65 +--
 tools/libxc/xc_domain.c               |   1 +
 tools/libxl/libxl.h                   |   8 +
 tools/libxl/libxl_create.c            |  22 +-
 tools/libxl/libxl_dom.c               |  67 ++-
 tools/libxl/libxl_internal.h          |   4 +
 tools/libxl/libxl_types.idl           |   6 +-
 tools/ocaml/libs/xc/xenctrl.ml        |  31 +-
 tools/ocaml/libs/xc/xenctrl.mli       |  30 +-
 tools/ocaml/libs/xc/xenctrl_stubs.c   |  48 +-
 tools/xl/xl_parse.c                   |  25 +-
 xen/Makefile                          |  16 +-
 xen/arch/x86/Kconfig                  |  40 +-
 xen/arch/x86/Makefile                 |   9 +
 xen/arch/x86/acpi/lib.c               |   2 +-
 xen/arch/x86/apic.c                   |  38 +-
 xen/arch/x86/boot/build32.mk          |   1 +
 xen/arch/x86/boot/cmdline.c           |   5 +-
 xen/arch/x86/boot/head.S              |  47 ++
 xen/arch/x86/boot/trampoline.S        |   7 +
 xen/arch/x86/boot/x86_64.S            |   5 +-
 xen/arch/x86/compat.c                 |   4 +-
 xen/arch/x86/cpu/amd.c                |  16 +-
 xen/arch/x86/cpu/common.c             |  76 ++-
 xen/arch/x86/cpu/intel.c              |  81 +--
 xen/arch/x86/dom0_build.c             |  48 +-
 xen/arch/x86/domctl.c                 |   2 +
 xen/arch/x86/e820.c                   |   7 +-
 xen/arch/x86/efi/efi-boot.h           |   4 +
 xen/arch/x86/guest/Makefile           |   4 +
 xen/arch/x86/guest/hypercall_page.S   |  79 +++
 xen/arch/x86/guest/pvh-boot.c         | 139 +++++
 xen/arch/x86/guest/xen.c              | 388 ++++++++++++++
 xen/arch/x86/hvm/dom0_build.c         |   4 -
 xen/arch/x86/hvm/svm/svm.c            |   6 +
 xen/arch/x86/mm.c                     |  13 +-
 xen/arch/x86/mpparse.c                |   2 +-
 xen/arch/x86/msi.c                    |   3 +-
 xen/arch/x86/msr.c                    |   3 +-
 xen/arch/x86/platform_hypercall.c     |   2 +
 xen/arch/x86/pv/Makefile              |   1 +
 xen/arch/x86/pv/dom0_build.c          |  58 ++-
 xen/arch/x86/pv/hypercall.c           |  17 +
 xen/arch/x86/pv/shim.c                | 957 ++++++++++++++++++++++++++++++++++
 xen/arch/x86/setup.c                  |  84 ++-
 xen/arch/x86/shutdown.c               |  39 +-
 xen/arch/x86/smpboot.c                |   4 +
 xen/arch/x86/tboot.c                  |   4 +-
 xen/arch/x86/time.c                   | 124 ++++-
 xen/arch/x86/traps.c                  |   5 +
 xen/arch/x86/xen.lds.S                |  82 ++-
 xen/common/domain.c                   |  53 +-
 xen/common/event_channel.c            |  99 ++--
 xen/common/libelf/libelf-dominfo.c    |   9 +-
 xen/common/memory.c                   |  21 +
 xen/common/page_alloc.c               |  15 +
 xen/common/rangeset.c                 |  52 ++
 xen/common/sched_null.c               |  11 +-
 xen/common/schedule.c                 |   3 +-
 xen/drivers/acpi/apei/apei-io.c       |   2 +-
 xen/drivers/acpi/tables/tbfadt.c      |   5 +-
 xen/drivers/char/Makefile             |   2 +
 xen/drivers/char/console.c            |  72 +++
 xen/drivers/char/consoled.c           | 148 ++++++
 xen/drivers/char/ehci-dbgp.c          |   2 +-
 xen/drivers/char/ns16550.c            |   2 +-
 xen/drivers/char/xen_pv_console.c     | 208 ++++++++
 xen/drivers/video/Kconfig             |   8 +-
 xen/include/asm-x86/apicdef.h         |   2 +-
 xen/include/asm-x86/asm_defns.h       |  12 +
 xen/include/asm-x86/cpuid.h           |   3 -
 xen/include/asm-x86/dom0_build.h      |   4 +
 xen/include/asm-x86/e820.h            |   1 +
 xen/include/asm-x86/fixmap.h          |   6 +-
 xen/include/asm-x86/guest.h           |  37 ++
 xen/include/asm-x86/guest/hypercall.h | 206 ++++++++
 xen/include/asm-x86/guest/pvh-boot.h  |  57 ++
 xen/include/asm-x86/guest/xen.h       |  92 ++++
 xen/include/asm-x86/hypercall.h       |   3 +
 xen/include/asm-x86/processor.h       |   4 +-
 xen/include/asm-x86/pv/shim.h         | 107 ++++
 xen/include/asm-x86/setup.h           |   6 +
 xen/include/public/arch-x86/cpuid.h   |   2 +
 xen/include/public/domctl.h           |   3 +-
 xen/include/xen/consoled.h            |  27 +
 xen/include/xen/domain.h              |   1 +
 xen/include/xen/event.h               |  15 +
 xen/include/xen/pv_console.h          |  38 ++
 xen/include/xen/rangeset.h            |   4 +-
 xen/include/xen/sched.h               |   4 +-
 102 files changed, 4106 insertions(+), 418 deletions(-)
 create mode 100644 tools/firmware/xen-dir/Makefile
 create mode 100644 tools/firmware/xen-dir/shim.config
 create mode 100644 xen/arch/x86/guest/Makefile
 create mode 100644 xen/arch/x86/guest/hypercall_page.S
 create mode 100644 xen/arch/x86/guest/pvh-boot.c
 create mode 100644 xen/arch/x86/guest/xen.c
 create mode 100644 xen/arch/x86/pv/shim.c
 create mode 100644 xen/drivers/char/consoled.c
 create mode 100644 xen/drivers/char/xen_pv_console.c
 create mode 100644 xen/include/asm-x86/guest.h
 create mode 100644 xen/include/asm-x86/guest/hypercall.h
 create mode 100644 xen/include/asm-x86/guest/pvh-boot.h
 create mode 100644 xen/include/asm-x86/guest/xen.h
 create mode 100644 xen/include/asm-x86/pv/shim.h
 create mode 100644 xen/include/xen/consoled.h
 create mode 100644 xen/include/xen/pv_console.h
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel