mbox series

[for-next,v2,0/9] Port Xen to Hyper-V

Message ID 20190930150044.5734-1-liuwe@microsoft.com (mailing list archive)
Headers show
Series Port Xen to Hyper-V | expand

Message

Wei Liu Sept. 30, 2019, 3 p.m. UTC
Hi all

This is version 2 of the patch series.

This is the very first stage for porting Xen to run on Hyper-V with all the
goodies Hyper-V has to offer.  With this series, Xen can successfully detect
Hyper-V and prints out a message.  I would like to first get the code structure
and kconfig options agreed upon.

There are two major areas to be worked on:
  * Make Dom0 able to use Hyper-V's synthetic devices.
  * Make Xen use of the synthetic timer, reference TSC and enlightenment VMCS
    and other interfaces.

They aren't trivial, and time can be scarce on my side, so I intend to post
patches piece meal when they are ready.

Questions and comments are welcome.

Thanks,
Wei.

---
Changes in v2:
1. Introduce and use a hypervisor framework
2. Keep memmap infra under Xen for now

Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Wei Liu <wl@xen.org>
Cc: Roger Pau Monné <roger.pau@citrix.com>

Wei Liu (9):
  x86: introduce CONFIG_GUEST and move code
  x86: include asm_defns.h directly in hypercall.h
  x86: drop hypervisor_cpuid_base
  x86: include xen/lib.h in guest/hypercall.h
  x86: introduce hypervisor framework
  x86: rename hypervisor_{alloc,free}_unused_page
  x86: switch xen implementation to use hypervisor framework
  x86: be more verbose when running on a hypervisor
  x86: introduce CONFIG_HYPERV and detection code

 xen/arch/x86/Kconfig                          | 13 +++
 xen/arch/x86/Makefile                         |  2 +-
 xen/arch/x86/guest/Makefile                   |  6 +-
 xen/arch/x86/guest/hyperv/Makefile            |  1 +
 xen/arch/x86/guest/hyperv/hyperv.c            | 69 ++++++++++++++++
 xen/arch/x86/guest/hypervisor.c               | 82 +++++++++++++++++++
 xen/arch/x86/guest/xen/Makefile               |  4 +
 xen/arch/x86/guest/{ => xen}/hypercall_page.S |  0
 xen/arch/x86/guest/{ => xen}/pvh-boot.c       |  2 +-
 xen/arch/x86/guest/{ => xen}/xen.c            | 39 ++++-----
 xen/arch/x86/pv/shim.c                        |  6 +-
 xen/arch/x86/setup.c                          |  6 +-
 xen/include/asm-x86/guest.h                   |  2 +
 xen/include/asm-x86/guest/hypercall.h         |  4 +
 xen/include/asm-x86/guest/hyperv.h            | 45 ++++++++++
 xen/include/asm-x86/guest/hypervisor.h        | 63 ++++++++++++++
 xen/include/asm-x86/guest/xen.h               | 24 ++----
 17 files changed, 321 insertions(+), 47 deletions(-)
 create mode 100644 xen/arch/x86/guest/hyperv/Makefile
 create mode 100644 xen/arch/x86/guest/hyperv/hyperv.c
 create mode 100644 xen/arch/x86/guest/hypervisor.c
 create mode 100644 xen/arch/x86/guest/xen/Makefile
 rename xen/arch/x86/guest/{ => xen}/hypercall_page.S (100%)
 rename xen/arch/x86/guest/{ => xen}/pvh-boot.c (99%)
 rename xen/arch/x86/guest/{ => xen}/xen.c (93%)
 create mode 100644 xen/include/asm-x86/guest/hyperv.h
 create mode 100644 xen/include/asm-x86/guest/hypervisor.h

Comments

Wei Liu Sept. 30, 2019, 3 p.m. UTC | #1
Hi all

In case you're wondering, I can already run a fully fledged Xen system on
Hyper-V with emulated disk and network.

This is the very first stage for porting Xen to run on Hyper-V with all the
goodies Hyper-V has to offer.  With this series, Xen can successfully detect
Hyper-V and prints out a message.  I would like to first get the directory
structure and kconfig options agreed upon.

