virtio,pc,pci: features, fixes, cleanups
Subsystems (2)
The following changes since commit 7433709a147706ad7d1956b15669279933d0f82b:
Merge tag 'hw-misc-20250113' of https://github.com/philmd/qemu into staging (2025-01-14 12:46:56 -0500)
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 60f543ad917fad731e39ff8ce2ca83b9a9cc9d90:
virtio-net: vhost-user: Implement internal migration (2025-01-15 13:07:34 -0500)
----------------------------------------------------------------
virtio,pc,pci: features, fixes, cleanups
The big thing here are:
stage-1 translation in vtd
internal migration in vhost-user ghes driver preparation for error injection new resource uuid feature in virtio gpu
And as usual, fixes and cleanups.
----------------------------------------------------------------
Clément Mathieu--Drif (4):
intel_iommu: Check if the input address is canonical
intel_iommu: Set accessed and dirty bits during stage-1 translation
intel_iommu: Add an internal API to find an address space with PASID
intel_iommu: Add support for PASID-based device IOTLB invalidation
Dorinda Bassey (1):
virtio-gpu: Add definition for resource_uuid feature
Igor Mammedov (6):
tests: acpi: whitelist expected blobs
cpuhp: make sure that remove events are handled within the same SCI
tests: acpi: update expected blobs
tests: acpi: whitelist expected blobs
pci: acpi: Windows 'PCI Label Id' bug workaround
tests: acpi: update expected blobs
Laurent Vivier (2):
vhost: Add stubs for the migration state transfer interface
virtio-net: vhost-user: Implement internal migration
Li Zhijian (1):
hw/cxl: Fix msix_notify: Assertion `vector < dev->msix_entries_nr`
Mauro Carvalho Chehab (16):
acpi/ghes: get rid of ACPI_HEST_SRC_ID_RESERVED acpi/ghes: simplify acpi_ghes_record_errors() code acpi/ghes: simplify the per-arch caller to build HEST table acpi/ghes: better handle source_id and notification acpi/ghes: Fix acpi_ghes_record_errors() argument acpi/ghes: Remove a duplicated out of bounds check acpi/ghes: Change the type for source_id
acpi/ghes: don't check if physical_address is not zero acpi/ghes: make the GHES record generation more generic acpi/ghes: better name GHES memory error function acpi/ghes: don't crash QEMU if ghes GED is not found acpi/ghes: rename etc/hardware_error file macros acpi/ghes: better name the offset of the hardware error firmware acpi/ghes: move offset calculus to a separate function acpi/ghes: Change ghes fill logic to work with only one source
docs: acpi_hest_ghes: fix documentation for CPER size
Nicholas Piggin (1):
pci/msix: Fix msix pba read vector poll end calculation
Sebastian Ott (1):
pci: ensure valid link status bits for downstream ports
Yi Liu (2):
intel_iommu: Rename slpte to pte
intel_iommu: Implement stage-1 translation
Yu Zhang (1):
intel_iommu: Use the latest fault reasons defined by spec
Zhenzhong Duan (13):
intel_iommu: Make pasid entry type check accurate
intel_iommu: Add a placeholder variable for scalable mode stage-1 translation
intel_iommu: Flush stage-2 cache in PASID-selective PASID-based iotlb invalidation
intel_iommu: Check stage-1 translation result with interrupt range
intel_iommu: Flush stage-1 cache in iotlb invalidation
intel_iommu: Process PASID-based iotlb invalidation
intel_iommu: piotlb invalidation should notify unmap
tests/acpi: q35: allow DMAR acpi table changes
intel_iommu: Set default aw_bits to 48 starting from QEMU 9.2 tests/acpi: q35: Update host address width in DMAR
intel_iommu: Introduce a property x-flts for stage-1 translation
intel_iommu: Introduce a property to control FS1GP cap bit setting tests/qtest: Add intel-iommu test
hw/i386/intel_iommu_internal.h | 101 ++- include/hw/acpi/ghes.h | 16 +- include/hw/i386/intel_iommu.h | 8 +- include/hw/virtio/vhost.h | 23 + include/hw/virtio/virtio-gpu.h | 3 + hw/acpi/cpu.c | 43 +- hw/acpi/generic_event_device.c | 4 +- hw/acpi/ghes-stub.c | 2 +- hw/acpi/ghes.c | 256 ++++---- hw/arm/virt-acpi-build.c | 5 +- hw/display/vhost-user-gpu.c | 8 + hw/display/virtio-gpu-base.c | 3 + hw/i386/acpi-build.c | 33 +- hw/i386/intel_iommu.c | 734 +++++++++++++++++----- hw/i386/pc.c | 1 + hw/mem/cxl_type3.c | 2 +- hw/net/virtio-net.c | 135 +++- hw/pci/msix.c | 2 +- hw/pci/pcie.c | 12 +- target/arm/kvm.c | 2 +- tests/qtest/intel-iommu-test.c | 64 ++ MAINTAINERS | 1 + docs/specs/acpi_hest_ghes.rst | 6 +- tests/data/acpi/x86/pc/DSDT | Bin 8526 -> 8611 bytes tests/data/acpi/x86/pc/DSDT.acpierst | Bin 8437 -> 8522 bytes tests/data/acpi/x86/pc/DSDT.acpihmat | Bin 9851 -> 9936 bytes tests/data/acpi/x86/pc/DSDT.bridge | Bin 15397 -> 15482 bytes tests/data/acpi/x86/pc/DSDT.cphp | Bin 8990 -> 9075 bytes tests/data/acpi/x86/pc/DSDT.dimmpxm | Bin 10180 -> 10265 bytes tests/data/acpi/x86/pc/DSDT.hpbridge | Bin 8477 -> 8562 bytes tests/data/acpi/x86/pc/DSDT.hpbrroot | Bin 5033 -> 5100 bytes tests/data/acpi/x86/pc/DSDT.ipmikcs | Bin 8598 -> 8683 bytes tests/data/acpi/x86/pc/DSDT.memhp | Bin 9885 -> 9970 bytes tests/data/acpi/x86/pc/DSDT.nohpet | Bin 8384 -> 8469 bytes tests/data/acpi/x86/pc/DSDT.numamem | Bin 8532 -> 8617 bytes tests/data/acpi/x86/pc/DSDT.roothp | Bin 12319 -> 12404 bytes tests/data/acpi/x86/q35/DMAR.dmar | Bin 120 -> 120 bytes tests/data/acpi/x86/q35/DSDT | Bin 8355 -> 8440 bytes tests/data/acpi/x86/q35/DSDT.acpierst | Bin 8372 -> 8457 bytes tests/data/acpi/x86/q35/DSDT.acpihmat | Bin 9680 -> 9765 bytes tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x | Bin 12565 -> 12650 bytes tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator | Bin 8634 -> 8719 bytes tests/data/acpi/x86/q35/DSDT.applesmc | Bin 8401 -> 8486 bytes tests/data/acpi/x86/q35/DSDT.bridge | Bin 11968 -> 12053 bytes tests/data/acpi/x86/q35/DSDT.core-count | Bin 12913 -> 12998 bytes tests/data/acpi/x86/q35/DSDT.core-count2 | Bin 33770 -> 33855 bytes tests/data/acpi/x86/q35/DSDT.cphp | Bin 8819 -> 8904 bytes tests/data/acpi/x86/q35/DSDT.cxl | Bin 13146 -> 13231 bytes tests/data/acpi/x86/q35/DSDT.dimmpxm | Bin 10009 -> 10094 bytes tests/data/acpi/x86/q35/DSDT.ipmibt | Bin 8430 -> 8515 bytes tests/data/acpi/x86/q35/DSDT.ipmismbus | Bin 8443 -> 8528 bytes tests/data/acpi/x86/q35/DSDT.ivrs | Bin 8372 -> 8457 bytes tests/data/acpi/x86/q35/DSDT.memhp | Bin 9714 -> 9799 bytes tests/data/acpi/x86/q35/DSDT.mmio64 | Bin 9485 -> 9570 bytes tests/data/acpi/x86/q35/DSDT.multi-bridge | Bin 13208 -> 13293 bytes tests/data/acpi/x86/q35/DSDT.noacpihp | Bin 8235 -> 8302 bytes tests/data/acpi/x86/q35/DSDT.nohpet | Bin 8213 -> 8298 bytes tests/data/acpi/x86/q35/DSDT.numamem | Bin 8361 -> 8446 bytes tests/data/acpi/x86/q35/DSDT.pvpanic-isa | Bin 8456 -> 8541 bytes tests/data/acpi/x86/q35/DSDT.thread-count | Bin 12913 -> 12998 bytes tests/data/acpi/x86/q35/DSDT.thread-count2 | Bin 33770 -> 33855 bytes tests/data/acpi/x86/q35/DSDT.tis.tpm12 | Bin 8961 -> 9046 bytes tests/data/acpi/x86/q35/DSDT.tis.tpm2 | Bin 8987 -> 9072 bytes tests/data/acpi/x86/q35/DSDT.type4-count | Bin 18589 -> 18674 bytes tests/data/acpi/x86/q35/DSDT.viot | Bin 14612 -> 14697 bytes tests/data/acpi/x86/q35/DSDT.xapic | Bin 35718 -> 35803 bytes tests/qtest/meson.build | 1 + 67 files changed, 1132 insertions(+), 333 deletions(-) create mode 100644 tests/qtest/intel-iommu-test.c
[PULL 06/48] intel_iommu: Use the latest fault reasons defined by spec
From: Yu Zhang <[email protected]>
Spec revision 3.0 or above defines more detailed fault reasons for scalable mode. So introduce them into emulation code, see spec section 7.1.2 for details.
Note spec revision has no relation with VERSION register, Guest kernel should not use that register to judge what features are supported. Instead cap/ecap bits should be checked.
Message-Id: <[email protected]>
--- hw/i386/intel_iommu_internal.h | 9 ++++++++- hw/i386/intel_iommu.c | 25 ++++++++++++++++--------- 2 files changed, 24 insertions(+), 10 deletions(-)
hw/i386/intel_iommu_internal.h +8 -1
@@ -311,7 +311,14 @@ typedef enum VTDFaultReason {* request while disabled */ VTD_FR_IR_SID_ERR =0x26 ,/* Invalid Source-ID */ -VTD_FR_PASID_TABLE_INV =0x58 ,/*Invalid PASID table entry */ +/* PASID directory entry access failure */ +VTD_FR_PASID_DIR_ACCESS_ERR =0x50 , +/* The Present(P) field of pasid directory entry is 0 */ +VTD_FR_PASID_DIR_ENTRY_P =0x51 , +VTD_FR_PASID_TABLE_ACCESS_ERR =0x58 ,/* PASID table entry access failure */ +/* The Present(P) field of pasid table entry is 0 */ +VTD_FR_PASID_ENTRY_P =0x59 , +VTD_FR_PASID_TABLE_ENTRY_INV =0x5b ,/*Invalid PASID table entry */ /* Output address in the interrupt address range for scalable mode */ VTD_FR_SM_INTERRUPT_ADDR = 0x87,
hw/i386/intel_iommu.c +16 -9
@@ -796,7 +796,7 @@ static int vtd_get_pdire_from_pdir_table(dma_addr_t pasid_dir_base, addr = pasid_dir_base + index * entry_size;if (dma_memory_read (&address_space_memory, addr, pdire, entry_size,MEMTXATTRS_UNSPECIFIED )) { -return -VTD_FR_PASID_TABLE_INV ; +return -VTD_FR_PASID_DIR_ACCESS_ERR ; } pdire->val =le64_to_cpu (pdire->val);
@@ -814,6 +814,7 @@ static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState *s,dma_addr_t addr, VTDPASIDEntry *pe) { + uint8_t pgtt;uint32_t index;dma_addr_t entry_size;X86IOMMUState *x86_iommu =X86_IOMMU_DEVICE (s);
@@ -823,7 +824,7 @@ static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState *s, addr = addr + index * entry_size;if (dma_memory_read (&address_space_memory, addr, pe, entry_size,MEMTXATTRS_UNSPECIFIED )) { -return -VTD_FR_PASID_TABLE_INV ; +return -VTD_FR_PASID_TABLE_ACCESS_ERR ; }for (size_t i =0 ; i <ARRAY_SIZE (pe->val); i++) { pe->val[i] =le64_to_cpu (pe->val[i]);
@@ -831,11 +832,13 @@ static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState *s,/* Do translation type check */ if (!vtd_pe_type_check (x86_iommu, pe)) { -return -VTD_FR_PASID_TABLE_INV ; +return -VTD_FR_PASID_TABLE_ENTRY_INV ; } -if (!vtd_is_level_supported (s,VTD_PE_GET_LEVEL (pe))) { -return -VTD_FR_PASID_TABLE_INV ; + pgtt =VTD_PE_GET_TYPE (pe); +if (pgtt ==VTD_SM_PASID_ENTRY_SLT && + !vtd_is_level_supported (s,VTD_PE_GET_LEVEL (pe))) { +return -VTD_FR_PASID_TABLE_ENTRY_INV ; }return 0 ;
@@ -876,7 +879,7 @@ static int vtd_get_pe_from_pasid_table(IntelIOMMUState *s, }if (!vtd_pdire_present (&pdire)) { -return -VTD_FR_PASID_TABLE_INV ; +return -VTD_FR_PASID_DIR_ENTRY_P ; } ret =vtd_get_pe_from_pdire (s, pasid, &pdire, pe);
@@ -885,7 +888,7 @@ static int vtd_get_pe_from_pasid_table(IntelIOMMUState *s, }if (!vtd_pe_present (pe)) { -return -VTD_FR_PASID_TABLE_INV ; +return -VTD_FR_PASID_ENTRY_P ; }return 0 ;
@@ -938,7 +941,7 @@ static int vtd_ce_get_pasid_fpd(IntelIOMMUState *s, }if (!vtd_pdire_present (&pdire)) { -return -VTD_FR_PASID_TABLE_INV ; +return -VTD_FR_PASID_DIR_ENTRY_P ; }/*
@@ -1795,7 +1798,11 @@ static const bool vtd_qualified_faults[] = { [VTD_FR_ROOT_ENTRY_RSVD] = false, [VTD_FR_PAGING_ENTRY_RSVD] = true, [VTD_FR_CONTEXT_ENTRY_TT] = true, - [VTD_FR_PASID_TABLE_INV] = false, + [VTD_FR_PASID_DIR_ACCESS_ERR] = false, + [VTD_FR_PASID_DIR_ENTRY_P] = true, + [VTD_FR_PASID_TABLE_ACCESS_ERR] = false, + [VTD_FR_PASID_ENTRY_P] = true, + [VTD_FR_PASID_TABLE_ENTRY_INV] = true, [VTD_FR_SM_INTERRUPT_ADDR] = true, [VTD_FR_MAX] = false, };
Signature · 1 line
MST
[PULL 09/48] intel_iommu: Flush stage-2 cache in PASID-selective PASID-based iotlb invalidation
In reply to Michael S. TsirkinFrom: Zhenzhong Duan <[email protected]>
Per VT-d spec 4.1, 6.5.2.4, "Table 21. PASID-based-IOTLB Invalidation", PADID-selective PASID-based iotlb invalidation will flush stage-2 iotlb entries with matching domain id and pasid.
With stage-1 translation introduced, guest could send PASID-selective PASID-based iotlb invalidation to flush either stage-1 or stage-2 entries.
By this chance, remove old IOTLB related definitions which were unused.
Message-Id: <[email protected]>
--- hw/i386/intel_iommu_internal.h | 14 ++++-- hw/i386/intel_iommu.c | 85 +++++++++++++++++++++++++++++++++- 2 files changed, 93 insertions(+), 6 deletions(-)
hw/i386/intel_iommu_internal.h +9 -5
@@ -404,11 +404,6 @@ typedef union VTDInvDesc VTDInvDesc;#define VTD_INV_DESC_IOTLB_AM (val) ((val) & 0x3fULL)#define VTD_INV_DESC_IOTLB_RSVD_LO 0xffffffff0000f100ULL#define VTD_INV_DESC_IOTLB_RSVD_HI 0xf80ULL -#define VTD_INV_DESC_IOTLB_PASID_PASID (2ULL << 4) -#define VTD_INV_DESC_IOTLB_PASID_PAGE (3ULL << 4) -#define VTD_INV_DESC_IOTLB_PASID (val) (((val) >> 32) & VTD_PASID_ID_MASK) -#define VTD_INV_DESC_IOTLB_PASID_RSVD_LO 0xfff00000000001c0ULL -#define VTD_INV_DESC_IOTLB_PASID_RSVD_HI 0xf80ULL/* Mask for Device IOTLB Invalidate Descriptor */ #define VTD_INV_DESC_DEVICE_IOTLB_ADDR (val) ((val) & 0xfffffffffffff000ULL)
@@ -443,6 +438,15 @@ typedef union VTDInvDesc VTDInvDesc; (0x3ffff800ULL | ~(VTD_HAW_MASK(aw) | VTD_SL_IGN_COM | VTD_SL_TM)) : \ (0x3ffff800ULL | ~(VTD_HAW_MASK (aw) |VTD_SL_IGN_COM )) +/* Masks for PIOTLB Invalidate Descriptor */ +#define VTD_INV_DESC_PIOTLB_G (3ULL << 4) +#define VTD_INV_DESC_PIOTLB_ALL_IN_PASID (2ULL << 4) +#define VTD_INV_DESC_PIOTLB_PSI_IN_PASID (3ULL << 4) +#define VTD_INV_DESC_PIOTLB_DID (val) (((val) >> 16) & VTD_DOMAIN_ID_MASK) +#define VTD_INV_DESC_PIOTLB_PASID (val) (((val) >> 32) & 0xfffffULL) +#define VTD_INV_DESC_PIOTLB_RSVD_VAL0 0xfff000000000f1c0ULL +#define VTD_INV_DESC_PIOTLB_RSVD_VAL1 0xf80ULL +/* Information about page-selective IOTLB invalidate */ struct VTDIOTLBPageInvInfo {uint16_t domain_id;
hw/i386/intel_iommu.c +84 -1
103 lines not on this page · raw message
Signature · 1 line
MST
[PULL 04/48] cpuhp: make sure that remove events are handled within the same SCI
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
CPU_SCAN_METHOD was processing insert events first and only if insert event was not present then it would check remove event.
Normally it's not an issue as it doesn't make much sense tho hotplug and immediately unplug it. In this corner case, which can be reproduced with:
qemu -smp 1,maxcpus=2 -cpu host -monitor stdio \
-drive if=pflash,format=raw,readonly,file=edk2-x86_64-code.fd * boot till GRUB prompt and pause guest (either via monitor or stop GRUB from automatic boot)
* at monitor prompt add CPU:
device_add host-x86_64-cpu,socket-id=0,core-id=1,thread-id=0,id=foo
* let guest OS boot completely, and unplug CPU from monitor prompt:
device_del foo
which triggers GPE event that leads to CPU_SCAN_METHOD on guest side
as result of above cpu 'foo' will not be hotunplugged, since QEMU sees insert event and ignores remove event (leaving it in pending state) for the GPE event.
Any follow up CPU hotplug/unplug action from QEMU side will handle previously ignored event, so as workaround user can repeat device_del.
Fix this corner-case by queuing remove events independently from insert events, aka the same way as we do with insert events. And then go over remove queue to send eject notify events to OSPM within the same GPE event.
PS:
Process remove queue after the cpu add queue has been processed 1st to ensure that OSPM gets hotadd evets after hotremove ones.
PS2:
Case where it's still borken happens when guest OS is Linux and device_del happens before guest OS initializes ACPI subsystem. Culprit in this case though is the guest kernel, which mangles GPE.sts (by clearing them up) and thus pending SCI turns to NOP leaving insert/remove events in pending state.
That is the guest bug and should be fixed there.
Message-Id: <[email protected]>
--- hw/acpi/cpu.c | 43 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 9 deletions(-)
hw/acpi/cpu.c +34 -9
@@ -327,6 +327,7 @@ const VMStateDescription vmstate_cpu_hotplug = {#define CPU_EJECT_METHOD "CEJ0"#define CPU_OST_METHOD "COST"#define CPU_ADDED_LIST "CNEW" +#define CPU_EJ_LIST "CEJL"#define CPU_ENABLED "CPEN"#define CPU_SELECTOR "CSEL"
@@ -488,7 +489,6 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts, method =aml_method (CPU_SCAN_METHOD ,0 ,AML_SERIALIZED ); {const uint8_t max_cpus_per_pass =255 ; -Aml *else_ctx;Aml *while_ctx, *while_ctx2;Aml *has_event =aml_local (0 );Aml *dev_chk =aml_int (1 );
@@ -499,6 +499,8 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,Aml *uid =aml_local (3 );Aml *has_job =aml_local (4 );Aml *new_cpus =aml_name (CPU_ADDED_LIST ); +Aml *ej_cpus =aml_name (CPU_EJ_LIST ); +Aml *num_ej_cpus =aml_local (5 );aml_append (method,aml_acquire (ctrl_lock,0xFFFF ));
@@ -513,6 +515,8 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,*/ aml_append (method,aml_name_decl (CPU_ADDED_LIST ,aml_package (max_cpus_per_pass))); +aml_append (method,aml_name_decl (CPU_EJ_LIST , +aml_package (max_cpus_per_pass)));aml_append (method,aml_store (zero, uid));aml_append (method,aml_store (one, has_job));
@@ -527,6 +531,7 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,aml_append (while_ctx2,aml_store (one, has_event));aml_append (while_ctx2,aml_store (zero, num_added_cpus)); +aml_append (while_ctx2,aml_store (zero, num_ej_cpus));/* * Scan CPUs, till there are CPUs with events or
@@ -559,8 +564,10 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,* if CPU_ADDED_LIST is full, exit inner loop and process * collected CPUs */ - ifctx =aml_if ( -aml_equal (num_added_cpus,aml_int (max_cpus_per_pass))); + ifctx =aml_if (aml_lor ( +aml_equal (num_added_cpus,aml_int (max_cpus_per_pass)), +aml_equal (num_ej_cpus,aml_int (max_cpus_per_pass)) + )); {aml_append (ifctx,aml_store (one, has_job));aml_append (ifctx,aml_break ());
@@ -577,16 +584,16 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,aml_append (ifctx,aml_store (one, has_event)); }aml_append (while_ctx, ifctx); - else_ctx =aml_else (); + ifctx =aml_if (aml_equal (rm_evt, one)); { -aml_append (ifctx, -aml_call2 (CPU_NOTIFY_METHOD , uid, eject_req)); -aml_append (ifctx,aml_store (one, rm_evt)); +/* cache to be removed CPUs to Notify later */ +aml_append (ifctx,aml_store (uid, +aml_index (ej_cpus, num_ej_cpus))); +aml_append (ifctx,aml_increment (num_ej_cpus));aml_append (ifctx,aml_store (one, has_event)); } -aml_append (else_ctx, ifctx); -aml_append (while_ctx, else_ctx); +aml_append (while_ctx, ifctx);aml_append (while_ctx,aml_increment (uid)); }aml_append (while_ctx2, while_ctx);
@@ -620,6 +627,24 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts,aml_append (while_ctx,aml_increment (cpu_idx)); }aml_append (while_ctx2, while_ctx); + +/* +* Notify OSPM about to be removed CPUs and clear remove flag +*/ +aml_append (while_ctx2,aml_store (zero, cpu_idx)); + while_ctx =aml_while (aml_lless (cpu_idx, num_ej_cpus)); + { +aml_append (while_ctx, +aml_store (aml_derefof (aml_index (ej_cpus, cpu_idx)), + uid)); +aml_append (while_ctx, +aml_call2 (CPU_NOTIFY_METHOD , uid, eject_req)); +aml_append (while_ctx,aml_store (uid, cpu_selector)); +aml_append (while_ctx,aml_store (one, rm_evt)); +aml_append (while_ctx,aml_increment (cpu_idx)); + } +aml_append (while_ctx2, while_ctx); +/* * If another batch is needed, then it will resume scanning * exactly at -- and not after -- the last CPU that's currently
Signature · 1 line
MST
[PULL 03/48] tests: acpi: whitelist expected blobs
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test-allowed-diff.h | 42 +++++++++++++++++++++ 1 file changed, 42 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +42 -0
@@ -1 +1,43 @@/* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/x86/pc/DSDT" , +"tests/data/acpi/x86/pc/DSDT.acpierst" , +"tests/data/acpi/x86/pc/DSDT.acpihmat" , +"tests/data/acpi/x86/pc/DSDT.bridge" , +"tests/data/acpi/x86/pc/DSDT.cphp" , +"tests/data/acpi/x86/pc/DSDT.dimmpxm" , +"tests/data/acpi/x86/pc/DSDT.hpbridge" , +"tests/data/acpi/x86/pc/DSDT.hpbrroot" , +"tests/data/acpi/x86/pc/DSDT.ipmikcs" , +"tests/data/acpi/x86/pc/DSDT.memhp" , +"tests/data/acpi/x86/pc/DSDT.nohpet" , +"tests/data/acpi/x86/pc/DSDT.numamem" , +"tests/data/acpi/x86/pc/DSDT.roothp" , +"tests/data/acpi/x86/q35/DSDT" , +"tests/data/acpi/x86/q35/DSDT.acpierst" , +"tests/data/acpi/x86/q35/DSDT.acpihmat" , +"tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x" , +"tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator" , +"tests/data/acpi/x86/q35/DSDT.applesmc" , +"tests/data/acpi/x86/q35/DSDT.bridge" , +"tests/data/acpi/x86/q35/DSDT.core-count" , +"tests/data/acpi/x86/q35/DSDT.core-count2" , +"tests/data/acpi/x86/q35/DSDT.cphp" , +"tests/data/acpi/x86/q35/DSDT.cxl" , +"tests/data/acpi/x86/q35/DSDT.dimmpxm" , +"tests/data/acpi/x86/q35/DSDT.ipmibt" , +"tests/data/acpi/x86/q35/DSDT.ipmismbus" , +"tests/data/acpi/x86/q35/DSDT.ivrs" , +"tests/data/acpi/x86/q35/DSDT.memhp" , +"tests/data/acpi/x86/q35/DSDT.mmio64" , +"tests/data/acpi/x86/q35/DSDT.multi-bridge" , +"tests/data/acpi/x86/q35/DSDT.noacpihp" , +"tests/data/acpi/x86/q35/DSDT.nohpet" , +"tests/data/acpi/x86/q35/DSDT.numamem" , +"tests/data/acpi/x86/q35/DSDT.pvpanic-isa" , +"tests/data/acpi/x86/q35/DSDT.thread-count" , +"tests/data/acpi/x86/q35/DSDT.thread-count2" , +"tests/data/acpi/x86/q35/DSDT.tis.tpm12" , +"tests/data/acpi/x86/q35/DSDT.tis.tpm2" , +"tests/data/acpi/x86/q35/DSDT.type4-count" , +"tests/data/acpi/x86/q35/DSDT.viot" , +"tests/data/acpi/x86/q35/DSDT.xapic",
Signature · 1 line
MST
[PULL 10/48] intel_iommu: Rename slpte to pte
In reply to Michael S. TsirkinFrom: Yi Liu <[email protected]>
Because we will support both FST(a.k.a, FLT) and SST(a.k.a, SLT) translation, rename variable and functions from slpte to pte whenever possible.
But some are SST only, they are renamed with sl_ prefix.
Message-Id: <[email protected]>
--- hw/i386/intel_iommu_internal.h | 24 +++--- include/hw/i386/intel_iommu.h | 2 +- hw/i386/intel_iommu.c | 129 +++++++++++++++++---------------- 3 files changed, 78 insertions(+), 77 deletions(-)
hw/i386/intel_iommu_internal.h +12 -12
@@ -533,24 +533,24 @@ typedef struct VTDRootEntry VTDRootEntry;/* Second Level Page Translation Pointer*/ #define VTD_SM_PASID_ENTRY_SLPTPTR (~0xfffULL) -/* Paging Structure common */ -#define VTD_SL_PT_PAGE_SIZE_MASK (1ULL << 7) -/* Bits to decide the offset for each level */ -#define VTD_SL_LEVEL_BITS 9 -/* Second Level Paging Structure */ -#define VTD_SL_PML4_LEVEL 4 -#define VTD_SL_PDP_LEVEL 3 -#define VTD_SL_PD_LEVEL 2 -#define VTD_SL_PT_LEVEL 1 -#define VTD_SL_PT_ENTRY_NR 512 -/* Masks for Second Level Paging Entry */ #define VTD_SL_RW_MASK 3ULL#define VTD_SL_R 1ULL#define VTD_SL_W (1ULL << 1) -#define VTD_SL_PT_BASE_ADDR_MASK (aw) (~(VTD_PAGE_SIZE - 1) & VTD_HAW_MASK(aw))#define VTD_SL_IGN_COM 0xbff0000000000000ULL#define VTD_SL_TM (1ULL << 62) +/* Common for both First Level and Second Level */ +#define VTD_PML4_LEVEL 4 +#define VTD_PDP_LEVEL 3 +#define VTD_PD_LEVEL 2 +#define VTD_PT_LEVEL 1 +#define VTD_PT_ENTRY_NR 512 +#define VTD_PT_PAGE_SIZE_MASK (1ULL << 7) +#define VTD_PT_BASE_ADDR_MASK (aw) (~(VTD_PAGE_SIZE - 1) & VTD_HAW_MASK(aw)) + +/* Bits to decide the offset for each level */ +#define VTD_LEVEL_BITS 9 +#endif
include/hw/i386/intel_iommu.h +1 -1
@@ -152,7 +152,7 @@ struct VTDIOTLBEntry {uint64_t gfn;uint16_t domain_id;uint32_t pasid; -uint64_t slpte; +uint64_t pte;uint64_t mask;uint8_t access_flags; };
hw/i386/intel_iommu.c +65 -64
344 lines not on this page · raw message
Signature · 1 line
MST
[PULL 11/48] intel_iommu: Implement stage-1 translation
In reply to Michael S. TsirkinFrom: Yi Liu <[email protected]>
This adds stage-1 page table walking to support stage-1 only translation in scalable mode.
Message-Id: <[email protected]>
--- hw/i386/intel_iommu_internal.h | 34 +++++++ hw/i386/intel_iommu.c | 158 ++++++++++++++++++++++++++++++++- 2 files changed, 188 insertions(+), 4 deletions(-)
hw/i386/intel_iommu_internal.h +34 -0
@@ -320,6 +320,15 @@ typedef enum VTDFaultReason {VTD_FR_PASID_ENTRY_P =0x59 ,VTD_FR_PASID_TABLE_ENTRY_INV =0x5b ,/*Invalid PASID table entry */ +/* Fail to access a first-level paging entry (not FS_PML4E) */ +VTD_FR_FS_PAGING_ENTRY_INV =0x70 , +VTD_FR_FS_PAGING_ENTRY_P =0x71 , +/* Non-zero reserved field in present first-stage paging entry */ +VTD_FR_FS_PAGING_ENTRY_RSVD =0x72 , +VTD_FR_PASID_ENTRY_FSPTPTR_INV =0x73 ,/* Invalid FSPTPTR in PASID entry */ +VTD_FR_FS_PAGING_ENTRY_US =0x81 ,/* Privilege violation */ +VTD_FR_SM_WRITE =0x85 ,/* No write permission */ +/* Output address in the interrupt address range for scalable mode */ VTD_FR_SM_INTERRUPT_ADDR =0x87 , VTD_FR_MAX, /* Guard */
@@ -438,6 +447,22 @@ typedef union VTDInvDesc VTDInvDesc; (0x3ffff800ULL | ~(VTD_HAW_MASK(aw) | VTD_SL_IGN_COM | VTD_SL_TM)) : \ (0x3ffff800ULL | ~(VTD_HAW_MASK (aw) |VTD_SL_IGN_COM )) +/* Rsvd field masks for fpte */ +#define VTD_FS_UPPER_IGNORED 0xfff0000000000000ULL +#define VTD_FPTE_PAGE_L1_RSVD_MASK (aw) \ + (~(VTD_HAW_MASK(aw) | VTD_FS_UPPER_IGNORED)) +#define VTD_FPTE_PAGE_L2_RSVD_MASK (aw) \ + (~(VTD_HAW_MASK(aw) | VTD_FS_UPPER_IGNORED)) +#define VTD_FPTE_PAGE_L3_RSVD_MASK (aw) \ + (~(VTD_HAW_MASK(aw) | VTD_FS_UPPER_IGNORED)) +#define VTD_FPTE_PAGE_L4_RSVD_MASK (aw) \ + (0x80ULL | ~(VTD_HAW_MASK(aw) | VTD_FS_UPPER_IGNORED)) + +#define VTD_FPTE_LPAGE_L2_RSVD_MASK (aw) \ + (0x1fe000ULL | ~(VTD_HAW_MASK(aw) | VTD_FS_UPPER_IGNORED)) +#define VTD_FPTE_LPAGE_L3_RSVD_MASK (aw) \ + (0x3fffe000ULL | ~(VTD_HAW_MASK(aw) | VTD_FS_UPPER_IGNORED)) +/* Masks for PIOTLB Invalidate Descriptor */ #define VTD_INV_DESC_PIOTLB_G (3ULL << 4)#define VTD_INV_DESC_PIOTLB_ALL_IN_PASID (2ULL << 4)
@@ -530,6 +555,15 @@ typedef struct VTDRootEntry VTDRootEntry;#define VTD_SM_PASID_ENTRY_AW 7ULL/* Adjusted guest-address-width */ #define VTD_SM_PASID_ENTRY_DID (val) ((val) & VTD_DOMAIN_ID_MASK) +#define VTD_SM_PASID_ENTRY_FLPM 3ULL +#define VTD_SM_PASID_ENTRY_FLPTPTR (~0xfffULL) + +/* First Level Paging Structure */ +/* Masks for First Level Paging Entry */ +#define VTD_FL_P 1ULL +#define VTD_FL_RW (1ULL << 1) +#define VTD_FL_US (1ULL << 2) +/* Second Level Page Translation Pointer*/ #define VTD_SM_PASID_ENTRY_SLPTPTR (~0xfffULL)
hw/i386/intel_iommu.c +154 -4
212 lines not on this page · raw message
Signature · 1 line
MST
[PULL 02/48] pci: ensure valid link status bits for downstream ports
In reply to Michael S. TsirkinFrom: Sebastian Ott <[email protected]>
PCI hotplug for downstream endpoints on arm fails because Linux' PCIe hotplug driver doesn't like the QEMU provided LNKSTA:
pcieport 0000:08:01.0: pciehp: Slot(2): Card present pcieport 0000:08:01.0: pciehp: Slot(2): Link Up
pcieport 0000:08:01.0: pciehp: Slot(2): Cannot train link: status 0x2000
There's 2 cases where LNKSTA isn't setup properly:
* the downstream device has no express capability
* max link width of the bridge is 0
Move the sanity checks added via 88c869198aa63
("pci: Sanity test minimum downstream LNKSTA") outside of the branch to make sure downstream ports always have a valid LNKSTA.
Message-Id: <[email protected]>
--- hw/pci/pcie.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
hw/pci/pcie.c +8 -4
@@ -1113,18 +1113,22 @@ void pcie_sync_bridge_lnk(PCIDevice *bridge_dev)if ((lnksta &PCI_EXP_LNKSTA_NLW ) > (lnkcap &PCI_EXP_LNKCAP_MLW )) { lnksta &= ~PCI_EXP_LNKSTA_NLW ; lnksta |= lnkcap &PCI_EXP_LNKCAP_MLW ; - }else if (!(lnksta &PCI_EXP_LNKSTA_NLW )) { - lnksta |=QEMU_PCI_EXP_LNKSTA_NLW (QEMU_PCI_EXP_LNK_X1 ); }if ((lnksta &PCI_EXP_LNKSTA_CLS ) > (lnkcap &PCI_EXP_LNKCAP_SLS )) { lnksta &= ~PCI_EXP_LNKSTA_CLS ; lnksta |= lnkcap &PCI_EXP_LNKCAP_SLS ; - }else if (!(lnksta &PCI_EXP_LNKSTA_CLS )) { - lnksta |=QEMU_PCI_EXP_LNKSTA_CLS (QEMU_PCI_EXP_LNK_2_5GT ); } } +if (!(lnksta &PCI_EXP_LNKSTA_NLW )) { + lnksta |=QEMU_PCI_EXP_LNKSTA_NLW (QEMU_PCI_EXP_LNK_X1 ); + } + +if (!(lnksta &PCI_EXP_LNKSTA_CLS )) { + lnksta |=QEMU_PCI_EXP_LNKSTA_CLS (QEMU_PCI_EXP_LNK_2_5GT ); + } +pci_word_test_and_clear_mask (exp_cap +PCI_EXP_LNKSTA ,PCI_EXP_LNKSTA_CLS |PCI_EXP_LNKSTA_NLW ); pci_word_test_and_set_mask(exp_cap + PCI_EXP_LNKSTA, lnksta &
Signature · 1 line
MST
[PULL 36/48] acpi/ghes: better name GHES memory error function
In reply to Michael S. TsirkinFrom: Mauro Carvalho Chehab <[email protected]>
The current function used to generate GHES data is specific for memory errors. Give a better name for it, as we now have a generic function as well.
Message-Id: <35b59121129d5e99cb5062cc3d775594bbb0905b.1736945236.git.mchehab+huawei@kernel.org>
--- include/hw/acpi/ghes.h | 4 ++-- hw/acpi/ghes-stub.c | 2 +- hw/acpi/ghes.c | 2 +- target/arm/kvm.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-)
include/hw/acpi/ghes.h +2 -2
@@ -74,15 +74,15 @@ void acpi_build_hest(GArray *table_data, GArray *hardware_errors, const char *oem_id, const char *oem_table_id);void acpi_ghes_add_fw_cfg (AcpiGhesState *vms,FWCfgState *s,GArray *hardware_errors); +int acpi_ghes_memory_errors (uint16_t source_id,uint64_t error_physical_addr);void ghes_record_cper_errors (const void *cper,size_t len,uint16_t source_id,Error **errp); -int acpi_ghes_record_errors (uint16_t source_id,uint64_t error_physical_addr);/** * acpi_ghes_present: Report whether ACPI GHES table is present * * Returns: true if the system has an ACPI GHES table and it is -* safe to call acpi_ghes_record_errors() to record a memory error. +* safe to call acpi_ghes_memory_errors() to record a memory error. */ bool acpi_ghes_present (void );#endif
hw/acpi/ghes-stub.c +1 -1
@@ -11,7 +11,7 @@#include "qemu/osdep.h" #include "hw/acpi/ghes.h" -int acpi_ghes_record_errors (uint16_t source_id,uint64_t physical_address) +int acpi_ghes_memory_errors (uint16_t source_id,uint64_t physical_address) {return -1 ; }
hw/acpi/ghes.c +1 -1
@@ -415,7 +415,7 @@ void ghes_record_cper_errors(const void *cper, size_t len,return ; } -int acpi_ghes_record_errors (uint16_t source_id,uint64_t physical_address) +int acpi_ghes_memory_errors (uint16_t source_id,uint64_t physical_address) {/* Memory Error Section Type */ const uint8_t guid[] =
target/arm/kvm.c +1 -1
@@ -2387,7 +2387,7 @@ void kvm_arch_on_sigbus_vcpu(CPUState *c, int code, void *addr)*/ if (code ==BUS_MCEERR_AR ) {kvm_cpu_synchronize_state (c); -if (!acpi_ghes_record_errors (ACPI_HEST_SRC_ID_SEA , paddr)) { +if (!acpi_ghes_memory_errors (ACPI_HEST_SRC_ID_SEA , paddr)) {kvm_inject_arm_sea (c); }else {error_report ("failed to record the error" );
Signature · 1 line
MST
[PULL 01/48] virtio-gpu: Add definition for resource_uuid feature
In reply to Michael S. TsirkinFrom: Dorinda Bassey <[email protected]>
Add the VIRTIO_GPU_F_RESOURCE_UUID feature to enable the assignment of resources UUIDs for export to other virtio devices.
Message-Id: <[email protected]>
--- include/hw/virtio/virtio-gpu.h | 3 +++ hw/display/vhost-user-gpu.c | 8 ++++++++ hw/display/virtio-gpu-base.c | 3 +++ 3 files changed, 14 insertions(+)
include/hw/virtio/virtio-gpu.h +3 -0
@@ -98,6 +98,7 @@ enum virtio_gpu_base_conf_flags {VIRTIO_GPU_FLAG_CONTEXT_INIT_ENABLED ,VIRTIO_GPU_FLAG_RUTABAGA_ENABLED ,VIRTIO_GPU_FLAG_VENUS_ENABLED , + VIRTIO_GPU_FLAG_RESOURCE_UUID_ENABLED, };#define virtio_gpu_virgl_enabled (_cfg) \
@@ -114,6 +115,8 @@ enum virtio_gpu_base_conf_flags { (_cfg.flags & (1 << VIRTIO_GPU_FLAG_CONTEXT_INIT_ENABLED))#define virtio_gpu_rutabaga_enabled (_cfg) \ (_cfg.flags & (1 << VIRTIO_GPU_FLAG_RUTABAGA_ENABLED)) +#define virtio_gpu_resource_uuid_enabled (_cfg) \ + (_cfg.flags & (1 << VIRTIO_GPU_FLAG_RESOURCE_UUID_ENABLED))#define virtio_gpu_hostmem_enabled (_cfg) \ (_cfg.hostmem > 0)#define virtio_gpu_venus_enabled (_cfg) \
hw/display/vhost-user-gpu.c +8 -0
@@ -631,6 +631,14 @@ vhost_user_gpu_device_realize(DeviceState *qdev, Error **errp)error_report ("EDID requested but the backend doesn't support it." ); g->parent_obj.conf.flags &= ~(1 <<VIRTIO_GPU_FLAG_EDID_ENABLED ); } +if (virtio_has_feature (g->vhost->dev.features, +VIRTIO_GPU_F_RESOURCE_UUID )) { + g->parent_obj.conf.flags |=1 <<VIRTIO_GPU_FLAG_RESOURCE_UUID_ENABLED ; + } +if (virtio_has_feature (g->vhost->dev.features, +VIRTIO_GPU_F_RESOURCE_UUID )) { + g->parent_obj.conf.flags |=1 <<VIRTIO_GPU_FLAG_RESOURCE_UUID_ENABLED ; + }if (!virtio_gpu_base_device_realize (qdev,NULL ,NULL , errp)) {return ;
hw/display/virtio-gpu-base.c +3 -0
@@ -235,6 +235,9 @@ virtio_gpu_base_get_features(VirtIODevice *vdev, uint64_t features,if (virtio_gpu_context_init_enabled (g->conf)) { features |= (1 <<VIRTIO_GPU_F_CONTEXT_INIT ); } +if (virtio_gpu_resource_uuid_enabled (g->conf)) { + features |= (1 <<VIRTIO_GPU_F_RESOURCE_UUID ); + }return features; }
Signature · 1 line
MST
[PULL 17/48] intel_iommu: Add an internal API to find an address space with PASID
In reply to Michael S. TsirkinFrom: Clément Mathieu--Drif <[email protected]>
This will be used to implement the device IOTLB invalidation
Message-Id: <[email protected]>
--- hw/i386/intel_iommu.c | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-)
hw/i386/intel_iommu.c +24 -16
@@ -70,6 +70,11 @@ struct vtd_hiod_key {uint8_t devfn; }; +struct vtd_as_raw_key { +uint16_t sid; +uint32_t pasid; +}; +struct vtd_iotlb_key {uint64_t gfn;uint32_t pasid;
@@ -1859,29 +1864,32 @@ static inline bool vtd_is_interrupt_addr(hwaddr addr)return VTD_INTERRUPT_ADDR_FIRST <= addr && addr <=VTD_INTERRUPT_ADDR_LAST ; } -static gboolean vtd_find_as_by_sid (gpointer key,gpointer value, -gpointer user_data) +static gboolean vtd_find_as_by_sid_and_pasid (gpointer key,gpointer value, +gpointer user_data) {struct vtd_as_key *as_key = (struct vtd_as_key *)key; -uint16_t target_sid = *(uint16_t *)user_data; +struct vtd_as_raw_key *target = (struct vtd_as_raw_key *)user_data;uint16_t sid =PCI_BUILD_BDF (pci_bus_num (as_key->bus), as_key->devfn); -return sid == target_sid; + +return (as_key->pasid == target->pasid) && (sid == target->sid); +} + +static VTDAddressSpace *vtd_get_as_by_sid_and_pasid (IntelIOMMUState *s, +uint16_t sid, +uint32_t pasid) +{ +struct vtd_as_raw_key key = { + .sid = sid, + .pasid = pasid + }; + +return g_hash_table_find (s->vtd_address_spaces, + vtd_find_as_by_sid_and_pasid, &key); }static VTDAddressSpace *vtd_get_as_by_sid (IntelIOMMUState *s,uint16_t sid) { -uint8_t bus_num =PCI_BUS_NUM (sid); -VTDAddressSpace *vtd_as = s->vtd_as_cache[bus_num]; - -if (vtd_as && - (sid ==PCI_BUILD_BDF (pci_bus_num (vtd_as->bus), vtd_as->devfn))) { -return vtd_as; - } - - vtd_as =g_hash_table_find (s->vtd_address_spaces, vtd_find_as_by_sid, &sid); - s->vtd_as_cache[bus_num] = vtd_as; - -return vtd_as; +return vtd_get_as_by_sid_and_pasid (s, sid,PCI_NO_PASID ); }static void vtd_pt_enable_fast_path (IntelIOMMUState *s,uint16_t source_id)
Signature · 1 line
MST
[PULL 20/48] tests/acpi: q35: allow DMAR acpi table changes
In reply to Michael S. TsirkinFrom: Zhenzhong Duan <[email protected]>
Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+)
tests/qtest/bios-tables-test-allowed-diff.h +1 -0
@@ -1 +1,2 @@/* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/x86/q35/DMAR.dmar",
Signature · 1 line
MST
[PULL 23/48] intel_iommu: Introduce a property x-flts for stage-1 translation
In reply to Michael S. TsirkinFrom: Zhenzhong Duan <[email protected]>
Intel VT-d 3.0 introduces scalable mode, and it has a bunch of capabilities related to scalable mode translation, thus there are multiple combinations.
This vIOMMU implementation wants to simplify it with a new property "x-flts". When turned on in scalable mode, stage-1 translation is supported. When turned on in legacy mode, throw out error.
With stage-1 translation support exposed to user, also accurate the pasid entry check in vtd_pe_type_check().
Message-Id: <[email protected]>
--- hw/i386/intel_iommu_internal.h | 2 ++ hw/i386/intel_iommu.c | 28 +++++++++++++++++++--------- 2 files changed, 21 insertions(+), 9 deletions(-)
hw/i386/intel_iommu_internal.h +2 -0
@@ -195,6 +195,7 @@#define VTD_ECAP_PASID (1ULL << 40)#define VTD_ECAP_SMTS (1ULL << 43)#define VTD_ECAP_SLTS (1ULL << 46) +#define VTD_ECAP_FLTS (1ULL << 47)/* CAP_REG */ /* (offset >> 4) << 24 */
@@ -211,6 +212,7 @@#define VTD_CAP_SLLPS ((1ULL << 34) | (1ULL << 35))#define VTD_CAP_DRAIN_WRITE (1ULL << 54)#define VTD_CAP_DRAIN_READ (1ULL << 55) +#define VTD_CAP_FS1GP (1ULL << 56)#define VTD_CAP_DRAIN (VTD_CAP_DRAIN_READ | VTD_CAP_DRAIN_WRITE)#define VTD_CAP_CM (1ULL << 7)#define VTD_PASID_ID_SHIFT 20
hw/i386/intel_iommu.c +19 -9
@@ -803,16 +803,18 @@ static inline bool vtd_is_fl_level_supported(IntelIOMMUState *s, uint32_t level) }/* Return true if check passed, otherwise false */ -static inline bool vtd_pe_type_check (X86IOMMUState *x86_iommu, -VTDPASIDEntry *pe) +static inline bool vtd_pe_type_check (IntelIOMMUState *s,VTDPASIDEntry *pe) {switch (VTD_PE_GET_TYPE (pe)) { -case VTD_SM_PASID_ENTRY_SLT : -return true; -case VTD_SM_PASID_ENTRY_PT : -return x86_iommu->pt_supported;case VTD_SM_PASID_ENTRY_FLT : +return !!(s->ecap &VTD_ECAP_FLTS ); +case VTD_SM_PASID_ENTRY_SLT : +return !!(s->ecap &VTD_ECAP_SLTS );case VTD_SM_PASID_ENTRY_NESTED : +/* Not support NESTED page table type yet */ +return false; +case VTD_SM_PASID_ENTRY_PT : +return !!(s->ecap &VTD_ECAP_PT );default :/* Unknown type */ return false;
@@ -861,7 +863,6 @@ static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState *s,uint8_t pgtt;uint32_t index;dma_addr_t entry_size; -X86IOMMUState *x86_iommu =X86_IOMMU_DEVICE (s); index =VTD_PASID_TABLE_INDEX (pasid); entry_size =VTD_PASID_ENTRY_SIZE ;
@@ -875,7 +876,7 @@ static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState *s, }/* Do translation type check */ -if (!vtd_pe_type_check (x86_iommu, pe)) { +if (!vtd_pe_type_check (s, pe)) {return -VTD_FR_PASID_TABLE_ENTRY_INV ; }
@@ -3827,6 +3828,7 @@ static const Property vtd_properties[] = { VTD_HOST_ADDRESS_WIDTH),DEFINE_PROP_BOOL ("caching-mode" , IntelIOMMUState, caching_mode, FALSE),DEFINE_PROP_BOOL ("x-scalable-mode" , IntelIOMMUState, scalable_mode, FALSE), +DEFINE_PROP_BOOL ("x-flts" , IntelIOMMUState, flts, FALSE),DEFINE_PROP_BOOL ("snoop-control" , IntelIOMMUState, snoop_control, false),DEFINE_PROP_BOOL ("x-pasid-mode" , IntelIOMMUState, pasid, false), DEFINE_PROP_BOOL("dma-drain", IntelIOMMUState, dma_drain, true),
@@ -4557,7 +4559,10 @@ static void vtd_cap_init(IntelIOMMUState *s) }/* TODO: read cap/ecap from host to decide which cap to be exposed. */ -if (s->scalable_mode) { +if (s->flts) { + s->ecap |=VTD_ECAP_SMTS |VTD_ECAP_FLTS ; + s->cap |=VTD_CAP_FS1GP ; + }else if (s->scalable_mode) { s->ecap |=VTD_ECAP_SMTS |VTD_ECAP_SRS |VTD_ECAP_SLTS ; }
@@ -4736,6 +4741,11 @@ static bool vtd_decide_config(IntelIOMMUState *s, Error **errp) } } +if (!s->scalable_mode && s->flts) { +error_setg (errp,"x-flts is only available in scalable mode" ); +return false; + } +if (!s->flts && s->aw_bits !=VTD_HOST_AW_39BIT && s->aw_bits !=VTD_HOST_AW_48BIT ) { error_setg(errp, "%s: supported values for aw-bits are: %d, %d",
Signature · 1 line
MST
[PULL 27/48] acpi/ghes: get rid of ACPI_HEST_SRC_ID_RESERVED
In reply to Michael S. TsirkinFrom: Mauro Carvalho Chehab <[email protected]>
This is just duplicating ACPI_GHES_ERROR_SOURCE_COUNT, which has a better name. So, drop the duplication.
Message-Id: <9012bf4c9630adf15a22af3c88fda8270916887b.1736945236.git.mchehab+huawei@kernel.org>
--- include/hw/acpi/ghes.h | 3 ++- hw/acpi/ghes.c | 7 ++----- 2 files changed, 4 insertions(+), 6 deletions(-)
include/hw/acpi/ghes.h +2 -1
@@ -59,7 +59,8 @@ enum AcpiGhesNotifyType {enum {ACPI_HEST_SRC_ID_SEA =0 ,/* future ids go here */ -ACPI_HEST_SRC_ID_RESERVED , + +ACPI_GHES_ERROR_SOURCE_COUNT }; typedef struct AcpiGhesState {
hw/acpi/ghes.c +2 -5
@@ -34,9 +34,6 @@/* The max size in bytes for one error block */ #define ACPI_GHES_MAX_RAW_DATA_LENGTH (1 * KiB) -/* Now only support ARMv8 SEA notification type error source */ -#define ACPI_GHES_ERROR_SOURCE_COUNT 1 -/* Generic Hardware Error Source version 2 */ #define ACPI_GHES_SOURCE_GENERIC_ERROR_V2 10
@@ -396,7 +393,7 @@ int acpi_ghes_record_errors(uint8_t source_id, uint64_t physical_address)AcpiGedState *acpi_ged_state;AcpiGhesState *ags; -assert (source_id <ACPI_HEST_SRC_ID_RESERVED ); +assert (source_id <ACPI_GHES_ERROR_SOURCE_COUNT ); acpi_ged_state =ACPI_GED (object_resolve_path_type ("" ,TYPE_ACPI_GED ,NULL ));
@@ -407,7 +404,7 @@ int acpi_ghes_record_errors(uint8_t source_id, uint64_t physical_address)if (physical_address) { -if (source_id <ACPI_HEST_SRC_ID_RESERVED ) { +if (source_id <ACPI_GHES_ERROR_SOURCE_COUNT ) { start_addr += source_id *sizeof (uint64_t ); }
Signature · 1 line
MST
[PULL 07/48] intel_iommu: Make pasid entry type check accurate
In reply to Michael S. TsirkinFrom: Zhenzhong Duan <[email protected]>
When guest configures Nested Translation(011b) or First-stage Translation only (001b), type check passed unaccurately.
Fails the type check in those cases as their simulation isn't supported yet.
Message-Id: <[email protected]>
--- hw/i386/intel_iommu.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
hw/i386/intel_iommu.c +4 -8
@@ -759,20 +759,16 @@ static inline bool vtd_pe_type_check(X86IOMMUState *x86_iommu, VTDPASIDEntry *pe) {switch (VTD_PE_GET_TYPE (pe)) { -case VTD_SM_PASID_ENTRY_FLT :case VTD_SM_PASID_ENTRY_SLT : -case VTD_SM_PASID_ENTRY_NESTED : -break ; +return true;case VTD_SM_PASID_ENTRY_PT : -if (!x86_iommu->pt_supported) { -return false; - } -break ; +return x86_iommu->pt_supported; +case VTD_SM_PASID_ENTRY_FLT : +case VTD_SM_PASID_ENTRY_NESTED :default :/* Unknown type */ return false; } -return true; }static inline bool vtd_pdire_present (VTDPASIDDirEntry *pdire)
Signature · 1 line
MST
[PULL 31/48] acpi/ghes: Fix acpi_ghes_record_errors() argument
In reply to Michael S. TsirkinFrom: Mauro Carvalho Chehab <[email protected]>
Align the header file with the actual implementation of this function, as the first argument is source ID and not notification type.
Message-Id: <d55f2a6ede5a168e42a20a228b2c066cb4c60939.1736945236.git.mchehab+huawei@kernel.org>
--- include/hw/acpi/ghes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/hw/acpi/ghes.h +1 -1
@@ -73,7 +73,7 @@ void acpi_build_hest(GArray *table_data, GArray *hardware_errors, const char *oem_id, const char *oem_table_id);void acpi_ghes_add_fw_cfg (AcpiGhesState *vms,FWCfgState *s,GArray *hardware_errors); -int acpi_ghes_record_errors (uint8_t notify,uint64_t error_physical_addr); +int acpi_ghes_record_errors (uint8_t source_id,uint64_t error_physical_addr);/** * acpi_ghes_present: Report whether ACPI GHES table is present
Signature · 1 line
MST
[PULL 05/48] tests: acpi: update expected blobs
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
previous patch has changed cpu hotplug AML, expected diff:
@@ -2942,6 +2942,7 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ", 0x00000001)
{
Acquire (\_SB.PCI0.PRES.CPLK, 0xFFFF)
Name (CNEW, Package (0xFF) {})+ Name (CEJL, Package (0xFF) {})
Local3 = Zero
Local4 = One
While ((Local4 == One))
@@ -2949,6 +2950,7 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ", 0x00000001)
Local4 = Zero
Local0 = One
Local1 = Zero
+ Local5 = Zero
While (((Local0 == One) && (Local3 < One)))
{
Local0 = Zero
@@ -2959,7 +2961,7 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ", 0x00000001)
Break
}- If ((Local1 == 0xFF))
+ If (((Local1 == 0xFF) || (Local5 == 0xFF)))
{
Local4 = One
Break
@@ -2972,10 +2974,11 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ", 0x00000001)
Local1++
Local0 = One
}
- ElseIf ((\_SB.PCI0.PRES.CRMV == One))
+
+ If ((\_SB.PCI0.PRES.CRMV == One))
{
- CTFY (Local3, 0x03)
- \_SB.PCI0.PRES.CRMV = One
+ CEJL [Local5] = Local3
+ Local5++ Local0 = One
}
@@ -2992,6 +2995,16 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ", 0x00000001)
\_SB.PCI0.PRES.CINS = One
Local2++
}
+
+ Local2 = Zero
+ While ((Local2 < Local5))
+ {
+ Local3 = DerefOf (CEJL [Local2])
+ CTFY (Local3, 0x03)
+ \_SB.PCI0.PRES.CSEL = Local3
+ \_SB.PCI0.PRES.CRMV = One
+ Local2++
+ }
}
Release (\_SB.PCI0.PRES.CPLK)Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test-allowed-diff.h | 42 ------------------ tests/data/acpi/x86/pc/DSDT | Bin 8526 -> 8593 bytes tests/data/acpi/x86/pc/DSDT.acpierst | Bin 8437 -> 8504 bytes tests/data/acpi/x86/pc/DSDT.acpihmat | Bin 9851 -> 9918 bytes tests/data/acpi/x86/pc/DSDT.bridge | Bin 15397 -> 15464 bytes tests/data/acpi/x86/pc/DSDT.cphp | Bin 8990 -> 9057 bytes tests/data/acpi/x86/pc/DSDT.dimmpxm | Bin 10180 -> 10247 bytes tests/data/acpi/x86/pc/DSDT.hpbridge | Bin 8477 -> 8544 bytes tests/data/acpi/x86/pc/DSDT.hpbrroot | Bin 5033 -> 5100 bytes tests/data/acpi/x86/pc/DSDT.ipmikcs | Bin 8598 -> 8665 bytes tests/data/acpi/x86/pc/DSDT.memhp | Bin 9885 -> 9952 bytes tests/data/acpi/x86/pc/DSDT.nohpet | Bin 8384 -> 8451 bytes tests/data/acpi/x86/pc/DSDT.numamem | Bin 8532 -> 8599 bytes tests/data/acpi/x86/pc/DSDT.roothp | Bin 12319 -> 12386 bytes tests/data/acpi/x86/q35/DSDT | Bin 8355 -> 8422 bytes tests/data/acpi/x86/q35/DSDT.acpierst | Bin 8372 -> 8439 bytes tests/data/acpi/x86/q35/DSDT.acpihmat | Bin 9680 -> 9747 bytes .../data/acpi/x86/q35/DSDT.acpihmat-generic-x | Bin 12565 -> 12632 bytes .../acpi/x86/q35/DSDT.acpihmat-noinitiator | Bin 8634 -> 8701 bytes tests/data/acpi/x86/q35/DSDT.applesmc | Bin 8401 -> 8468 bytes tests/data/acpi/x86/q35/DSDT.bridge | Bin 11968 -> 12035 bytes tests/data/acpi/x86/q35/DSDT.core-count | Bin 12913 -> 12980 bytes tests/data/acpi/x86/q35/DSDT.core-count2 | Bin 33770 -> 33837 bytes tests/data/acpi/x86/q35/DSDT.cphp | Bin 8819 -> 8886 bytes tests/data/acpi/x86/q35/DSDT.cxl | Bin 13146 -> 13213 bytes tests/data/acpi/x86/q35/DSDT.dimmpxm | Bin 10009 -> 10076 bytes tests/data/acpi/x86/q35/DSDT.ipmibt | Bin 8430 -> 8497 bytes tests/data/acpi/x86/q35/DSDT.ipmismbus | Bin 8443 -> 8510 bytes tests/data/acpi/x86/q35/DSDT.ivrs | Bin 8372 -> 8439 bytes tests/data/acpi/x86/q35/DSDT.memhp | Bin 9714 -> 9781 bytes tests/data/acpi/x86/q35/DSDT.mmio64 | Bin 9485 -> 9552 bytes tests/data/acpi/x86/q35/DSDT.multi-bridge | Bin 13208 -> 13275 bytes tests/data/acpi/x86/q35/DSDT.noacpihp | Bin 8235 -> 8302 bytes tests/data/acpi/x86/q35/DSDT.nohpet | Bin 8213 -> 8280 bytes tests/data/acpi/x86/q35/DSDT.numamem | Bin 8361 -> 8428 bytes tests/data/acpi/x86/q35/DSDT.pvpanic-isa | Bin 8456 -> 8523 bytes tests/data/acpi/x86/q35/DSDT.thread-count | Bin 12913 -> 12980 bytes tests/data/acpi/x86/q35/DSDT.thread-count2 | Bin 33770 -> 33837 bytes tests/data/acpi/x86/q35/DSDT.tis.tpm12 | Bin 8961 -> 9028 bytes tests/data/acpi/x86/q35/DSDT.tis.tpm2 | Bin 8987 -> 9054 bytes tests/data/acpi/x86/q35/DSDT.type4-count | Bin 18589 -> 18656 bytes tests/data/acpi/x86/q35/DSDT.viot | Bin 14612 -> 14679 bytes tests/data/acpi/x86/q35/DSDT.xapic | Bin 35718 -> 35785 bytes 43 files changed, 42 deletions(-)
tests/qtest/bios-tables-test-allowed-diff.h +0 -42
@@ -1,43 +1 @@/* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/x86/pc/DSDT" , -"tests/data/acpi/x86/pc/DSDT.acpierst" , -"tests/data/acpi/x86/pc/DSDT.acpihmat" , -"tests/data/acpi/x86/pc/DSDT.bridge" , -"tests/data/acpi/x86/pc/DSDT.cphp" , -"tests/data/acpi/x86/pc/DSDT.dimmpxm" , -"tests/data/acpi/x86/pc/DSDT.hpbridge" , -"tests/data/acpi/x86/pc/DSDT.hpbrroot" , -"tests/data/acpi/x86/pc/DSDT.ipmikcs" , -"tests/data/acpi/x86/pc/DSDT.memhp" , -"tests/data/acpi/x86/pc/DSDT.nohpet" , -"tests/data/acpi/x86/pc/DSDT.numamem" , -"tests/data/acpi/x86/pc/DSDT.roothp" , -"tests/data/acpi/x86/q35/DSDT" , -"tests/data/acpi/x86/q35/DSDT.acpierst" , -"tests/data/acpi/x86/q35/DSDT.acpihmat" , -"tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x" , -"tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator" , -"tests/data/acpi/x86/q35/DSDT.applesmc" , -"tests/data/acpi/x86/q35/DSDT.bridge" , -"tests/data/acpi/x86/q35/DSDT.core-count" , -"tests/data/acpi/x86/q35/DSDT.core-count2" , -"tests/data/acpi/x86/q35/DSDT.cphp" , -"tests/data/acpi/x86/q35/DSDT.cxl" , -"tests/data/acpi/x86/q35/DSDT.dimmpxm" , -"tests/data/acpi/x86/q35/DSDT.ipmibt" , -"tests/data/acpi/x86/q35/DSDT.ipmismbus" , -"tests/data/acpi/x86/q35/DSDT.ivrs" , -"tests/data/acpi/x86/q35/DSDT.memhp" , -"tests/data/acpi/x86/q35/DSDT.mmio64" , -"tests/data/acpi/x86/q35/DSDT.multi-bridge" , -"tests/data/acpi/x86/q35/DSDT.noacpihp" , -"tests/data/acpi/x86/q35/DSDT.nohpet" , -"tests/data/acpi/x86/q35/DSDT.numamem" , -"tests/data/acpi/x86/q35/DSDT.pvpanic-isa" , -"tests/data/acpi/x86/q35/DSDT.thread-count" , -"tests/data/acpi/x86/q35/DSDT.thread-count2" , -"tests/data/acpi/x86/q35/DSDT.tis.tpm12" , -"tests/data/acpi/x86/q35/DSDT.tis.tpm2" , -"tests/data/acpi/x86/q35/DSDT.type4-count" , -"tests/data/acpi/x86/q35/DSDT.viot" , -"tests/data/acpi/x86/q35/DSDT.xapic",
tests/data/acpi/x86/pc/DSDT binary +0 -0
tests/data/acpi/x86/pc/DSDT.acpierst binary +0 -0
tests/data/acpi/x86/pc/DSDT.acpihmat binary +0 -0
tests/data/acpi/x86/pc/DSDT.bridge binary +0 -0
tests/data/acpi/x86/pc/DSDT.cphp binary +0 -0
tests/data/acpi/x86/pc/DSDT.dimmpxm binary +0 -0
tests/data/acpi/x86/pc/DSDT.hpbridge binary +0 -0
tests/data/acpi/x86/pc/DSDT.hpbrroot binary +0 -0
tests/data/acpi/x86/pc/DSDT.ipmikcs binary +0 -0
tests/data/acpi/x86/pc/DSDT.memhp binary +0 -0
tests/data/acpi/x86/pc/DSDT.nohpet binary +0 -0
tests/data/acpi/x86/pc/DSDT.numamem binary +0 -0
tests/data/acpi/x86/pc/DSDT.roothp binary +0 -0
tests/data/acpi/x86/q35/DSDT binary +0 -0
tests/data/acpi/x86/q35/DSDT.acpierst binary +0 -0
tests/data/acpi/x86/q35/DSDT.acpihmat binary +0 -0
tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x binary +0 -0
tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator binary +0 -0
tests/data/acpi/x86/q35/DSDT.applesmc binary +0 -0
tests/data/acpi/x86/q35/DSDT.bridge binary +0 -0
tests/data/acpi/x86/q35/DSDT.core-count binary +0 -0
tests/data/acpi/x86/q35/DSDT.core-count2 binary +0 -0
tests/data/acpi/x86/q35/DSDT.cphp binary +0 -0
tests/data/acpi/x86/q35/DSDT.cxl binary +0 -0
tests/data/acpi/x86/q35/DSDT.dimmpxm binary +0 -0
tests/data/acpi/x86/q35/DSDT.ipmibt binary +0 -0
tests/data/acpi/x86/q35/DSDT.ipmismbus binary +0 -0
tests/data/acpi/x86/q35/DSDT.ivrs binary +0 -0
tests/data/acpi/x86/q35/DSDT.memhp binary +0 -0
tests/data/acpi/x86/q35/DSDT.mmio64 binary +0 -0
tests/data/acpi/x86/q35/DSDT.multi-bridge binary +0 -0
tests/data/acpi/x86/q35/DSDT.noacpihp binary +0 -0
tests/data/acpi/x86/q35/DSDT.nohpet binary +0 -0
tests/data/acpi/x86/q35/DSDT.numamem binary +0 -0
tests/data/acpi/x86/q35/DSDT.pvpanic-isa binary +0 -0
tests/data/acpi/x86/q35/DSDT.thread-count binary +0 -0
tests/data/acpi/x86/q35/DSDT.thread-count2 binary +0 -0
tests/data/acpi/x86/q35/DSDT.tis.tpm12 binary +0 -0
tests/data/acpi/x86/q35/DSDT.tis.tpm2 binary +0 -0
tests/data/acpi/x86/q35/DSDT.type4-count binary +0 -0
tests/data/acpi/x86/q35/DSDT.viot binary +0 -0
tests/data/acpi/x86/q35/DSDT.xapic binary +0 -0
Signature · 1 line
MST
[PULL 29/48] acpi/ghes: simplify the per-arch caller to build HEST table
In reply to Michael S. TsirkinFrom: Mauro Carvalho Chehab <[email protected]>
The GHES driver requires not only a HEST table, but also a separate firmware file to store Error Structure records. It can't do one without the other.
Simplify the caller logic for it to require one function.
No functional changes.
Message-Id: <9584bb8953385e165681d5d185c503f8df8ef42f.1736945236.git.mchehab+huawei@kernel.org>
--- include/hw/acpi/ghes.h | 4 ++-- hw/acpi/ghes.c | 7 +++++-- hw/arm/virt-acpi-build.c | 5 ++--- 3 files changed, 9 insertions(+), 7 deletions(-)
include/hw/acpi/ghes.h +2 -2
@@ -68,8 +68,8 @@ typedef struct AcpiGhesState {bool present;/* True if GHES is present at all on this board */ } AcpiGhesState; -void build_ghes_error_table (GArray *hardware_errors,BIOSLinker *linker); -void acpi_build_hest (GArray *table_data,BIOSLinker *linker, +void acpi_build_hest (GArray *table_data,GArray *hardware_errors, +BIOSLinker *linker,const char *oem_id,const char *oem_table_id);void acpi_ghes_add_fw_cfg (AcpiGhesState *vms,FWCfgState *s,GArray *hardware_errors);
hw/acpi/ghes.c +5 -2
@@ -233,7 +233,7 @@ static int acpi_ghes_record_mem_error(uint64_t error_block_address,* Initialize "etc/hardware_errors" and "etc/hardware_errors_addr" fw_cfg blobs. * See docs/specs/acpi_hest_ghes.rst for blobs format. */ -void build_ghes_error_table (GArray *hardware_errors,BIOSLinker *linker) +static void build_ghes_error_table (GArray *hardware_errors,BIOSLinker *linker) {int i, error_status_block_offset;
@@ -356,12 +356,15 @@ static void build_ghes_v2(GArray *table_data, int source_id, BIOSLinker *linker) }/* Build Hardware Error Source Table */ -void acpi_build_hest (GArray *table_data,BIOSLinker *linker, +void acpi_build_hest (GArray *table_data,GArray *hardware_errors, +BIOSLinker *linker,const char *oem_id,const char *oem_table_id) {AcpiTable table = { .sig ="HEST" , .rev =1 , .oem_id = oem_id, .oem_table_id = oem_table_id }; +build_ghes_error_table (hardware_errors, linker); +acpi_table_begin (&table, table_data);/* Error Source Count */
hw/arm/virt-acpi-build.c +2 -3
@@ -946,10 +946,9 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables)build_dbg2 (tables_blob, tables->linker, vms);if (vms->ras) { -build_ghes_error_table (tables->hardware_errors, tables->linker);acpi_add_table (table_offsets, tables_blob); -acpi_build_hest (tables_blob, tables->linker, vms->oem_id, - vms->oem_table_id); +acpi_build_hest (tables_blob, tables->hardware_errors, tables->linker, + vms->oem_id, vms->oem_table_id); }if (ms->numa_state->num_nodes >0 ) {
Signature · 1 line
MST
[PULL 30/48] acpi/ghes: better handle source_id and notification
In reply to Michael S. TsirkinFrom: Mauro Carvalho Chehab <[email protected]>
GHES has two fields that are stored on HEST error source blocks associated with notifications:
- notification type, which is a number defined at the ACPI spec containing several arch-specific synchronous and assynchronous types;
- source id, which is a HW/FW defined number, used to distinguish between different implemented sources.
There could be several sources with the same notification type, which is dependent of the way each architecture maps notifications.
Right now, build_ghes_v2() hardcodes a 1:1 mapping between such fields. Move it to two independent parameters, allowing the caller function to fill both.
Message-Id: <133ff72ea1041fed7dbcf97b7a2b0f4dfacde31a.1736945236.git.mchehab+huawei@kernel.org>
--- hw/acpi/ghes.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-)
hw/acpi/ghes.c +9 -14
@@ -284,9 +284,13 @@ static void build_ghes_error_table(GArray *hardware_errors, BIOSLinker *linker) }/* Build Generic Hardware Error Source version 2 (GHESv2) */ -static void build_ghes_v2 (GArray *table_data,int source_id,BIOSLinker *linker) +static void build_ghes_v2 (GArray *table_data, +BIOSLinker *linker, +enum AcpiGhesNotifyType notify, +uint16_t source_id) {uint64_t address_offset; +/* * Type: * Generic Hardware Error Source version 2(GHESv2 - Type 10)
@@ -316,18 +320,8 @@ static void build_ghes_v2(GArray *table_data, int source_id, BIOSLinker *linker) address_offset +GAS_ADDR_OFFSET ,sizeof (uint64_t ), ACPI_GHES_ERRORS_FW_CFG_FILE, source_id * sizeof(uint64_t)); -switch (source_id) { -case ACPI_HEST_SRC_ID_SEA : -/* -* Notification Structure -* Now only enable ARMv8 SEA notification type -*/ -build_ghes_hw_error_notification (table_data,ACPI_GHES_NOTIFY_SEA ); -break ; -default : -error_report ("Not support this error source" ); -abort (); - } +/* Notification Structure */ +build_ghes_hw_error_notification (table_data, notify);/* Error Status Block Length */ build_append_int_noprefix (table_data,ACPI_GHES_MAX_RAW_DATA_LENGTH ,4 );
@@ -369,7 +363,8 @@ void acpi_build_hest(GArray *table_data, GArray *hardware_errors,/* Error Source Count */ build_append_int_noprefix (table_data,ACPI_GHES_ERROR_SOURCE_COUNT ,4 ); -build_ghes_v2 (table_data,ACPI_HEST_SRC_ID_SEA , linker); +build_ghes_v2 (table_data, linker, +ACPI_GHES_NOTIFY_SEA ,ACPI_HEST_SRC_ID_SEA );acpi_table_end (linker, &table); }
Signature · 1 line
MST
[PULL 35/48] acpi/ghes: make the GHES record generation more generic
In reply to Michael S. TsirkinFrom: Mauro Carvalho Chehab <[email protected]>
Split the code into separate functions to allow using the common CPER filling code by different error sources.
The generic code was moved to ghes_record_cper_errors(), and ghes_gen_err_data_uncorrectable_recoverable() now contains only a logic to fill the Generic Error Data part of the record, as described at:
ACPI 6.2: 18.3.2.7.1 Generic Error Data
The remaining code to generate a memory error now belongs to acpi_ghes_record_errors() function.
A further patch will give it a better name.
Message-Id: <68d9f787d8c4fc8d1dbc227d6902fe801e42dea9.1736945236.git.mchehab+huawei@kernel.org>
--- include/hw/acpi/ghes.h | 3 ++ hw/acpi/ghes.c | 120 +++++++++++++++++++++++------------------ 2 files changed, 72 insertions(+), 51 deletions(-)
include/hw/acpi/ghes.h +3 -0
@@ -23,6 +23,7 @@#define ACPI_GHES_H #include "hw/acpi/bios-linker-loader.h" +#include "qapi/error.h" /* * Values for Hardware Error Notification Type field
@@ -73,6 +74,8 @@ void acpi_build_hest(GArray *table_data, GArray *hardware_errors, const char *oem_id, const char *oem_table_id);void acpi_ghes_add_fw_cfg (AcpiGhesState *vms,FWCfgState *s,GArray *hardware_errors); +void ghes_record_cper_errors (const void *cper,size_t len, +uint16_t source_id,Error **errp);int acpi_ghes_record_errors (uint16_t source_id,uint64_t error_physical_addr);/**
hw/acpi/ghes.c +69 -51
165 lines not on this page · raw message
Signature · 1 line
MST
[PULL 48/48] virtio-net: vhost-user: Implement internal migration
In reply to Michael S. TsirkinFrom: Laurent Vivier <[email protected]>
Add support of VHOST_USER_PROTOCOL_F_DEVICE_STATE in virtio-net with vhost-user backend.
Message-Id: <[email protected]>
--- hw/net/virtio-net.c | 135 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 112 insertions(+), 23 deletions(-)
hw/net/virtio-net.c +112 -23
@@ -3337,6 +3337,117 @@ static const VMStateDescription vmstate_virtio_net_rss = { }, }; +static struct vhost_dev *virtio_net_get_vhost (VirtIODevice *vdev) +{ +VirtIONet *n =VIRTIO_NET (vdev); +NetClientState *nc; +struct vhost_net *net; + +if (!n->nic) { +return NULL ; + } + + nc =qemu_get_queue (n->nic); +if (!nc) { +return NULL ; + } + + net =get_vhost_net (nc->peer); +if (!net) { +return NULL ; + } + +return &net->dev; +} + +static int vhost_user_net_save_state (QEMUFile *f,void *pv,size_t size, +const VMStateField *field, +JSONWriter *vmdesc) +{ +VirtIONet *n = pv; +VirtIODevice *vdev =VIRTIO_DEVICE (n); +struct vhost_dev *vhdev; +Error *local_error =NULL ; +int ret; + + vhdev =virtio_net_get_vhost (vdev); +if (vhdev ==NULL ) { +error_reportf_err (local_error, +"Error getting vhost back-end of %s device %s: " , + vdev->name, vdev->parent_obj.canonical_path); +return -1 ; + } + + ret =vhost_save_backend_state (vhdev, f, &local_error); +if (ret <0 ) { +error_reportf_err (local_error, +"Error saving back-end state of %s device %s: " , + vdev->name, vdev->parent_obj.canonical_path); +return ret; + } + +return 0 ; +} + +static int vhost_user_net_load_state (QEMUFile *f,void *pv,size_t size, +const VMStateField *field) +{ +VirtIONet *n = pv; +VirtIODevice *vdev =VIRTIO_DEVICE (n); +struct vhost_dev *vhdev; +Error *local_error =NULL ; +int ret; + + vhdev =virtio_net_get_vhost (vdev); +if (vhdev ==NULL ) { +error_reportf_err (local_error, +"Error getting vhost back-end of %s device %s: " , + vdev->name, vdev->parent_obj.canonical_path); +return -1 ; + } + + ret =vhost_load_backend_state (vhdev, f, &local_error); +if (ret <0 ) { +error_reportf_err (local_error, +"Error loading back-end state of %s device %s: " , + vdev->name, vdev->parent_obj.canonical_path); +return ret; + } + +return 0 ; +} + +static bool vhost_user_net_is_internal_migration (void *opaque) +{ +VirtIONet *n = opaque; +VirtIODevice *vdev =VIRTIO_DEVICE (n); +struct vhost_dev *vhdev; + + vhdev =virtio_net_get_vhost (vdev); +if (vhdev ==NULL ) { +return false; + } + +return vhost_supports_device_state (vhdev); +} + +static const VMStateDescription vhost_user_net_backend_state = { + .name ="virtio-net-device/backend" , + .version_id =0 , + .needed = vhost_user_net_is_internal_migration, + .fields = (const VMStateField []) { + { + .name ="backend" , + .info = &(const VMStateInfo ) { + .name ="virtio-net vhost-user backend state" , + .get = vhost_user_net_load_state, + .put = vhost_user_net_save_state, + }, + }, +VMSTATE_END_OF_LIST () + } +}; +static const VMStateDescription vmstate_virtio_net_device = { .name ="virtio-net-device" , .version_id =VIRTIO_NET_VM_VERSION ,
@@ -3389,6 +3500,7 @@ static const VMStateDescription vmstate_virtio_net_device = { }, .subsections = (const VMStateDescription * const []) { &vmstate_virtio_net_rss, + &vhost_user_net_backend_state,NULL } };
@@ -3950,29 +4062,6 @@ static bool dev_unplug_pending(void *opaque)return vdc->primary_unplug_pending (dev); } -static struct vhost_dev *virtio_net_get_vhost (VirtIODevice *vdev) -{ -VirtIONet *n =VIRTIO_NET (vdev); -NetClientState *nc; -struct vhost_net *net; - -if (!n->nic) { -return NULL ; - } - - nc =qemu_get_queue (n->nic); -if (!nc) { -return NULL ; - } - - net =get_vhost_net (nc->peer); -if (!net) { -return NULL ; - } - -return &net->dev; -} -static const VMStateDescription vmstate_virtio_net = { .name ="virtio-net" , .minimum_version_id =VIRTIO_NET_VM_VERSION ,
Signature · 1 line
MST
[PULL 32/48] acpi/ghes: Remove a duplicated out of bounds check
In reply to Michael S. TsirkinFrom: Mauro Carvalho Chehab <[email protected]>
acpi_ghes_record_errors() has an assert() at the beginning to ensure that source_id will be lower than ACPI_GHES_ERROR_SOURCE_COUNT. Remove a duplicated check.
Message-Id: <df33b004d85b7b9aa388fb2ac530dcdea94b7edc.1736945236.git.mchehab+huawei@kernel.org>
--- hw/acpi/ghes.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
hw/acpi/ghes.c +1 -3
@@ -404,9 +404,7 @@ int acpi_ghes_record_errors(uint8_t source_id, uint64_t physical_address)return -1 ; } -if (source_id <ACPI_GHES_ERROR_SOURCE_COUNT ) { - start_addr += source_id *sizeof (uint64_t ); - } + start_addr += source_id *sizeof (uint64_t );cpu_physical_memory_read (start_addr, &error_block_addr,sizeof (error_block_addr));
Signature · 1 line
MST
[PULL 34/48] acpi/ghes: don't check if physical_address is not zero
In reply to Michael S. TsirkinFrom: Mauro Carvalho Chehab <[email protected]>
The 'physical_address' value is a faulty page. As such, 0 is as valid as any other value.
Message-Id: <da32536bf4962e5c03471e2a4e6e0ef92be4a1be.1736945236.git.mchehab+huawei@kernel.org>
--- hw/acpi/ghes.c | 4 ---- 1 file changed, 4 deletions(-)
hw/acpi/ghes.c +0 -4
@@ -400,10 +400,6 @@ int acpi_ghes_record_errors(uint16_t source_id, uint64_t physical_address) start_addr =le64_to_cpu (ags->ghes_addr_le); -if (!physical_address) { -return -1 ; - } - start_addr += source_id *sizeof (uint64_t ); cpu_physical_memory_read(start_addr, &error_block_addr,
Signature · 1 line
MST
[PULL 28/48] acpi/ghes: simplify acpi_ghes_record_errors() code
In reply to Michael S. TsirkinFrom: Mauro Carvalho Chehab <[email protected]>
Reduce the ident of the function and prepares it for the next changes.
No functional changes.
Message-Id: <19af4188535217213486d169e0501e592bc78a95.1736945236.git.mchehab+huawei@kernel.org>
--- hw/acpi/ghes.c | 56 ++++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 27 deletions(-)
hw/acpi/ghes.c +29 -27
@@ -402,40 +402,42 @@ int acpi_ghes_record_errors(uint8_t source_id, uint64_t physical_address) start_addr =le64_to_cpu (ags->ghes_addr_le); -if (physical_address) { +if (!physical_address) { +return -1 ; + } -if (source_id <ACPI_GHES_ERROR_SOURCE_COUNT ) { - start_addr += source_id *sizeof (uint64_t ); - } +if (source_id <ACPI_GHES_ERROR_SOURCE_COUNT ) { + start_addr += source_id *sizeof (uint64_t ); + } -cpu_physical_memory_read (start_addr, &error_block_addr, -sizeof (error_block_addr)); +cpu_physical_memory_read (start_addr, &error_block_addr, +sizeof (error_block_addr)); - error_block_addr =le64_to_cpu (error_block_addr); + error_block_addr =le64_to_cpu (error_block_addr); - read_ack_register_addr = start_addr + -ACPI_GHES_ERROR_SOURCE_COUNT *sizeof (uint64_t ); + read_ack_register_addr = start_addr + +ACPI_GHES_ERROR_SOURCE_COUNT *sizeof (uint64_t ); -cpu_physical_memory_read (read_ack_register_addr, - &read_ack_register,sizeof (read_ack_register)); +cpu_physical_memory_read (read_ack_register_addr, + &read_ack_register,sizeof (read_ack_register)); -/* zero means OSPM does not acknowledge the error */ -if (!read_ack_register) { -error_report ("OSPM does not acknowledge previous error," -" so can not record CPER for current error anymore" ); - }else if (error_block_addr) { - read_ack_register =cpu_to_le64 (0 ); -/* -* Clear the Read Ack Register, OSPM will write it to 1 when -* it acknowledges this error. -*/ -cpu_physical_memory_write (read_ack_register_addr, - &read_ack_register,sizeof (uint64_t )); +/* zero means OSPM does not acknowledge the error */ +if (!read_ack_register) { +error_report ("OSPM does not acknowledge previous error," +" so can not record CPER for current error anymore" ); + }else if (error_block_addr) { + read_ack_register =cpu_to_le64 (0 ); +/* +* Clear the Read Ack Register, OSPM will write it to 1 when +* it acknowledges this error. +*/ +cpu_physical_memory_write (read_ack_register_addr, + &read_ack_register,sizeof (uint64_t )); - ret =acpi_ghes_record_mem_error (error_block_addr, - physical_address); - }else -error_report ("can not find Generic Error Status Block" ); + ret =acpi_ghes_record_mem_error (error_block_addr, + physical_address); + }else { +error_report ("can not find Generic Error Status Block" ); }return ret;
Signature · 1 line
MST
[PULL 41/48] acpi/ghes: Change ghes fill logic to work with only one source
In reply to Michael S. TsirkinFrom: Mauro Carvalho Chehab <[email protected]>
Extending to multiple sources require a BIOS pointer to the beginning of the HEST table, which in turn requires a backward-compatible code.
So, the current code supports only one source. Ensure that and simplify the code.
Message-Id: <66bddd42a64c8515ad98b9975d953b4a70ffcc6d.1736945236.git.mchehab+huawei@kernel.org>
--- hw/acpi/ghes.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
hw/acpi/ghes.c +4 -8
@@ -387,15 +387,13 @@ static void get_hw_error_offsets(uint64_t ghes_addr,* As the current version supports only one source, the ack offset is * just sizeof(uint64_t). */ - *read_ack_register_addr = ghes_addr + -ACPI_GHES_ERROR_SOURCE_COUNT *sizeof (uint64_t ); + *read_ack_register_addr = ghes_addr +sizeof (uint64_t ); }void ghes_record_cper_errors (const void *cper,size_t len,uint16_t source_id,Error **errp) {uint64_t cper_addr =0 , read_ack_register_addr =0 , read_ack_register; -uint64_t start_addr;AcpiGedState *acpi_ged_state;AcpiGhesState *ags;
@@ -412,11 +410,9 @@ void ghes_record_cper_errors(const void *cper, size_t len, } ags = &acpi_ged_state->ghes_state; - start_addr =le64_to_cpu (ags->hw_error_le); - - start_addr += source_id *sizeof (uint64_t ); - -get_hw_error_offsets (start_addr, &cper_addr, &read_ack_register_addr); +assert (ACPI_GHES_ERROR_SOURCE_COUNT ==1 ); +get_hw_error_offsets (le64_to_cpu (ags->hw_error_le), + &cper_addr, &read_ack_register_addr);if (!cper_addr) {error_setg (errp,"can not find Generic Error Status Block" );
Signature · 1 line
MST
[PULL 18/48] intel_iommu: Add support for PASID-based device IOTLB invalidation
In reply to Michael S. TsirkinFrom: Clément Mathieu--Drif <[email protected]>
Message-Id: <[email protected]>
--- hw/i386/intel_iommu_internal.h | 11 ++++++++ hw/i386/intel_iommu.c | 50 ++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+)
hw/i386/intel_iommu_internal.h +11 -0
@@ -385,6 +385,7 @@ typedef union VTDInvDesc VTDInvDesc;#define VTD_INV_DESC_WAIT 0x5/* Invalidation Wait Descriptor */ #define VTD_INV_DESC_PIOTLB 0x6/* PASID-IOTLB Invalidate Desc */ #define VTD_INV_DESC_PC 0x7/* PASID-cache Invalidate Desc */ +#define VTD_INV_DESC_DEV_PIOTLB 0x8/* PASID-based-DIOTLB inv_desc*/ #define VTD_INV_DESC_NONE 0/* Not an Invalidate Descriptor */ /* Masks for Invalidation Wait Descriptor*/
@@ -426,6 +427,16 @@ typedef union VTDInvDesc VTDInvDesc;/* Masks for Interrupt Entry Invalidate Descriptor */ #define VTD_INV_DESC_IEC_RSVD 0xffff000007fff1e0ULL +/* Masks for PASID based Device IOTLB Invalidate Descriptor */ +#define VTD_INV_DESC_PASID_DEVICE_IOTLB_ADDR (val) ((val) & \ + 0xfffffffffffff000ULL) +#define VTD_INV_DESC_PASID_DEVICE_IOTLB_SIZE (val) ((val >> 11) & 0x1) +#define VTD_INV_DESC_PASID_DEVICE_IOTLB_GLOBAL (val) ((val) & 0x1) +#define VTD_INV_DESC_PASID_DEVICE_IOTLB_SID (val) (((val) >> 16) & 0xffffULL) +#define VTD_INV_DESC_PASID_DEVICE_IOTLB_PASID (val) ((val >> 32) & 0xfffffULL) +#define VTD_INV_DESC_PASID_DEVICE_IOTLB_RSVD_VAL0 0xfff000000000f000ULL +#define VTD_INV_DESC_PASID_DEVICE_IOTLB_RSVD_VAL1 0x7feULL +/* Rsvd field masks for spte */ #define VTD_SPTE_SNP 0x800ULL
hw/i386/intel_iommu.c +50 -0
62 lines not on this page · raw message
Signature · 1 line
MST
[PULL 12/48] intel_iommu: Check if the input address is canonical
In reply to Michael S. TsirkinFrom: Clément Mathieu--Drif <[email protected]>
Stage-1 translation must fail if the address to translate is not canonical.
Message-Id: <[email protected]>
--- hw/i386/intel_iommu_internal.h | 1 + hw/i386/intel_iommu.c | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+)
hw/i386/intel_iommu_internal.h +1 -0
@@ -326,6 +326,7 @@ typedef enum VTDFaultReason {/* Non-zero reserved field in present first-stage paging entry */ VTD_FR_FS_PAGING_ENTRY_RSVD =0x72 ,VTD_FR_PASID_ENTRY_FSPTPTR_INV =0x73 ,/* Invalid FSPTPTR in PASID entry */ +VTD_FR_FS_NON_CANONICAL =0x80 ,/* SNG.1 : Address for FS not canonical.*/ VTD_FR_FS_PAGING_ENTRY_US =0x81 ,/* Privilege violation */ VTD_FR_SM_WRITE = 0x85, /* No write permission */
hw/i386/intel_iommu.c +23 -0
@@ -1824,6 +1824,7 @@ static const bool vtd_qualified_faults[] = { [VTD_FR_FS_PAGING_ENTRY_P] = true, [VTD_FR_FS_PAGING_ENTRY_RSVD] = true, [VTD_FR_PASID_ENTRY_FSPTPTR_INV] = true, + [VTD_FR_FS_NON_CANONICAL] = true, [VTD_FR_FS_PAGING_ENTRY_US] = true, [VTD_FR_SM_WRITE] = true, [VTD_FR_SM_INTERRUPT_ADDR] = true,
@@ -1930,6 +1931,22 @@ static inline bool vtd_flpte_present(uint64_t flpte)return !!(flpte &VTD_FL_P ); } +/* Return true if IOVA is canonical, otherwise false. */ +static bool vtd_iova_fl_check_canonical (IntelIOMMUState *s,uint64_t iova, +VTDContextEntry *ce,uint32_t pasid) +{ +uint64_t iova_limit =vtd_iova_limit (s, ce, s->aw_bits, pasid); +uint64_t upper_bits_mask = ~(iova_limit -1 ); +uint64_t upper_bits = iova & upper_bits_mask; +bool msb = ((iova & (iova_limit >>1 )) !=0 ); + +if (msb) { +return upper_bits == upper_bits_mask; + }else { +return !upper_bits; + } +} +/* * Given the @iova, get relevant @flptep. @flpte_level will be the last level * of the translation, can be used for deciding the size of large page.
@@ -1945,6 +1962,12 @@ static int vtd_iova_to_flpte(IntelIOMMUState *s, VTDContextEntry *ce,uint32_t offset;uint64_t flpte; +if (!vtd_iova_fl_check_canonical (s, iova, ce, pasid)) { +error_report_once ("%s: detected non canonical IOVA (iova=0x%" PRIx64"," +"pasid=0x%" PRIx32")" , __func__, iova, pasid); +return -VTD_FR_FS_NON_CANONICAL ; + } +while (true) { offset =vtd_iova_level_offset (iova, level); flpte =vtd_get_pte (addr, offset);
Signature · 1 line
MST
[PULL 13/48] intel_iommu: Check stage-1 translation result with interrupt range
In reply to Michael S. TsirkinFrom: Zhenzhong Duan <[email protected]>
Per VT-d spec 4.1 section 3.15, "Untranslated requests and translation requests that result in an address in the interrupt range will be blocked with condition code LGN.4 or SGN.8."
This applies to both stage-1 and stage-2 IOMMU page table, move the check from vtd_iova_to_slpte() to vtd_do_iommu_translate() so stage-1 page table could also be checked.
By this chance, update the comment with correct section number.
Message-Id: <[email protected]>
--- hw/i386/intel_iommu.c | 48 ++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 23 deletions(-)
hw/i386/intel_iommu.c +25 -23
@@ -1138,7 +1138,6 @@ static int vtd_iova_to_slpte(IntelIOMMUState *s, VTDContextEntry *ce,uint32_t offset;uint64_t slpte;uint64_t access_right_check; -uint64_t xlat, size;if (!vtd_iova_sl_range_check (s, iova, ce, aw_bits, pasid)) { error_report_once("%s: detected IOVA overflow (iova=0x%" PRIx64 ","
@@ -1191,28 +1190,7 @@ static int vtd_iova_to_slpte(IntelIOMMUState *s, VTDContextEntry *ce, level--; } - xlat =vtd_get_pte_addr (*slptep, aw_bits); - size = ~vtd_pt_level_page_mask (level) +1 ; - -/* -* From VT-d spec 3.14: Untranslated requests and translation -* requests that result in an address in the interrupt range will be -* blocked with condition code LGN.4 or SGN.8. -*/ -if ((xlat >VTD_INTERRUPT_ADDR_LAST || - xlat + size -1 <VTD_INTERRUPT_ADDR_FIRST )) { -return 0 ; - }else { -error_report_once ("%s: xlat address is in interrupt range " -"(iova=0x%" PRIx64", level=0x%" PRIx32", " -"slpte=0x%" PRIx64", write=%d, " -"xlat=0x%" PRIx64", size=0x%" PRIx64", " -"pasid=0x%" PRIx32")" , - __func__, iova, level, slpte, is_write, - xlat, size, pasid); -return s->scalable_mode ? -VTD_FR_SM_INTERRUPT_ADDR : - -VTD_FR_INTERRUPT_ADDR ; - } +return 0 ; }typedef int (*vtd_page_walk_hook )(const IOMMUTLBEvent *event,void *private);
@@ -2064,6 +2042,7 @@ static bool vtd_do_iommu_translate(VTDAddressSpace *vtd_as, PCIBus *bus,uint8_t access_flags;bool rid2pasid = (pasid ==PCI_NO_PASID ) && s->root_scalable;VTDIOTLBEntry *iotlb_entry; +uint64_t xlat, size;/* * We have standalone memory region for interrupt addresses, we
@@ -2173,6 +2152,29 @@ static bool vtd_do_iommu_translate(VTDAddressSpace *vtd_as, PCIBus *bus, ret_fr =vtd_iova_to_slpte (s, &ce, addr, is_write, &pte, &level, &reads, &writes, s->aw_bits, pasid); } +if (!ret_fr) { + xlat =vtd_get_pte_addr (pte, s->aw_bits); + size = ~vtd_pt_level_page_mask (level) +1 ; + +/* +* Per VT-d spec 4.1 section 3.15: Untranslated requests and translation +* requests that result in an address in the interrupt range will be +* blocked with condition code LGN.4 or SGN.8. +*/ +if ((xlat <=VTD_INTERRUPT_ADDR_LAST && + xlat + size -1 >=VTD_INTERRUPT_ADDR_FIRST )) { +error_report_once ("%s: xlat address is in interrupt range " +"(iova=0x%" PRIx64", level=0x%" PRIx32", " +"pte=0x%" PRIx64", write=%d, " +"xlat=0x%" PRIx64", size=0x%" PRIx64", " +"pasid=0x%" PRIx32")" , + __func__, addr, level, pte, is_write, + xlat, size, pasid); + ret_fr = s->scalable_mode ? -VTD_FR_SM_INTERRUPT_ADDR : + -VTD_FR_INTERRUPT_ADDR ; + } + } +if (ret_fr) {vtd_report_fault (s, -ret_fr, is_fpd_set, source_id, addr, is_write, pasid !=PCI_NO_PASID , pasid);
Signature · 1 line
MST
[PULL 37/48] acpi/ghes: don't crash QEMU if ghes GED is not found
In reply to Michael S. TsirkinFrom: Mauro Carvalho Chehab <[email protected]>
Make error handling within ghes_record_cper_errors() consistent, i.e. instead abort just print a error in case ghes GED is not found.
Message-Id: <c7e1665ba46df321f0ce161d60dfd681ab827535.1736945236.git.mchehab+huawei@kernel.org>
--- hw/acpi/ghes.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
hw/acpi/ghes.c +4 -1
@@ -371,7 +371,10 @@ void ghes_record_cper_errors(const void *cper, size_t len, acpi_ged_state =ACPI_GED (object_resolve_path_type ("" ,TYPE_ACPI_GED ,NULL )); -g_assert (acpi_ged_state); +if (!acpi_ged_state) { +error_setg (errp,"Can't find ACPI_GED object" ); +return ; + } ags = &acpi_ged_state->ghes_state; start_addr =le64_to_cpu (ags->ghes_addr_le);
Signature · 1 line
MST
[PULL 24/48] intel_iommu: Introduce a property to control FS1GP cap bit setting
In reply to Michael S. TsirkinFrom: Zhenzhong Duan <[email protected]>
This gives user flexibility to turn off FS1GP for debug purpose.
It is also useful for future nesting feature. When host IOMMU doesn't support FS1GP but vIOMMU does, nested page table on host side works after turning FS1GP off in vIOMMU.
This property has no effect when vIOMMU is in legacy mode or x-flts=off in scalable modme.
Message-Id: <[email protected]>
--- include/hw/i386/intel_iommu.h | 1 + hw/i386/intel_iommu.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-)
include/hw/i386/intel_iommu.h +1 -0
@@ -307,6 +307,7 @@ struct IntelIOMMUState {bool dma_drain;/* Whether DMA r/w draining enabled */ bool dma_translation;/* Whether DMA translation supported */ bool pasid;/* Whether to support PASID */ +bool fs1gp;/* First Stage 1-GByte Page Support */ /* Transient Mapping, Reserved(0) since VTD spec revision 3.2 */ bool stale_tm;
hw/i386/intel_iommu.c +4 -1
@@ -3834,6 +3834,7 @@ static const Property vtd_properties[] = {DEFINE_PROP_BOOL ("dma-drain" , IntelIOMMUState, dma_drain, true),DEFINE_PROP_BOOL ("dma-translation" , IntelIOMMUState, dma_translation, true),DEFINE_PROP_BOOL ("stale-tm" , IntelIOMMUState, stale_tm, false), + DEFINE_PROP_BOOL("fs1gp", IntelIOMMUState, fs1gp, true), };/* Read IRTE entry with specific index */
@@ -4561,7 +4562,9 @@ static void vtd_cap_init(IntelIOMMUState *s)/* TODO: read cap/ecap from host to decide which cap to be exposed. */ if (s->flts) { s->ecap |=VTD_ECAP_SMTS |VTD_ECAP_FLTS ; - s->cap |=VTD_CAP_FS1GP ; +if (s->fs1gp) { + s->cap |=VTD_CAP_FS1GP ; + } }else if (s->scalable_mode) { s->ecap |=VTD_ECAP_SMTS |VTD_ECAP_SRS |VTD_ECAP_SLTS ; }
Signature · 1 line
MST
[PULL 25/48] tests/qtest: Add intel-iommu test
In reply to Michael S. TsirkinFrom: Zhenzhong Duan <[email protected]>
Add the framework to test the intel-iommu device.
Currently only tested cap/ecap bits correctness when x-flts=on in scalable mode. Also tested cap/ecap bits consistency before and after system reset.
Message-Id: <[email protected]>
--- include/hw/i386/intel_iommu.h | 1 + tests/qtest/intel-iommu-test.c | 64 ++++++++++++++++++++++++++++++++++ MAINTAINERS | 1 + tests/qtest/meson.build | 1 + 4 files changed, 67 insertions(+) create mode 100644 tests/qtest/intel-iommu-test.c
include/hw/i386/intel_iommu.h +1 -0
@@ -47,6 +47,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(IntelIOMMUState, INTEL_IOMMU_DEVICE)#define VTD_HOST_AW_48BIT 48#define VTD_HOST_ADDRESS_WIDTH VTD_HOST_AW_48BIT#define VTD_HAW_MASK (aw) ((1ULL << (aw)) - 1) +#define VTD_MGAW_FROM_CAP (cap) ((cap >> 16) & 0x3fULL)#define DMAR_REPORT_F_INTR (1)
tests/qtest/intel-iommu-test.c new file +64 -0
64 lines not on this page · raw message
MAINTAINERS +1 -0
@@ -3711,6 +3711,7 @@ F: hw/i386/intel_iommu.c F: hw/i386/intel_iommu_internal.h F: include/hw/i386/intel_iommu.h F: tests/functional/test_intel_iommu.py +F: tests/qtest/intel-iommu-test.c AMD-Vi Emulation S: Orphan
tests/qtest/meson.build +1 -0
@@ -93,6 +93,7 @@ qtests_i386 = \ (config_all_devices.has_key('CONFIG_SB16') ? ['fuzz-sb16-test'] : []) + \ (config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-test'] : []) + \ (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) + \ + (config_all_devices.has_key('CONFIG_VTD') ? ['intel-iommu-test'] : []) + \ (host_os != 'windows' and \ config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) + \ (config_all_devices.has_key('CONFIG_PCIE_PORT') and \
Signature · 1 line
MST
[PULL 08/48] intel_iommu: Add a placeholder variable for scalable mode stage-1 translation
In reply to Michael S. TsirkinFrom: Zhenzhong Duan <[email protected]>
Add an new element flts in IntelIOMMUState to mark stage-1 translation support in scalable mode, this element will be exposed as an intel_iommu property x-flts finally.
For now, it's only a placehholder and used for address width compatibility check and block host device passthrough until nesting is supported.
Message-Id: <[email protected]>
--- include/hw/i386/intel_iommu.h | 1 + hw/i386/intel_iommu.c | 23 ++++++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-)
include/hw/i386/intel_iommu.h +1 -0
@@ -262,6 +262,7 @@ struct IntelIOMMUState {bool caching_mode;/* RO - is cap CM enabled? */ bool scalable_mode;/* RO - is Scalable Mode supported? */ +bool flts;/* RO - is stage-1 translation supported? */ bool snoop_control;/* RO - is SNP filed supported? */ dma_addr_t root;/* Current root table pointer */
hw/i386/intel_iommu.c +18 -5
@@ -3917,7 +3917,13 @@ static bool vtd_check_hiod(IntelIOMMUState *s, HostIOMMUDevice *hiod,return false; } -return true; +if (!s->flts) { +/* All checks requested by VTD stage-2 translation pass */ +return true; + } + +error_setg (errp,"host device is uncompatible with stage-1 translation" ); +return false; } static bool vtd_dev_set_iommu_device(PCIBus *bus, void *opaque, int devfn,
@@ -4307,14 +4313,21 @@ static bool vtd_decide_config(IntelIOMMUState *s, Error **errp) } } -/* Currently only address widths supported are 39 and 48 bits */ -if ((s->aw_bits !=VTD_HOST_AW_39BIT ) && - (s->aw_bits !=VTD_HOST_AW_48BIT )) { -error_setg (errp,"Supported values for aw-bits are: %d, %d" , +if (!s->flts && s->aw_bits !=VTD_HOST_AW_39BIT && + s->aw_bits !=VTD_HOST_AW_48BIT ) { +error_setg (errp,"%s: supported values for aw-bits are: %d, %d" , + s->scalable_mode ?"Scalable mode(flts=off)" :"Legacy mode" ,VTD_HOST_AW_39BIT ,VTD_HOST_AW_48BIT );return false; } +if (s->flts && s->aw_bits !=VTD_HOST_AW_48BIT ) { +error_setg (errp, +"Scalable mode(flts=on): supported value for aw-bits is: %d" , +VTD_HOST_AW_48BIT ); +return false; + } +if (s->scalable_mode && !s->dma_drain) {error_setg (errp,"Need to set dma_drain for scalable mode" );return false;
Signature · 1 line
MST
[PULL 40/48] acpi/ghes: move offset calculus to a separate function
In reply to Michael S. TsirkinFrom: Mauro Carvalho Chehab <[email protected]>
Currently, CPER address location is calculated as an offset of the hardware_errors table. It is also badly named, as the offset actually used is the address where the CPER data starts, and not the beginning of the error source.
Move the logic which calculates such offset to a separate function, in preparation for a patch that will be changing the logic to calculate it from the HEST table.
While here, properly name the variable which stores the cper address.
Message-Id: <60fdd1bf379ba1db3099710868802aa49a27febb.1736945236.git.mchehab+huawei@kernel.org>
--- hw/acpi/ghes.c | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-)
hw/acpi/ghes.c +31 -9
@@ -364,10 +364,37 @@ void acpi_ghes_add_fw_cfg(AcpiGhesState *ags, FWCfgState *s, ags->present = true; } +static void get_hw_error_offsets (uint64_t ghes_addr, +uint64_t *cper_addr, +uint64_t *read_ack_register_addr) +{ +if (!ghes_addr) { +return ; + } + +/* +* non-HEST version supports only one source, so no need to change +* the start offset based on the source ID. Also, we can't validate +* the source ID, as it is stored inside the HEST table. +*/ + +cpu_physical_memory_read (ghes_addr, cper_addr, +sizeof (*cper_addr)); + + *cper_addr =le64_to_cpu (*cper_addr); + +/* +* As the current version supports only one source, the ack offset is +* just sizeof(uint64_t). +*/ + *read_ack_register_addr = ghes_addr + +ACPI_GHES_ERROR_SOURCE_COUNT *sizeof (uint64_t ); +} +void ghes_record_cper_errors (const void *cper,size_t len,uint16_t source_id,Error **errp) { -uint64_t error_block_addr, read_ack_register_addr, read_ack_register =0 ; +uint64_t cper_addr =0 , read_ack_register_addr =0 , read_ack_register;uint64_t start_addr;AcpiGedState *acpi_ged_state;AcpiGhesState *ags;
@@ -389,18 +416,13 @@ void ghes_record_cper_errors(const void *cper, size_t len, start_addr += source_id *sizeof (uint64_t ); -cpu_physical_memory_read (start_addr, &error_block_addr, -sizeof (error_block_addr)); +get_hw_error_offsets (start_addr, &cper_addr, &read_ack_register_addr); - error_block_addr =le64_to_cpu (error_block_addr); -if (!error_block_addr) { +if (!cper_addr) {error_setg (errp,"can not find Generic Error Status Block" );return ; } - read_ack_register_addr = start_addr + -ACPI_GHES_ERROR_SOURCE_COUNT *sizeof (uint64_t ); -cpu_physical_memory_read (read_ack_register_addr, &read_ack_register,sizeof (read_ack_register));
@@ -421,7 +443,7 @@ void ghes_record_cper_errors(const void *cper, size_t len, &read_ack_register, sizeof(uint64_t));/* Write the generic error data entry into guest memory */ -cpu_physical_memory_write (error_block_addr, cper, len); +cpu_physical_memory_write (cper_addr, cper, len);return ; }
Signature · 1 line
MST
[PULL 39/48] acpi/ghes: better name the offset of the hardware error firmware
In reply to Michael S. TsirkinFrom: Mauro Carvalho Chehab <[email protected]>
The hardware error firmware is where HEST error structures are stored. Those can be GHESv2, but they can also be other types.
Better name the location of the hardware error.
No functional changes.
Message-Id: <ddbb94294bafee998f12fede3ba0b05dae5ee45f.1736945236.git.mchehab+huawei@kernel.org>
--- include/hw/acpi/ghes.h | 2 +- hw/acpi/generic_event_device.c | 4 ++-- hw/acpi/ghes.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-)
include/hw/acpi/ghes.h +1 -1
@@ -65,7 +65,7 @@ enum { };typedef struct AcpiGhesState { -uint64_t ghes_addr_le; +uint64_t hw_error_le;bool present;/* True if GHES is present at all on this board */ }AcpiGhesState ;
hw/acpi/generic_event_device.c +2 -2
@@ -363,7 +363,7 @@ static const VMStateDescription vmstate_ghes = { .version_id = 1, .minimum_version_id = 1, .fields = (const VMStateField []) { -VMSTATE_UINT64 (ghes_addr_le, AcpiGhesState), +VMSTATE_UINT64 (hw_error_le, AcpiGhesState),VMSTATE_END_OF_LIST () }, };
@@ -371,7 +371,7 @@ static const VMStateDescription vmstate_ghes = {static bool ghes_needed (void *opaque) {AcpiGedState *s = opaque; -return s->ghes_state.ghes_addr_le; +return s->ghes_state.hw_error_le; }static const VMStateDescription vmstate_ghes_state = {
hw/acpi/ghes.c +2 -2
@@ -359,7 +359,7 @@ void acpi_ghes_add_fw_cfg(AcpiGhesState *ags, FWCfgState *s,/* Create a read-write fw_cfg file for Address */ fw_cfg_add_file_callback (s,ACPI_HW_ERROR_ADDR_FW_CFG_FILE ,NULL ,NULL , -NULL , &(ags->ghes_addr_le),sizeof (ags->ghes_addr_le), false); +NULL , &(ags->hw_error_le),sizeof (ags->hw_error_le), false); ags->present = true; }
@@ -385,7 +385,7 @@ void ghes_record_cper_errors(const void *cper, size_t len, } ags = &acpi_ged_state->ghes_state; - start_addr =le64_to_cpu (ags->ghes_addr_le); + start_addr =le64_to_cpu (ags->hw_error_le); start_addr += source_id *sizeof (uint64_t );
Signature · 1 line
MST
[PULL 33/48] acpi/ghes: Change the type for source_id
In reply to Michael S. TsirkinFrom: Mauro Carvalho Chehab <[email protected]>
As described at: ACPI 6.5 spec at:
18.3.2. ACPI Error Source
In particular at GHES/GHESv2 table:
Table 18.10 Generic Hardware Error Source Structure
HEST source ID is actually a 16-bit value.
Message-Id: <0e83ba548c1aedd1299fe387b94db78986590a34.1736945236.git.mchehab+huawei@kernel.org>
--- include/hw/acpi/ghes.h | 2 +- hw/acpi/ghes-stub.c | 2 +- hw/acpi/ghes.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
include/hw/acpi/ghes.h +1 -1
@@ -73,7 +73,7 @@ void acpi_build_hest(GArray *table_data, GArray *hardware_errors, const char *oem_id, const char *oem_table_id);void acpi_ghes_add_fw_cfg (AcpiGhesState *vms,FWCfgState *s,GArray *hardware_errors); -int acpi_ghes_record_errors (uint8_t source_id,uint64_t error_physical_addr); +int acpi_ghes_record_errors (uint16_t source_id,uint64_t error_physical_addr);/** * acpi_ghes_present: Report whether ACPI GHES table is present
hw/acpi/ghes-stub.c +1 -1
@@ -11,7 +11,7 @@#include "qemu/osdep.h" #include "hw/acpi/ghes.h" -int acpi_ghes_record_errors (uint8_t source_id,uint64_t physical_address) +int acpi_ghes_record_errors (uint16_t source_id,uint64_t physical_address) {return -1 ; }
hw/acpi/ghes.c +1 -1
@@ -383,7 +383,7 @@ void acpi_ghes_add_fw_cfg(AcpiGhesState *ags, FWCfgState *s, ags->present = true; } -int acpi_ghes_record_errors (uint8_t source_id,uint64_t physical_address) +int acpi_ghes_record_errors (uint16_t source_id,uint64_t physical_address) {uint64_t error_block_addr, read_ack_register_addr, read_ack_register =0 ;uint64_t start_addr;
Signature · 1 line
MST
[PULL 21/48] intel_iommu: Set default aw_bits to 48 starting from QEMU 9.2
In reply to Michael S. TsirkinFrom: Zhenzhong Duan <[email protected]>
According to VTD spec, stage-1 page table could support 4-level and 5-level paging.
However, 5-level paging translation emulation is unsupported yet. That means the only supported value for aw_bits is 48. So default aw_bits to 48 when stage-1 translation is turned on.
For legacy and scalable modes, 48 is the default choice for modern OS when both 48 and 39 are supported. So it makes sense to set default to 48 for these two modes too starting from QEMU 9.2. Use pc_compat_9_1 to handle the compatibility for machines before 9.2.
Message-Id: <[email protected]>
--- include/hw/i386/intel_iommu.h | 2 +- hw/i386/pc.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
include/hw/i386/intel_iommu.h +1 -1
@@ -45,7 +45,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(IntelIOMMUState, INTEL_IOMMU_DEVICE)#define DMAR_REG_SIZE 0x230#define VTD_HOST_AW_39BIT 39#define VTD_HOST_AW_48BIT 48 -#define VTD_HOST_ADDRESS_WIDTH VTD_HOST_AW_39BIT +#define VTD_HOST_ADDRESS_WIDTH VTD_HOST_AW_48BIT#define VTD_HAW_MASK (aw) ((1ULL << (aw)) - 1)#define DMAR_REPORT_F_INTR (1)
hw/i386/pc.c +1 -0
@@ -86,6 +86,7 @@ GlobalProperty pc_compat_9_1[] = { { "ICH9-LPC", "x-smi-swsmi-timer", "off" }, { "ICH9-LPC", "x-smi-periodic-timer", "off" }, { TYPE_INTEL_IOMMU_DEVICE, "stale-tm", "on" }, + { TYPE_INTEL_IOMMU_DEVICE, "aw-bits", "39" }, };const size_t pc_compat_9_1_len =G_N_ELEMENTS (pc_compat_9_1);
Signature · 1 line
MST
[PULL 38/48] acpi/ghes: rename etc/hardware_error file macros
In reply to Michael S. TsirkinFrom: Mauro Carvalho Chehab <[email protected]>
Now that we have also have a file to store HEST data location, which is part of GHES, better name the file where CPER records are stored.
No functional changes.
Message-Id: <e79a013bcd9f634b46ff6b34756d1b1403713af3.1736945236.git.mchehab+huawei@kernel.org>
--- hw/acpi/ghes.c | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-)
hw/acpi/ghes.c +23 -15
@@ -28,8 +28,8 @@#include "hw/nvram/fw_cfg.h" #include "qemu/uuid.h" -#define ACPI_GHES_ERRORS_FW_CFG_FILE "etc/hardware_errors" -#define ACPI_GHES_DATA_ADDR_FW_CFG_FILE "etc/hardware_errors_addr" +#define ACPI_HW_ERROR_FW_CFG_FILE "etc/hardware_errors" +#define ACPI_HW_ERROR_ADDR_FW_CFG_FILE "etc/hardware_errors_addr"/* The max size in bytes for one error block */ #define ACPI_GHES_MAX_RAW_DATA_LENGTH (1 * KiB)
@@ -234,7 +234,7 @@ static void build_ghes_error_table(GArray *hardware_errors, BIOSLinker *linker) ACPI_GHES_MAX_RAW_DATA_LENGTH * ACPI_GHES_ERROR_SOURCE_COUNT);/* Tell guest firmware to place hardware_errors blob into RAM */ -bios_linker_loader_alloc (linker,ACPI_GHES_ERRORS_FW_CFG_FILE , +bios_linker_loader_alloc (linker,ACPI_HW_ERROR_FW_CFG_FILE , hardware_errors,sizeof (uint64_t ), false);for (i =0 ; i <ACPI_GHES_ERROR_SOURCE_COUNT ; i++) {
@@ -243,17 +243,21 @@ static void build_ghes_error_table(GArray *hardware_errors, BIOSLinker *linker)* corresponding "Generic Error Status Block" */ bios_linker_loader_add_pointer (linker, -ACPI_GHES_ERRORS_FW_CFG_FILE ,sizeof (uint64_t ) * i, -sizeof (uint64_t ),ACPI_GHES_ERRORS_FW_CFG_FILE , - error_status_block_offset + i *ACPI_GHES_MAX_RAW_DATA_LENGTH ); +ACPI_HW_ERROR_FW_CFG_FILE , +sizeof (uint64_t ) * i, +sizeof (uint64_t ), +ACPI_HW_ERROR_FW_CFG_FILE , + error_status_block_offset + + i *ACPI_GHES_MAX_RAW_DATA_LENGTH ); }/* * tell firmware to write hardware_errors GPA into * hardware_errors_addr fw_cfg, once the former has been initialized. */ -bios_linker_loader_write_pointer (linker,ACPI_GHES_DATA_ADDR_FW_CFG_FILE , -0 ,sizeof (uint64_t ),ACPI_GHES_ERRORS_FW_CFG_FILE ,0 ); +bios_linker_loader_write_pointer (linker,ACPI_HW_ERROR_ADDR_FW_CFG_FILE ,0 , +sizeof (uint64_t ), +ACPI_HW_ERROR_FW_CFG_FILE ,0 ); }/* Build Generic Hardware Error Source version 2 (GHESv2) */
@@ -290,8 +294,10 @@ static void build_ghes_v2(GArray *table_data,build_append_gas (table_data,AML_AS_SYSTEM_MEMORY ,0x40 ,0 ,4 /* QWord access */ ,0 );bios_linker_loader_add_pointer (linker,ACPI_BUILD_TABLE_FILE , - address_offset +GAS_ADDR_OFFSET ,sizeof (uint64_t ), -ACPI_GHES_ERRORS_FW_CFG_FILE , source_id *sizeof (uint64_t )); + address_offset +GAS_ADDR_OFFSET , +sizeof (uint64_t ), +ACPI_HW_ERROR_FW_CFG_FILE , + source_id *sizeof (uint64_t ));/* Notification Structure */ build_ghes_hw_error_notification (table_data, notify);
@@ -308,9 +314,11 @@ static void build_ghes_v2(GArray *table_data,build_append_gas (table_data,AML_AS_SYSTEM_MEMORY ,0x40 ,0 ,4 /* QWord access */ ,0 );bios_linker_loader_add_pointer (linker,ACPI_BUILD_TABLE_FILE , - address_offset +GAS_ADDR_OFFSET , -sizeof (uint64_t ),ACPI_GHES_ERRORS_FW_CFG_FILE , - (ACPI_GHES_ERROR_SOURCE_COUNT + source_id) *sizeof (uint64_t )); + address_offset +GAS_ADDR_OFFSET , +sizeof (uint64_t ), +ACPI_HW_ERROR_FW_CFG_FILE , + (ACPI_GHES_ERROR_SOURCE_COUNT + source_id) + *sizeof (uint64_t ));/* * Read Ack Preserve field
@@ -346,11 +354,11 @@ void acpi_ghes_add_fw_cfg(AcpiGhesState *ags, FWCfgState *s, GArray *hardware_error) {/* Create a read-only fw_cfg file for GHES */ -fw_cfg_add_file (s,ACPI_GHES_ERRORS_FW_CFG_FILE , hardware_error->data, +fw_cfg_add_file (s,ACPI_HW_ERROR_FW_CFG_FILE , hardware_error->data, hardware_error->len);/* Create a read-write fw_cfg file for Address */ -fw_cfg_add_file_callback (s,ACPI_GHES_DATA_ADDR_FW_CFG_FILE ,NULL ,NULL , +fw_cfg_add_file_callback (s,ACPI_HW_ERROR_ADDR_FW_CFG_FILE ,NULL ,NULL ,NULL , &(ags->ghes_addr_le),sizeof (ags->ghes_addr_le), false); ags->present = true;
Signature · 1 line
MST
[PULL 45/48] tests: acpi: update expected blobs
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
_DSM function 7 AML should have followig change:
If ((Arg2 == 0x07))
{
- Local0 = Package (0x02)
- {
- Zero,
- ""
- }
Local2 = AIDX (DerefOf (Arg4 [Zero]), DerefOf (Arg4 [One]
))
- Local0 [Zero] = Local2
+ Local0 = Package (0x02) {}
+ If (!((Local2 == Zero) || (Local2 == 0xFFFFFFFF)))
+ {
+ Local0 [Zero] = Local2
+ Local0 [One] = ""
+ }
+
Return (Local0)
}
}Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test-allowed-diff.h | 40 ------------------ tests/data/acpi/x86/pc/DSDT | Bin 8593 -> 8611 bytes tests/data/acpi/x86/pc/DSDT.acpierst | Bin 8504 -> 8522 bytes tests/data/acpi/x86/pc/DSDT.acpihmat | Bin 9918 -> 9936 bytes tests/data/acpi/x86/pc/DSDT.bridge | Bin 15464 -> 15482 bytes tests/data/acpi/x86/pc/DSDT.cphp | Bin 9057 -> 9075 bytes tests/data/acpi/x86/pc/DSDT.dimmpxm | Bin 10247 -> 10265 bytes tests/data/acpi/x86/pc/DSDT.hpbridge | Bin 8544 -> 8562 bytes tests/data/acpi/x86/pc/DSDT.ipmikcs | Bin 8665 -> 8683 bytes tests/data/acpi/x86/pc/DSDT.memhp | Bin 9952 -> 9970 bytes tests/data/acpi/x86/pc/DSDT.nohpet | Bin 8451 -> 8469 bytes tests/data/acpi/x86/pc/DSDT.numamem | Bin 8599 -> 8617 bytes tests/data/acpi/x86/pc/DSDT.roothp | Bin 12386 -> 12404 bytes tests/data/acpi/x86/q35/DSDT | Bin 8422 -> 8440 bytes tests/data/acpi/x86/q35/DSDT.acpierst | Bin 8439 -> 8457 bytes tests/data/acpi/x86/q35/DSDT.acpihmat | Bin 9747 -> 9765 bytes .../data/acpi/x86/q35/DSDT.acpihmat-generic-x | Bin 12632 -> 12650 bytes .../acpi/x86/q35/DSDT.acpihmat-noinitiator | Bin 8701 -> 8719 bytes tests/data/acpi/x86/q35/DSDT.applesmc | Bin 8468 -> 8486 bytes tests/data/acpi/x86/q35/DSDT.bridge | Bin 12035 -> 12053 bytes tests/data/acpi/x86/q35/DSDT.core-count | Bin 12980 -> 12998 bytes tests/data/acpi/x86/q35/DSDT.core-count2 | Bin 33837 -> 33855 bytes tests/data/acpi/x86/q35/DSDT.cphp | Bin 8886 -> 8904 bytes tests/data/acpi/x86/q35/DSDT.cxl | Bin 13213 -> 13231 bytes tests/data/acpi/x86/q35/DSDT.dimmpxm | Bin 10076 -> 10094 bytes tests/data/acpi/x86/q35/DSDT.ipmibt | Bin 8497 -> 8515 bytes tests/data/acpi/x86/q35/DSDT.ipmismbus | Bin 8510 -> 8528 bytes tests/data/acpi/x86/q35/DSDT.ivrs | Bin 8439 -> 8457 bytes tests/data/acpi/x86/q35/DSDT.memhp | Bin 9781 -> 9799 bytes tests/data/acpi/x86/q35/DSDT.mmio64 | Bin 9552 -> 9570 bytes tests/data/acpi/x86/q35/DSDT.multi-bridge | Bin 13275 -> 13293 bytes tests/data/acpi/x86/q35/DSDT.nohpet | Bin 8280 -> 8298 bytes tests/data/acpi/x86/q35/DSDT.numamem | Bin 8428 -> 8446 bytes tests/data/acpi/x86/q35/DSDT.pvpanic-isa | Bin 8523 -> 8541 bytes tests/data/acpi/x86/q35/DSDT.thread-count | Bin 12980 -> 12998 bytes tests/data/acpi/x86/q35/DSDT.thread-count2 | Bin 33837 -> 33855 bytes tests/data/acpi/x86/q35/DSDT.tis.tpm12 | Bin 9028 -> 9046 bytes tests/data/acpi/x86/q35/DSDT.tis.tpm2 | Bin 9054 -> 9072 bytes tests/data/acpi/x86/q35/DSDT.type4-count | Bin 18656 -> 18674 bytes tests/data/acpi/x86/q35/DSDT.viot | Bin 14679 -> 14697 bytes tests/data/acpi/x86/q35/DSDT.xapic | Bin 35785 -> 35803 bytes 41 files changed, 40 deletions(-)
tests/qtest/bios-tables-test-allowed-diff.h +0 -40
@@ -1,41 +1 @@/* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/x86/pc/DSDT" , -"tests/data/acpi/x86/pc/DSDT.acpierst" , -"tests/data/acpi/x86/pc/DSDT.acpihmat" , -"tests/data/acpi/x86/pc/DSDT.bridge" , -"tests/data/acpi/x86/pc/DSDT.cphp" , -"tests/data/acpi/x86/pc/DSDT.dimmpxm" , -"tests/data/acpi/x86/pc/DSDT.hpbridge" , -"tests/data/acpi/x86/pc/DSDT.ipmikcs" , -"tests/data/acpi/x86/pc/DSDT.memhp" , -"tests/data/acpi/x86/pc/DSDT.nohpet" , -"tests/data/acpi/x86/pc/DSDT.numamem" , -"tests/data/acpi/x86/pc/DSDT.roothp" , -"tests/data/acpi/x86/q35/DSDT" , -"tests/data/acpi/x86/q35/DSDT.acpierst" , -"tests/data/acpi/x86/q35/DSDT.acpihmat" , -"tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x" , -"tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator" , -"tests/data/acpi/x86/q35/DSDT.applesmc" , -"tests/data/acpi/x86/q35/DSDT.bridge" , -"tests/data/acpi/x86/q35/DSDT.core-count" , -"tests/data/acpi/x86/q35/DSDT.core-count2" , -"tests/data/acpi/x86/q35/DSDT.cphp" , -"tests/data/acpi/x86/q35/DSDT.cxl" , -"tests/data/acpi/x86/q35/DSDT.dimmpxm" , -"tests/data/acpi/x86/q35/DSDT.ipmibt" , -"tests/data/acpi/x86/q35/DSDT.ipmismbus" , -"tests/data/acpi/x86/q35/DSDT.ivrs" , -"tests/data/acpi/x86/q35/DSDT.memhp" , -"tests/data/acpi/x86/q35/DSDT.mmio64" , -"tests/data/acpi/x86/q35/DSDT.multi-bridge" , -"tests/data/acpi/x86/q35/DSDT.nohpet" , -"tests/data/acpi/x86/q35/DSDT.numamem" , -"tests/data/acpi/x86/q35/DSDT.pvpanic-isa" , -"tests/data/acpi/x86/q35/DSDT.thread-count" , -"tests/data/acpi/x86/q35/DSDT.thread-count2" , -"tests/data/acpi/x86/q35/DSDT.tis.tpm12" , -"tests/data/acpi/x86/q35/DSDT.tis.tpm2" , -"tests/data/acpi/x86/q35/DSDT.type4-count" , -"tests/data/acpi/x86/q35/DSDT.viot" , -"tests/data/acpi/x86/q35/DSDT.xapic",
tests/data/acpi/x86/pc/DSDT binary +0 -0
tests/data/acpi/x86/pc/DSDT.acpierst binary +0 -0
tests/data/acpi/x86/pc/DSDT.acpihmat binary +0 -0
tests/data/acpi/x86/pc/DSDT.bridge binary +0 -0
tests/data/acpi/x86/pc/DSDT.cphp binary +0 -0
tests/data/acpi/x86/pc/DSDT.dimmpxm binary +0 -0
tests/data/acpi/x86/pc/DSDT.hpbridge binary +0 -0
tests/data/acpi/x86/pc/DSDT.ipmikcs binary +0 -0
tests/data/acpi/x86/pc/DSDT.memhp binary +0 -0
tests/data/acpi/x86/pc/DSDT.nohpet binary +0 -0
tests/data/acpi/x86/pc/DSDT.numamem binary +0 -0
tests/data/acpi/x86/pc/DSDT.roothp binary +0 -0
tests/data/acpi/x86/q35/DSDT binary +0 -0
tests/data/acpi/x86/q35/DSDT.acpierst binary +0 -0
tests/data/acpi/x86/q35/DSDT.acpihmat binary +0 -0
tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x binary +0 -0
tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator binary +0 -0
tests/data/acpi/x86/q35/DSDT.applesmc binary +0 -0
tests/data/acpi/x86/q35/DSDT.bridge binary +0 -0
tests/data/acpi/x86/q35/DSDT.core-count binary +0 -0
tests/data/acpi/x86/q35/DSDT.core-count2 binary +0 -0
tests/data/acpi/x86/q35/DSDT.cphp binary +0 -0
tests/data/acpi/x86/q35/DSDT.cxl binary +0 -0
tests/data/acpi/x86/q35/DSDT.dimmpxm binary +0 -0
tests/data/acpi/x86/q35/DSDT.ipmibt binary +0 -0
tests/data/acpi/x86/q35/DSDT.ipmismbus binary +0 -0
tests/data/acpi/x86/q35/DSDT.ivrs binary +0 -0
tests/data/acpi/x86/q35/DSDT.memhp binary +0 -0
tests/data/acpi/x86/q35/DSDT.mmio64 binary +0 -0
tests/data/acpi/x86/q35/DSDT.multi-bridge binary +0 -0
tests/data/acpi/x86/q35/DSDT.nohpet binary +0 -0
tests/data/acpi/x86/q35/DSDT.numamem binary +0 -0
tests/data/acpi/x86/q35/DSDT.pvpanic-isa binary +0 -0
tests/data/acpi/x86/q35/DSDT.thread-count binary +0 -0
tests/data/acpi/x86/q35/DSDT.thread-count2 binary +0 -0
tests/data/acpi/x86/q35/DSDT.tis.tpm12 binary +0 -0
tests/data/acpi/x86/q35/DSDT.tis.tpm2 binary +0 -0
tests/data/acpi/x86/q35/DSDT.type4-count binary +0 -0
tests/data/acpi/x86/q35/DSDT.viot binary +0 -0
tests/data/acpi/x86/q35/DSDT.xapic binary +0 -0
Signature · 1 line
MST
[PULL 42/48] docs: acpi_hest_ghes: fix documentation for CPER size
In reply to Michael S. TsirkinFrom: Mauro Carvalho Chehab <[email protected]>
While the spec defines a CPER size of 4KiB for each record, currently it is set to 1KiB. Fix the documentation and add a pointer to the macro name there, as this may help to keep it updated.
Message-Id: <f7e94433bec19a9d6b23ecccc24b5fe3a6f7f52b.1736945236.git.mchehab+huawei@kernel.org>
--- docs/specs/acpi_hest_ghes.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
docs/specs/acpi_hest_ghes.rst +4 -2
@@ -67,8 +67,10 @@ Design Details (3) The address registers table contains N Error Block Address entries and N Read Ack Register entries. The size for each entry is 8-byte. The Error Status Data Block table contains N Error Status Data Block - entries. The size for each entry is 4096(0x1000) bytes. The total size - for the "etc/hardware_errors" fw_cfg blob is (N * 8 * 2 + N * 4096) bytes. + entries. The size for each entry is defined at the source code as + ACPI_GHES_MAX_RAW_DATA_LENGTH (currently 1024 bytes). The total size + for the "etc/hardware_errors" fw_cfg blob is + (N * 8 * 2 + N * ACPI_GHES_MAX_RAW_DATA_LENGTH) bytes. N is the number of the kinds of hardware error sources. (4) QEMU generates the ACPI linker/loader script for the firmware. The
Signature · 1 line
MST
[PULL 46/48] hw/cxl: Fix msix_notify: Assertion `vector < dev->msix_entries_nr`
In reply to Michael S. TsirkinFrom: Li Zhijian <[email protected]>
This assertion always happens when we sanitize the CXL memory device.
$ echo 1 > /sys/bus/cxl/devices/mem0/security/sanitize
It is incorrect to register an MSIX number beyond the device's capability.
Increase the device's MSIX number to cover the mailbox msix number(9).
Message-Id: <[email protected]>
--- hw/mem/cxl_type3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/mem/cxl_type3.c +1 -1
@@ -843,7 +843,7 @@ static void ct3_realize(PCIDevice *pci_dev, Error **errp)ComponentRegisters *regs = &cxl_cstate->crb;MemoryRegion *mr = ®s->component_registers;uint8_t *pci_conf = pci_dev->config; -unsigned short msix_num =6 ; +unsigned short msix_num =10 ;int i, rc;uint16_t count;
Signature · 1 line
MST
[PULL 26/48] pci/msix: Fix msix pba read vector poll end calculation
In reply to Michael S. TsirkinFrom: Nicholas Piggin <[email protected]>
The end vector calculation has a bug that results in polling fewer than required vectors when reading at a non-zero offset in PBA memory.
Message-Id: <[email protected]>
--- hw/pci/msix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/pci/msix.c +1 -1
@@ -250,7 +250,7 @@ static uint64_t msix_pba_mmio_read(void *opaque, hwaddr addr,PCIDevice *dev = opaque;if (dev->msix_vector_poll_notifier) {unsigned vector_start = addr *8 ; -unsigned vector_end =MIN (addr + size *8 , dev->msix_entries_nr); +unsigned vector_end =MIN ((addr + size) *8 , dev->msix_entries_nr); dev->msix_vector_poll_notifier (dev, vector_start, vector_end); }
Signature · 1 line
MST
[PULL 22/48] tests/acpi: q35: Update host address width in DMAR
In reply to Michael S. TsirkinFrom: Zhenzhong Duan <[email protected]>
Differences:
@@ -1,39 +1,39 @@
/*
* Intel ACPI Component Architecture
* AML/ASL+ Disassembler version 20200925 (64-bit version)
* Copyright (c) 2000 - 2020 Intel Corporation
*
- * Disassembly of tests/data/acpi/x86/q35/DMAR.dmar, Mon Nov 11 15:31:18 2024
+ * Disassembly of /tmp/aml-SPJ4W2, Mon Nov 11 15:31:18 2024
*
* ACPI Data Table [DMAR]
*
* Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue */
[000h 0000 4] Signature : "DMAR" [DMA Remapping table] [004h 0004 4] Table Length : 00000078 [008h 0008 1] Revision : 01 -[009h 0009 1] Checksum : 15 +[009h 0009 1] Checksum : 0C [00Ah 0010 6] Oem ID : "BOCHS " [010h 0016 8] Oem Table ID : "BXPC " [018h 0024 4] Oem Revision : 00000001 [01Ch 0028 4] Asl Compiler ID : "BXPC" [020h 0032 4] Asl Compiler Revision : 00000001
-[024h 0036 1] Host Address Width : 26 +[024h 0036 1] Host Address Width : 2F [025h 0037 1] Flags : 01
[026h 0038 10] Reserved : 00 00 00 00 00 00 00 00 00 00
[030h 0048 2] Subtable Type : 0000 [Hardware Unit Definition]
[032h 0050 2] Length : 0040
[034h 0052 1] Flags : 00 [035h 0053 1] Reserved : 00 [036h 0054 2] PCI Segment Number : 0000 [038h 0056 8] Register Base Address : 00000000FED90000
[040h 0064 1] Device Scope Type : 03 [IOAPIC Device] [041h 0065 1] Entry Length : 08 [042h 0066 2] Reserved : 0000 [044h 0068 1] Enumeration ID : 00 [045h 0069 1] PCI Bus Number : FF
Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test-allowed-diff.h | 1 - tests/data/acpi/x86/q35/DMAR.dmar | Bin 120 -> 120 bytes 2 files changed, 1 deletion(-)
tests/qtest/bios-tables-test-allowed-diff.h +0 -1
@@ -1,2 +1 @@/* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/x86/q35/DMAR.dmar",
tests/data/acpi/x86/q35/DMAR.dmar binary +0 -0
Signature · 1 line
MST
[PULL 16/48] intel_iommu: Process PASID-based iotlb invalidation
In reply to Michael S. TsirkinFrom: Zhenzhong Duan <[email protected]>
PASID-based iotlb (piotlb) is used during walking Intel VT-d stage-1 page table.
This emulates the stage-1 page table iotlb invalidation requested by a PASID-based IOTLB Invalidate Descriptor (P_IOTLB).
Message-Id: <[email protected]>
--- hw/i386/intel_iommu_internal.h | 3 +++ hw/i386/intel_iommu.c | 43 ++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+)
hw/i386/intel_iommu_internal.h +3 -0
@@ -471,6 +471,9 @@ typedef union VTDInvDesc VTDInvDesc;#define VTD_INV_DESC_PIOTLB_PSI_IN_PASID (3ULL << 4)#define VTD_INV_DESC_PIOTLB_DID (val) (((val) >> 16) & VTD_DOMAIN_ID_MASK)#define VTD_INV_DESC_PIOTLB_PASID (val) (((val) >> 32) & 0xfffffULL) +#define VTD_INV_DESC_PIOTLB_AM (val) ((val) & 0x3fULL) +#define VTD_INV_DESC_PIOTLB_IH (val) (((val) >> 6) & 0x1) +#define VTD_INV_DESC_PIOTLB_ADDR (val) ((val) & ~0xfffULL)#define VTD_INV_DESC_PIOTLB_RSVD_VAL0 0xfff000000000f1c0ULL#define VTD_INV_DESC_PIOTLB_RSVD_VAL1 0xf80ULL
hw/i386/intel_iommu.c +43 -0
66 lines not on this page · raw message
Signature · 1 line
MST
[PULL 44/48] pci: acpi: Windows 'PCI Label Id' bug workaround
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
Current versions of Windows call _DSM(func=7) regardless of whether it is supported or not. It leads to NICs having bogus 'PCI Label Id = 0', where none should be set at all.
Also presence of 'PCI Label Id' triggers another Windows bug on localized versions that leads to hangs. The later bug is fixed in latest updates for 'Windows Server' but not in consumer versions of Windows (and there is no plans to fix it
as far as I'm aware).
Given it's easy, implement Microsoft suggested workaround (return invalid Package) so that affected Windows versions could boot on QEMU.
This would effectvely remove bogus 'PCI Label Id's on NICs, but MS teem confirmed that flipping 'PCI Label Id' should not change 'Network Connection' ennumeration, so it should be safe for QEMU to change _DSM without any compat code.
Smoke tested with WinXP and WS2022
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/774
Message-Id: <[email protected]>
--- hw/i386/acpi-build.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-)
hw/i386/acpi-build.c +23 -10
@@ -654,6 +654,7 @@ static Aml *aml_pci_pdsm(void)Aml *acpi_index =aml_local (2 );Aml *zero =aml_int (0 );Aml *one =aml_int (1 ); +Aml *not_supp =aml_int (0xFFFFFFFF );Aml *func =aml_arg (2 );Aml *params =aml_arg (4 );Aml *bnum =aml_derefof (aml_index (params,aml_int (0 )));
@@ -678,7 +679,7 @@ static Aml *aml_pci_pdsm(void)*/ ifctx1 =aml_if (aml_lnot (aml_or (aml_equal (acpi_index, zero), -aml_equal (acpi_index,aml_int (0xFFFFFFFF )),NULL ) +aml_equal (acpi_index, not_supp),NULL ) )); {/* have supported functions */
@@ -704,18 +705,30 @@ static Aml *aml_pci_pdsm(void) {Aml *pkg =aml_package (2 ); -aml_append (pkg, zero); -/* -* optional, if not impl. should return null string -*/ -aml_append (pkg,aml_string ("%s" ,"" )); -aml_append (ifctx,aml_store (pkg, ret)); -aml_append (ifctx,aml_store (aml_call2 ("AIDX" , bnum, sunum), acpi_index)); +aml_append (ifctx,aml_store (pkg, ret));/* -* update acpi-index to actual value +* Windows calls func=7 without checking if it's available, +* as workaround Microsoft has suggested to return invalid for func7 +* Package, so return 2 elements package but only initialize elements +* when acpi_index is supported and leave them uninitialized, which +* leads elements to being Uninitialized ObjectType and should trip +* Windows into discarding result as an unexpected and prevent setting +* bogus 'PCI Label' on the device. */ -aml_append (ifctx,aml_store (acpi_index,aml_index (ret, zero))); + ifctx1 =aml_if (aml_lnot (aml_lor ( +aml_equal (acpi_index, zero),aml_equal (acpi_index, not_supp) + ))); + { +aml_append (ifctx1,aml_store (acpi_index,aml_index (ret, zero))); +/* +* optional, if not impl. should return null string +*/ +aml_append (ifctx1,aml_store (aml_string ("%s" ,"" ), +aml_index (ret, one))); + } +aml_append (ifctx, ifctx1); +aml_append (ifctx,aml_return (ret)); }
Signature · 1 line
MST
[PULL 15/48] intel_iommu: Flush stage-1 cache in iotlb invalidation
In reply to Michael S. TsirkinFrom: Zhenzhong Duan <[email protected]>
According to spec, Page-Selective-within-Domain Invalidation (11b):
1. IOTLB entries caching second-stage mappings (PGTT=010b) or pass-through (PGTT=100b) mappings associated with the specified domain-id and the input-address range are invalidated.
2. IOTLB entries caching first-stage (PGTT=001b) or nested (PGTT=011b) mapping associated with specified domain-id are invalidated.
So per spec definition the Page-Selective-within-Domain Invalidation needs to flush first stage and nested cached IOTLB entries as well.
We don't support nested yet and pass-through mapping is never cached, so what in iotlb cache are only first-stage and second-stage mappings.
Add a tag pgtt in VTDIOTLBEntry to mark PGTT type of the mapping and invalidate entries based on PGTT type.
Message-Id: <[email protected]>
--- include/hw/i386/intel_iommu.h | 1 + hw/i386/intel_iommu.c | 27 +++++++++++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-)
include/hw/i386/intel_iommu.h +1 -0
@@ -155,6 +155,7 @@ struct VTDIOTLBEntry {uint64_t pte;uint64_t mask;uint8_t access_flags; +uint8_t pgtt; };/* VT-d Source-ID Qualifier types */
hw/i386/intel_iommu.c +21 -6
@@ -305,9 +305,21 @@ static gboolean vtd_hash_remove_by_page(gpointer key, gpointer value,VTDIOTLBPageInvInfo *info = (VTDIOTLBPageInvInfo *)user_data;uint64_t gfn = (info->addr >>VTD_PAGE_SHIFT_4K ) & info->mask;uint64_t gfn_tlb = (info->addr & entry->mask) >>VTD_PAGE_SHIFT_4K ; -return (entry->domain_id == info->domain_id) && - (((entry->gfn & info->mask) == gfn) || - (entry->gfn == gfn_tlb)); + +if (entry->domain_id != info->domain_id) { +return false; + } + +/* +* According to spec, IOTLB entries caching first-stage (PGTT=001b) or +* nested (PGTT=011b) mapping associated with specified domain-id are +* invalidated. Nested isn't supported yet, so only need to check 001b. +*/ +if (entry->pgtt ==VTD_SM_PASID_ENTRY_FLT ) { +return true; + } + +return (entry->gfn & info->mask) == gfn || entry->gfn == gfn_tlb; }/* Reset all the gen of VTDAddressSpace to zero and set the gen of
@@ -382,7 +394,7 @@ out:static void vtd_update_iotlb (IntelIOMMUState *s,uint16_t source_id,uint16_t domain_id,hwaddr addr,uint64_t pte,uint8_t access_flags,uint32_t level, -uint32_t pasid) +uint32_t pasid,uint8_t pgtt) {VTDIOTLBEntry *entry =g_malloc (sizeof (*entry));struct vtd_iotlb_key *key =g_malloc (sizeof (*key));
@@ -400,6 +412,7 @@ static void vtd_update_iotlb(IntelIOMMUState *s, uint16_t source_id, entry->access_flags = access_flags; entry->mask =vtd_pt_level_page_mask (level); entry->pasid = pasid; + entry->pgtt = pgtt; key->gfn = gfn; key->sid = source_id;
@@ -2062,7 +2075,7 @@ static bool vtd_do_iommu_translate(VTDAddressSpace *vtd_as, PCIBus *bus,bool is_fpd_set = false;bool reads = true;bool writes = true; -uint8_t access_flags; +uint8_t access_flags, pgtt;bool rid2pasid = (pasid ==PCI_NO_PASID ) && s->root_scalable;VTDIOTLBEntry *iotlb_entry;uint64_t xlat, size;
@@ -2171,9 +2184,11 @@ static bool vtd_do_iommu_translate(VTDAddressSpace *vtd_as, PCIBus *bus,if (s->flts && s->root_scalable) { ret_fr =vtd_iova_to_flpte (s, &ce, addr, is_write, &pte, &level, &reads, &writes, s->aw_bits, pasid); + pgtt =VTD_SM_PASID_ENTRY_FLT ; }else { ret_fr =vtd_iova_to_slpte (s, &ce, addr, is_write, &pte, &level, &reads, &writes, s->aw_bits, pasid); + pgtt =VTD_SM_PASID_ENTRY_SLT ; }if (!ret_fr) { xlat =vtd_get_pte_addr (pte, s->aw_bits);
@@ -2207,7 +2222,7 @@ static bool vtd_do_iommu_translate(VTDAddressSpace *vtd_as, PCIBus *bus, page_mask =vtd_pt_level_page_mask (level); access_flags =IOMMU_ACCESS_FLAG (reads, writes);vtd_update_iotlb (s, source_id,vtd_get_domain_id (s, &ce, pasid), - addr, pte, access_flags, level, pasid); + addr, pte, access_flags, level, pasid, pgtt); out:vtd_iommu_unlock (s); entry->iova = addr & page_mask;
Signature · 1 line
MST
[PULL 14/48] intel_iommu: Set accessed and dirty bits during stage-1 translation
In reply to Michael S. TsirkinFrom: Clément Mathieu--Drif <[email protected]>
Message-Id: <[email protected]>
--- hw/i386/intel_iommu_internal.h | 3 +++ hw/i386/intel_iommu.c | 25 ++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-)
hw/i386/intel_iommu_internal.h +3 -0
@@ -332,6 +332,7 @@ typedef enum VTDFaultReason {/* Output address in the interrupt address range for scalable mode */ VTD_FR_SM_INTERRUPT_ADDR =0x87 , +VTD_FR_FS_BIT_UPDATE_FAILED =0x91 ,/* SFS.10 */ VTD_FR_MAX ,/* Guard */ } VTDFaultReason;
@@ -564,6 +565,8 @@ typedef struct VTDRootEntry VTDRootEntry;#define VTD_FL_P 1ULL#define VTD_FL_RW (1ULL << 1)#define VTD_FL_US (1ULL << 2) +#define VTD_FL_A (1ULL << 5) +#define VTD_FL_D (1ULL << 6)/* Second Level Page Translation Pointer*/ #define VTD_SM_PASID_ENTRY_SLPTPTR (~0xfffULL)
hw/i386/intel_iommu.c +24 -1
@@ -1806,6 +1806,7 @@ static const bool vtd_qualified_faults[] = { [VTD_FR_FS_PAGING_ENTRY_US] = true, [VTD_FR_SM_WRITE] = true, [VTD_FR_SM_INTERRUPT_ADDR] = true, + [VTD_FR_FS_BIT_UPDATE_FAILED] = true, [VTD_FR_MAX] = false, };
@@ -1925,6 +1926,20 @@ static bool vtd_iova_fl_check_canonical(IntelIOMMUState *s, uint64_t iova, } } +static MemTxResult vtd_set_flag_in_pte (dma_addr_t base_addr,uint32_t index, +uint64_t pte,uint64_t flag) +{ +if (pte & flag) { +return MEMTX_OK ; + } + pte |= flag; + pte =cpu_to_le64 (pte); +return dma_memory_write (&address_space_memory, + base_addr + index *sizeof (pte), + &pte,sizeof (pte), +MEMTXATTRS_UNSPECIFIED ); +} +/* * Given the @iova, get relevant @flptep. @flpte_level will be the last level * of the translation, can be used for deciding the size of large page.
@@ -1938,7 +1953,7 @@ static int vtd_iova_to_flpte(IntelIOMMUState *s, VTDContextEntry *ce,dma_addr_t addr =vtd_get_iova_pgtbl_base (s, ce, pasid);uint32_t level =vtd_get_iova_level (s, ce, pasid);uint32_t offset; -uint64_t flpte; +uint64_t flpte, flag_ad =VTD_FL_A ;if (!vtd_iova_fl_check_canonical (s, iova, ce, pasid)) { error_report_once("%s: detected non canonical IOVA (iova=0x%" PRIx64 ","
@@ -1985,6 +2000,14 @@ static int vtd_iova_to_flpte(IntelIOMMUState *s, VTDContextEntry *ce,return -VTD_FR_FS_PAGING_ENTRY_RSVD ; } +if (vtd_is_last_pte (flpte, level) && is_write) { + flag_ad |=VTD_FL_D ; + } + +if (vtd_set_flag_in_pte (addr, offset, flpte, flag_ad) !=MEMTX_OK ) { +return -VTD_FR_FS_BIT_UPDATE_FAILED ; + } +if (vtd_is_last_pte (flpte, level)) { *flptep = flpte; *flpte_level = level;
Signature · 1 line
MST
[PULL 47/48] vhost: Add stubs for the migration state transfer interface
In reply to Michael S. TsirkinFrom: Laurent Vivier <[email protected]>
Migration state transfer interface is only used by vhost-user-fs, so the interface needs to be defined only when vhost is built.
But I need to use this interface with virtio-net and vhost is not always enabled, and to avoid undefined reference error during build, define stub functions for vhost_supports_device_state(), vhost_save_backend_state() and vhost_load_backend_state().
Message-Id: <[email protected]>
--- include/hw/virtio/vhost.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
include/hw/virtio/vhost.h +23 -0
@@ -365,7 +365,14 @@ static inline int vhost_reset_device(struct vhost_dev *hdev)* Returns true if the device supports these commands, and false if it * does not. */ +#ifdef CONFIG_VHOST bool vhost_supports_device_state (struct vhost_dev *dev); +#else +static inline bool vhost_supports_device_state (struct vhost_dev *dev) +{ +return false; +} +#endif /** * vhost_set_device_state_fd(): Begin transfer of internal state from/to
@@ -448,7 +455,15 @@ int vhost_check_device_state(struct vhost_dev *dev, Error **errp);* * Returns 0 on success, and -errno otherwise. */ +#ifdef CONFIG_VHOST int vhost_save_backend_state (struct vhost_dev *dev,QEMUFile *f,Error **errp); +#else +static inline int vhost_save_backend_state (struct vhost_dev *dev,QEMUFile *f, +Error **errp) +{ +return -ENOSYS ; +} +#endif /** * vhost_load_backend_state(): High-level function to load a vhost
@@ -465,6 +480,14 @@ int vhost_save_backend_state(struct vhost_dev *dev, QEMUFile *f, Error **errp);* * Returns 0 on success, and -errno otherwise. */ +#ifdef CONFIG_VHOST int vhost_load_backend_state (struct vhost_dev *dev,QEMUFile *f,Error **errp); +#else +static inline int vhost_load_backend_state (struct vhost_dev *dev,QEMUFile *f, +Error **errp) +{ +return -ENOSYS ; +} +#endif #endif
Signature · 1 line
MST
[PULL 43/48] tests: acpi: whitelist expected blobs
In reply to Michael S. TsirkinFrom: Igor Mammedov <[email protected]>
Message-Id: <[email protected]>
--- tests/qtest/bios-tables-test-allowed-diff.h | 40 +++++++++++++++++++++ 1 file changed, 40 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +40 -0
@@ -1 +1,41 @@/* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/x86/pc/DSDT" , +"tests/data/acpi/x86/pc/DSDT.acpierst" , +"tests/data/acpi/x86/pc/DSDT.acpihmat" , +"tests/data/acpi/x86/pc/DSDT.bridge" , +"tests/data/acpi/x86/pc/DSDT.cphp" , +"tests/data/acpi/x86/pc/DSDT.dimmpxm" , +"tests/data/acpi/x86/pc/DSDT.hpbridge" , +"tests/data/acpi/x86/pc/DSDT.ipmikcs" , +"tests/data/acpi/x86/pc/DSDT.memhp" , +"tests/data/acpi/x86/pc/DSDT.nohpet" , +"tests/data/acpi/x86/pc/DSDT.numamem" , +"tests/data/acpi/x86/pc/DSDT.roothp" , +"tests/data/acpi/x86/q35/DSDT" , +"tests/data/acpi/x86/q35/DSDT.acpierst" , +"tests/data/acpi/x86/q35/DSDT.acpihmat" , +"tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x" , +"tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator" , +"tests/data/acpi/x86/q35/DSDT.applesmc" , +"tests/data/acpi/x86/q35/DSDT.bridge" , +"tests/data/acpi/x86/q35/DSDT.core-count" , +"tests/data/acpi/x86/q35/DSDT.core-count2" , +"tests/data/acpi/x86/q35/DSDT.cphp" , +"tests/data/acpi/x86/q35/DSDT.cxl" , +"tests/data/acpi/x86/q35/DSDT.dimmpxm" , +"tests/data/acpi/x86/q35/DSDT.ipmibt" , +"tests/data/acpi/x86/q35/DSDT.ipmismbus" , +"tests/data/acpi/x86/q35/DSDT.ivrs" , +"tests/data/acpi/x86/q35/DSDT.memhp" , +"tests/data/acpi/x86/q35/DSDT.mmio64" , +"tests/data/acpi/x86/q35/DSDT.multi-bridge" , +"tests/data/acpi/x86/q35/DSDT.nohpet" , +"tests/data/acpi/x86/q35/DSDT.numamem" , +"tests/data/acpi/x86/q35/DSDT.pvpanic-isa" , +"tests/data/acpi/x86/q35/DSDT.thread-count" , +"tests/data/acpi/x86/q35/DSDT.thread-count2" , +"tests/data/acpi/x86/q35/DSDT.tis.tpm12" , +"tests/data/acpi/x86/q35/DSDT.tis.tpm2" , +"tests/data/acpi/x86/q35/DSDT.type4-count" , +"tests/data/acpi/x86/q35/DSDT.viot" , +"tests/data/acpi/x86/q35/DSDT.xapic",
Signature · 1 line
MST
Quoted 21 lines · Michael S. Tsirkin
The following changes since commit
7433709a147706ad7d1956b15669279933d0f82b:Merge tag 'hw-misc-20250113' of https://github.com/philmd/qemu into staging (2025-01-14 12:46:56 -0500)
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
60f543ad917fad731e39ff8ce2ca83b9a9cc9d90:virtio-net: vhost-user: Implement internal migration (2025-01-15 13:07:34 -0500)
----------------------------------------------------------------
virtio,pc,pci: features, fixes, cleanupsThe big thing here are:
stage-1 translation in vtd
internal migration in vhost-user ghes driver preparation for error injection new resource uuid feature in virtio gpu
Quoted 3 lines
And as usual, fixes and cleanups.
Signed-off-by Michael S. Tsirkin <[email protected]>
Should I be concerned that the vmclock device isn't in this PR?
[PULL 19/48] intel_iommu: piotlb invalidation should notify unmap
In reply to Michael S. TsirkinFrom: Zhenzhong Duan <[email protected]>
This is used by some emulated devices which caches address translation result. When piotlb invalidation issued in guest, those caches should be refreshed.
There is already a similar implementation in iotlb invalidation. So update vtd_iotlb_page_invalidate_notify() to make it work also for piotlb invalidation.
For device that does not implement ATS capability or disable it but still caches the translation result, it is better to implement ATS cap or enable it if there is need to cache the translation result.
Message-Id: <[email protected]>
--- hw/i386/intel_iommu.c | 43 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 9 deletions(-)
hw/i386/intel_iommu.c +34 -9
@@ -2450,8 +2450,13 @@ static void vtd_iotlb_domain_invalidate(IntelIOMMUState *s, uint16_t domain_id) } } +/* +* There is no pasid field in iotlb invalidation descriptor, so PCI_NO_PASID +* is passed as parameter. Piotlb invalidation supports pasid, pasid in its +* descriptor is passed which should not be PCI_NO_PASID. +*/ static void vtd_iotlb_page_invalidate_notify (IntelIOMMUState *s, -uint16_t domain_id,hwaddr addr, +uint16_t domain_id,hwaddr addr,uint8_t am,uint32_t pasid) {VTDAddressSpace *vtd_as;
@@ -2460,19 +2465,37 @@ static void vtd_iotlb_page_invalidate_notify(IntelIOMMUState *s,hwaddr size = (1 << am) *VTD_PAGE_SIZE ; QLIST_FOREACH(vtd_as, &(s->vtd_as_with_notifiers), next) { -if (pasid !=PCI_NO_PASID && pasid != vtd_as->pasid) { -continue ; - } ret =vtd_dev_to_context_entry (s,pci_bus_num (vtd_as->bus), vtd_as->devfn, &ce);if (!ret && domain_id ==vtd_get_domain_id (s, &ce, vtd_as->pasid)) { +uint32_t rid2pasid =PCI_NO_PASID ; + +if (s->root_scalable) { + rid2pasid =VTD_CE_GET_RID2PASID (&ce); + } + +/* +* In legacy mode, vtd_as->pasid == pasid is always true. +* In scalable mode, for vtd address space backing a PCI +* device without pasid, needs to compare pasid with +* rid2pasid of this device. +*/ +if (!(vtd_as->pasid == pasid || + (vtd_as->pasid ==PCI_NO_PASID && pasid == rid2pasid))) { +continue ; + } +if (vtd_as_has_map_notifier (vtd_as)) {/* -* As long as we have MAP notifications registered in -* any of our IOMMU notifiers, we need to sync the -* shadow page table. +* When stage-1 translation is off, as long as we have MAP +* notifications registered in any of our IOMMU notifiers, +* we need to sync the shadow page table. Otherwise VFIO +* device attaches to nested page table instead of shadow +* page table, so no need to sync. */ -vtd_sync_shadow_page_table_range (vtd_as, &ce, addr, size); +if (!s->flts || !s->root_scalable) { +vtd_sync_shadow_page_table_range (vtd_as, &ce, addr, size); + } }else {/* * For UNMAP-only notifiers, we don't need to walk the
@@ -2960,7 +2983,7 @@ static void vtd_piotlb_pasid_invalidate(IntelIOMMUState *s,continue ; } -if (!s->flts) { +if (!s->flts || !vtd_as_has_map_notifier (vtd_as)) {vtd_address_space_sync (vtd_as); } }
@@ -2981,6 +3004,8 @@ static void vtd_piotlb_page_invalidate(IntelIOMMUState *s, uint16_t domain_id,g_hash_table_foreach_remove (s->iotlb, vtd_hash_remove_by_page_piotlb, &info);vtd_iommu_unlock (s); + +vtd_iotlb_page_invalidate_notify (s, domain_id, addr, am, pasid); } static bool vtd_process_piotlb_desc(IntelIOMMUState *s,
Signature · 1 line
MST
Quoted 22 lines · David Woodhouse
Quoted 21 lines · Michael S. Tsirkin
The following changes since commit
7433709a147706ad7d1956b15669279933d0f82b:Merge tag 'hw-misc-20250113' of https://github.com/philmd/qemu into staging (2025-01-14 12:46:56 -0500)
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
60f543ad917fad731e39ff8ce2ca83b9a9cc9d90:virtio-net: vhost-user: Implement internal migration (2025-01-15 13:07:34 -0500)
----------------------------------------------------------------
virtio,pc,pci: features, fixes, cleanupsThe big thing here are:
stage-1 translation in vtd
internal migration in vhost-user ghes driver preparation for error injection new resource uuid feature in virtio gpu
Quoted 8 lines
Quoted 3 lines
And as usual, fixes and cleanups.
Signed-off-by Michael S. Tsirkin <[email protected]>Should I be concerned that the vmclock device isn't in this PR?
Oops.. it was there :( Dropped by mistake in a rebase. I'll redo the pull, thanks!
Quoted 27 lines · Michael S. Tsirkin
Quoted 26 lines · David Woodhouse
Quoted 24 lines · Michael S. Tsirkin
The following changes since commit
7433709a147706ad7d1956b15669279933d0f82b:Merge tag 'hw-misc-20250113' of https://github.com/philmd/qemu into staging (2025-01-14 12:46:56 -0500)
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
60f543ad917fad731e39ff8ce2ca83b9a9cc9d90:virtio-net: vhost-user: Implement internal migration (2025-01-15 13:07:34 -0500)
----------------------------------------------------------------
virtio,pc,pci: features, fixes, cleanupsThe big thing here are:
stage-1 translation in vtd
internal migration in vhost-user ghes driver preparation for error injection new resource uuid feature in virtio gpuAnd as usual, fixes and cleanups.
Signed-off-by Michael S. Tsirkin <[email protected]>
Quoted 8 lines
Quoted 4 lines
Should I be concerned that the vmclock device isn't in this PR?
Oops.. it was there :( Dropped by mistake in a rebase. I'll redo the pull, thanks!
If it's easier, I could just round it up with the pull request I need to send tomorro^W later today anyway?
Michael S. Tsirkin
Acked-byQuoted 30 lines · David Woodhouse
Quoted 29 lines · Michael S. Tsirkin
Quoted 28 lines · David Woodhouse
Quoted 21 lines · Michael S. Tsirkin
The following changes since commit
7433709a147706ad7d1956b15669279933d0f82b:Merge tag 'hw-misc-20250113' of https://github.com/philmd/qemu into staging (2025-01-14 12:46:56 -0500)
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
60f543ad917fad731e39ff8ce2ca83b9a9cc9d90:virtio-net: vhost-user: Implement internal migration (2025-01-15 13:07:34 -0500)
----------------------------------------------------------------
virtio,pc,pci: features, fixes, cleanupsThe big thing here are:
stage-1 translation in vtd
internal migration in vhost-user ghes driver preparation for error injection new resource uuid feature in virtio gpuQuoted 3 lines
And as usual, fixes and cleanups.
Signed-off-by Michael S. Tsirkin <[email protected]>Should I be concerned that the vmclock device isn't in this PR?
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Oops.. it was there :( Dropped by mistake in a rebase. I'll redo the pull, thanks!
If it's easier, I could just round it up with the pull request I need to send tomorro^W later today anyway?
Yes pls do. You can add:
but, I noticed checkpatch warnings:
3634039b93cc51816263e0cb5ba32e1b61142d5d:89: WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? 3634039b93cc51816263e0cb5ba32e1b61142d5d:366: WARNING: added, moved or deleted file(s) imported from Linux, are you using scripts/update-linux-headers.sh? 3634039b93cc51816263e0cb5ba32e1b61142d5d:366: ERROR: headers imported from Linux should be self-contained in a patch with no other changes
Please address.
Quoted 11 lines · Michael S. Tsirkin
The following changes since commit
7433709a147706ad7d1956b15669279933d0f82b:Merge tag 'hw-misc-20250113' of https://github.com/philmd/qemu into staging (2025-01-14 12:46:56 -0500)
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
60f543ad917fad731e39ff8ce2ca83b9a9cc9d90:virtio-net: vhost-user: Implement internal migration (2025-01-15 13:07:34 -0500)
OK I missed including David's patch but he'll merge it himself. So the request stands.
Quoted 154 lines
----------------------------------------------------------------
virtio,pc,pci: features, fixes, cleanupsThe big thing here are:
stage-1 translation in vtd
internal migration in vhost-user ghes driver preparation for error injection new resource uuid feature in virtio gpuAnd as usual, fixes and cleanups.
Signed-off-by Michael S. Tsirkin <[email protected]>----------------------------------------------------------------
Clément Mathieu--Drif (4):
intel_iommu: Check if the input address is canonical
intel_iommu: Set accessed and dirty bits during stage-1 translation
intel_iommu: Add an internal API to find an address space with PASID
intel_iommu: Add support for PASID-based device IOTLB invalidationDorinda Bassey (1):
virtio-gpu: Add definition forresource_uuidfeatureIgor Mammedov (6):
tests: acpi: whitelist expected blobs
cpuhp: make sure that remove events are handled within the same SCI
tests: acpi: update expected blobs
tests: acpi: whitelist expected blobs
pci: acpi: Windows 'PCI Label Id' bug workaround
tests: acpi: update expected blobsLaurent Vivier (2):
vhost: Add stubs for the migration state transfer interface
virtio-net: vhost-user: Implement internal migrationLi Zhijian (1):
hw/cxl: Fix msix_notify: Assertion `vector < dev->msix_entries_nr`Mauro Carvalho Chehab (16):
acpi/ghes: get rid ofACPI_HEST_SRC_ID_RESERVEDacpi/ghes: simplifyacpi_ghes_record_errors()code acpi/ghes: simplify the per-arch caller to build HEST table acpi/ghes: better handlesource_idand notification acpi/ghes: Fixacpi_ghes_record_errors()argument acpi/ghes: Remove a duplicated out of bounds check acpi/ghes: Change the type forsource_id
acpi/ghes: don't check ifphysical_addressis not zero acpi/ghes: make the GHES record generation more generic acpi/ghes: better name GHES memory error function acpi/ghes: don't crash QEMU if ghes GED is not found acpi/ghes: rename etc/hardware_error file macros acpi/ghes: better name the offset of the hardware error firmware acpi/ghes: move offset calculus to a separate function acpi/ghes: Change ghes fill logic to work with only one source
docs:acpi_hest_ghes: fix documentation for CPER sizeNicholas Piggin (1):
pci/msix: Fix msix pba read vector poll end calculationSebastian Ott (1):
pci: ensure valid link status bits for downstream portsYi Liu (2):
intel_iommu: Rename slpte to pte
intel_iommu: Implement stage-1 translationYu Zhang (1):
intel_iommu: Use the latest fault reasons defined by specZhenzhong Duan (13):
intel_iommu: Make pasid entry type check accurate
intel_iommu: Add a placeholder variable for scalable mode stage-1 translation
intel_iommu: Flush stage-2 cache in PASID-selective PASID-based iotlb invalidation
intel_iommu: Check stage-1 translation result with interrupt range
intel_iommu: Flush stage-1 cache in iotlb invalidation
intel_iommu: Process PASID-based iotlb invalidation
intel_iommu: piotlb invalidation should notify unmap
tests/acpi: q35: allow DMAR acpi table changes
intel_iommu: Set defaultaw_bitsto 48 starting from QEMU 9.2 tests/acpi: q35: Update host address width in DMAR
intel_iommu: Introduce a property x-flts for stage-1 translation
intel_iommu: Introduce a property to control FS1GP cap bit setting tests/qtest: Add intel-iommu testhw/i386/intel_iommu_internal.h | 101 ++- include/hw/acpi/ghes.h | 16 +- include/hw/i386/intel_iommu.h | 8 +- include/hw/virtio/vhost.h | 23 + include/hw/virtio/virtio-gpu.h | 3 + hw/acpi/cpu.c | 43 +- hw/acpi/generic_event_device.c | 4 +- hw/acpi/ghes-stub.c | 2 +- hw/acpi/ghes.c | 256 ++++---- hw/arm/virt-acpi-build.c | 5 +- hw/display/vhost-user-gpu.c | 8 + hw/display/virtio-gpu-base.c | 3 + hw/i386/acpi-build.c | 33 +- hw/i386/intel_iommu.c | 734 +++++++++++++++++----- hw/i386/pc.c | 1 + hw/mem/cxl_type3.c | 2 +- hw/net/virtio-net.c | 135 +++- hw/pci/msix.c | 2 +- hw/pci/pcie.c | 12 +- target/arm/kvm.c | 2 +- tests/qtest/intel-iommu-test.c | 64 ++ MAINTAINERS | 1 + docs/specs/acpi_hest_ghes.rst | 6 +- tests/data/acpi/x86/pc/DSDT | Bin 8526 -> 8611 bytes tests/data/acpi/x86/pc/DSDT.acpierst | Bin 8437 -> 8522 bytes tests/data/acpi/x86/pc/DSDT.acpihmat | Bin 9851 -> 9936 bytes tests/data/acpi/x86/pc/DSDT.bridge | Bin 15397 -> 15482 bytes tests/data/acpi/x86/pc/DSDT.cphp | Bin 8990 -> 9075 bytes tests/data/acpi/x86/pc/DSDT.dimmpxm | Bin 10180 -> 10265 bytes tests/data/acpi/x86/pc/DSDT.hpbridge | Bin 8477 -> 8562 bytes tests/data/acpi/x86/pc/DSDT.hpbrroot | Bin 5033 -> 5100 bytes tests/data/acpi/x86/pc/DSDT.ipmikcs | Bin 8598 -> 8683 bytes tests/data/acpi/x86/pc/DSDT.memhp | Bin 9885 -> 9970 bytes tests/data/acpi/x86/pc/DSDT.nohpet | Bin 8384 -> 8469 bytes tests/data/acpi/x86/pc/DSDT.numamem | Bin 8532 -> 8617 bytes tests/data/acpi/x86/pc/DSDT.roothp | Bin 12319 -> 12404 bytes tests/data/acpi/x86/q35/DMAR.dmar | Bin 120 -> 120 bytes tests/data/acpi/x86/q35/DSDT | Bin 8355 -> 8440 bytes tests/data/acpi/x86/q35/DSDT.acpierst | Bin 8372 -> 8457 bytes tests/data/acpi/x86/q35/DSDT.acpihmat | Bin 9680 -> 9765 bytes tests/data/acpi/x86/q35/DSDT.acpihmat-generic-x | Bin 12565 -> 12650 bytes tests/data/acpi/x86/q35/DSDT.acpihmat-noinitiator | Bin 8634 -> 8719 bytes tests/data/acpi/x86/q35/DSDT.applesmc | Bin 8401 -> 8486 bytes tests/data/acpi/x86/q35/DSDT.bridge | Bin 11968 -> 12053 bytes tests/data/acpi/x86/q35/DSDT.core-count | Bin 12913 -> 12998 bytes tests/data/acpi/x86/q35/DSDT.core-count2 | Bin 33770 -> 33855 bytes tests/data/acpi/x86/q35/DSDT.cphp | Bin 8819 -> 8904 bytes tests/data/acpi/x86/q35/DSDT.cxl | Bin 13146 -> 13231 bytes tests/data/acpi/x86/q35/DSDT.dimmpxm | Bin 10009 -> 10094 bytes tests/data/acpi/x86/q35/DSDT.ipmibt | Bin 8430 -> 8515 bytes tests/data/acpi/x86/q35/DSDT.ipmismbus | Bin 8443 -> 8528 bytes tests/data/acpi/x86/q35/DSDT.ivrs | Bin 8372 -> 8457 bytes tests/data/acpi/x86/q35/DSDT.memhp | Bin 9714 -> 9799 bytes tests/data/acpi/x86/q35/DSDT.mmio64 | Bin 9485 -> 9570 bytes tests/data/acpi/x86/q35/DSDT.multi-bridge | Bin 13208 -> 13293 bytes tests/data/acpi/x86/q35/DSDT.noacpihp | Bin 8235 -> 8302 bytes tests/data/acpi/x86/q35/DSDT.nohpet | Bin 8213 -> 8298 bytes tests/data/acpi/x86/q35/DSDT.numamem | Bin 8361 -> 8446 bytes tests/data/acpi/x86/q35/DSDT.pvpanic-isa | Bin 8456 -> 8541 bytes tests/data/acpi/x86/q35/DSDT.thread-count | Bin 12913 -> 12998 bytes tests/data/acpi/x86/q35/DSDT.thread-count2 | Bin 33770 -> 33855 bytes tests/data/acpi/x86/q35/DSDT.tis.tpm12 | Bin 8961 -> 9046 bytes tests/data/acpi/x86/q35/DSDT.tis.tpm2 | Bin 8987 -> 9072 bytes tests/data/acpi/x86/q35/DSDT.type4-count | Bin 18589 -> 18674 bytes tests/data/acpi/x86/q35/DSDT.viot | Bin 14612 -> 14697 bytes tests/data/acpi/x86/q35/DSDT.xapic | Bin 35718 -> 35803 bytes tests/qtest/meson.build | 1 + 67 files changed, 1132 insertions(+), 333 deletions(-) create mode 100644 tests/qtest/intel-iommu-test.c
Quoted 16 lines · Michael S. Tsirkin
Yes pls do. You can add:
but, I noticed checkpatch warnings:
3634039b93cc51816263e0cb5ba32e1b61142d5d:89: WARNING: added, moved or deleted file(s), does
MAINTAINERSneed updating? 3634039b93cc51816263e0cb5ba32e1b61142d5d:366: WARNING: added, moved or deleted file(s) imported from Linux, are you usingscripts/update-linux-headers.sh? 3634039b93cc51816263e0cb5ba32e1b61142d5d:366: ERROR: headers imported from Linux should be self-contained in a patch with no other changes
Quoted 1 line
Please address.
I've split it out into three commits now, first adding to update-linux- headers.sh, then importing the new header, then finally the actual vmclock support.
That pushes me *slightly* over the edge of calling it a trivial change, so I've posted it one last time for review. Assuming nobody screams and I don't have to make further changes, I'm happy to post a PR tomorrow, or let you do it, as you prefer.
Thanks.
Stefan Hajnoczi
AppliedApplied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/10.0 for any user-visible changes.