|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 12/17] libxl: Q35 support (new option device_model_machine)
On Fri, Mar 13, 2026 at 04:35:04PM +0000, Thierry Escande wrote:
> Provide a new domain config option to select the emulated machine type,
> device_model_machine. It has following possible values:
> - "i440" - i440 emulation (default)
> - "q35" - emulate a Q35 machine. By default, the storage interface is
> AHCI.
>
> Note that omitting device_model_machine parameter means i440 system
> by default, so the default behavior doesn't change for existing domain
> config files.
>
> Setting device_model_machine to "q35" sends '-machine q35,accel=xen'
> argument to QEMU. Unlike i440, there is no separated machine type to
> enable/disable Xen platform device, it is controlled via a machine
> property only. See 'libxl: Add xen-platform device for Q35 machine'
> patch for a detailed description.
Not an explicit objection to this patch, but I wonder what will we do
for PVH when we start exposing PCI devices. We cannot provide a fully
complete emulated Q35, but we do need to expose an MCFG for extended
config space. The current naming "device_model_machine" won't work
for PVH, as there's no device model there. But at the same time I
wonder whether what we end up exposing to PVH would resemble any
physical chipsets, or it's more likely going to be the minimum needed
to make PVH guests happy to access the PCI config space (and hence we
might end up emulating too little to match any chipset).
Thanks, Roger.
>
> Signed-off-by: Alexey Gerasimenko <x1917x@xxxxxxxxx>
> Signed-off-by: Thierry Escande <thierry.escande@xxxxxxxxxx>
> ---
> tools/libs/light/libxl_dm.c | 16 ++++++++++------
> tools/libs/light/libxl_types.idl | 7 +++++++
> tools/xl/xl_parse.c | 14 ++++++++++++++
> 3 files changed, 31 insertions(+), 6 deletions(-)
>
> diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
> index 511ec76a65..36f2813cde 100644
> --- a/tools/libs/light/libxl_dm.c
> +++ b/tools/libs/light/libxl_dm.c
> @@ -1562,13 +1562,17 @@ static int
> libxl__build_device_model_args_new(libxl__gc *gc,
> flexarray_append(dm_args, b_info->extra_pv[i]);
> break;
> case LIBXL_DOMAIN_TYPE_HVM:
> - if (!libxl_defbool_val(b_info->u.hvm.xen_platform_pci)) {
> - /* Switching here to the machine "pc" which does not add
> - * the xen-platform device instead of the default "xenfv"
> machine.
> - */
> - machinearg = libxl__strdup(gc,
> "pc,accel=xen,suppress-vmdesc=on");
> + if (b_info->device_model_machine == LIBXL_DEVICE_MODEL_MACHINE_Q35) {
> + machinearg = libxl__sprintf(gc, "q35,accel=xen");
> } else {
> - machinearg = libxl__strdup(gc, "xenfv,suppress-vmdesc=on");
> + if (!libxl_defbool_val(b_info->u.hvm.xen_platform_pci)) {
> + /* Switching here to the machine "pc" which does not add
> + * the xen-platform device instead of the default "xenfv"
> machine.
> + */
> + machinearg = libxl__strdup(gc,
> "pc,accel=xen,suppress-vmdesc=on");
> + } else {
> + machinearg = libxl__strdup(gc, "xenfv,suppress-vmdesc=on");
> + }
> }
> if (b_info->u.hvm.mmio_hole_memkb) {
> uint64_t max_ram_below_4g = (1ULL << 32) -
> diff --git a/tools/libs/light/libxl_types.idl
> b/tools/libs/light/libxl_types.idl
> index d64a573ff3..f9cd881b66 100644
> --- a/tools/libs/light/libxl_types.idl
> +++ b/tools/libs/light/libxl_types.idl
> @@ -109,6 +109,12 @@ libxl_device_model_version =
> Enumeration("device_model_version", [
> (2, "QEMU_XEN"), # Upstream based qemu-xen device model
> ])
>
> +libxl_device_model_machine = Enumeration("device_model_machine", [
> + (0, "UNKNOWN"),
> + (1, "I440"),
> + (2, "Q35"),
> + ])
> +
> libxl_console_type = Enumeration("console_type", [
> (0, "UNKNOWN"),
> (1, "SERIAL"),
> @@ -613,6 +619,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
> ("device_model_ssidref", uint32),
> ("device_model_ssid_label", string),
> ("device_model_user", string),
> + ("device_model_machine", libxl_device_model_machine),
This possibly wants to be inside the u.hvm sub-structure. I don't
think we want to use it for PVH, not with this current naming at
least.
Thanks, Roger.
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |