All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Wei Liu <wei.liu2@citrix.com>
Subject: [PATCH v2 00/23] Make CONFIG_HVM work
Date: Sun, 26 Aug 2018 13:19:33 +0100	[thread overview]
Message-ID: <cover.65253d1128f698146b48c4ff3bba2198f360c7b1.1535285866.git-series.wei.liu2@citrix.com> (raw)

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.241
hw_caps                : bfebfbff:77faf3ff:2c100800:00000121:0000000f:009c6fbf:00000000:00000100
virt_caps              : directio
total_memory           : 32589
free_memory            : 1033
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          : Sun Aug 26 12:36:59 2018 +0100 git:7668e6dcc6
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        : Sun Aug 26 12:37:04 BST 2018
build_id               : 1a2fb4652d8c26e5590bba6652049696a97ad2ab
xend_config_format     : 4

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.

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

$ ls -l xen # PV only, non-debug
-rwxrwxr-x 1 wei wei 1920572 Aug 26 12:37 xen

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

Wei.

Wei Liu (23):
  x86: change name of parameter for various invlpg functions
  xen: is_hvm_{domain,vcpu} should evaluate to false when !CONFIG_HVM
  x86: enclose hvm_op and dm_op in CONFIG_HVM in relevant tables
  x86/hvm: provide hvm_hap_supported
  x86: provide stub for memory_type_changed
  x86: don't call vpci function in physdev_op when !CONFIG_HAS_VPCI
  x86/vpmu: put HVM only code under CONFIG_HVM
  xen/pt: io.c contains HVM only code
  x86/pt: make it build with !CONFIG_HVM
  x86/pt: split out HVM functions from vtd.c
  x86: XENMEM_resource_ioreq_server is HVM only
  x86: monitor.o is currently HVM only
  x86: provide stubs, declarations and macros in hvm.h
  x86/mm: put nested p2m code under CONFIG_HVM
  x86/mm: put HVM only code under CONFIG_HVM
  x86/p2m/pod: make it build with !CONFIG_HVM
  x86/mm: put paging_update_nestedmode under CONFIG_HVM
  x86/domctl: XEN_DOMCTL_debug_op is HVM only
  x86: PIT emulation is common to both PV and HVM
  xen: connect guest creation with CONFIG_{HVM,PV}
  x86: expose CONFIG_HVM
  x86/pvshim: disable HVM for PV shim
  xen: decouple HVM and IOMMU capabilities

 tools/firmware/xen-dir/shim.config       |   2 +-
 tools/libxl/libxl.c                      |   5 +-
 tools/libxl/libxl.h                      |   6 +-
 tools/libxl/libxl_types.idl              |   1 +-
 tools/xl/xl_info.c                       |   5 +-
 xen/arch/arm/Kconfig                     |   3 +-
 xen/arch/x86/Kconfig                     |   6 +-
 xen/arch/x86/Makefile                    |   3 +-
 xen/arch/x86/cpu/vpmu.c                  |   6 +-
 xen/arch/x86/cpuid.c                     |   2 +-
 xen/arch/x86/domain.c                    |   8 +-
 xen/arch/x86/domctl.c                    |   2 +-
 xen/arch/x86/emul-i8254.c                | 609 ++++++++++++++++++++++++-
 xen/arch/x86/hvm/Makefile                |   1 +-
 xen/arch/x86/hvm/i8254.c                 | 597 +------------------------
 xen/arch/x86/hvm/svm/svm.c               |  14 +-
 xen/arch/x86/hvm/vmx/vmx.c               |  12 +-
 xen/arch/x86/hypercall.c                 |   4 +-
 xen/arch/x86/mm.c                        |  16 +-
 xen/arch/x86/mm/Makefile                 |   7 +-
 xen/arch/x86/mm/hap/hap.c                |   2 +-
 xen/arch/x86/mm/p2m.c                    |  23 +-
 xen/arch/x86/mm/paging.c                 |   2 +-
 xen/arch/x86/mm/shadow/multi.c           |  14 +-
 xen/arch/x86/mm/shadow/none.c            |   2 +-
 xen/arch/x86/physdev.c                   |   2 +-
 xen/arch/x86/pv/hypercall.c              |   4 +-
 xen/arch/x86/setup.c                     |   2 +-
 xen/arch/x86/sysctl.c                    |   2 +-
 xen/arch/x86/traps.c                     |   4 +-
 xen/common/domain.c                      |  14 +-
 xen/common/memory.c                      |   3 +-
 xen/common/vm_event.c                    |   2 +-
 xen/drivers/passthrough/Makefile         |   4 +-
 xen/drivers/passthrough/vtd/x86/Makefile |   3 +-
 xen/drivers/passthrough/vtd/x86/hvm.c    |  67 +++-
 xen/drivers/passthrough/vtd/x86/vtd.c    |  45 +--
 xen/include/asm-x86/hvm/domain.h         |   4 +-
 xen/include/asm-x86/hvm/hvm.h            | 160 +++++-
 xen/include/asm-x86/hvm/io.h             |   5 +-
 xen/include/asm-x86/hvm/svm/asid.h       |   4 +-
 xen/include/asm-x86/hvm/svm/svm.h        |   4 +-
 xen/include/asm-x86/hvm/vmx/vmx.h        |   5 +-
 xen/include/asm-x86/monitor.h            |  14 +-
 xen/include/asm-x86/mtrr.h               |   5 +-
 xen/include/asm-x86/p2m.h                |  40 +-
 xen/include/asm-x86/paging.h             |   3 +-
 xen/include/public/sysctl.h              |   8 +-
 xen/include/xen/sched.h                  |  13 +-
 49 files changed, 1048 insertions(+), 721 deletions(-)
 create mode 100644 xen/arch/x86/emul-i8254.c
 delete mode 100644 xen/arch/x86/hvm/i8254.c
 create mode 100644 xen/drivers/passthrough/vtd/x86/hvm.c

