Skip to content

Q35 initial support for HVM guests

Thierry Escande xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest17 patches 70 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17libacpi: Split dsdt.asl file and extract i440 specific partstools/firmware/hvmloader/Makefile tools/firmware/hvmloader/ovmf.c tools/firmware/hvmloader/seabios.c +5 more+53 -365 replies
2/17libacpi: new DSDT ACPI table for Q35tools/firmware/hvmloader/Makefile tools/libacpi/Makefile tools/libacpi/dsdt.asl +1 more+135 -25 replies
3/17hvmloader: add function to set the emulated machine type (i440/Q35)tools/firmware/hvmloader/hvmloader.c tools/firmware/hvmloader/pci_regs.h tools/firmware/hvmloader/util.c +1 more+59 -07 replies
4/17hvmloader: add ACPI enabling for Q35tools/firmware/hvmloader/hvmloader.c+17 -23 replies
5/17hvmloader: add Q35 DSDT table loadingtools/firmware/hvmloader/util.c tools/firmware/hvmloader/util.h+17 -22 replies
6/17hvmloader: Move pci devices setup to a separate functiontools/firmware/hvmloader/pci.c tools/firmware/hvmloader/pci_regs.h+68 -534 replies
7/17hvmloader: add basic Q35 supporttools/firmware/hvmloader/config.h tools/firmware/hvmloader/pci.c tools/firmware/hvmloader/pci_regs.h+31 -54 replies
8/17hvmloader: Extend PCI BAR structtools/firmware/hvmloader/pci.c+35 -234 replies
9/17xev/hvm: Add HVMOP_get|set_ecam_space hypercallsxen/arch/x86/hvm/hvm.c xen/arch/x86/include/asm/domain.h xen/include/public/hvm/hvm_op.h+67 -06 replies
10/17hvmloader: Add support for HVMOP_set|get_ecam_space hypercallstools/firmware/hvmloader/util.c tools/firmware/hvmloader/util.h+30 -01 reply
11/17hvmloader: allocate MMCONFIG area in the MMIO holetools/firmware/hvmloader/config.h tools/firmware/hvmloader/pci.c tools/firmware/hvmloader/pci_regs.h+66 -06 replies
12/17libxl: Q35 support (new option device_model_machine)tools/libs/light/libxl_dm.c tools/libs/light/libxl_types.idl tools/xl/xl_parse.c+31 -63 replies
13/17libxl: Add xen-platform device for Q35 machinetools/libs/light/libxl_dm.c+6 -01 reply
14/17libacpi: build ACPI MCFG table if requestedtools/libacpi/acpi2_0.h tools/libacpi/build.c tools/libacpi/libacpi.h+66 -02 replies
15/17hvmloader: Set MCFG in ACPI tabletools/firmware/hvmloader/e820.c tools/firmware/hvmloader/util.c+20 -02 replies
16/17Handle PCIe ECAM space access from guestsxen/arch/x86/hvm/ioreq.c+15 -03 replies
17/17docs: provide description for device_model_machine optiondocs/man/xl.cfg.5.pod.in+27 -03 replies

Reviews trailers per patch

1 of 17 patches has a Reviewed-by or Acked-by.

PatchRoger Pau Monné
1/17
2/17
3/17
4/17R-b
5/17
6/17
7/17
8/17
9/17
10/17
11/17
12/17
13/17
14/17
15/17
16/17
17/17

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/17] Q35 initial support for HVM guests

This series introduces initial Q35 chipset support for HVM guests, based on the patchset at [1] by Alexey Gerasimenko.

Basic support means that this patchset allows to start an HVM guest that emulates a Q35 chipset via Qemu and implements access to PCIe extended configuration space for such devices emulated by Qemu.

Support for PCIe device passthrough is not implemented yet. This is planned but implies modifications in the hypervisor and the firmwares, mainly for the support of multiple PCI buses.

In order to create a Q35 guest, a new domain config option has been added, named 'device_model_machine'. Possible values are:
- "i440" - i440 emulation (default)
- "q35" - emulate a Q35 machine

If the option is omitted it defaults to "i440", not impacting existing domain configuration files.

DSDT files for Q35 and i440 are largely similar so the existing file dsdt.asl has been split with i440 and q35 specific parts put in seperated files.

The PCIe MMCONFIG area is configured by hvmloader and its base address and size are set in Xen using a new pair of hypercalls HVMOP_get|set_ecam_space. Access to the MMCONFIG area from a guest is trapped by Xen and transfered to the emulator as XEN_DMOP_IO_RANGE_PCI ioreq type.

[1] https://lore.kernel.org/xen-devel/[email protected]/

Thierry Escande (17):
libacpi: Split dsdt.asl file and extract i440 specific parts
libacpi: new DSDT ACPI table for Q35
hvmloader: add function to set the emulated machine type (i440/Q35)
hvmloader: add ACPI enabling for Q35
hvmloader: add Q35 DSDT table loading
hvmloader: Move pci devices setup to a separate function
hvmloader: add basic Q35 support
hvmloader: Extend PCI BAR struct
xev/hvm: Add HVMOP_get|set_ecam_space hypercalls
hvmloader: Add support for HVMOP_set|get_ecam_space hypercalls
hvmloader: allocate MMCONFIG area in the MMIO hole
libxl: Q35 support (new option device_model_machine)
libxl: Add xen-platform device for Q35 machine
libacpi: build ACPI MCFG table if requested
hvmloader: Set MCFG in ACPI table
Handle PCIe ECAM space access from guests
docs: provide description for device_model_machine option

 docs/man/xl.cfg.5.pod.in             |  27 +++
 tools/firmware/hvmloader/Makefile    |   2 +-
 tools/firmware/hvmloader/config.h    |   5 +
 tools/firmware/hvmloader/e820.c      |  11 ++
 tools/firmware/hvmloader/hvmloader.c |  21 ++-
 tools/firmware/hvmloader/ovmf.c      |   4 +-
 tools/firmware/hvmloader/pci.c       | 264 +++++++++++++++++++--------
 tools/firmware/hvmloader/pci_regs.h  |  16 ++
 tools/firmware/hvmloader/seabios.c   |   4 +-
 tools/firmware/hvmloader/util.c      |  94 +++++++++-
 tools/firmware/hvmloader/util.h      |  21 ++-
 tools/libacpi/Makefile               |  10 +-
 tools/libacpi/acpi2_0.h              |  17 ++
 tools/libacpi/build.c                |  43 +++++
 tools/libacpi/dsdt.asl               |  28 +--
 tools/libacpi/dsdt_i440.asl          |  36 ++++
 tools/libacpi/dsdt_q35.asl           | 130 +++++++++++++
 tools/libacpi/libacpi.h              |   6 +
 tools/libs/light/libxl_dm.c          |  22 ++-
 tools/libs/light/libxl_types.idl     |   7 +
 tools/xl/xl_parse.c                  |  14 ++
 xen/arch/x86/hvm/hvm.c               |  52 ++++++
 xen/arch/x86/hvm/ioreq.c             |  15 ++
 xen/arch/x86/include/asm/domain.h    |   4 +
 xen/include/public/hvm/hvm_op.h      |  11 ++
 25 files changed, 739 insertions(+), 125 deletions(-)
 create mode 100644 tools/libacpi/dsdt_i440.asl
 create mode 100644 tools/libacpi/dsdt_q35.asl
Signature · 10 lines
2.51.0



--
Thierry Escande | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech