All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/34] Make CONFIG_HVM work
@ 2018-08-17 15:12 Wei Liu
  2018-08-17 15:12 ` [PATCH 01/34] x86: fix building !CONFIG_LOCK_PROFILE Wei Liu
                   ` (35 more replies)
  0 siblings, 36 replies; 130+ messages in thread
From: Wei Liu @ 2018-08-17 15:12 UTC (permalink / raw)
  To: xen-devel; +Cc: Wei Liu

This series goes through x86 code to make CONFIG_HVM work.

With this series, it is possible to build Xen with PV support only.

Running `xl info` on a host with PV only Xen:

root@lcy2-dt108:~# xl info
host                   : lcy2-dt108
release                : 4.17.0-0.bpo.1-amd64
version                : #1 SMP Debian 4.17.8-1~bpo9+1 (2018-07-23)
machine                : x86_64
nr_cpus                : 8
max_cpu_id             : 7
nr_nodes               : 1
cores_per_socket       : 4
threads_per_core       : 2
cpu_mhz                : 3504.057
hw_caps                :
bfebfbff:77faf3ff:2c100800:00000121:0000000f:009c6fbf:00000000:00000100
virt_caps              : hvm_directio
total_memory           : 32589
free_memory            : 4158
sharing_freed_memory   : 0
sharing_used_memory    : 0
outstanding_claims     : 0
free_cpus              : 0
xen_major              : 4
xen_minor              : 12
xen_extra              : -unstable
xen_version            : 4.12-unstable
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p
xen_scheduler          : credit
xen_pagesize           : 4096
platform_params        : virt_start=0xffff800000000000
xen_changeset          : Fri Aug 17 12:53:34 2018 +0100 git:382ad34e4e
xen_commandline        : placeholder loglvl=all guest_loglvl=all
com2=115200,8n1 ucode=scan console=com2,vga console_to_ring
sync_console hvm_fep
cc_compiler            : gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
cc_compile_by          : wei
cc_compile_domain      : uk.xensource.com
cc_compile_date        : Fri Aug 17 14:41:56 BST 2018
build_id               : 3989ecb7693aa02f6ecc748a951ed444cc70ba94
xend_config_format     : 4

The hvm_directio flag is not accurate. See the last patch for
discussion.

The major goal at the moment is to get something that works first,
then refine code structure later.  Currently CONFIG_HVM is littered in
individual files. In the future some of the code could / should be
moved to files under hvm/ for cleaner split.

I ran some basic PV / PVSHIM VM life cycle tests and XTF PV tests, all
worked.

$ ls -l xen # PV only, non-debug
-rwxrwxr-x 1 wei wei 1957436 Aug 17 15:32 xen
$ ls -l xen # default build, non-debug
-rwxrwxr-x 1 wei wei 2379388 Aug 17 15:39 xen

The PV only Xen is ~17.8% smaller in size.

Wei.

