[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 00/34] Make CONFIG_HVM work
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@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |