xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/62] Comet: Run PV in PVH container
@ 2018-01-12 11:28 Wei Liu
  2018-01-12 11:28 ` [PATCH v2 01/62] x86/svm: Offer CPUID Faulting to AMD HVM guests as well Wei Liu
                   ` (61 more replies)
  0 siblings, 62 replies; 66+ messages in thread
From: Wei Liu @ 2018-01-12 11:28 UTC (permalink / raw)
  To: Xen-devel; +Cc: wei.liu2

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

-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 66+ messages in thread

end of thread, other threads:[~2018-01-16 12:22 UTC | newest]

Thread overview: 66+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-12 11:28 [PATCH v2 00/62] Comet: Run PV in PVH container Wei Liu
2018-01-12 11:28 ` [PATCH v2 01/62] x86/svm: Offer CPUID Faulting to AMD HVM guests as well Wei Liu
2018-01-12 11:28 ` [PATCH v2 02/62] xen/x86: report domain id on cpuid Wei Liu
2018-01-12 11:28 ` [PATCH v2 03/62] tools/libxc: remove extraneous newline in xc_dom_load_acpi Wei Liu
2018-01-12 11:28 ` [PATCH v2 04/62] tools/libelf: fix elf notes check for PVH guest Wei Liu
2018-01-12 11:28 ` [PATCH v2 05/62] tools/libxc: Multi modules support Wei Liu
2018-01-12 11:28 ` [PATCH v2 06/62] xen/common: Widen the guest logging buffer slightly Wei Liu
2018-01-12 11:28 ` [PATCH v2 07/62] x86/time: Print a more helpful error when a platform timer can't be found Wei Liu
2018-01-12 11:28 ` [PATCH v2 08/62] x86/link: Introduce and use SECTION_ALIGN Wei Liu
2018-01-12 11:28 ` [PATCH v2 09/62] ACPICA: Make ACPI Power Management Timer (PM Timer) optional Wei Liu
2018-01-12 11:28 ` [PATCH v2 10/62] xen/domctl: Return arch_config via getdomaininfo Wei Liu
2018-01-12 11:28 ` [PATCH v2 11/62] tools/ocaml: Expose arch_config in domaininfo Wei Liu
2018-01-12 11:28 ` [PATCH v2 12/62] tools/ocaml: Extend domain_create() to take arch_domainconfig Wei Liu
2018-01-12 11:28 ` [PATCH v2 13/62] x86/fixmap: Modify fix_to_virt() to return a void pointer Wei Liu
2018-01-12 11:28 ` [PATCH v2 14/62] x86: Common cpuid faulting support Wei Liu
2018-01-12 11:28 ` [PATCH v2 15/62] x86/Kconfig: Options for Xen and PVH support Wei Liu
2018-01-12 11:28 ` [PATCH v2 16/62] x86/link: Relocate program headers Wei Liu
2018-01-12 11:28 ` [PATCH v2 17/62] x86: introduce ELFNOTE macro Wei Liu
2018-01-12 11:28 ` [PATCH v2 18/62] x86: produce a binary that can be booted as PVH Wei Liu
2018-01-12 11:28 ` [PATCH v2 19/62] x86/entry: Early PVH boot code Wei Liu
2018-01-12 11:28 ` [PATCH v2 20/62] x86/boot: Map more than the first 16MB Wei Liu
2018-01-12 11:28 ` [PATCH v2 21/62] x86/entry: Probe for Xen early during boot Wei Liu
2018-01-12 11:28 ` [PATCH v2 22/62] x86/guest: Hypercall support Wei Liu
2018-01-12 11:28 ` [PATCH v2 23/62] x86/shutdown: Support for using SCHEDOP_{shutdown, reboot} Wei Liu
2018-01-12 11:28 ` [PATCH v2 24/62] x86/pvh: Retrieve memory map from Xen Wei Liu
2018-01-12 11:28 ` [PATCH v2 25/62] xen/console: Introduce console=xen Wei Liu
2018-01-12 11:28 ` [PATCH v2 26/62] xen: introduce rangeset_claim_range Wei Liu
2018-01-12 11:28 ` [PATCH v2 27/62] xen/pvshim: keep track of used PFN ranges Wei Liu
2018-01-12 11:28 ` [PATCH v2 28/62] x86/guest: map shared_info page Wei Liu
2018-01-12 11:28 ` [PATCH v2 29/62] xen/guest: fetch vCPU ID from Xen Wei Liu
2018-01-12 11:28 ` [PATCH v2 30/62] x86/guest: map per-cpu vcpu_info area Wei Liu
2018-01-12 11:28 ` [PATCH v2 31/62] x86: xen pv clock time source Wei Liu
2018-01-12 20:45   ` Joao Martins
2018-01-16 12:22     ` Wei Liu
2018-01-12 11:28 ` [PATCH v2 32/62] x86: APIC timer calibration when running as a guest Wei Liu
2018-01-12 11:28 ` [PATCH v2 33/62] x86: read wallclock from Xen when running in pvh mode Wei Liu
2018-01-12 11:28 ` [PATCH v2 34/62] x86: don't swallow the first command line item in guest mode Wei Liu
2018-01-12 11:28 ` [PATCH v2 35/62] x86/guest: setup event channel upcall vector Wei Liu
2018-01-12 11:28 ` [PATCH v2 36/62] x86/guest: add PV console code Wei Liu
2018-01-12 11:28 ` [PATCH v2 37/62] x86/guest: use PV console for Xen/Dom0 I/O Wei Liu
2018-01-12 11:28 ` [PATCH v2 38/62] x86/shim: Kconfig and command line options Wei Liu
2018-01-12 11:28 ` [PATCH v2 39/62] tools/firmware: Build and install xen-shim Wei Liu
2018-01-12 11:28 ` [PATCH v2 40/62] xen/x86: make VGA support selectable Wei Liu
2018-01-12 11:28 ` [PATCH v2 41/62] xen/pvh: do not mark the low 1MB as IO mem Wei Liu
2018-01-12 11:28 ` [PATCH v2 42/62] sched/null: skip vCPUs on the waitqueue that are blocked Wei Liu
2018-01-12 11:28 ` [PATCH v2 43/62] xen/pvshim: skip Dom0-only domain builder parts Wei Liu
2018-01-12 11:28 ` [PATCH v2 44/62] xen: mark xenstore/console pages as RAM Wei Liu
2018-01-12 11:28 ` [PATCH v2 45/62] xen/pvshim: modify Dom0 builder in order to build a DomU Wei Liu
2018-01-12 11:28 ` [PATCH v2 46/62] xen/pvshim: set correct domid value Wei Liu
2018-01-12 11:28 ` [PATCH v2 47/62] xen/pvshim: forward evtchn ops between L0 Xen and L2 DomU Wei Liu
2018-01-12 11:28 ` [PATCH v2 48/62] xen/pvshim: add grant table operations Wei Liu
2018-01-12 11:28 ` [PATCH v2 49/62] x86/pv-shim: shadow PV console's page for L2 DomU Wei Liu
2018-01-12 11:28 ` [PATCH v2 50/62] xen/pvshim: add migration support Wei Liu
2018-01-12 11:28 ` [PATCH v2 51/62] xen/pvshim: add shim_mem cmdline parameter Wei Liu
2018-01-12 11:29 ` [PATCH v2 52/62] xen/pvshim: set max_pages to the value of tot_pages Wei Liu
2018-01-12 11:29 ` [PATCH v2 53/62] xen/pvshim: support vCPU hotplug Wei Liu
2018-01-12 11:29 ` [PATCH v2 54/62] xen/pvshim: memory hotplug Wei Liu
2018-01-12 11:29 ` [PATCH v2 55/62] xen/shim: modify shim_mem parameter behaviour Wei Liu
2018-01-12 11:29 ` [PATCH v2 56/62] xen/pvshim: use default position for the m2p mappings Wei Liu
2018-01-12 11:29 ` [PATCH v2 57/62] xen/shim: crash instead of reboot in shim mode Wei Liu
2018-01-12 11:29 ` [PATCH v2 58/62] xen/shim: allow DomU to have as many vcpus as available Wei Liu
2018-01-12 11:29 ` [PATCH v2 59/62] libxl: pvshim: Provide first-class config settings to enable shim mode Wei Liu
2018-01-12 14:45   ` [PATCH] fixup! " Ian Jackson
2018-01-12 11:29 ` [PATCH v2 60/62] libxl: pvshim: Introduce pvshim_extra Wei Liu
2018-01-12 11:29 ` [PATCH v2 61/62] xl: pvshim: Provide and document xl config Wei Liu
2018-01-12 11:29 ` [PATCH v2 62/62] xl: Default guest mode changed from PV to PVH with PV shim Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).