pci, vhost, virtio, iommu: features, fixes, cleanups
Subsystems (3)
[PULL 080/106] amd_iommu: Turn on XT support only when guest has enabled it
In reply to Michael S. TsirkinFrom: Sairaj Kodilkar <[email protected]>
Current code uses 32 bit destination ID irrespective of the fact that guest has enabled x2APIC support through control register[XTEn] and completely depends on command line parameter xtsup=on. This is not a correct hardware behaviour and can cause problems in the guest which has not enabled XT mode.
Introduce new flag "xten", which is enabled when guest writes 1 to the control register bit 50 (XTEn). Also, add a new subsection in VMStateDescription for backward compatibility during vm migration.
Message-Id: <[email protected]>
--- hw/i386/amd_iommu.c | 21 +++++++++++++++++++-- hw/i386/amd_iommu.h | 4 +++- 2 files changed, 22 insertions(+), 3 deletions(-)
hw/i386/amd_iommu.c +19 -2
@@ -1579,6 +1579,8 @@ static void amdvi_handle_control_write(AMDVIState *s) s->cmdbuf_enabled = s->enabled && !!(control &AMDVI_MMIO_CONTROL_CMDBUFLEN ); s->ga_enabled = !!(control &AMDVI_MMIO_CONTROL_GAEN ); + s->xten = !!(control &AMDVI_MMIO_CONTROL_XTEN ) && s->xtsup && + s->ga_enabled;/* update the flags depending on the control register */ if (s->cmdbuf_enabled) {
@@ -2054,7 +2056,7 @@ static int amdvi_int_remap_ga(AMDVIState *iommu, irq->vector = irte.hi.fields.vector; irq->dest_mode = irte.lo.fields_remap.dm; irq->redir_hint = irte.lo.fields_remap.rq_eoi; -if (iommu->xtsup) { +if (iommu->xten) { irq->dest = irte.lo.fields_remap.destination | (irte.hi.fields.destination_hi <<24 ); }else {
@@ -2437,6 +2439,7 @@ static void amdvi_init(AMDVIState *s) s->mmio_enabled = false; s->enabled = false; s->cmdbuf_enabled = false; + s->xten = false;/* reset MMIO */ memset (s->mmior,0 ,AMDVI_MMIO_SIZE );
@@ -2501,6 +2504,16 @@ static void amdvi_sysbus_reset(DeviceState *dev)amdvi_reset_address_translation_all (s); } +static const VMStateDescription vmstate_xt = { + .name ="amd-iommu-xt" , + .version_id =1 , + .minimum_version_id =1 , + .fields = (VMStateField []) { +VMSTATE_BOOL (xten, AMDVIState), +VMSTATE_END_OF_LIST () + } +}; +static const VMStateDescription vmstate_amdvi_sysbus_migratable = { .name ="amd-iommu" , .version_id =1 ,
@@ -2545,7 +2558,11 @@ static const VMStateDescription vmstate_amdvi_sysbus_migratable = { VMSTATE_UINT8_ARRAY(romask, AMDVIState, AMDVI_MMIO_SIZE), VMSTATE_UINT8_ARRAY(w1cmask, AMDVIState, AMDVI_MMIO_SIZE),VMSTATE_END_OF_LIST () - } + }, + .subsections = (const VMStateDescription *const []) { + &vmstate_xt, +NULL + } };static void amdvi_sysbus_realize (DeviceState *dev,Error **errp)
hw/i386/amd_iommu.h +3 -1
@@ -102,6 +102,7 @@#define AMDVI_MMIO_CONTROL_COMWAITINTEN (1ULL << 4)#define AMDVI_MMIO_CONTROL_CMDBUFLEN (1ULL << 12)#define AMDVI_MMIO_CONTROL_GAEN (1ULL << 17) +#define AMDVI_MMIO_CONTROL_XTEN (1ULL << 50)/* MMIO status register bits */ #define AMDVI_MMIO_STATUS_CMDBUF_RUN (1 << 4)
@@ -413,7 +414,8 @@ struct AMDVIState {/* Interrupt remapping */ bool ga_enabled; -bool xtsup; +bool xtsup;/* xtsup=on command line */ +bool xten;/* guest controlled, x2apic mode enabled */ /* DMA address translation */ bool dma_remap;
Signature · 1 line
MST
[PULL 023/106] hw/acpi/aml-build.c: add aml_irq() representing the 3-byte IRQ descriptor
In reply to Michael S. TsirkinFrom: Mark Cave-Ayland <[email protected]>
The existing aml_interrupt() uses the Extended Interrupt Descriptor to store the interrupt information, however newer Windows will only parse the standard IRQ Descriptor when enumerating ISA serial ports.
Message-Id: <[email protected]>
--- hw/acpi/aml-build-stub.c | 6 ++++++ hw/acpi/aml-build.c | 27 +++++++++++++++++++++++++++ include/hw/acpi/aml-build.h | 2 ++ 3 files changed, 35 insertions(+)
hw/acpi/aml-build-stub.c +6 -0
@@ -67,6 +67,12 @@ Aml *aml_irq_no_flags(uint8_t irq)return NULL ; } +Aml *aml_irq (uint8_t irq,AmlLevelAndEdge level_and_edge, +AmlActiveHighAndLow high_and_low,AmlShared shared) +{ +return NULL ; +} + Aml *aml_interrupt(AmlConsumerAndProducer con_and_pro, AmlLevelAndEdge level_and_edge, AmlActiveHighAndLow high_and_low, AmlShared shared,
hw/acpi/aml-build.c +27 -0
@@ -1061,6 +1061,33 @@ Aml *aml_irq_no_flags(uint8_t irq)return var; } +/* +* ACPI 1.0b: 6.4.2.1.1 ASL Macro for IRQ Descriptor +* +* More verbose description at: +* ACPI 5.0: 19.5.63 IRQ (Interrupt Resource Descriptor Macro) +* 6.4.2.1 IRQ Descriptor +*/ +Aml *aml_irq (uint8_t irq,AmlLevelAndEdge level_and_edge, +AmlActiveHighAndLow high_and_low,AmlShared shared) +{ +uint16_t irq_mask; +Aml *var =aml_alloc (); +uint8_t irq_flags = level_and_edge | (high_and_low <<3 ) | + (shared <<4 ); + +assert ((level_and_edge ==AML_EDGE && high_and_low ==AML_ACTIVE_HIGH ) || + (level_and_edge ==AML_LEVEL && high_and_low ==AML_ACTIVE_LOW )); +assert (irq <16 ); +build_append_byte (var->buf,0x23 );/* IRQ descriptor 3 byte form */ + + irq_mask =1U << irq; +build_append_byte (var->buf, irq_mask &0xFF );/* IRQ mask bits[7:0] */ +build_append_byte (var->buf, irq_mask >>8 );/* IRQ mask bits[15:8] */ +build_append_byte (var->buf, irq_flags);/* IRQ flags */ +return var; +} +/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefLNot */ Aml *aml_lnot (Aml *arg) {
include/hw/acpi/aml-build.h +2 -0
@@ -343,6 +343,8 @@ Aml *aml_io(AmlIODecode dec, uint16_t min_base, uint16_t max_base,Aml *aml_operation_region (const char *name,AmlRegionSpace rs,Aml *offset,uint32_t len);Aml *aml_irq_no_flags (uint8_t irq); +Aml *aml_irq (uint8_t irq,AmlLevelAndEdge level_and_edge, +AmlActiveHighAndLow high_and_low,AmlShared shared);Aml *aml_named_field (const char *name,unsigned length);Aml *aml_reserved_field (unsigned length);Aml *aml_local (int num);
Signature · 1 line
MST
[PULL 078/106] vhost: accept in order feature flag
In reply to Michael S. TsirkinFrom: Eugenio Pérez <[email protected]>
Let's accept the feature flag with all the infrastructure to process it in place.
Message-Id: <[email protected]>
--- hw/virtio/vhost-shadow-virtqueue.c | 1 + 1 file changed, 1 insertion(+)
hw/virtio/vhost-shadow-virtqueue.c +1 -0
@@ -38,6 +38,7 @@ bool vhost_svq_valid_features(uint64_t features, Error **errp)case VIRTIO_F_ANY_LAYOUT :case VIRTIO_RING_F_EVENT_IDX :case VIRTIO_RING_F_INDIRECT_DESC : +case VIRTIO_F_IN_ORDER :continue ;case VIRTIO_F_ACCESS_PLATFORM :
Signature · 1 line
MST
[PULL 096/106] qmp: add shmem feature map
In reply to Michael S. TsirkinFrom: Albert Esteve <[email protected]>
Add new vhost-user protocolVHOST_USER_PROTOCOL_F_SHMEM feature to
feature map.
Message-Id: <[email protected]>
--- hw/virtio/virtio-qmp.c | 3 +++ 1 file changed, 3 insertions(+)
hw/virtio/virtio-qmp.c +3 -0
@@ -123,6 +123,9 @@ static const qmp_virtio_feature_map_t vhost_user_protocol_map[] = {FEATURE_ENTRY (VHOST_USER_PROTOCOL_F_DEVICE_STATE , \"VHOST_USER_PROTOCOL_F_DEVICE_STATE: Backend device state transfer " "supported" ), +FEATURE_ENTRY (VHOST_USER_PROTOCOL_F_SHMEM , \ +"VHOST_USER_PROTOCOL_F_SHMEM: Backend shared memory mapping " +"supported" ), { -1, "" } };
Signature · 1 line
MST
[PULL 092/106] vhost_user.rst: Align VhostUserMsg excerpt members
In reply to Michael S. TsirkinFrom: Albert Esteve <[email protected]>
Add missing members to the VhostUserMsg excerpt in the vhost-user spec documentation.
Message-Id: <[email protected]>
--- docs/interop/vhost-user.rst | 4 ++++ 1 file changed, 4 insertions(+)
docs/interop/vhost-user.rst +4 -0
@@ -378,11 +378,15 @@ In QEMU the vhost-user message is implemented with the following struct: struct vhost_vring_state state; struct vhost_vring_addr addr; VhostUserMemory memory; + VhostUserMemRegMsg mem_reg; VhostUserLog log; struct vhost_iotlb_msg iotlb; VhostUserConfig config; + VhostUserCryptoSession session; VhostUserVringArea area; VhostUserInflight inflight; + VhostUserShared object; + VhostUserTransferDeviceState transfer_state; }; } QEMU_PACKED VhostUserMsg;
Signature · 1 line
MST
[PULL 045/106] hw/virtio/virtio-bus: refactor virtio_bus_set_host_notifier()
In reply to Michael S. TsirkinFrom: Vladimir Sementsov-Ogievskiy <[email protected]>
The logic kept as is. Refactor to simplify further changes.
Message-Id: <[email protected]>
--- hw/virtio/virtio-bus.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-)
hw/virtio/virtio-bus.c +8 -10
@@ -298,20 +298,18 @@ int virtio_bus_set_host_notifier(VirtioBusState *bus, int n, bool assign) __func__, strerror(-r), r);return r; } - r = k->ioeventfd_assign (proxy, notifier, n, true); -if (r <0 ) { -error_report ("%s: unable to assign ioeventfd: %d" , __func__, r); -virtio_bus_cleanup_host_notifier (bus, n); - } - }else { - k->ioeventfd_assign (proxy, notifier, n, false); } -if (r ==0 ) { -virtio_queue_set_host_notifier_enabled (vq, assign); + r = k->ioeventfd_assign (proxy, notifier, n, assign); +if (r <0 && assign) { +error_report ("%s: unable to assign ioeventfd: %d" , __func__, r); +virtio_bus_cleanup_host_notifier (bus, n); +return r; } -return r; +virtio_queue_set_host_notifier_enabled (vq, assign); + +return 0 ; }void virtio_bus_cleanup_host_notifier (VirtioBusState *bus,int n)
Signature · 1 line
MST
[PULL 044/106] vhost: vhost_dev_init(): simplify features initialization
In reply to Michael S. TsirkinFrom: Vladimir Sementsov-Ogievskiy <[email protected]>
Drop extra variable and extra function parameter passing, initialize dev._features directly.
Message-Id: <[email protected]>
--- hw/virtio/vhost.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
hw/virtio/vhost.c +5 -9
@@ -1560,18 +1560,17 @@ static void vhost_virtqueue_cleanup(struct vhost_virtqueue *vq) } } -static int vhost_dev_get_features (struct vhost_dev *hdev, -uint64_t *features) +static int vhost_dev_init_features (struct vhost_dev *hdev) {uint64_t features64;int r;if (hdev->vhost_ops->vhost_get_features_ex) { -return hdev->vhost_ops->vhost_get_features_ex (hdev, features); +return hdev->vhost_ops->vhost_get_features_ex (hdev, hdev->_features_ex); } r = hdev->vhost_ops->vhost_get_features (hdev, &features64); -virtio_features_from_u64 (features, features64); +virtio_features_from_u64 (hdev->_features_ex, features64);return r; }
@@ -1579,7 +1578,6 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque, VhostBackendType backend_type, uint32_t busyloop_timeout, Error **errp) { - uint64_t features[VIRTIO_FEATURES_NU64S]; unsigned int used, reserved, limit;int i, r, n_initialized_vqs =0 ;
@@ -1600,9 +1598,9 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque, goto fail; } - r =vhost_dev_get_features (hdev, features); + r =vhost_dev_init_features (hdev);if (r <0 ) { -error_setg_errno (errp, -r,"vhost_get_features failed" ); +error_setg_errno (errp, -r,"vhost_init_features failed" ); goto fail; }
@@ -1628,8 +1626,6 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque, } } -virtio_features_copy (hdev->_features_ex, features); - hdev->memory_listener = (MemoryListener ) { .name ="vhost" , .begin = vhost_begin,
Signature · 1 line
MST
[PULL 105/106] tests/qtest: add 8-byte MMIO access sweep for intel-iommu
In reply to Michael S. TsirkinFrom: Junjie Cao <[email protected]>
Sweep every 4-byte-aligned offset in the VT-d MMIO register space with 8-byte reads and writes to verify that no register handler aborts on an oversized access.
Message-Id: <[email protected]>
--- tests/qtest/intel-iommu-test.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
tests/qtest/intel-iommu-test.c +30 -0
@@ -17,11 +17,39 @@#define ECAP_STAGE_1_FIXED1 (VTD_ECAP_QI | VTD_ECAP_IR | VTD_ECAP_IRO | \ VTD_ECAP_MHMV | VTD_ECAP_SMTS | VTD_ECAP_FSTS) +static inline uint32_t vtd_reg_readl (QTestState *s,uint64_t offset) +{ +return qtest_readl (s,Q35_HOST_BRIDGE_IOMMU_ADDR + offset); +} +static inline uint64_t vtd_reg_readq (QTestState *s,uint64_t offset) {return qtest_readq (s,Q35_HOST_BRIDGE_IOMMU_ADDR + offset); } +static inline void vtd_reg_writeq (QTestState *s,uint64_t offset, +uint64_t value) +{ +qtest_writeq (s,Q35_HOST_BRIDGE_IOMMU_ADDR + offset, value); +} + +static void test_intel_iommu_8byte_access (void ) +{ +QTestState *s; +uint64_t off; + + s =qtest_init ("-M q35 -device intel-iommu" ); + +for (off =0 ; off <DMAR_REG_SIZE ; off +=4 ) { +vtd_reg_readq (s, off); +vtd_reg_writeq (s, off,0 ); + } + + g_assert_cmpuint(vtd_reg_readl(s, DMAR_VER_REG), !=, 0); + +qtest_quit (s); +} +static void test_intel_iommu_stage_1 (void ) {uint8_t init_csr[DMAR_REG_SIZE ];/* register values */
@@ -58,6 +86,8 @@ static void test_intel_iommu_stage_1(void)int main (int argc,char **argv) {g_test_init (&argc, &argv,NULL ); +qtest_add_func ("/q35/intel-iommu/8byte-access" , + test_intel_iommu_8byte_access);qtest_add_func ("/q35/intel-iommu/stage-1" , test_intel_iommu_stage_1);return g_test_run ();
Signature · 1 line
MST
[PULL 056/106] vhost: rename vring pointer fields to reflect user addresses
In reply to Michael S. TsirkinFrom: Vladimir Sementsov-Ogievskiy <[email protected]>
Rename vq->desc/avail/used to vq->desc_user/avail_user/used_user to clearly indicate these fields contain user space addresses, not physical addresses.
Based-on: <[email protected]>
Message-Id: <[email protected]>
--- hw/virtio/vhost.c | 37 +++++++++++++++++++------------------ include/hw/virtio/vhost.h | 6 +++--- 2 files changed, 22 insertions(+), 21 deletions(-)
hw/virtio/vhost.c +19 -18
@@ -489,11 +489,11 @@ static void vhost_vrings_unmap(struct vhost_dev *dev,return ; } -vhost_memory_unmap (dev, &vq->used, vq->used_size, touched, +vhost_memory_unmap (dev, &vq->used_user, vq->used_size, touched, touched ? vq->used_size :0 ); -vhost_memory_unmap (dev, &vq->avail, vq->avail_size,0 , +vhost_memory_unmap (dev, &vq->avail_user, vq->avail_size,0 , touched ? vq->avail_size :0 ); -vhost_memory_unmap (dev, &vq->desc, vq->desc_size,0 , +vhost_memory_unmap (dev, &vq->desc_user, vq->desc_size,0 , touched ? vq->desc_size :0 ); }
@@ -504,13 +504,13 @@ static int vhost_vrings_map(struct vhost_dev *dev, { vq->desc_size =virtio_queue_get_desc_size (vdev, idx); vq->desc_phys =virtio_queue_get_desc_addr (vdev, idx); - vq->desc =NULL ; + vq->desc_user =NULL ; vq->avail_size =virtio_queue_get_avail_size (vdev, idx); vq->avail_phys =virtio_queue_get_avail_addr (vdev, idx); - vq->avail =NULL ; + vq->avail_user =NULL ; vq->used_size =virtio_queue_get_used_size (vdev, idx); vq->used_phys =virtio_queue_get_used_addr (vdev, idx); - vq->used =NULL ; + vq->used_user =NULL ;if (vq->desc_phys ==0 ) {/* Queue might not be ready for start */
@@ -521,16 +521,17 @@ static int vhost_vrings_map(struct vhost_dev *dev,return 1 ; } - vq->desc =vhost_memory_map (dev, vq->desc_phys, vq->desc_size, false); -if (!vq->desc) { + vq->desc_user =vhost_memory_map (dev, vq->desc_phys, vq->desc_size, false); +if (!vq->desc_user) { goto fail; } - vq->avail =vhost_memory_map (dev, vq->avail_phys, vq->avail_size, false); -if (!vq->avail) { + vq->avail_user =vhost_memory_map (dev, vq->avail_phys, vq->avail_size, + false); +if (!vq->avail_user) { goto fail; } - vq->used =vhost_memory_map (dev, vq->used_phys, vq->used_size, true); -if (!vq->used) { + vq->used_user =vhost_memory_map (dev, vq->used_phys, vq->used_size, true); +if (!vq->used_user) { goto fail; }
@@ -594,7 +595,7 @@ static int vhost_verify_ring_mappings(struct vhost_dev *dev, j =0 ; r =vhost_verify_ring_part_mapping ( - vq->desc, vq->desc_phys, vq->desc_size, + vq->desc_user, vq->desc_phys, vq->desc_size, reg_hva, reg_gpa, reg_size);if (r) {break ;
@@ -602,7 +603,7 @@ static int vhost_verify_ring_mappings(struct vhost_dev *dev, j++; r =vhost_verify_ring_part_mapping ( - vq->avail, vq->avail_phys, vq->avail_size, + vq->avail_user, vq->avail_phys, vq->avail_size, reg_hva, reg_gpa, reg_size);if (r) {break ;
@@ -610,7 +611,7 @@ static int vhost_verify_ring_mappings(struct vhost_dev *dev, j++; r =vhost_verify_ring_part_mapping ( - vq->used, vq->used_phys, vq->used_size, + vq->used_user, vq->used_phys, vq->used_size, reg_hva, reg_gpa, reg_size);if (r) {break ;
@@ -1106,9 +1107,9 @@ static int vhost_virtqueue_set_addr(struct vhost_dev *dev, addr.avail_user_addr = (uint64_t )(unsigned long )vq->avail_phys; addr.used_user_addr = (uint64_t )(unsigned long )vq->used_phys; }else { - addr.desc_user_addr = (uint64_t )(unsigned long )vq->desc; - addr.avail_user_addr = (uint64_t )(unsigned long )vq->avail; - addr.used_user_addr = (uint64_t )(unsigned long )vq->used; + addr.desc_user_addr = (uint64_t )(unsigned long )vq->desc_user; + addr.avail_user_addr = (uint64_t )(unsigned long )vq->avail_user; + addr.used_user_addr = (uint64_t )(unsigned long )vq->used_user; } addr.index = idx; addr.log_guest_addr = vq->used_phys;
include/hw/virtio/vhost.h +3 -3
@@ -24,9 +24,9 @@ struct vhost_inflight {struct vhost_virtqueue {int kick;int call; -void *desc; -void *avail; -void *used; +void *desc_user; +void *avail_user; +void *used_user;int num;unsigned long long desc_phys;unsigned desc_size;
Signature · 1 line
MST
[PULL 041/106] vhost: final refactoring of vhost vrings map/unmap
In reply to Michael S. TsirkinFrom: Vladimir Sementsov-Ogievskiy <[email protected]>
Introduce helper functions vhost_vrings_map() andvhost_vrings_unmap() and use them.
Message-Id: <[email protected]>
--- hw/virtio/vhost.c | 89 +++++++++++++++++++++++++++++------------------ 1 file changed, 55 insertions(+), 34 deletions(-)
hw/virtio/vhost.c +55 -34
@@ -489,6 +489,56 @@ static void vhost_memory_unmap(struct vhost_dev *dev, void **buffer, *buffer =NULL ; } +static void vhost_vrings_unmap (struct vhost_dev *dev, +struct vhost_virtqueue *vq,bool touched) +{ +vhost_memory_unmap (dev, &vq->used, vq->used_size, touched, + touched ? vq->used_size :0 ); +vhost_memory_unmap (dev, &vq->avail, vq->avail_size,0 , + touched ? vq->avail_size :0 ); +vhost_memory_unmap (dev, &vq->desc, vq->desc_size,0 , + touched ? vq->desc_size :0 ); +} + +static int vhost_vrings_map (struct vhost_dev *dev, +struct VirtIODevice *vdev, +struct vhost_virtqueue *vq, +unsigned idx) +{ + vq->desc_size =virtio_queue_get_desc_size (vdev, idx); + vq->desc_phys =virtio_queue_get_desc_addr (vdev, idx); + vq->desc =NULL ; + vq->avail_size =virtio_queue_get_avail_size (vdev, idx); + vq->avail_phys =virtio_queue_get_avail_addr (vdev, idx); + vq->avail =NULL ; + vq->used_size =virtio_queue_get_used_size (vdev, idx); + vq->used_phys =virtio_queue_get_used_addr (vdev, idx); + vq->used =NULL ; + +if (vq->desc_phys ==0 ) { +/* Queue might not be ready for start */ +return 0 ; + } + vq->desc =vhost_memory_map (dev, vq->desc_phys, vq->desc_size, false); +if (!vq->desc) { + goto fail; + } + vq->avail =vhost_memory_map (dev, vq->avail_phys, vq->avail_size, false); +if (!vq->avail) { + goto fail; + } + vq->used =vhost_memory_map (dev, vq->used_phys, vq->used_size, true); +if (!vq->used) { + goto fail; + } + +return 1 ; + +fail: +vhost_vrings_unmap (dev, vq, false); +return -ENOMEM ; +} + static int vhost_verify_ring_part_mapping(void *ring_hva, uint64_t ring_gpa, uint64_t ring_size,
@@ -1287,34 +1337,9 @@ int vhost_virtqueue_start(struct vhost_dev *dev, };struct VirtQueue *vvq =virtio_get_queue (vdev, idx); - vq->desc_size =virtio_queue_get_desc_size (vdev, idx); - vq->desc_phys =virtio_queue_get_desc_addr (vdev, idx); - vq->desc =NULL ; - vq->avail_size =virtio_queue_get_avail_size (vdev, idx); - vq->avail_phys =virtio_queue_get_avail_addr (vdev, idx); - vq->avail =NULL ; - vq->used_size =virtio_queue_get_used_size (vdev, idx); - vq->used_phys =virtio_queue_get_used_addr (vdev, idx); - vq->used =NULL ; - -if (vq->desc_phys ==0 ) { -/* Queue might not be ready for start */ -return 0 ; - } - vq->desc =vhost_memory_map (dev, vq->desc_phys, vq->desc_size, false); -if (!vq->desc) { - r = -ENOMEM ; - goto fail; - } - vq->avail =vhost_memory_map (dev, vq->avail_phys, vq->avail_size, false); -if (!vq->avail) { - r = -ENOMEM ; - goto fail; - } - vq->used =vhost_memory_map (dev, vq->used_phys, vq->used_size, true); -if (!vq->used) { - r = -ENOMEM ; - goto fail; + r =vhost_vrings_map (dev, vdev, vq, idx); +if (r <=0 ) { +return r; } vq->num = state.num =virtio_queue_get_num (vdev, idx);
@@ -1375,9 +1400,7 @@ int vhost_virtqueue_start(struct vhost_dev *dev,return 0 ; fail: -vhost_memory_unmap (dev, &vq->used, vq->used_size,0 ,0 ); -vhost_memory_unmap (dev, &vq->avail, vq->avail_size,0 ,0 ); -vhost_memory_unmap (dev, &vq->desc, vq->desc_size,0 ,0 ); +vhost_vrings_unmap (dev, vq, false);return r; }
@@ -1424,9 +1447,7 @@ static int do_vhost_virtqueue_stop(struct vhost_dev *dev, vhost_vq_index); } -vhost_memory_unmap (dev, &vq->used, vq->used_size,1 , vq->used_size); -vhost_memory_unmap (dev, &vq->avail, vq->avail_size,0 , vq->avail_size); -vhost_memory_unmap (dev, &vq->desc, vq->desc_size,0 , vq->desc_size); +vhost_vrings_unmap (dev, vq, true);return r; }
Signature · 1 line
MST
[PULL 063/106] amd_iommu: Follow root pointer before page walk and use 1-based levels
In reply to Michael S. TsirkinFrom: Alejandro Jimenez <[email protected]>
DTE[Mode] and PTE NextLevel encode page table levels as 1-based values, but fetch_pte() currently uses a 0-based level counter, making the logic harder to follow and requiring conversions between DTE mode and level.
Switch the page table walk logic to use 1-based level accounting in fetch_pte() and the relevant macro helpers. To further simplify the page walking loop, split the root page table access from the walk i.e. rework fetch_pte() to follow the DTE Page Table Root Pointer and retrieve the top level pagetable entry before entering the loop, then iterate only over the PDE/PTE entries.
The reworked algorithm fixes a page walk bug where the page size was calculated for the next level before checking if the current PTE was already a leaf/hugepage. That caused hugepage mappings to be reported as 4K pages, leading to performance degradation and failures in some setups.
Message-Id: <[email protected]>
--- hw/i386/amd_iommu.c | 134 ++++++++++++++++++++++++++++++-------------- hw/i386/amd_iommu.h | 11 ++-- 2 files changed, 98 insertions(+), 47 deletions(-)
hw/i386/amd_iommu.c +93 -41
@@ -648,6 +648,52 @@ static uint64_t large_pte_page_size(uint64_t pte)return PTE_LARGE_PAGE_SIZE (pte); } +/* +* Validate DTE fields and extract permissions and top level data required to +* initiate the page table walk. +* +* On success, returns 0 and stores: +* - top_level: highest page-table level encoded in DTE[Mode] +* - dte_perms: effective permissions from the DTE +* +* On failure, returns -AMDVI_FR_PT_ROOT_INV. This includes cases where: +* - DTE permissions disallow read AND write +* - DTE[Mode] is invalid for translation +* - IOVA exceeds the address width supported by DTE[Mode] +* In all such cases a page walk must be aborted. +*/ +static uint64_t amdvi_get_top_pt_level_and_perms (hwaddr address,uint64_t dte, +uint8_t *top_level, +IOMMUAccessFlags *dte_perms) +{ + *dte_perms =amdvi_get_perms (dte); +if (*dte_perms ==IOMMU_NONE ) { +return -AMDVI_FR_PT_ROOT_INV ; + } + +/* Verifying a valid mode is encoded in DTE */ + *top_level =get_pte_translation_mode (dte); + +/* +* Page Table Root pointer is only valid for GPA->SPA translation on +* supported modes. +*/ +if (*top_level ==0 || *top_level >6 ) { +return -AMDVI_FR_PT_ROOT_INV ; + } + +/* +* If IOVA is larger than the max supported by the highest pgtable level, +* there is nothing to do. +*/ +if (address >PT_LEVEL_MAX_ADDR (*top_level)) { +/* IOVA too large for the current DTE */ +return -AMDVI_FR_PT_ROOT_INV ; + } + +return 0 ; +} +/* * Helper function to fetch a PTE using AMD v1 pgtable format. * On successful page walk, returns 0 and pte parameter points to a valid PTE.
@@ -662,40 +708,49 @@ static uint64_t large_pte_page_size(uint64_t pte)static uint64_t fetch_pte (AMDVIAddressSpace *as,hwaddr address,uint64_t dte,uint64_t *pte,hwaddr *page_size) { -IOMMUAccessFlags perms =amdvi_get_perms (dte); - -uint8_t level, mode;uint64_t pte_addr; +uint8_t pt_level, next_pt_level; +IOMMUAccessFlags perms; +int ret; - *pte = dte; *page_size =0 ; -if (perms ==IOMMU_NONE ) { +/* +* Verify the DTE is properly configured before page walk, and extract +* top pagetable level and permissions. +*/ + ret =amdvi_get_top_pt_level_and_perms (address, dte, &pt_level, &perms); +if (ret <0 ) { +return ret; + } + +/* +* Retrieve the top pagetable entry by following the DTE Page Table Root +* Pointer and indexing the top level table using the IOVA from the request. +*/ + pte_addr =NEXT_PTE_ADDR (dte, pt_level, address); + *pte =amdvi_get_pte_entry (as->iommu_state, pte_addr, as->devfn); + +if (*pte == (uint64_t )-1 ) { +/* +* A returned PTE of -1 here indicates a failure to read the top level +* page table from guest memory. A page walk is not possible and page +* size must be returned as 0. +*/ return -AMDVI_FR_PT_ROOT_INV ; }/* -* The Linux kernel driver initializes the default mode to 3, corresponding -* to a 39-bit GPA space, where each entry in the pagetable translates to a -* 1GB (2^30) page size. +* Calculate page size for the top level page table entry. +* This ensures correct results for a single level Page Table setup. */ - level = mode =get_pte_translation_mode (dte); -assert (mode >0 && mode <7 ); + *page_size =PTE_LEVEL_PAGE_SIZE (pt_level);/* -* If IOVA is larger than the max supported by the current pgtable level, -* there is nothing to do. +* The root page table entry and its level have been determined. Begin the +* page walk. */ -if (address >PT_LEVEL_MAX_ADDR (mode -1 )) { -/* IOVA too large for the current DTE */ -return -AMDVI_FR_PT_ROOT_INV ; - } - - do { - level -= 1; - - /* Update the page_size */ - *page_size = PTE_LEVEL_PAGE_SIZE(level); +while (pt_level >0 ) {/* Permission bits are ANDed at every level, including the DTE */ perms &=amdvi_get_perms (*pte);
@@ -708,37 +763,34 @@ static uint64_t fetch_pte(AMDVIAddressSpace *as, hwaddr address, uint64_t dte,return 0 ; } + next_pt_level =PTE_NEXT_LEVEL (*pte); +/* Large or Leaf PTE found */ -if (PTE_NEXT_LEVEL (*pte) ==7 ||PTE_NEXT_LEVEL (*pte) ==0 ) { +if (next_pt_level ==0 || next_pt_level ==7 ) {/* Leaf PTE found */ break ; } + pt_level = next_pt_level; +/* -* Index the pgtable using the IOVA bits corresponding to current level -* and walk down to the lower level. +* The current entry is a Page Directory Entry. Descend to the lower +* page table level encoded in current pte, and index the new table +* using the appropriate IOVA bits to retrieve the new entry. */ - pte_addr =NEXT_PTE_ADDR (*pte, level, address); + *page_size =PTE_LEVEL_PAGE_SIZE (pt_level); + + pte_addr =NEXT_PTE_ADDR (*pte, pt_level, address); *pte =amdvi_get_pte_entry (as->iommu_state, pte_addr, as->devfn);if (*pte == (uint64_t )-1 ) { -/* -* A returned PTE of -1 indicates a failure to read the page table -* entry from guest memory. -*/ -if (level == mode -1 ) { -/* Failure to retrieve the Page Table from Root Pointer */ - *page_size =0 ; -return -AMDVI_FR_PT_ROOT_INV ; - }else { -/* Failure to read PTE. Page walk skips a page_size chunk */ -return -AMDVI_FR_PT_ENTRY_INV ; - } +/* Failure to read PTE. Page walk skips a page_size chunk */ +return -AMDVI_FR_PT_ENTRY_INV ; } - }while (level >0 ); + } + +assert (PTE_NEXT_LEVEL (*pte) ==0 ||PTE_NEXT_LEVEL (*pte) ==7 ); -assert (PTE_NEXT_LEVEL (*pte) ==0 ||PTE_NEXT_LEVEL (*pte) ==7 || - level ==0 );/* * Page walk ends when Next Level field on PTE shows that either a leaf PTE * or a series of large PTEs have been reached. In the latter case, even if
hw/i386/amd_iommu.h +5 -6
@@ -186,17 +186,16 @@#define IOMMU_PTE_PRESENT (pte) ((pte) & AMDVI_PTE_PR) -/* Using level=0 for leaf PTE at 4K page size */ -#define PT_LEVEL_SHIFT (level) (12 + ((level) * 9)) +/* Using level=1 for leaf PTE at 4K page size */ +#define PT_LEVEL_SHIFT (level) (12 + (((level) - 1) * 9))/* Return IOVA bit group used to index the Page Table at specific level */ #define PT_LEVEL_INDEX (level, iova) (((iova) >> PT_LEVEL_SHIFT(level)) & \ GENMASK64(8, 0)) -/* Return the max address for a specified level i.e. max_oaddr */ -#define PT_LEVEL_MAX_ADDR (x) (((x) < 5) ? \ - ((1ULL << PT_LEVEL_SHIFT((x + 1))) - 1) : \ - (~(0ULL))) +/* Return the maximum output address for a specified page table level */ +#define PT_LEVEL_MAX_ADDR (level) (((level) > 5) ? (~(0ULL)) : \ + ((1ULL << PT_LEVEL_SHIFT((level) + 1)) - 1))/* Extract the NextLevel field from PTE/PDE */ #define PTE_NEXT_LEVEL (pte) (((pte) & AMDVI_PTE_NEXT_LEVEL_MASK) >> 9)
Signature · 1 line
MST
Re: [PULL 063/106] amd_iommu: Follow root pointer before page walk and use 1-based levels
Quoted 14 lines · Michael S. Tsirkin
From: Alejandro Jimenez <[email protected]>
DTE[Mode] and PTE NextLevel encode page table levels as 1-based values, but
fetch_pte()currently uses a 0-based level counter, making the logic harder to follow and requiring conversions between DTE mode and level.Switch the page table walk logic to use 1-based level accounting in
fetch_pte()and the relevant macro helpers. To further simplify the page walking loop, split the root page table access from the walk i.e. reworkfetch_pte()to follow the DTE Page Table Root Pointer and retrieve the top level pagetable entry before entering the loop, then iterate only over the PDE/PTE entries.
Quoted 4 lines
The reworked algorithm fixes a page walk bug where the page size was calculated for the next level before checking if the current PTE was already a leaf/hugepage. That caused hugepage mappings to be reported as 4K pages, leading to performance degradation and failures in some setups.
Hi; Coverity flags up an issue with this commit. It won't have any practical consequences, but it does show that there's something we could clean up.
Quoted 7 lines
hw/i386/amd_iommu.c +7
-0+/* +* Validate DTE fields and extract permissions and top level data required to +* initiate the page table walk. +* +* On success, returns 0 and stores: +* - top_level: highest page-table level encoded in DTE[Mode] +* - dte_perms: effective permissions from the DTE
hw/i386/amd_iommu.c static uint64_t large_pte_page_size(uint64_t pte) · line 667
Quoted 10 lines
hw/i386/amd_iommu.c +10
-0+* +* On failure, returns -AMDVI_FR_PT_ROOT_INV. This includes cases where: +* - DTE permissions disallow read AND write +* - DTE[Mode] is invalid for translation +* - IOVA exceeds the address width supported by DTE[Mode] +* In all such cases a page walk must be aborted. +*/ +static uint64_t amdvi_get_top_pt_level_and_perms (hwaddr address,uint64_t dte, +uint8_t *top_level, +IOMMUAccessFlags *dte_perms)
This function returns 0 on success, or a small negative number on failure. But we have typed it as returning uint64_t.
Quoted 11 lines
hw/i386/amd_iommu.c +3
-3@@ -662,40 +708,49 @@ static uint64_t large_pte_page_size(uint64_t pte)static uint64_t fetch_pte (AMDVIAddressSpace *as,hwaddr address,uint64_t dte,uint64_t *pte,hwaddr *page_size) { -IOMMUAccessFlags perms =amdvi_get_perms (dte); - -uint8_t level, mode;uint64_t pte_addr; +uint8_t pt_level, next_pt_level; +IOMMUAccessFlags perms; +int ret;
hw/i386/amd_iommu.c static uint64_t large_pte_page_size(uint64_t pte) · line 722
Quoted 10 lines
hw/i386/amd_iommu.c +5
-2- *pte = dte; *page_size =0 ; -if (perms ==IOMMU_NONE ) { +/* +* Verify the DTE is properly configured before page walk, and extract +* top pagetable level and permissions. +*/ + ret =amdvi_get_top_pt_level_and_perms (address, dte, &pt_level, &perms);
At the callsite we take that uint64_t return value and put it into an "int" local variable. That potentially overflows. (In practice none of the values actually returned will overflow.)
hw/i386/amd_iommu.c static uint64_t large_pte_page_size(uint64_t pte) · line 724
Quoted 2 lines
hw/i386/amd_iommu.c +2
-0+if (ret <0 ) { +return ret;
Then we return that 'int' value from this function, which extends it back out to uint64_t again.
Review static uint64_t large_pte_page_size(uint64_t pte) · line 725
Quoted 1 line
(quoted diff) +1
-0+ }
Since all of fetch_pte()'s callers put its return value into an 'int' local variable, and fetch_pte() is the only function that calls amdvi_get_top_pt_level_and_perms(), I think the right fix here is to make both amdvi_get_top_pt_level_and_perms() and fetch_pte() return "int" instead of "uint64_t". Then the type matches what the return variable is (0 on success, small negative on failure) and also the type of the variable that all the callers put it into.
thanks
-- PMM
Re: [PULL 063/106] amd_iommu: Follow root pointer before page walk and use 1-based levels
Quoted 79 lines · Peter Maydell
Quoted 14 lines · Michael S. Tsirkin
From: Alejandro Jimenez <[email protected]>
DTE[Mode] and PTE NextLevel encode page table levels as 1-based values, but
fetch_pte()currently uses a 0-based level counter, making the logic harder to follow and requiring conversions between DTE mode and level.Switch the page table walk logic to use 1-based level accounting in
fetch_pte()and the relevant macro helpers. To further simplify the page walking loop, split the root page table access from the walk i.e. reworkfetch_pte()to follow the DTE Page Table Root Pointer and retrieve the top level pagetable entry before entering the loop, then iterate only over the PDE/PTE entries.Quoted 4 lines
The reworked algorithm fixes a page walk bug where the page size was calculated for the next level before checking if the current PTE was already a leaf/hugepage. That caused hugepage mappings to be reported as 4K pages, leading to performance degradation and failures in some setups.
Hi; Coverity flags up an issue with this commit. It won't have any practical consequences, but it does show that there's something we could clean up.
Quoted 7 lines
hw/i386/amd_iommu.c +7
-0+/* +* Validate DTE fields and extract permissions and top level data required to +* initiate the page table walk. +* +* On success, returns 0 and stores: +* - top_level: highest page-table level encoded in DTE[Mode] +* - dte_perms: effective permissions from the DTE hw/i386/amd_iommu.c static uint64_t large_pte_page_size(uint64_t pte) · line 667
Quoted 10 lines
hw/i386/amd_iommu.c +10
-0+* +* On failure, returns -AMDVI_FR_PT_ROOT_INV. This includes cases where: +* - DTE permissions disallow read AND write +* - DTE[Mode] is invalid for translation +* - IOVA exceeds the address width supported by DTE[Mode] +* In all such cases a page walk must be aborted. +*/ +static uint64_t amdvi_get_top_pt_level_and_perms (hwaddr address,uint64_t dte, +uint8_t *top_level, +IOMMUAccessFlags *dte_perms)This function returns 0 on success, or a small negative number on failure. But we have typed it as returning
uint64_t.Quoted 11 lines
hw/i386/amd_iommu.c +3
-3@@ -662,40 +708,49 @@ static uint64_t large_pte_page_size(uint64_t pte)static uint64_t fetch_pte (AMDVIAddressSpace *as,hwaddr address,uint64_t dte,uint64_t *pte,hwaddr *page_size) { -IOMMUAccessFlags perms =amdvi_get_perms (dte); - -uint8_t level, mode;uint64_t pte_addr; +uint8_t pt_level, next_pt_level; +IOMMUAccessFlags perms; +int ret;hw/i386/amd_iommu.c static uint64_t large_pte_page_size(uint64_t pte) · line 722
Quoted 10 lines
hw/i386/amd_iommu.c +5
-2- *pte = dte; *page_size =0 ; -if (perms ==IOMMU_NONE ) { +/* +* Verify the DTE is properly configured before page walk, and extract +* top pagetable level and permissions. +*/ + ret =amdvi_get_top_pt_level_and_perms (address, dte, &pt_level, &perms);At the callsite we take that
uint64_treturn value and put it into an "int" local variable. That potentially overflows. (In practice none of the values actually returned will overflow.)hw/i386/amd_iommu.c static uint64_t large_pte_page_size(uint64_t pte) · line 724
Quoted 2 lines
hw/i386/amd_iommu.c +2
-0+if (ret <0 ) { +return ret;Then we return that 'int' value from this function, which extends it back out to
uint64_tagain.Review static uint64_t large_pte_page_size(uint64_t pte) · line 725
Quoted 1 line
(quoted diff) +1
-0+ }
Quoted 8 lines
Since all of fetch_pte()'s callers put its return value into an 'int' local variable, and
fetch_pte()is the only function that callsamdvi_get_top_pt_level_and_perms(), I think the right fix here is to make bothamdvi_get_top_pt_level_and_perms()andfetch_pte()return "int" instead of "uint64_t". Then the type matches what the return variable is (0 on success, small negative on failure) and also the type of the variable that all the callers put it into.
Thank you for pointing this out.
This started when I initially introduced fetch_pte() as an unused helper, returning the PTE value directly. After feedback, I changed it to return an "int", but a later patch in the series accidentally reverted back to "uint64_t". Then I repeated the same wrong pattern in amdvi_get_top_pt_level_and_perms().
I'll send a patch making both amdvi_get_top_pt_level_and_perms() and fetch_pte() return "int".
Thank you,
Alejandro
Quoted 2 lines
thanks
-- PMM
[PULL 067/106] ppc/pnv_phb3: Error out on invalid config access
In reply to Michael S. TsirkinFrom: Aditya Gupta <[email protected]>
PHB in Power8 supports 8 byte registers, and hence the ops structure allows accessing of 8 bytes in 'pnv_phb3_reg_ops'
Both 'pnv_phb3_reg_read' & 'pnv_phb3_reg_write' pass the arguments as is to 'pnv_phb3_config_{read,write}', if offset is PHB_CONFIG_DATA.
This when called with size as 8, causes following assert failure in 'pci_host_config_read_common' & 'pci_host_config_write_common':
assert(len <= 4);
Validate that size is <=4, before jumping to pci_host_config_{read,write}_common
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3334
Message-Id: <[email protected]>
--- hw/pci-host/pnv_phb3.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
hw/pci-host/pnv_phb3.c +10 -0
@@ -475,6 +475,11 @@ void pnv_phb3_reg_write(void *opaque, hwaddr off, uint64_t val, unsigned size)/* Special case configuration data */ if ((off &0xfffc ) ==PHB_CONFIG_DATA ) { +if (size >4 ) { +phb3_error (phb,"Invalid config access, offset: 0x%" PRIx64" size: %d" , + off, size); +return ; + }pnv_phb3_config_write (phb, off &0x3 , size, val);return ; }
@@ -597,6 +602,11 @@ uint64_t pnv_phb3_reg_read(void *opaque, hwaddr off, unsigned size)uint64_t val;if ((off &0xfffc ) ==PHB_CONFIG_DATA ) { +if (size >4 ) { +phb3_error (phb,"Invalid config access, offset: 0x%" PRIx64" size: %d" , + off, size); +return ~0ull ; + }return pnv_phb3_config_read (phb, off &0x3 , size); }
Signature · 1 line
MST
[PULL 039/106] vhost: move vrings mapping to the top of vhost_virtqueue_start()
In reply to Michael S. TsirkinFrom: Vladimir Sementsov-Ogievskiy <[email protected]>
This simplifies further refactoring and final introduction of vhost backend live migration.
Message-Id: <[email protected]>
--- hw/virtio/vhost.c | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-)
hw/virtio/vhost.c +22 -23
@@ -1303,29 +1303,6 @@ int vhost_virtqueue_start(struct vhost_dev *dev,return 0 ; } - vq->num = state.num =virtio_queue_get_num (vdev, idx); - r = dev->vhost_ops->vhost_set_vring_num (dev, &state); -if (r) { -VHOST_OPS_DEBUG (r,"vhost_set_vring_num failed" ); -return r; - } - - state.num =virtio_queue_get_last_avail_idx (vdev, idx); - r = dev->vhost_ops->vhost_set_vring_base (dev, &state); -if (r) { -VHOST_OPS_DEBUG (r,"vhost_set_vring_base failed" ); -return r; - } - -if (vhost_needs_vring_endian (vdev)) { - r =vhost_virtqueue_set_vring_endian_legacy (dev, -virtio_vdev_is_big_endian (vdev), - vhost_vq_index); -if (r) { -return r; - } - } - l = vq->desc_size; vq->desc =vhost_memory_map (dev, vq->desc_phys, l, false);if (!vq->desc) {
@@ -1347,6 +1324,28 @@ int vhost_virtqueue_start(struct vhost_dev *dev, goto fail; } + vq->num = state.num =virtio_queue_get_num (vdev, idx); + r = dev->vhost_ops->vhost_set_vring_num (dev, &state); +if (r) { +VHOST_OPS_DEBUG (r,"vhost_set_vring_num failed" ); + goto fail; + } + + state.num =virtio_queue_get_last_avail_idx (vdev, idx); + r = dev->vhost_ops->vhost_set_vring_base (dev, &state); +if (r) { +VHOST_OPS_DEBUG (r,"vhost_set_vring_base failed" ); + goto fail; + } + +if (vhost_needs_vring_endian (vdev)) { + r =vhost_virtqueue_set_vring_endian_legacy ( + dev,virtio_vdev_is_big_endian (vdev), vhost_vq_index); +if (r) { + goto fail; + } + } + r =vhost_virtqueue_set_addr (dev, vq, vhost_vq_index, dev->log_enabled);if (r <0 ) { goto fail;
Signature · 1 line
MST
Quoted 3 lines · Michael S. Tsirkin
Resolved a bunch of conflicts.
If you see anything wrong here, pls holler.
Hi Michael,
The check for mangled mailing list author emails is failing. Please git commit --amend --author=... with their real email and resend your pull request:
Alireza Sanaee via qemu development (2):
hw/cxl: Allow cxl_cfmws_find_device() to filter on whether
interleaved paths are accepted
hw/cxl: Add a performant (and correct) path for the non interleaved cases
ERROR: pull request includes commits attributed to list
Thanks!
Stefan
Quoted 354 lines
The following changes since commit
f5a2438405d4ae8b62de7c9b39fac0b2155ee544:Merge tag 'pull-qapi-2026-05-21' of https://repo.or.cz/qemu/armbru into staging (2026-05-21 09:00:22 -0400)
are available in the Git repository at:
https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to
31dbba011d0f3a21432d0629fae0b4885f2eed25:hw/scsi/vhost-scsi: fix build with older kernel headers (2026-06-03 08:36:42 -0400)
----------------------------------------------------------------
pci, vhost, virtio, iommu: features, fixes, cleanups
intel_iommu:
PASID support for passthrough
some properties renamed
virtio-rtc:
new device
acpi:
watchdog (x86 q35)
COM irqs are now shared
vhost-user:
vhost-user passes GPA not HVA now
vhost SHMEM_MAP/UNMAP support
vhost-vdpa:
svqIN_ORDERsupportamd_iommu:
IOMMU XT interrupt support
command buffer fixes
cxl:
PPR support
performant path for non-interleaved cases
vhost-scsi:
build fix for older kernel headers
fixes, cleanups all over the placeSigned-off-by Michael S. Tsirkin <[email protected]>----------------------------------------------------------------
Aditya Gupta (2):
ppc/pnv_phb3: Error out on invalid config access hw/pci: Replace assert with bounds check and returnAlbert Esteve (7):
vhost-user: Add VirtIO Shared Memory map requestvhost_user.rst: Align VhostUserMsg excerpt membersvhost_user.rst: Add SHMEM_MAP/_UNMAP to spec
vhost_user: Add frontendget_shmem_configcommandvhost_user.rst: AddGET_SHMEM_CONFIGmessage
qmp: add shmem feature map
vhost-user-device: Add shared memory BARAlejandro Jimenez (3):
amd_iommu: Update command buffer head ptr in MMIO region after wraparound
amd_iommu: Follow root pointer before page walk and use 1-based levels
amd_iommu: Reject non-decreasing NextLevel infetch_pte()Alexandr Moshkov (1):
vhost-user.rst: fix typoAlexey Gerasimenko (1):
q35: Fix incorrect values for PCIEXBAR masksAlireza Sanaee via qemu development (2):
hw/cxl: Allowcxl_cfmws_find_device()to filter on whether interleaved paths are accepted hw/cxl: Add a performant (and correct) path for the non interleaved casesCostas Argyris (1):
tests/qtest: Add amd-iommu command buffer head wrap testEugenio Pérez (8):
net/vhost-vdpa: enable vqs beforeDRIVER_OKif no cvq
virtio: Allow to fill a whole virtqueue in order
vhost: move svq next desc array to descs state struct
vhost: factor out the descriptor next fetching
vhost: factor out the get of last used desc in SVQ
vhost: factor out the detach buf logic in SVQ
vhost: addin_orderfeature to shadow virtqueue
vhost: accept in order feature flagIgor Mammedov (6):
acpi: add API to build WDAT instructions
x86: q35: add 'wdat' property
x86: q35: generate WDAT ACPI table
tests: acpi: x86/q35: whitelist new WDAT table
tests: acpi: x86/q35: add WDAT table test case
tests: acpi: x86/q35: update expected WDAT blobJonathan Cameron (1):
MAINTAINERS: Update CXL maintainers entry including adding linux-cxl listJorge E. Moreira (1):
vhost-user.rst: Explicitly allow front-end to write to kick FDsJunjie Cao (2):
intel_iommu: fix guest-triggerable abort on oversized MMIO access tests/qtest: add 8-byte MMIO access sweep for intel-iommuKuan-Wei Chiu (3):
vhost-user: Fix stale error logs and return values in teardown paths
standard-headers: Addvirtio_rtc.hfrom Linux 7.0-rc1
virtio-rtc: Add basic virtio-rtc supportMark Cave-Ayland (4):
hw/acpi/aml-build.c: addaml_irq()representing the 3-byte IRQ descriptor tests/acpi: allow DSDT acpi table changeshw/char/serial-isa.c: declare IRQ as shared in ACPI IRQ descriptor
tests: data: update x86 ACPI tablesMax Makarov (2):
vhost-user-blk-server: do not advertiseVIRTIO_BLK_F_SIZE_MAXwith size_max=0
vhost-user-blk: do not forceVIRTIO_BLK_F_SIZE_MAXPaolo Bonzini (1):
amd_iommu: restrict command buffer head/tail ranges to ring sizeQuan Sun (1):
hw/scsi/vhost-scsi: fix build with older kernel headersSairaj Kodilkar (3):
amd_iommu: Use switch case to determine mmio register name
amd_iommu: Turn on XT support only when guest has enabled it
amd_iommu: Generate XT interrupts when xt support is enabledShiju Jose (3):
hw/cxl: Fix handling of component ID to not assume it is a string
hw/cxl: Add fixes in Post Package Repair (PPR)
hw/cxl/events: Fix handling of component ID in event records generation to not assume it is a stringStefano Garzarella (2):
libvhost-user: fix buffer overflow invirtqueue_read_indirect_desc()
libvduse: fix buffer overflow invduse_queue_read_indirect_desc()Thomas Huth (1):
hw/i386/pc: Add a proper owner for the ioport memory regionsVladimir Sementsov-Ogievskiy (32):
vhost-user: rework enabling vrings
vhost: dropbackend_featuresfield
vhost-user: introducevhost_user_has_protocol_feature()helper
vhost: moveprotocol_featurestovhost_user
vhost-user-gpu: drop code duplication
vhost: make vhost_dev.features private
virtio: move common part of_set_guest_notifierto generic code
virtio: drop*_set_guest_notifier_fd_handler()helpers
vhost-user: keep QIOChannelSocket for backend channel
vhost:vhost_virtqueue_start(): fix failure path
vhost: makevhost_memory_unmap()null-safe
vhost: simplify calls tovhost_memory_unmap()
vhost: move vrings mapping to the top ofvhost_virtqueue_start()
vhost:vhost_virtqueue_start(): drop extra local variables
vhost: final refactoring of vhost vrings map/unmap
vhost: simplifyvhost_dev_init()error-path
vhost: move busyloop timeout initialization tovhost_virtqueue_init()
vhost:vhost_dev_init(): simplify features initialization hw/virtio/virtio-bus: refactorvirtio_bus_set_host_notifier()
vhost-user: make trace events more readable
vhost-user-blk: add some useful trace-points
vhost: add some useful trace-points
vhost: move IOTLB functions fromvhost-backend.ctovhost.c
vhost: use consistent naming for backend handlers
vhost: renamevhost-backend.ctovhost-kernel.c
vhost: replace .vhost_vq_get_addr() with .vhost_phys_vring_addr()
vhost: simplifyvhost_memory_map()andvhost_memory_unmap()
qapi: remove user addresses from x-query-virtio-vhost-queue-status
vhost: stop reusingvq->desc(and friends) to store physical address
vhost: rename vring pointer fields to reflect user addresses
vhost: add .vhost_phys_iotlb_msg() handler
vhost-user: addVHOST_USER_PROTOCOL_F_GPA_ADDRESSESZhenzhong Duan (19):
intel_iommu: Remove 'x-' prefix from 'x-scalable-mode' and 'x-flts' properties
intel_iommu: Change 'flts' property naming to 'fsts'
vfio/iommufd: Extend attach/detach_hwpt callback implementations with pasid
iommufd: Extend attach/detach_hwpt callbacks to support pasid
vfio/iommufd: Create nesting parent hwpt withIOMMU_HWPT_ALLOC_PASIDflag
intel_iommu: Create the nested hwpt withIOMMU_HWPT_ALLOC_PASIDflag
intel_iommu: Rename pasid property to "pasid-bits" and define it as type uint8
intel_iommu: makevtd_dev_get_pe_from_pasid()more generic
intel_iommu: Export some functions
intel_iommu: Fix PASID validity check in fault reporting
intel_iommu: UseIOMMU_NO_PASIDand deletePASID_0
intel_iommu: Refactor PASID processing to useIOMMU_NO_PASIDinternally
intel_iommu_accel: Handle PASID entry addition forpc_inv_dscrequest
intel_iommu_accel: Handle PASID entry removal forpc_inv_dscrequest
intel_iommu_accel: Bypass PASID entry addition for just deleted entry
intel_iommu_accel: Handle PASID entry removal for system reset
intel_iommu_accel: Switch to VTDAccelPASIDCacheEntry for PASID bind/unbind and PIOTLB invalidation
intel_iommu_accel: Add pasid bits size check
intel_iommu: Expose flagVIOMMU_FLAG_PASID_SUPPORTEDandVIOMMU_FLAG_WANT_PASID_ATTACHMAINTAINERS | 12 +- backends/cryptodev-vhost.c | 9 +- backends/iommufd.c | 23 +- backends/vhost-user.c | 8 +- block/export/vhost-user-blk-server.c | 2 +- docs/devel/vfio-iommufd.rst | 10 +- docs/interop/vhost-user.rst | 135 +++++- hw/acpi/aml-build-stub.c | 6 + hw/acpi/aml-build.c | 41 ++ hw/acpi/meson.build | 3 +- hw/acpi/wdat-ich9-stub.c | 15 + hw/acpi/wdat-ich9.c | 90 ++++ hw/arm/smmuv3-accel.c | 12 +- hw/block/trace-events | 10 + hw/block/vhost-user-blk.c | 36 +- hw/char/serial-isa.c | 3 +- hw/cxl/cxl-component-utils.c | 6 + hw/cxl/cxl-host.c | 234 ++++++++- hw/cxl/cxl-mailbox-utils.c | 6 +- hw/display/vhost-user-gpu.c | 11 +- hw/i386/acpi-build.c | 12 + hw/i386/amd_iommu.c | 288 +++++++---- hw/i386/amd_iommu.h | 36 +- hw/i386/intel_iommu.c | 352 +++++++------- hw/i386/intel_iommu_accel.c | 401 ++++++++++++--- hw/i386/intel_iommu_accel.h | 20 +- hw/i386/intel_iommu_internal.h | 44 +- hw/i386/pc.c | 6 +- hw/i386/pc_q35.c | 18 + hw/i386/trace-events | 1 + hw/mem/cxl_type3.c | 17 +- hw/net/vhost_net.c | 35 +- hw/pci-host/pnv_phb3.c | 10 + hw/pci-host/q35.c | 6 +- hw/pci/pci_host.c | 14 +- hw/s390x/virtio-ccw.c | 35 +- hw/scsi/vhost-scsi-common.c | 2 +- hw/scsi/vhost-scsi.c | 2 +- hw/scsi/vhost-user-scsi.c | 1 - hw/vfio/device.c | 11 + hw/vfio/iommufd.c | 68 ++- hw/vfio/trace-events | 4 +- hw/virtio/Kconfig | 5 + hw/virtio/meson.build | 5 +- hw/virtio/trace-events | 16 +- hw/virtio/vdpa-dev.c | 3 +- hw/virtio/{vhost-backend.c => vhost-kernel.c} | 90 +--- hw/virtio/vhost-shadow-virtqueue.c | 215 ++++++-- hw/virtio/vhost-shadow-virtqueue.h | 38 +- hw/virtio/vhost-user-base.c | 63 ++- hw/virtio/vhost-user-fs.c | 9 +- hw/virtio/vhost-user-scmi.c | 9 +- hw/virtio/vhost-user-stub.c | 6 + hw/virtio/vhost-user-test-device-pci.c | 42 +- hw/virtio/vhost-user.c | 566 ++++++++++++++++++---- hw/virtio/vhost-vdpa.c | 19 +- hw/virtio/vhost-vsock-common.c | 9 +- hw/virtio/vhost.c | 384 +++++++++------ hw/virtio/virtio-bus.c | 18 +- hw/virtio/virtio-hmp-cmds.c | 5 - hw/virtio/virtio-mmio.c | 41 +- hw/virtio/virtio-pci.c | 34 +- hw/virtio/virtio-qmp.c | 18 +- hw/virtio/virtio-rtc-pci.c | 65 +++ hw/virtio/virtio-rtc.c | 190 ++++++++ hw/virtio/virtio.c | 251 +++++++++- include/hw/acpi/aml-build.h | 2 + include/hw/acpi/wdat-ich9.h | 15 + include/hw/acpi/wdat.h | 118 +++++ include/hw/core/iommu.h | 14 + include/hw/cxl/cxl.h | 1 + include/hw/cxl/cxl_device.h | 4 + include/hw/i386/intel_iommu.h | 4 +- include/hw/i386/pc.h | 1 + include/hw/pci-host/q35.h | 4 +- include/hw/vfio/vfio-device.h | 1 + include/hw/virtio/vhost-backend.h | 47 +- include/hw/virtio/vhost-user.h | 6 + include/hw/virtio/vhost.h | 71 ++- include/hw/virtio/virtio-pci.h | 3 - include/hw/virtio/virtio-rtc.h | 22 + include/hw/virtio/virtio.h | 151 +++++- include/standard-headers/linux/virtio_rtc.h | 237 +++++++++ include/system/iommufd.h | 18 +- include/system/memory.h | 4 +- net/vhost-vdpa.c | 37 +- qapi/virtio.json | 18 - subprojects/libvduse/libvduse.c | 7 +- subprojects/libvhost-user/libvhost-user.c | 77 ++- subprojects/libvhost-user/libvhost-user.h | 56 +++ system/memory.c | 14 + tests/data/acpi/x86/microvm/DSDT | Bin 365 -> 366 bytes tests/data/acpi/x86/microvm/DSDT.ioapic2 | Bin 365 -> 366 bytes tests/data/acpi/x86/microvm/DSDT.pcie | Bin 2985 -> 2986 bytes tests/data/acpi/x86/microvm/DSDT.rtc | Bin 404 -> 405 bytes tests/data/acpi/x86/microvm/DSDT.usb | Bin 414 -> 415 bytes tests/data/acpi/x86/pc/DSDT | Bin 8598 -> 8599 bytes tests/data/acpi/x86/pc/DSDT.acpierst | Bin 8509 -> 8510 bytes tests/data/acpi/x86/pc/DSDT.acpihmat | Bin 9923 -> 9924 bytes tests/data/acpi/x86/pc/DSDT.bridge | Bin 15469 -> 15470 bytes tests/data/acpi/x86/pc/DSDT.cphp | Bin 9062 -> 9063 bytes tests/data/acpi/x86/pc/DSDT.dimmpxm | Bin 10252 -> 10253 bytes tests/data/acpi/x86/pc/DSDT.hpbridge | Bin 8549 -> 8550 bytes tests/data/acpi/x86/pc/DSDT.hpbrroot | Bin 5087 -> 5088 bytes tests/data/acpi/x86/pc/DSDT.ipmikcs | Bin 8670 -> 8671 bytes tests/data/acpi/x86/pc/DSDT.memhp | Bin 9957 -> 9958 bytes tests/data/acpi/x86/pc/DSDT.nohpet | Bin 8456 -> 8457 bytes tests/data/acpi/x86/pc/DSDT.numamem | Bin 8604 -> 8605 bytes tests/data/acpi/x86/pc/DSDT.roothp | Bin 12391 -> 12392 bytes tests/data/acpi/x86/q35/DSDT | Bin 8427 -> 8428 bytes tests/data/acpi/x86/q35/DSDT.acpierst | Bin 8444 -> 8445 bytes tests/data/acpi/x86/q35/DSDT.acpihmat | Bin 9752 -> 9753 bytes tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x | Bin 12637 -> 12638 bytes tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator | Bin 8706 -> 8707 bytes tests/data/acpi/x86/q35/DSDT.applesmc | Bin 8473 -> 8474 bytes tests/data/acpi/x86/q35/DSDT.bridge | Bin 12040 -> 12041 bytes tests/data/acpi/x86/q35/DSDT.core-count | Bin 12985 -> 12986 bytes tests/data/acpi/x86/q35/DSDT.core-count2 | Bin 33842 -> 33843 bytes tests/data/acpi/x86/q35/DSDT.cphp | Bin 8891 -> 8892 bytes tests/data/acpi/x86/q35/DSDT.cxl | Bin 13218 -> 13219 bytes tests/data/acpi/x86/q35/DSDT.dimmpxm | Bin 10081 -> 10082 bytes tests/data/acpi/x86/q35/DSDT.ipmibt | Bin 8502 -> 8503 bytes tests/data/acpi/x86/q35/DSDT.ipmismbus | Bin 8515 -> 8516 bytes tests/data/acpi/x86/q35/DSDT.ivrs | Bin 8444 -> 8445 bytes tests/data/acpi/x86/q35/DSDT.memhp | Bin 9786 -> 9787 bytes tests/data/acpi/x86/q35/DSDT.mmio64 | Bin 9557 -> 9558 bytes tests/data/acpi/x86/q35/DSDT.multi-bridge | Bin 13280 -> 13281 bytes tests/data/acpi/x86/q35/DSDT.noacpihp | Bin 8289 -> 8290 bytes tests/data/acpi/x86/q35/DSDT.nohpet | Bin 8285 -> 8286 bytes tests/data/acpi/x86/q35/DSDT.numamem | Bin 8433 -> 8434 bytes tests/data/acpi/x86/q35/DSDT.pvpanic-isa | Bin 8528 -> 8529 bytes tests/data/acpi/x86/q35/DSDT.thread-count | Bin 12985 -> 12986 bytes tests/data/acpi/x86/q35/DSDT.thread-count2 | Bin 33842 -> 33843 bytes tests/data/acpi/x86/q35/DSDT.tis.tpm12 | Bin 9033 -> 9034 bytes tests/data/acpi/x86/q35/DSDT.tis.tpm2 | Bin 9059 -> 9060 bytes tests/data/acpi/x86/q35/DSDT.type4-count | Bin 18661 -> 18662 bytes tests/data/acpi/x86/q35/DSDT.viot | Bin 14684 -> 14685 bytes tests/data/acpi/x86/q35/DSDT.xapic | Bin 35790 -> 35791 bytes tests/data/acpi/x86/q35/WDAT.wdat | Bin 0 -> 308 bytes tests/qtest/amd-iommu-test.c | 76 +++ tests/qtest/bios-tables-test.c | 13 + tests/qtest/intel-iommu-test.c | 32 +- tests/qtest/iommu-intel-test.c | 4 +- tests/qtest/meson.build | 1 + 144 files changed, 4056 insertions(+), 1158 deletions(-) create mode 100644 hw/acpi/wdat-ich9-stub.c create mode 100644 hw/acpi/wdat-ich9.c rename hw/virtio/{vhost-backend.c => vhost-kernel.c} (83%) create mode 100644 hw/virtio/vhost-user-stub.c create mode 100644 hw/virtio/virtio-rtc-pci.c create mode 100644 hw/virtio/virtio-rtc.c create mode 100644 include/hw/acpi/wdat-ich9.h create mode 100644 include/hw/acpi/wdat.h create mode 100644 include/hw/virtio/virtio-rtc.h create mode 100644 include/standard-headers/linux/virtio_rtc.h create mode 100644 tests/data/acpi/x86/q35/WDAT.wdat create mode 100644 tests/qtest/amd-iommu-test.c
Quoted 16 lines · Stefan Hajnoczi
Quoted 3 lines · Michael S. Tsirkin
Resolved a bunch of conflicts.
If you see anything wrong here, pls holler.Hi Michael,
The check for mangled mailing list author emails is failing. Pleasegit commit --amend --author=...with their real email and resend your pull request:Alireza Sanaee via qemu development (2):
hw/cxl: Allowcxl_cfmws_find_device()to filter on whether
interleaved paths are accepted
hw/cxl: Add a performant (and correct) path for the non interleaved cases
ERROR: pull request includes commits attributed to list
Quoted 3 lines
Thanks!
Stefan
Fixed now, thanks!
new hash 062c1b7d033e675ea622939
Quoted 354 lines
Quoted 354 lines
The following changes since commit
f5a2438405d4ae8b62de7c9b39fac0b2155ee544:Merge tag 'pull-qapi-2026-05-21' of https://repo.or.cz/qemu/armbru into staging (2026-05-21 09:00:22 -0400)
are available in the Git repository at:
https://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
for you to fetch changes up to
31dbba011d0f3a21432d0629fae0b4885f2eed25:hw/scsi/vhost-scsi: fix build with older kernel headers (2026-06-03 08:36:42 -0400)
----------------------------------------------------------------
pci, vhost, virtio, iommu: features, fixes, cleanups
intel_iommu:
PASID support for passthrough
some properties renamed
virtio-rtc:
new device
acpi:
watchdog (x86 q35)
COM irqs are now shared
vhost-user:
vhost-user passes GPA not HVA now
vhost SHMEM_MAP/UNMAP support
vhost-vdpa:
svqIN_ORDERsupportamd_iommu:
IOMMU XT interrupt support
command buffer fixes
cxl:
PPR support
performant path for non-interleaved cases
vhost-scsi:
build fix for older kernel headers
fixes, cleanups all over the placeSigned-off-by Michael S. Tsirkin <[email protected]>----------------------------------------------------------------
Aditya Gupta (2):
ppc/pnv_phb3: Error out on invalid config access hw/pci: Replace assert with bounds check and returnAlbert Esteve (7):
vhost-user: Add VirtIO Shared Memory map requestvhost_user.rst: Align VhostUserMsg excerpt membersvhost_user.rst: Add SHMEM_MAP/_UNMAP to spec
vhost_user: Add frontendget_shmem_configcommandvhost_user.rst: AddGET_SHMEM_CONFIGmessage
qmp: add shmem feature map
vhost-user-device: Add shared memory BARAlejandro Jimenez (3):
amd_iommu: Update command buffer head ptr in MMIO region after wraparound
amd_iommu: Follow root pointer before page walk and use 1-based levels
amd_iommu: Reject non-decreasing NextLevel infetch_pte()Alexandr Moshkov (1):
vhost-user.rst: fix typoAlexey Gerasimenko (1):
q35: Fix incorrect values for PCIEXBAR masksAlireza Sanaee via qemu development (2):
hw/cxl: Allowcxl_cfmws_find_device()to filter on whether interleaved paths are accepted hw/cxl: Add a performant (and correct) path for the non interleaved casesCostas Argyris (1):
tests/qtest: Add amd-iommu command buffer head wrap testEugenio Pérez (8):
net/vhost-vdpa: enable vqs beforeDRIVER_OKif no cvq
virtio: Allow to fill a whole virtqueue in order
vhost: move svq next desc array to descs state struct
vhost: factor out the descriptor next fetching
vhost: factor out the get of last used desc in SVQ
vhost: factor out the detach buf logic in SVQ
vhost: addin_orderfeature to shadow virtqueue
vhost: accept in order feature flagIgor Mammedov (6):
acpi: add API to build WDAT instructions
x86: q35: add 'wdat' property
x86: q35: generate WDAT ACPI table
tests: acpi: x86/q35: whitelist new WDAT table
tests: acpi: x86/q35: add WDAT table test case
tests: acpi: x86/q35: update expected WDAT blobJonathan Cameron (1):
MAINTAINERS: Update CXL maintainers entry including adding linux-cxl listJorge E. Moreira (1):
vhost-user.rst: Explicitly allow front-end to write to kick FDsJunjie Cao (2):
intel_iommu: fix guest-triggerable abort on oversized MMIO access tests/qtest: add 8-byte MMIO access sweep for intel-iommuKuan-Wei Chiu (3):
vhost-user: Fix stale error logs and return values in teardown paths
standard-headers: Addvirtio_rtc.hfrom Linux 7.0-rc1
virtio-rtc: Add basic virtio-rtc supportMark Cave-Ayland (4):
hw/acpi/aml-build.c: addaml_irq()representing the 3-byte IRQ descriptor tests/acpi: allow DSDT acpi table changeshw/char/serial-isa.c: declare IRQ as shared in ACPI IRQ descriptor
tests: data: update x86 ACPI tablesMax Makarov (2):
vhost-user-blk-server: do not advertiseVIRTIO_BLK_F_SIZE_MAXwith size_max=0
vhost-user-blk: do not forceVIRTIO_BLK_F_SIZE_MAXPaolo Bonzini (1):
amd_iommu: restrict command buffer head/tail ranges to ring sizeQuan Sun (1):
hw/scsi/vhost-scsi: fix build with older kernel headersSairaj Kodilkar (3):
amd_iommu: Use switch case to determine mmio register name
amd_iommu: Turn on XT support only when guest has enabled it
amd_iommu: Generate XT interrupts when xt support is enabledShiju Jose (3):
hw/cxl: Fix handling of component ID to not assume it is a string
hw/cxl: Add fixes in Post Package Repair (PPR)
hw/cxl/events: Fix handling of component ID in event records generation to not assume it is a stringStefano Garzarella (2):
libvhost-user: fix buffer overflow invirtqueue_read_indirect_desc()
libvduse: fix buffer overflow invduse_queue_read_indirect_desc()Thomas Huth (1):
hw/i386/pc: Add a proper owner for the ioport memory regionsVladimir Sementsov-Ogievskiy (32):
vhost-user: rework enabling vrings
vhost: dropbackend_featuresfield
vhost-user: introducevhost_user_has_protocol_feature()helper
vhost: moveprotocol_featurestovhost_user
vhost-user-gpu: drop code duplication
vhost: make vhost_dev.features private
virtio: move common part of_set_guest_notifierto generic code
virtio: drop*_set_guest_notifier_fd_handler()helpers
vhost-user: keep QIOChannelSocket for backend channel
vhost:vhost_virtqueue_start(): fix failure path
vhost: makevhost_memory_unmap()null-safe
vhost: simplify calls tovhost_memory_unmap()
vhost: move vrings mapping to the top ofvhost_virtqueue_start()
vhost:vhost_virtqueue_start(): drop extra local variables
vhost: final refactoring of vhost vrings map/unmap
vhost: simplifyvhost_dev_init()error-path
vhost: move busyloop timeout initialization tovhost_virtqueue_init()
vhost:vhost_dev_init(): simplify features initialization hw/virtio/virtio-bus: refactorvirtio_bus_set_host_notifier()
vhost-user: make trace events more readable
vhost-user-blk: add some useful trace-points
vhost: add some useful trace-points
vhost: move IOTLB functions fromvhost-backend.ctovhost.c
vhost: use consistent naming for backend handlers
vhost: renamevhost-backend.ctovhost-kernel.c
vhost: replace .vhost_vq_get_addr() with .vhost_phys_vring_addr()
vhost: simplifyvhost_memory_map()andvhost_memory_unmap()
qapi: remove user addresses from x-query-virtio-vhost-queue-status
vhost: stop reusingvq->desc(and friends) to store physical address
vhost: rename vring pointer fields to reflect user addresses
vhost: add .vhost_phys_iotlb_msg() handler
vhost-user: addVHOST_USER_PROTOCOL_F_GPA_ADDRESSESZhenzhong Duan (19):
intel_iommu: Remove 'x-' prefix from 'x-scalable-mode' and 'x-flts' properties
intel_iommu: Change 'flts' property naming to 'fsts'
vfio/iommufd: Extend attach/detach_hwpt callback implementations with pasid
iommufd: Extend attach/detach_hwpt callbacks to support pasid
vfio/iommufd: Create nesting parent hwpt withIOMMU_HWPT_ALLOC_PASIDflag
intel_iommu: Create the nested hwpt withIOMMU_HWPT_ALLOC_PASIDflag
intel_iommu: Rename pasid property to "pasid-bits" and define it as type uint8
intel_iommu: makevtd_dev_get_pe_from_pasid()more generic
intel_iommu: Export some functions
intel_iommu: Fix PASID validity check in fault reporting
intel_iommu: UseIOMMU_NO_PASIDand deletePASID_0
intel_iommu: Refactor PASID processing to useIOMMU_NO_PASIDinternally
intel_iommu_accel: Handle PASID entry addition forpc_inv_dscrequest
intel_iommu_accel: Handle PASID entry removal forpc_inv_dscrequest
intel_iommu_accel: Bypass PASID entry addition for just deleted entry
intel_iommu_accel: Handle PASID entry removal for system reset
intel_iommu_accel: Switch to VTDAccelPASIDCacheEntry for PASID bind/unbind and PIOTLB invalidation
intel_iommu_accel: Add pasid bits size check
intel_iommu: Expose flagVIOMMU_FLAG_PASID_SUPPORTEDandVIOMMU_FLAG_WANT_PASID_ATTACHMAINTAINERS | 12 +- backends/cryptodev-vhost.c | 9 +- backends/iommufd.c | 23 +- backends/vhost-user.c | 8 +- block/export/vhost-user-blk-server.c | 2 +- docs/devel/vfio-iommufd.rst | 10 +- docs/interop/vhost-user.rst | 135 +++++- hw/acpi/aml-build-stub.c | 6 + hw/acpi/aml-build.c | 41 ++ hw/acpi/meson.build | 3 +- hw/acpi/wdat-ich9-stub.c | 15 + hw/acpi/wdat-ich9.c | 90 ++++ hw/arm/smmuv3-accel.c | 12 +- hw/block/trace-events | 10 + hw/block/vhost-user-blk.c | 36 +- hw/char/serial-isa.c | 3 +- hw/cxl/cxl-component-utils.c | 6 + hw/cxl/cxl-host.c | 234 ++++++++- hw/cxl/cxl-mailbox-utils.c | 6 +- hw/display/vhost-user-gpu.c | 11 +- hw/i386/acpi-build.c | 12 + hw/i386/amd_iommu.c | 288 +++++++---- hw/i386/amd_iommu.h | 36 +- hw/i386/intel_iommu.c | 352 +++++++------- hw/i386/intel_iommu_accel.c | 401 ++++++++++++--- hw/i386/intel_iommu_accel.h | 20 +- hw/i386/intel_iommu_internal.h | 44 +- hw/i386/pc.c | 6 +- hw/i386/pc_q35.c | 18 + hw/i386/trace-events | 1 + hw/mem/cxl_type3.c | 17 +- hw/net/vhost_net.c | 35 +- hw/pci-host/pnv_phb3.c | 10 + hw/pci-host/q35.c | 6 +- hw/pci/pci_host.c | 14 +- hw/s390x/virtio-ccw.c | 35 +- hw/scsi/vhost-scsi-common.c | 2 +- hw/scsi/vhost-scsi.c | 2 +- hw/scsi/vhost-user-scsi.c | 1 - hw/vfio/device.c | 11 + hw/vfio/iommufd.c | 68 ++- hw/vfio/trace-events | 4 +- hw/virtio/Kconfig | 5 + hw/virtio/meson.build | 5 +- hw/virtio/trace-events | 16 +- hw/virtio/vdpa-dev.c | 3 +- hw/virtio/{vhost-backend.c => vhost-kernel.c} | 90 +--- hw/virtio/vhost-shadow-virtqueue.c | 215 ++++++-- hw/virtio/vhost-shadow-virtqueue.h | 38 +- hw/virtio/vhost-user-base.c | 63 ++- hw/virtio/vhost-user-fs.c | 9 +- hw/virtio/vhost-user-scmi.c | 9 +- hw/virtio/vhost-user-stub.c | 6 + hw/virtio/vhost-user-test-device-pci.c | 42 +- hw/virtio/vhost-user.c | 566 ++++++++++++++++++---- hw/virtio/vhost-vdpa.c | 19 +- hw/virtio/vhost-vsock-common.c | 9 +- hw/virtio/vhost.c | 384 +++++++++------ hw/virtio/virtio-bus.c | 18 +- hw/virtio/virtio-hmp-cmds.c | 5 - hw/virtio/virtio-mmio.c | 41 +- hw/virtio/virtio-pci.c | 34 +- hw/virtio/virtio-qmp.c | 18 +- hw/virtio/virtio-rtc-pci.c | 65 +++ hw/virtio/virtio-rtc.c | 190 ++++++++ hw/virtio/virtio.c | 251 +++++++++- include/hw/acpi/aml-build.h | 2 + include/hw/acpi/wdat-ich9.h | 15 + include/hw/acpi/wdat.h | 118 +++++ include/hw/core/iommu.h | 14 + include/hw/cxl/cxl.h | 1 + include/hw/cxl/cxl_device.h | 4 + include/hw/i386/intel_iommu.h | 4 +- include/hw/i386/pc.h | 1 + include/hw/pci-host/q35.h | 4 +- include/hw/vfio/vfio-device.h | 1 + include/hw/virtio/vhost-backend.h | 47 +- include/hw/virtio/vhost-user.h | 6 + include/hw/virtio/vhost.h | 71 ++- include/hw/virtio/virtio-pci.h | 3 - include/hw/virtio/virtio-rtc.h | 22 + include/hw/virtio/virtio.h | 151 +++++- include/standard-headers/linux/virtio_rtc.h | 237 +++++++++ include/system/iommufd.h | 18 +- include/system/memory.h | 4 +- net/vhost-vdpa.c | 37 +- qapi/virtio.json | 18 - subprojects/libvduse/libvduse.c | 7 +- subprojects/libvhost-user/libvhost-user.c | 77 ++- subprojects/libvhost-user/libvhost-user.h | 56 +++ system/memory.c | 14 + tests/data/acpi/x86/microvm/DSDT | Bin 365 -> 366 bytes tests/data/acpi/x86/microvm/DSDT.ioapic2 | Bin 365 -> 366 bytes tests/data/acpi/x86/microvm/DSDT.pcie | Bin 2985 -> 2986 bytes tests/data/acpi/x86/microvm/DSDT.rtc | Bin 404 -> 405 bytes tests/data/acpi/x86/microvm/DSDT.usb | Bin 414 -> 415 bytes tests/data/acpi/x86/pc/DSDT | Bin 8598 -> 8599 bytes tests/data/acpi/x86/pc/DSDT.acpierst | Bin 8509 -> 8510 bytes tests/data/acpi/x86/pc/DSDT.acpihmat | Bin 9923 -> 9924 bytes tests/data/acpi/x86/pc/DSDT.bridge | Bin 15469 -> 15470 bytes tests/data/acpi/x86/pc/DSDT.cphp | Bin 9062 -> 9063 bytes tests/data/acpi/x86/pc/DSDT.dimmpxm | Bin 10252 -> 10253 bytes tests/data/acpi/x86/pc/DSDT.hpbridge | Bin 8549 -> 8550 bytes tests/data/acpi/x86/pc/DSDT.hpbrroot | Bin 5087 -> 5088 bytes tests/data/acpi/x86/pc/DSDT.ipmikcs | Bin 8670 -> 8671 bytes tests/data/acpi/x86/pc/DSDT.memhp | Bin 9957 -> 9958 bytes tests/data/acpi/x86/pc/DSDT.nohpet | Bin 8456 -> 8457 bytes tests/data/acpi/x86/pc/DSDT.numamem | Bin 8604 -> 8605 bytes tests/data/acpi/x86/pc/DSDT.roothp | Bin 12391 -> 12392 bytes tests/data/acpi/x86/q35/DSDT | Bin 8427 -> 8428 bytes tests/data/acpi/x86/q35/DSDT.acpierst | Bin 8444 -> 8445 bytes tests/data/acpi/x86/q35/DSDT.acpihmat | Bin 9752 -> 9753 bytes tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x | Bin 12637 -> 12638 bytes tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator | Bin 8706 -> 8707 bytes tests/data/acpi/x86/q35/DSDT.applesmc | Bin 8473 -> 8474 bytes tests/data/acpi/x86/q35/DSDT.bridge | Bin 12040 -> 12041 bytes tests/data/acpi/x86/q35/DSDT.core-count | Bin 12985 -> 12986 bytes tests/data/acpi/x86/q35/DSDT.core-count2 | Bin 33842 -> 33843 bytes tests/data/acpi/x86/q35/DSDT.cphp | Bin 8891 -> 8892 bytes tests/data/acpi/x86/q35/DSDT.cxl | Bin 13218 -> 13219 bytes tests/data/acpi/x86/q35/DSDT.dimmpxm | Bin 10081 -> 10082 bytes tests/data/acpi/x86/q35/DSDT.ipmibt | Bin 8502 -> 8503 bytes tests/data/acpi/x86/q35/DSDT.ipmismbus | Bin 8515 -> 8516 bytes tests/data/acpi/x86/q35/DSDT.ivrs | Bin 8444 -> 8445 bytes tests/data/acpi/x86/q35/DSDT.memhp | Bin 9786 -> 9787 bytes tests/data/acpi/x86/q35/DSDT.mmio64 | Bin 9557 -> 9558 bytes tests/data/acpi/x86/q35/DSDT.multi-bridge | Bin 13280 -> 13281 bytes tests/data/acpi/x86/q35/DSDT.noacpihp | Bin 8289 -> 8290 bytes tests/data/acpi/x86/q35/DSDT.nohpet | Bin 8285 -> 8286 bytes tests/data/acpi/x86/q35/DSDT.numamem | Bin 8433 -> 8434 bytes tests/data/acpi/x86/q35/DSDT.pvpanic-isa | Bin 8528 -> 8529 bytes tests/data/acpi/x86/q35/DSDT.thread-count | Bin 12985 -> 12986 bytes tests/data/acpi/x86/q35/DSDT.thread-count2 | Bin 33842 -> 33843 bytes tests/data/acpi/x86/q35/DSDT.tis.tpm12 | Bin 9033 -> 9034 bytes tests/data/acpi/x86/q35/DSDT.tis.tpm2 | Bin 9059 -> 9060 bytes tests/data/acpi/x86/q35/DSDT.type4-count | Bin 18661 -> 18662 bytes tests/data/acpi/x86/q35/DSDT.viot | Bin 14684 -> 14685 bytes tests/data/acpi/x86/q35/DSDT.xapic | Bin 35790 -> 35791 bytes tests/data/acpi/x86/q35/WDAT.wdat | Bin 0 -> 308 bytes tests/qtest/amd-iommu-test.c | 76 +++ tests/qtest/bios-tables-test.c | 13 + tests/qtest/intel-iommu-test.c | 32 +- tests/qtest/iommu-intel-test.c | 4 +- tests/qtest/meson.build | 1 + 144 files changed, 4056 insertions(+), 1158 deletions(-) create mode 100644 hw/acpi/wdat-ich9-stub.c create mode 100644 hw/acpi/wdat-ich9.c rename hw/virtio/{vhost-backend.c => vhost-kernel.c} (83%) create mode 100644 hw/virtio/vhost-user-stub.c create mode 100644 hw/virtio/virtio-rtc-pci.c create mode 100644 hw/virtio/virtio-rtc.c create mode 100644 include/hw/acpi/wdat-ich9.h create mode 100644 include/hw/acpi/wdat.h create mode 100644 include/hw/virtio/virtio-rtc.h create mode 100644 include/standard-headers/linux/virtio_rtc.h create mode 100644 tests/data/acpi/x86/q35/WDAT.wdat create mode 100644 tests/qtest/amd-iommu-test.c
Stefan Hajnoczi
AppliedApplied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/11.1 for any user-visible changes.