Wei Liu (34):
  x86: fix building !CONFIG_LOCK_PROFILE
  x86/vvmx: make get_shadow_eptp static function
  x86: HVM_FEP should depend on HVM
  x86/mm: don't reference hvm_funcs directly
  xen: is_hvm_domain should evaluate to 0 when !CONFIG_HVM
  x86: fix two unused variable errors when !CONFIG_HVM
  x86: only call memory_type_changed for HVM guests
  x86: enclose hvm_op and dm_op in CONFIG_HVM in PV hypercall table
  x86: guard HAS_VPCI with CONFIG_HVM
  x86: stub out has_* testing for emulation flags
  xen/pt: io.c contains HVM only code
  x86/pt: only call some functions for HVM guests
  x86/pt: split out HVM functions from vtd.c
  x86/pt: add HVM check to XEN_DOMCTL_unbind_pt_irq
  x86/nestedhvm: make it build with !CONFIG_HVM
  x86/hvm: enclose hvm_enabled and hvm_funcs in CONFIG_HVM
  x86/vmce: enclose HVM load / save code in CONFIG_HVM
  x86/amd: skip OSVW function calls if !CONFIG_HVM
  x86: check HVM before trying to get ioreq server
  x86/mtrr: move is_var_mtrr_overlapped
  x86/mm: p2m_flush and nvcpu_flush are HVM only
  x86/mm: put HVM only code under CONFIG_HVM
  x86/oprofile: put SVM only code under CONFIG_HVM
  x86/mem_access: put HVM only function under CONFIG_HVM
  x86/mm/shadow: make it build with !CONFIG_HVM
  x86/mm/shadow: split out HVM only code
  x86: make hvm_inject_* functions build when !CONFIG_HVM
  x86/vm_event: put vm_event_fill_regs under CONFIG_HVM
  x86/mm: put paging_update_nestedmode under CONFIG_HVM
  x86: PIT emulation is common to PV and HVM
  xen: refuse to create HVM guests when !CONFIG_HVM
  x86: expose CONFIG_HVM
  x86/pvshim: disable HVM for PV shim
  RFC x86: introduce directio virt cap

 tools/firmware/xen-dir/shim.config       |   2 +-
 xen/arch/arm/Kconfig                     |   3 +-
 xen/arch/x86/Kconfig                     |   9 +-
 xen/arch/x86/Makefile                    |   1 +-
 xen/arch/x86/cpu/mcheck/vmce.c           |   2 +-
 xen/arch/x86/cpu/mtrr/generic.c          |  31 +-
 xen/arch/x86/domain.c                    |   3 +-
 xen/arch/x86/domctl.c                    |   8 +-
 xen/arch/x86/emul-i8254.c                | 506 +++++++++++++++++++++-
 xen/arch/x86/hvm/i8254.c                 | 462 +-------------------
 xen/arch/x86/hvm/mtrr.c                  |  31 +-
 xen/arch/x86/hvm/nestedhvm.c             |  21 +-
 xen/arch/x86/hvm/vmsi.c                  |   4 +-
 xen/arch/x86/hvm/vmx/vmx.c               |   8 +-
 xen/arch/x86/hvm/vmx/vvmx.c              |   2 +-
 xen/arch/x86/microcode_amd.c             |   4 +-
 xen/arch/x86/mm.c                        |   6 +-
 xen/arch/x86/mm/Makefile                 |   5 +-
 xen/arch/x86/mm/hap/Makefile             |   2 +-
 xen/arch/x86/mm/mem_access.c             |   2 +-
 xen/arch/x86/mm/p2m.c                    |  26 +-
 xen/arch/x86/mm/paging.c                 |   2 +-
 xen/arch/x86/mm/shadow/Makefile          |   1 +-
 xen/arch/x86/mm/shadow/common.c          | 559 +-----------------------
 xen/arch/x86/mm/shadow/hvm.c             | 590 ++++++++++++++++++++++++-
 xen/arch/x86/mm/shadow/multi.c           |  27 +-
 xen/arch/x86/oprofile/op_model_athlon.c  |   5 +-
 xen/arch/x86/pv/hypercall.c              |   4 +-
 xen/arch/x86/sysctl.c                    |   4 +-
 xen/arch/x86/vm_event.c                  |   2 +-
 xen/common/domain.c                      |   8 +-
 xen/common/domctl.c                      |   5 +-
 xen/common/spinlock.c                    |   2 +-
 xen/common/vm_event.c                    |   2 +-
 xen/drivers/passthrough/Makefile         |   4 +-
 xen/drivers/passthrough/iommu.c          |   3 +-
 xen/drivers/passthrough/pci.c            |   2 +-
 xen/drivers/passthrough/vtd/iommu.c      |   6 +-
 xen/drivers/passthrough/vtd/x86/Makefile |   3 +-
 xen/drivers/passthrough/vtd/x86/hvm.c    |  77 +++-
 xen/drivers/passthrough/vtd/x86/vtd.c    |  45 +--
 xen/include/asm-x86/domain.h             |  24 +-
 xen/include/asm-x86/hvm/domain.h         |   4 +-
 xen/include/asm-x86/hvm/hvm.h            |  19 +-
 xen/include/asm-x86/hvm/nestedhvm.h      |  19 +-
 xen/include/asm-x86/hvm/vmx/vvmx.h       |   2 +-
 xen/include/asm-x86/hvm/vpt.h            |   9 +-
 xen/include/asm-x86/mtrr.h               |   2 +-
 xen/include/xen/sched.h                  |   6 +-
 49 files changed, 1435 insertions(+), 1139 deletions(-)
 create mode 100644 xen/arch/x86/emul-i8254.c
 create mode 100644 xen/arch/x86/mm/shadow/hvm.c
 create mode 100644 xen/drivers/passthrough/vtd/x86/hvm.c

base-commit: effed864104ad9bee3f72a2a7d9fb2146b8bf122
-- 
git-series 0.9.1

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

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

end of thread, other threads:[~2018-08-27  9:12 UTC | newest]

Thread overview: 130+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-17 15:12 [PATCH 00/34] Make CONFIG_HVM work Wei Liu
2018-08-17 15:12 ` [PATCH 01/34] x86: fix building !CONFIG_LOCK_PROFILE Wei Liu
2018-08-17 15:37   ` Wei Liu
2018-08-17 15:12 ` [PATCH 02/34] x86/vvmx: make get_shadow_eptp static function Wei Liu
2018-08-22  2:48   ` Tian, Kevin
2018-08-17 15:12 ` [PATCH 03/34] x86: HVM_FEP should depend on HVM Wei Liu
2018-08-21  8:06   ` Roger Pau Monné
2018-08-17 15:12 ` [PATCH 04/34] x86/mm: don't reference hvm_funcs directly Wei Liu
2018-08-20  9:28   ` Andrew Cooper
2018-08-20 10:21     ` Wei Liu
2018-08-17 15:12 ` [PATCH 05/34] xen: is_hvm_domain should evaluate to 0 when !CONFIG_HVM Wei Liu
2018-08-19 16:48   ` Andrew Cooper
2018-08-20  9:06     ` Wei Liu
2018-08-20  9:23       ` Andrew Cooper
2018-08-20  9:45         ` Wei Liu
2018-08-20 11:51   ` Jan Beulich
2018-08-21 16:31     ` Wei Liu
2018-08-21 18:33       ` Julien Grall
2018-08-21 18:49         ` Wei Liu
2018-08-21 18:50           ` Julien Grall
2018-08-21 18:59             ` Stefano Stabellini
2018-08-21 20:08               ` Wei Liu
2018-08-22 15:11                 ` Julien Grall
2018-08-22 15:20                   ` Wei Liu
2018-08-17 15:12 ` [PATCH 06/34] x86: fix two unused variable errors " Wei Liu
2018-08-21  8:09   ` Roger Pau Monné
2018-08-21  8:11     ` Andrew Cooper
2018-08-17 15:12 ` [PATCH 07/34] x86: only call memory_type_changed for HVM guests Wei Liu
2018-08-20 11:57   ` Jan Beulich
2018-08-22 16:12     ` Wei Liu
2018-08-17 15:12 ` [PATCH 08/34] x86: enclose hvm_op and dm_op in CONFIG_HVM in PV hypercall table Wei Liu
2018-08-20 11:59   ` Jan Beulich
2018-08-20 13:09     ` Wei Liu
2018-08-17 15:12 ` [PATCH 09/34] x86: guard HAS_VPCI with CONFIG_HVM Wei Liu
2018-08-20 12:03   ` Jan Beulich
2018-08-17 15:12 ` [PATCH 10/34] x86: stub out has_* testing for emulation flags Wei Liu
2018-08-20 12:37   ` Jan Beulich
2018-08-22 16:43     ` Wei Liu
2018-08-17 15:12 ` [PATCH 11/34] xen/pt: io.c contains HVM only code Wei Liu
2018-08-20 12:41   ` Jan Beulich
2018-08-17 15:12 ` [PATCH 12/34] x86/pt: only call some functions for HVM guests Wei Liu
2018-08-20 12:48   ` Jan Beulich
2018-08-22 17:08     ` Wei Liu
2018-08-17 15:12 ` [PATCH 13/34] x86/pt: split out HVM functions from vtd.c Wei Liu
2018-08-20 12:05   ` Jan Beulich
2018-08-21 10:30     ` Wei Liu
2018-08-17 15:12 ` [PATCH 14/34] x86/pt: add HVM check to XEN_DOMCTL_unbind_pt_irq Wei Liu
2018-08-20 12:51   ` Jan Beulich
2018-08-17 15:12 ` [PATCH 15/34] x86/nestedhvm: make it build with !CONFIG_HVM Wei Liu
2018-08-20 12:57   ` Jan Beulich
2018-08-17 15:12 ` [PATCH 16/34] x86/hvm: enclose hvm_enabled and hvm_funcs in CONFIG_HVM Wei Liu
2018-08-20 13:04   ` Jan Beulich
2018-08-24 16:25     ` Wei Liu
2018-08-17 15:12 ` [PATCH 17/34] x86/vmce: enclose HVM load / save code " Wei Liu
2018-08-20 13:04   ` Jan Beulich
2018-08-17 15:12 ` [PATCH 18/34] x86/amd: skip OSVW function calls if !CONFIG_HVM Wei Liu
2018-08-20 13:06   ` Jan Beulich
2018-08-17 15:12 ` [PATCH 19/34] x86: check HVM before trying to get ioreq server Wei Liu
2018-08-20 13:08   ` Jan Beulich
2018-08-17 15:12 ` [PATCH 20/34] x86/mtrr: move is_var_mtrr_overlapped Wei Liu
2018-08-21  7:58   ` Jan Beulich
2018-08-21 14:12     ` Wei Liu
2018-08-17 15:12 ` [PATCH 21/34] x86/mm: p2m_flush and nvcpu_flush are HVM only Wei Liu
2018-08-21  8:01   ` Jan Beulich
2018-08-22 14:14     ` Wei Liu
2018-08-24 17:19       ` Wei Liu
2018-08-17 15:12 ` [PATCH 22/34] x86/mm: put HVM only code under CONFIG_HVM Wei Liu
2018-08-19 16:27   ` Razvan Cojocaru
2018-08-24 16:25     ` Wei Liu
2018-08-21  8:07   ` Jan Beulich
2018-08-22 14:14     ` Wei Liu
2018-08-24 17:05     ` Wei Liu
2018-08-17 15:12 ` [PATCH 23/34] x86/oprofile: put SVM " Wei Liu
2018-08-21  8:12   ` Jan Beulich
2018-08-17 15:12 ` [PATCH 24/34] x86/mem_access: put HVM only function " Wei Liu
2018-08-19 16:36   ` Razvan Cojocaru
2018-08-17 15:12 ` [PATCH 25/34] x86/mm/shadow: make it build with !CONFIG_HVM Wei Liu
2018-08-21  8:27   ` Jan Beulich
2018-08-24 20:40     ` Wei Liu
2018-08-26 11:04     ` Wei Liu
2018-08-27  7:46       ` Jan Beulich
2018-08-27  9:12         ` Wei Liu
2018-08-21  8:29   ` Roger Pau Monné
2018-08-21  8:41     ` Jan Beulich
2018-08-24 20:39     ` Wei Liu
2018-08-21  8:41   ` Jan Beulich
2018-08-24 20:26     ` Wei Liu
2018-08-24  6:56   ` Tim Deegan
2018-08-17 15:12 ` [PATCH 26/34] x86/mm/shadow: split out HVM only code Wei Liu
2018-08-21 11:36   ` Jan Beulich
2018-08-24  6:57   ` Tim Deegan
2018-08-17 15:12 ` [PATCH 27/34] x86: make hvm_inject_* functions build when !CONFIG_HVM Wei Liu
2018-08-21  8:37   ` Roger Pau Monné
2018-08-24 16:27     ` Wei Liu
2018-08-21 11:39   ` Jan Beulich
2018-08-17 15:12 ` [PATCH 28/34] x86/vm_event: put vm_event_fill_regs under CONFIG_HVM Wei Liu
2018-08-19 16:41   ` Razvan Cojocaru
2018-08-21 10:45     ` Wei Liu
2018-08-21 11:00       ` Razvan Cojocaru
2018-08-17 15:12 ` [PATCH 29/34] x86/mm: put paging_update_nestedmode " Wei Liu
2018-08-21 11:41   ` Jan Beulich
2018-08-24 16:28     ` Wei Liu
2018-08-17 15:12 ` [PATCH 30/34] x86: PIT emulation is common to PV and HVM Wei Liu
2018-08-21  8:03   ` Roger Pau Monné
2018-08-21 11:43   ` Jan Beulich
2018-08-17 15:12 ` [PATCH 31/34] xen: refuse to create HVM guests when !CONFIG_HVM Wei Liu
2018-08-20 12:59   ` Andrew Cooper
2018-08-21 10:41     ` Wei Liu
2018-08-21 18:35       ` Julien Grall
2018-08-21 11:46   ` Jan Beulich
2018-08-17 15:12 ` [PATCH 32/34] x86: expose CONFIG_HVM Wei Liu
2018-08-21 11:48   ` Jan Beulich
2018-08-21 12:49     ` Andrew Cooper
2018-08-21 12:57       ` Jan Beulich
2018-08-17 15:12 ` [PATCH 33/34] x86/pvshim: disable HVM for PV shim Wei Liu
2018-08-21  8:40   ` Roger Pau Monné
2018-08-17 15:12 ` [PATCH 34/34] RFC x86: introduce directio virt cap Wei Liu
2018-08-21  8:32   ` Roger Pau Monné
2018-08-21 10:25     ` Wei Liu
2018-08-21 10:40       ` Roger Pau Monné
2018-08-21 10:43         ` Wei Liu
2018-08-21 11:52   ` Jan Beulich
2018-08-21 13:43     ` Wei Liu
2018-08-21 15:40       ` Jan Beulich
2018-08-21 16:02         ` Wei Liu
2018-08-21 16:11           ` Jan Beulich
2018-08-17 15:55 ` [PATCH 00/34] Make CONFIG_HVM work Konrad Rzeszutek Wilk
2018-08-17 16:00   ` Wei Liu
2018-08-20  9:13 ` Andrew Cooper
2018-08-20  9:16   ` Wei Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.