base-commit: e5d6ddcd31a6113e4a3db7a235ca78770fe8f401
-- 
git-series 0.9.1

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

             reply	other threads:[~2018-08-26 12:20 UTC|newest]

Thread overview: 97+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-26 12:19 Wei Liu [this message]
2018-08-26 12:19 ` [PATCH v2 01/23] x86: change name of parameter for various invlpg functions Wei Liu
2018-08-27 13:49   ` Boris Ostrovsky
2018-08-27 13:54     ` Jan Beulich
2018-08-27 14:20   ` Jan Beulich
2018-08-30  1:26   ` Tian, Kevin
2018-09-03 13:46   ` Wei Liu
2018-09-04 13:42     ` Boris Ostrovsky
2018-08-26 12:19 ` [PATCH v2 02/23] xen: is_hvm_{domain, vcpu} should evaluate to false when !CONFIG_HVM Wei Liu
2018-08-27 14:24   ` Jan Beulich
2018-08-28  8:41     ` Wei Liu
2018-08-28 11:09       ` Julien Grall
2018-08-26 12:19 ` [PATCH v2 03/23] x86: enclose hvm_op and dm_op in CONFIG_HVM in relevant tables Wei Liu
2018-08-27 14:24   ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 04/23] x86/hvm: provide hvm_hap_supported Wei Liu
2018-08-27 14:25   ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 05/23] x86: provide stub for memory_type_changed Wei Liu
2018-08-27 14:28   ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 06/23] x86: don't call vpci function in physdev_op when !CONFIG_HAS_VPCI Wei Liu
2018-08-27 14:29   ` Jan Beulich
2018-08-28  8:45     ` Wei Liu
2018-08-28  9:08       ` Jan Beulich
2018-08-29 16:23         ` Wei Liu
2018-08-26 12:19 ` [PATCH v2 07/23] x86/vpmu: put HVM only code under CONFIG_HVM Wei Liu
2018-08-27 15:03   ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 08/23] xen/pt: io.c contains HVM only code Wei Liu
2018-08-27 15:04   ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 09/23] x86/pt: make it build with !CONFIG_HVM Wei Liu
2018-08-27 15:07   ` Jan Beulich
2018-08-30  1:29   ` Tian, Kevin
2018-08-26 12:19 ` [PATCH v2 10/23] x86/pt: split out HVM functions from vtd.c Wei Liu
2018-08-30  1:29   ` Tian, Kevin
2018-08-26 12:19 ` [PATCH v2 11/23] x86: XENMEM_resource_ioreq_server is HVM only Wei Liu
2018-08-27 15:13   ` Jan Beulich
2018-08-29 16:28     ` Wei Liu
2018-08-26 12:19 ` [PATCH v2 12/23] x86: monitor.o is currently " Wei Liu
2018-08-26 16:33   ` Razvan Cojocaru
2018-08-27 15:18   ` Jan Beulich
2018-08-27 15:23     ` Razvan Cojocaru
2018-08-29 16:42     ` Wei Liu
2018-08-29 17:43       ` Tamas K Lengyel
2018-08-29 18:09         ` Razvan Cojocaru
2018-08-30  7:14           ` Wei Liu
2018-08-26 12:19 ` [PATCH v2 13/23] x86: provide stubs, declarations and macros in hvm.h Wei Liu
2018-08-27 15:43   ` Jan Beulich
2018-09-03  9:45   ` Paul Durrant
2018-09-03  9:50     ` Wei Liu
2018-08-26 12:19 ` [PATCH v2 14/23] x86/mm: put nested p2m code under CONFIG_HVM Wei Liu
2018-08-27 15:56   ` Jan Beulich
2018-08-28  8:40     ` Wei Liu
2018-08-28  9:10       ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 15/23] x86/mm: put HVM only " Wei Liu
2018-08-26 16:39   ` Razvan Cojocaru
2018-08-27  9:03   ` Wei Liu
2018-08-28 10:41     ` Wei Liu
2018-08-28 10:53       ` Jan Beulich
2018-08-27 16:01   ` Jan Beulich
2018-08-28 10:41     ` Wei Liu
2018-08-26 12:19 ` [PATCH v2 16/23] x86/p2m/pod: make it build with !CONFIG_HVM Wei Liu
2018-08-28 10:47   ` Jan Beulich
2018-08-28 10:54     ` Wei Liu
2018-08-28 11:32       ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 17/23] x86/mm: put paging_update_nestedmode under CONFIG_HVM Wei Liu
2018-08-28 10:50   ` Jan Beulich
2018-08-30  7:42     ` Wei Liu
2018-08-30  8:35       ` Jan Beulich
2018-09-03 14:27         ` Wei Liu
2018-09-03 14:48           ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 18/23] x86/domctl: XEN_DOMCTL_debug_op is HVM only Wei Liu
2018-08-28 10:50   ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 19/23] x86: PIT emulation is common to both PV and HVM Wei Liu
2018-08-28 11:44   ` Jan Beulich
2018-08-28 13:19     ` Wei Liu
2018-08-28 14:36       ` Jan Beulich
2018-08-28 14:48         ` Wei Liu
2018-08-28 14:51           ` Andrew Cooper
2018-08-28 14:58             ` Wei Liu
2018-08-28 15:04               ` Jan Beulich
2018-08-28 15:17                 ` Wei Liu
2018-08-28 14:56           ` Wei Liu
2018-08-26 12:19 ` [PATCH v2 20/23] xen: connect guest creation with CONFIG_{HVM, PV} Wei Liu
2018-08-28 11:07   ` Julien Grall
2018-08-28 13:13     ` Wei Liu
2018-08-28 11:47   ` Jan Beulich
2018-08-28 13:15     ` Wei Liu
2018-08-26 12:19 ` [PATCH v2 21/23] x86: expose CONFIG_HVM Wei Liu
2018-08-28 11:50   ` Jan Beulich
2018-08-28 12:14     ` Andrew Cooper
2018-08-28 13:33       ` Jan Beulich
2018-08-29 16:56         ` Andrew Cooper
2018-08-30  6:21           ` Jan Beulich
2018-08-30  6:57             ` Juergen Gross
2018-08-31 20:09             ` Andrew Cooper
2018-09-03 11:35               ` Jan Beulich
2018-08-26 12:19 ` [PATCH v2 22/23] x86/pvshim: disable HVM for PV shim Wei Liu
2018-08-26 12:19 ` [PATCH v2 23/23] xen: decouple HVM and IOMMU capabilities Wei Liu
2018-08-28 11:56   ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.65253d1128f698146b48c4ff3bba2198f360c7b1.1535285866.git-series.wei.liu2@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.