There are two major areas to be worked on:
  * Make Dom0 able to use Hyper-V's synthetic devices.
  * Make Xen use of the synthetic timer, reference TSC and enlightenment VMCS
    and other interfaces.

They aren't trivial, and time can be scarce on my side, so I intend to post
patches piece meal when they are ready.

Questions and comments are welcome.

Thanks,
Wei.

Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Wei Liu <wl@xen.org>
Cc: Roger Pau Monné <roger.pau@citrix.com>

Wei Liu (8):
  x86: introduce CONFIG_GUEST and move code
  x86: include asm_defns.h directly in hypercall.h
  x86: drop hypervisor_cpuid_base
  x86: factor out xen variants for hypervisor setup code
  x86: factor out hypervisor agnostic code
  x86: make probe_xen return boolean value
  x86: introduce CONFIG_HYPERV and hyperv directory
  x86: be more verbose when running nested

 xen/arch/x86/Kconfig                          |  13 ++
 xen/arch/x86/Makefile                         |   2 +-
 xen/arch/x86/guest/Makefile                   |   6 +-
 xen/arch/x86/guest/hyperv/Makefile            |   1 +
 xen/arch/x86/guest/hyperv/hyperv.c            |  63 ++++++++++
 xen/arch/x86/guest/hypervisor.c               | 116 ++++++++++++++++++
 xen/arch/x86/guest/xen/Makefile               |   4 +
 xen/arch/x86/guest/{ => xen}/hypercall_page.S |   0
 xen/arch/x86/guest/{ => xen}/pvh-boot.c       |   0
 xen/arch/x86/guest/{ => xen}/xen.c            |  73 ++---------
 xen/arch/x86/pv/shim.c                        |   2 +-
 xen/arch/x86/setup.c                          |  11 ++
 xen/include/asm-x86/guest.h                   |   2 +
 xen/include/asm-x86/guest/hypercall.h         |   2 +
 xen/include/asm-x86/guest/hyperv.h            |  48 ++++++++
 xen/include/asm-x86/guest/hypervisor.h        |  58 +++++++++
 xen/include/asm-x86/guest/xen.h               |  23 +---
 17 files changed, 337 insertions(+), 87 deletions(-)
 create mode 100644 xen/arch/x86/guest/hyperv/Makefile
 create mode 100644 xen/arch/x86/guest/hyperv/hyperv.c
 create mode 100644 xen/arch/x86/guest/hypervisor.c
 create mode 100644 xen/arch/x86/guest/xen/Makefile
 rename xen/arch/x86/guest/{ => xen}/hypercall_page.S (100%)
 rename xen/arch/x86/guest/{ => xen}/pvh-boot.c (100%)
 rename xen/arch/x86/guest/{ => xen}/xen.c (80%)
 create mode 100644 xen/include/asm-x86/guest/hyperv.h
 create mode 100644 xen/include/asm-x86/guest/hypervisor.h
Wei Liu Oct. 21, 2019, 8:58 a.m. UTC | #2
On Mon, Sep 30, 2019 at 04:00:34PM +0100, Wei Liu wrote:
> Hi all
> 
> This is version 2 of the patch series.
> 
> This is the very first stage for porting Xen to run on Hyper-V with all the
> goodies Hyper-V has to offer.  With this series, Xen can successfully detect
> Hyper-V and prints out a message.  I would like to first get the code structure
> and kconfig options agreed upon.
> 
> There are two major areas to be worked on:
>   * Make Dom0 able to use Hyper-V's synthetic devices.
>   * Make Xen use of the synthetic timer, reference TSC and enlightenment VMCS
>     and other interfaces.
> 
> They aren't trivial, and time can be scarce on my side, so I intend to post
> patches piece meal when they are ready.
> 
> Questions and comments are welcome.
> 
> Thanks,
> Wei.
> 
> ---
> Changes in v2:
> 1. Introduce and use a hypervisor framework
> 2. Keep memmap infra under Xen for now

Ping?

Can I get an high level agreement on the code structure such that I can
continue building on top of this series?

Wei.