xen queue
The following changes since commit 19361471b59441cd6f2aa22d4fbee7a6e9e76586:
Merge tag 'pull-la-20220705' of https://gitlab.com/rth7680/qemu into staging (2022-07-05 16:30:52 +0530)
are available in the Git repository at:
https://xenbits.xen.org/git-http/people/aperard/qemu-dm.git tags/pull-xen-20220705
for you to fetch changes up to c0e86b7624cb9d6db03e0d48cf82659e5b89a6a6:
xen/pass-through: don't create needless register group (2022-07-05 14:19:48 +0100)
----------------------------------------------------------------
Xen patches
- Xen PCI passthrough fixes
----------------------------------------------------------------
Chuck Zmudzinski (2):
xen/pass-through: merge emulated bits correctly xen/pass-through: don't create needless register group
hw/xen/xen_pt_config_init.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-)
[PULL 1/2] xen/pass-through: merge emulated bits correctly
From: Chuck Zmudzinski <[email protected]>
In xen_pt_config_reg_init(), there is an error in the merging of the emulated data with the host value. With the current Qemu, instead of merging the emulated bits with the host bits as defined by emu_mask, the emulated bits are merged with the host bits as defined by the inverse of emu_mask. In some cases, depending on the data in the registers on the host, the way the registers are setup, and the initial values of the emulated bits, the end result will be that the register is initialized with the wrong value.
To correct this error, use the XEN_PT_MERGE_VALUE macro to help ensure the merge is done correctly.
This correction is needed to resolve Qemu project issue #1061, which describes the failure of Xen HVM Linux guests to boot in certain configurations with passed through PCI devices, that is, when this error disables instead of enables the PCI_STATUS_CAP_LIST bit of the PCI_STATUS register of a passed through PCI device, which in turn disables the MSI-X capability of the device in Linux guests with the end result being that the Linux guest never completes the boot process.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1061
Message-Id: <e4392535d8e5266063dc5461d0f1d301e3dd5951.1656522217.git.brchuckz@aol.com>
--- hw/xen/xen_pt_config_init.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
hw/xen/xen_pt_config_init.c +6 -5
@@ -1965,11 +1965,12 @@ static void xen_pt_config_reg_init(XenPCIPassthroughState *s,if ((data & host_mask) != (val & host_mask)) {uint32_t new_val; - -/* Mask out host (including past size). */ - new_val = val & host_mask; -/* Merge emulated ones (excluding the non-emulated ones). */ - new_val |= data & host_mask; +/* +* Merge the emulated bits (data) with the host bits (val) +* and mask out the bits past size to enable restoration +* of the proper value for logging below. +*/ + new_val =XEN_PT_MERGE_VALUE (val, data, host_mask) & size_mask;/* Leave intact host and emulated values past the size - even though * we do not care as we write per reg->size granularity, but for the * logging below lets have the proper value. */
Signature · 1 line
Anthony PERARD
[PULL 2/2] xen/pass-through: don't create needless register group
In reply to Anthony PERARD viaFrom: Chuck Zmudzinski <[email protected]>
Currently we are creating a register group for the Intel IGD OpRegion for every device we pass through, but the XEN_PCI_INTEL_OPREGION register group is only valid for an Intel IGD. Add a check to make sure the device is an Intel IGD and a check that the administrator has enabled gfx_passthru in the xl domain configuration. Require both checks to be true before creating the register group. Use the existing is_igd_vga_passthrough() function to check for a graphics device from any vendor and that the administrator enabled gfx_passthru in the xl domain configuration, but further require that the vendor be Intel, because only Intel IGD devices have an Intel OpRegion. These are the same checks hvmloader and libxl do to determine if the Intel OpRegion needs to be mapped into the guest's memory. Also, move the comment about trapping 0xfc for the Intel OpRegion where it belongs after applying this patch.
Message-Id: <c76dff6369ccf2256bd9eed5141da1db767293d2.1656480662.git.brchuckz@aol.com>
--- hw/xen/xen_pt_config_init.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
hw/xen/xen_pt_config_init.c +9 -5
@@ -2032,12 +2032,16 @@ void xen_pt_config_init(XenPCIPassthroughState *s, Error **errp) } } -/* -* By default we will trap up to 0x40 in the cfg space. -* If an intel device is pass through we need to trap 0xfc, -* therefore the size should be 0xff. -*/ if (xen_pt_emu_reg_grps[i].grp_id ==XEN_PCI_INTEL_OPREGION ) { +if (!is_igd_vga_passthrough (&s->real_device) || + s->real_device.vendor_id !=PCI_VENDOR_ID_INTEL ) { +continue ; + } +/* +* By default we will trap up to 0x40 in the cfg space. +* If an intel device is pass through we need to trap 0xfc, +* therefore the size should be 0xff. +*/ reg_grp_offset =XEN_PCI_INTEL_OPREGION ; }
Signature · 1 line
Anthony PERARD
Richard Henderson
AppliedQuoted 8 lines · Anthony PERARD via
The following changes since commit
19361471b59441cd6f2aa22d4fbee7a6e9e76586:Merge tag 'pull-la-20220705' of https://gitlab.com/rth7680/qemu into staging (2022-07-05 16:30:52 +0530)are available in the Git repository at:
https://xenbits.xen.org/git-http/people/aperard/qemu-dm.git tags/pull-xen-20220705
Quoted 8 lines
for you to fetch changes up to
c0e86b7624cb9d6db03e0d48cf82659e5b89a6a6:xen/pass-through: don't create needless register group (2022-07-05 14:19:48 +0100)----------------------------------------------------------------
Xen patches- Xen PCI passthrough fixes
Applied, thanks. Please update https://wiki.qemu.org/ChangeLog/7.1 as appropriate.
r~
Quoted 9 lines
----------------------------------------------------------------
Chuck Zmudzinski (2):
xen/pass-through: merge emulated bits correctly xen/pass-through: don't create needless register grouphw/xen/xen_pt_config_init.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-)