functional changes intended.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
---
include/hw/vfio/vfio-common.h | 4 +-
hw/vfio/container.c | 82 +--
hw/vfio/spapr.c | 81
VFIO Device is also changed to point to base container instead of
legacy container.
No fucntional change intended.
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
---
include/hw/vfio/vfio-common.h | 3 +--
include/hw/vfio/vfio-container-base.h | 1 +
hw/vfio/common.c
No functional changes intended.
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-common.h | 1 -
hw/vfio/spapr.c | 36 +++
2 files changed, 20 insertions(+), 17 deletions(-)
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio
t
vfio/pci: Allow the selection of a given iommu backend
Yi Liu (2):
util/char_dev: Add open_cdev()
vfio/iommufd: Implement the iommufd backend
Zhenzhong Duan (28):
vfio/container: Move IBM EEH related functions into spapr_pci_vfio.c
vfio/container: Move vfio_container_add/del_secti
From: Eric Auger
No functional change intended.
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
---
include/hw/vfio/vfio-common.h | 2 --
include/hw/vfio/vfio-container-base.h | 2 ++
hw/vfio
ed-by: Eric Auger
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
---
v4: use SPDX identifier, use iommufd_cdev_* prefix, merge with manual alloc
patch
include/hw/vfio/vfio-common.h | 23 ++
hw/vfio/common.c | 19 +-
hw/vfio/iommufd.c
vfio_get_dirty_bitmap
Signed-off-by: Eric Auger
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
---
include/hw/vfio/vfio-common.h | 9
hw/vfio/common.c | 42 +++
hw/vfio/container.c | 6 ++---
hw/vfio/trace-events
ended.
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
v4: use SPDX identifier, use const char *name parameter,
HW_VFIO_VFIO_CONTAINER_BASE_H
include/hw/vfio/vfio-common.h | 8 ++---
include/hw/vfio/vfio-container-base.h
From: Yi Liu
/dev/vfio/devices/vfioX may not exist. In that case it is still possible
to open /dev/char/$major:$minor instead. Add helper function to abstract
the cdev open.
Suggested-by: Jason Gunthorpe
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
---
MAINTAINERS
ved into spapr, we changed to check container->pgsizes.
Suggested-by: Alex Williamson
Signed-off-by: Zhenzhong Duan
---
v4: add vfio_find_hostwin back for VFIO_SPAPR_TCE_IOMMU
include/hw/vfio/vfio-common.h | 5 ---
hw/vfio/common.c | 70 +
hw/vfio/
From: Eric Auger
Move the giommu_list field in the base container and store
the base container in the VFIOGuestIOMMU.
No functional change intended.
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-common.h
ned-off-by: Zhenzhong Duan
---
v4: remove VFIOIOMMUSpaprOps
include/hw/vfio/vfio-container-base.h | 6 ++
hw/vfio/spapr.c | 14 ++
2 files changed, 20 insertions(+)
diff --git a/include/hw/vfio/vfio-container-base.h
b/include/hw/vfio/vfio-container-base.h
in
No fucntional change intended.
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-common.h | 5 -
include/hw/vfio/vfio-container-base.h | 5 +
hw/vfio/common.c | 8 ++--
hw/vfio/container-base.c | 21 +
hw/vfio
y to check if a device is mdev with FD passing,
so fail the x-balloon-allowed check unconditionally in this case.
There is also no easy way to get BDF as name with FD passing, so
we fake a name by VFIO_FD[fd].
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-common.h | 1 +
hw
From: Eric Auger
dirty_pages_supported field is also moved to the base container
No fucntional change intended.
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
v4: use assert
include/hw/vfio/vfio-common.h | 6
From: Eric Auger
No functional change intended.
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
v4: Split vrdl_list change out in a seperate patch
include/hw/vfio/vfio-common.h | 2 --
include/hw/vfio/vfio-container-base.h
Since PPC doesn't support IOMMUFD, make iommufd related code
compiled out.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
---
hw/vfio/common.c | 2 +-
hw/vfio/pci.c| 2 +-
hw/vfio/platform.c | 2 +-
backends/meson.build | 4 ++--
hw/vfio/meson.build | 2 +-
5
This gives management tools like libvirt a chance to open the vfio
cdev with privilege and pass FD to qemu. This way qemu never needs
to have privilege to open a VFIO or iommu cdev node.
Signed-off-by: Zhenzhong Duan
---
hw/vfio/platform.c | 41 +
1 file
No functional changes intended.
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-common.h | 1 -
hw/vfio/spapr.c | 24
2 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
From: Eric Auger
Move the space field to the base object. Also the VFIOAddressSpace
now contains a list of base containers.
No fucntional change intended.
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
v4: use bcontainer->space-
This adds "--enable-iommufd/--disable-iommufd" to enable or disable
iommufd support, enabled by default.
Signed-off-by: Zhenzhong Duan
---
meson.build | 6 ++
meson_options.txt | 2 ++
scripts/meson-buildoptions.sh | 3 +++
3 files changed, 11
x27;t supported, query_dirty_bitmap will
never be called.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
---
hw/vfio/container-base.c | 4
hw/vfio/container.c | 4
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/vfio/container-base.c b/hw/vfio/c
: Zhenzhong Duan
---
v4: fix build error in 32bit fedora
hw/vfio/iommufd.c | 47 +++
1 file changed, 47 insertions(+)
diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c
index 1bb55ca2c4..22f02f92a9 100644
--- a/hw/vfio/iommufd.c
+++ b/hw/vfio/iommufd.c
From: Eric Auger
No fucntional change intended.
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
v4: use SPDX identifier, use assert
include/hw/vfio/vfio-common.h | 4 ---
include/hw/vfio/vfio-container-base.h | 7 +
hw
Previously we added support to select iommu backend for vfio pci
device. Now we added others, E.g: platform, ap and ccw.
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-platform.h | 1 +
hw/vfio/ap.c| 5 +
hw/vfio/ccw.c | 5 +
hw/vfio
Meanwhile remove the helper function vfio_free_container as it
only calls g_free now.
No functional change intended.
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-common.h | 1 -
include/hw/vfio/vfio-container-base.h | 1 +
hw/vfio/common.c | 5
Add a new callback iommufd_pci_hot_reset to do iommufd specific
check and reset operation.
Signed-off-by: Zhenzhong Duan
---
hw/vfio/pci.h| 2 +
hw/vfio/iommufd.c| 142 +++
hw/vfio/pci.c| 4 +-
hw/vfio/trace-events | 1 +
4 files
From: Eric Auger
No fucntional change intended.
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
hw/vfio/common.c| 16
hw/vfio/container.c | 12 +---
2 files changed, 21 insertions(+), 7 deletions(-)
diff
This gives management tools like libvirt a chance to open the vfio
cdev with privilege and pass FD to qemu. This way qemu never needs
to have privilege to open a VFIO or iommu cdev node.
Opportunisticly, remove some unnecessory double-cast.
Signed-off-by: Zhenzhong Duan
---
hw/vfio/ap.c | 32
This helper will be used by both legacy and iommufd backends.
No functional changes intended.
Signed-off-by: Zhenzhong Duan
---
hw/vfio/pci.h | 3 +++
hw/vfio/pci.c | 54 +++
2 files changed, 40 insertions(+), 17 deletions(-)
diff --git a/hw
same changes to avoid
build error.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-common.h | 12 ++
include/hw/vfio/vfio-container-base.h | 12 ++
hw/vfio/common.c | 9 +++
hw/vfio/container-base.c
This adds two helper functions vfio_container_init/destroy which will be
used by both legacy and iommufd containers to do base container specific
initialization and release.
No fucntional change intended.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio
vfio_spapr_create_window calls vfio_spapr_remove_window,
With reoder of definition of the two, we can make
vfio_spapr_create/remove_window static.
No functional changes intended.
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
---
include/hw/vfio/vfio-common.h | 6 -
hw/vfio
Legacy vfio pci and iommufd cdev have different process to hot reset
vfio device, expand current code to abstract out pci_hot_reset callback
for legacy vfio, this same interface will also be used by iommufd
cdev vfio device.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
---
hw
This gives management tools like libvirt a chance to open the vfio
cdev with privilege and pass FD to qemu. This way qemu never needs
to have privilege to open a VFIO or iommu cdev node.
Opportunisticly, remove a redundant definition of TYPE_VFIO_CCW.
Signed-off-by: Zhenzhong Duan
---
hw/vfio
mufd0
Suggested-by: Alex Williamson
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
---
hw/vfio/pci.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index eb662fd086..7a6696ca55 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@
-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
---
v4: add CONFIG_IOMMUFD check, document default case
MAINTAINERS | 7 ++
qapi/qom.json| 22
include/sysemu/iommufd.h | 46 +++
backends/iommufd-stub.c | 59 +
backends/iommufd.c
-common.h also for containter.c
usage.
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
---
---
hw/vfio/common.c | 1085 +
hw/vfio/container.c | 1085 +
hw/vfio/meson.build
From: Yi Liu
Move low-level iommu agnostic helpers to a separate helpers.c
file. They relate to regions, interrupts and device/region
capabilities.
Signed-off-by: Eric Auger
Signed-off-by: Yi Sun
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
---
hw/vfio/common.c | 569
>From https://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd.git
branch: for_next
commit id: eb501c2d96cfce6b42528e8321ea085ec605e790
Signed-off-by: Zhenzhong Duan
---
Note this is a placeholder patch.
include/standard-headers/linux/fuse.h | 3 +
linux-headers/linux/iommuf
: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
---
hw/vfio/container.c | 66 +++
hw/vfio/pci.c | 50 --
hw/vfio/trace-events | 2 +-
include/hw/vfio/vfio-common.h | 3 ++
4 files changed, 76
So that it doesn't need to be moved into container.c as done
in following patch.
Signed-off-by: Zhenzhong Duan
---
hw/vfio/common.c | 17 -
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index 51c6e7598e..fda5fc87b9 100644
-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
---
MAINTAINERS | 7 +
backends/Kconfig | 4 +
backends/iommufd.c | 291 +++
backends/meson.build | 3 +
backends/trace-events| 13 ++
include/sysemu
...which will be used by both legacy and iommufd backend.
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
---
hw/vfio/common.c | 44 +++
include/hw/vfio/vfio-common.h | 3 +++
2 files changed, 32 insertions(+), 15 deletions(-)
diff --git a/hw
From: Eric Auger
Let the vfio-ap device use vfio_attach_device() and
vfio_detach_device(), hence hiding the details of the used
IOMMU backend.
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
---
hw/vfio/ap.c | 68
Commit "vfio/container-base: Introduce [attach/detach]_device container
callbacks"
add support to link to address space, we can utilize it to simplify
vfio_viommu_preset().
Signed-off-by: Zhenzhong Duan
---
hw/vfio/common.c | 17 +
1 file changed, 1 insertion(+), 16
, saying first vfio address space created instead of the
first group.
Signed-off-by: Zhenzhong Duan
---
hw/vfio/common.c | 224 ++-
1 file changed, 122 insertions(+), 102 deletions(-)
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index 949ad6714a
tatic functions, local to container.c.
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
---
hw/vfio/ccw.c | 120 --
hw/vfio/container.c | 10 +--
include/hw/vfio/vfio-common.h | 5 --
3 files changed, 33 inser
ed-by: Eric Auger
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
---
hw/vfio/common.c | 12 +-
hw/vfio/iommufd.c | 521 ++
hw/vfio/meson.build | 3 +
hw/vfio/trace-e
From: Eric Auger
Update the script to import iommufd.h
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
---
scripts/update-linux-headers.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/update-linux-headers.sh b/scripts/update
From: Yi Liu
/dev/vfio/devices/vfioX may not exist. In that case it is still possible
to open /dev/char/$major:$minor instead. Add helper function to abstract
the cdev open.
Suggested-by: Jason Gunthorpe
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
---
MAINTAINERS | 6
Note the /dev/iommu device may have been pre-opened by a
management tool such as libvirt. This mode is no more considered
for the legacy backend. So let's remove the "TODO" comment.
Suggested-by: Alex Williamson
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhon
o-authored-by: Eric Auger
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
hw/vfio/common.c | 72 +---
hw/vfio/container-base.c | 160 +
hw/vfio/container.c | 247 +
share the common bus reset and system reset
path for different BEs.
Signed-off-by: Zhenzhong Duan
---
hw/vfio/pci.c| 224 +++
hw/vfio/trace-events | 1 +
2 files changed, 208 insertions(+), 17 deletions(-)
diff --git a/hw/vfio/pci.c b/hw/vfio
vfio devices.
There is no easy way to check if a device is mdev with FD passing,
so fail the x-balloon-allowed check unconditionally in this case.
There is also no easy way to get BDF as name with FD passing, so
we fake a name by VFIO_FD[fd].
Signed-off-by: Zhenzhong Duan
---
hw/vfio/helpers.c
: Zhenzhong Duan
---
hw/vfio/common.c | 156 +++
1 file changed, 89 insertions(+), 67 deletions(-)
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index 9ca695837f..67150e4575 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -796,6 +796,92
The way to get vfio device pointer is different between legacy
container and iommufd container, with iommufd backend support
added, it's time to add the iterator support for iommufd.
Signed-off-by: Zhenzhong Duan
---
hw/vfio/iommufd.c | 29 +
1 file change
This adds "--enable-iommufd/--disable-iommufd" to enable or disable
iommufd support, enabled by default.
Signed-off-by: Zhenzhong Duan
---
meson.build | 6 ++
meson_options.txt | 2 ++
scripts/meson-buildoptions.sh | 3 +++
3 files changed, 11
From: Eric Auger
Let the vfio-platform device use vfio_attach_device() and
vfio_detach_device(), hence hiding the details of the used
IOMMU backend.
Signed-off-by: Eric Auger
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
---
hw/vfio/platform.c | 43
ommon: Move legacy VFIO backend code into separate container.c
vfio: Add base container
util/char_dev: Add open_cdev()
vfio/iommufd: Implement the iommufd backend
Zhenzhong Duan (9):
Update linux-header to support iommufd cdev and hwpt alloc
vfio/common: Extract out vfio_kvm_device_[
"make guest_memfd require uncoordinated discard")
Signed-off-by: Zhenzhong Duan
---
system/physmem.c | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/system/physmem.c b/system/physmem.c
index 2154432cb6..9a3b3a7636 100644
--- a/system/physmem.c
+++ b/system/physme
: Zhenzhong Duan
---
hw/i386/intel_iommu_internal.h | 10 +
hw/i386/intel_iommu.c | 78 ++
2 files changed, 88 insertions(+)
diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h
index 4e0331caba..f71fc91234 100644
--- a/hw/i386
intel_iommu: Implement stage-1 translation
intel_iommu: Modify x-scalable-mode to be string option
Yu Zhang (1):
intel_iommu: Use the latest fault reasons defined by spec
Zhenzhong Duan (8):
intel_iommu: Make pasid entry type check accurate
intel_iommu: Add a placeholder variable for s
are
supported. Instead cap/ecap bits should be checked.
Signed-off-by: Yu Zhang
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu_internal.h | 9 -
hw/i386/intel_iommu.c | 25 -
2 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/hw/i386
From: Clément Mathieu--Drif
Signed-off-by: Clément Mathieu--Drif
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu_internal.h | 3 +++
hw/i386/intel_iommu.c | 24
2 files changed, 27 insertions(+)
diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386
This is used by some emulated devices which caches address
translation result. When piotlb invalidation issued in guest,
those caches should be refreshed.
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu.c | 35 ++-
1 file changed, 34
From: Clément Mathieu--Drif
This will be used to implement the device IOTLB invalidation
Signed-off-by: Clément Mathieu--Drif
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu.c | 39 ---
1 file changed, 24 insertions(+), 15 deletions(-)
diff --git a
From: Clément Mathieu--Drif
This piece of code can be shared by both IOTLB invalidation and
PASID-based IOTLB invalidation
No functional changes intended.
Reviewed-by: Philippe Mathieu-Daudé
Signed-off-by: Clément Mathieu--Drif
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu.c | 57
ng
is supported.
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu_internal.h | 2 ++
include/hw/i386/intel_iommu.h | 1 +
hw/i386/intel_iommu.c | 34 +++---
3 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/hw
: Clément Mathieu--Drif
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
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(-)
diff
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).
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu_internal.h
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.
Signed-off-by: Zhenzhong Duan
---
include/hw/i386/intel_iommu.h | 1 +
hw/i386/intel_iommu.c
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu.c | 12
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index e65f5b29a5..1cff8b00ae 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -759,20 +759,16 @@ sta
From: Clément Mathieu--Drif
Signed-off-by: Clément Mathieu--Drif
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu_internal.h | 11
hw/i386/intel_iommu.c | 50 ++
2 files changed, 61 insertions(+)
diff --git a/hw/i386
for compatibility.
Add a check to ensure user specified value is 48 in modern mode
for now.
Signed-off-by: Zhenzhong Duan
---
include/hw/i386/intel_iommu.h | 2 +-
hw/i386/intel_iommu.c | 16 +++-
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/include/hw
From: Yi Liu
This adds stage-1 page table walking to support stage-1 only
transltion in scalable modern mode.
Signed-off-by: Yi Liu
Co-developed-by: Clément Mathieu--Drif
Signed-off-by: Clément Mathieu--Drif
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
hw/i386
From: Clément Mathieu--Drif
First stage translation must fail if the address to translate is
not canonical.
Signed-off-by: Clément Mathieu--Drif
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu_internal.h | 2 ++
hw/i386/intel_iommu.c | 21 +
2 files
Add the framework to test the intel-iommu device.
Currently only tested cap/ecap bits correctness in scalable
modern mode. Also tested cap/ecap bits consistency before
and after system reset.
Signed-off-by: Zhenzhong Duan
---
MAINTAINERS| 1 +
include/hw/i386/intel_iommu.h
scalable mode support
- if not configured, means no scalable mode support, if not proper
configured, will throw error
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
include/hw/i386/intel_iommu.h | 1 +
hw/i386/intel_iommu.c | 24 +++
See https://lists.gnu.org/archive/html/qemu-devel/2024-07/msg04612.html
Not tested due to no ap/ccw environment. But build test pass.
Thanks
Zhenzhong
Zhenzhong Duan (2):
vfio/ap: Don't initialize HOST_IOMMU_DEVICE with mdev
vfio/ccw: Don't initialize HOST_IOMMU_DEVICE with mdev
nt HostIOMMUDeviceClass::realize()
handler")
Signed-off-by: Zhenzhong Duan
---
hw/vfio/ap.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
index 0c4354e3e7..391bfb72ca 100644
--- a/hw/vfio/ap.c
+++ b/hw/vfio/ap.c
@@ -230,6 +230,9 @@ static void vfio_
nt HostIOMMUDeviceClass::realize()
handler")
Signed-off-by: Zhenzhong Duan
---
hw/vfio/ccw.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c
index 1f8e1272c7..70934b01d5 100644
--- a/hw/vfio/ccw.c
+++ b/hw/vfio/ccw.c
@@ -675,6 +675,9 @@ static void vfio_c
are
supported. Instead cap/ecap bits should be checked.
Signed-off-by: Yu Zhang
Signed-off-by: Zhenzhong Duan
Reviewed-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu_internal.h | 9 -
hw/i386/intel_iommu.c | 25 -
2 files changed, 24 insertions(+), 10
Signed-off-by: Zhenzhong Duan
Reviewed-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 12
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index c52912f593..e3465fc27d 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i38
: Clément Mathieu--Drif
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
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(-)
diff
From: Clément Mathieu--Drif
This will be used to implement the device IOTLB invalidation
Signed-off-by: Clément Mathieu--Drif
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu.c | 39 ---
1 file changed, 24 insertions(+), 15 deletions(-)
diff --git a
Valgrind complains definitely loss in get_relocated_path(), because
GString is leaked in get_relocated_path() when returning with gchar *.
Use g_string_free(, false) to free GString while preserving gchar *.
Signed-off-by: Zhenzhong Duan
---
util/cutils.c | 2 +-
1 file changed, 1 insertion
_setv: Assertion `*errp == NULL'
failed.
After fix:
qemu-system-x86_64: cannot create PID file: Cannot open pid file: Permission
denied
Signed-off-by: Zhenzhong Duan
---
softmmu/vl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/softmmu/vl.c b/softmmu/vl.c
index
ansient Mapping.
Suggested-by: Yi Liu
Suggested-by: Jason Wang
Signed-off-by: Zhenzhong Duan
---
v3: still need to check x86_iommu->dt_supported
v2: introcude "x-stale-tm" to handle migration compatibility (Jason)
hw/i386/intel_iommu_internal.h | 12 ++--
include/hw/i386/inte
From: Clément Mathieu--Drif
This will be used to implement the device IOTLB invalidation
Signed-off-by: Clément Mathieu--Drif
Signed-off-by: Zhenzhong Duan
Acked-by: Jason Wang
---
hw/i386/intel_iommu.c | 39 ---
1 file changed, 24 insertions(+), 15
Signed-off-by: Zhenzhong Duan
Reviewed-by: Clément Mathieu--Drif
Reviewed-by: Yi Liu
Acked-by: Jason Wang
---
hw/i386/intel_iommu.c | 12
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 378e417b27..be7c8a670b 10064
From: Yi Liu
This adds stage-1 page table walking to support stage-1 only
translation in scalable modern mode.
Signed-off-by: Yi Liu
Co-developed-by: Clément Mathieu--Drif
Signed-off-by: Clément Mathieu--Drif
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
Acked-by: Jason Wang
---
hw
for backward compatibility.
Add a check to ensure user specified value is 48 in modern mode
for now.
Signed-off-by: Zhenzhong Duan
Reviewed-by: Clément Mathieu--Drif
---
include/hw/i386/intel_iommu.h | 2 +-
hw/i386/intel_iommu.c | 10 +-
2 files changed, 10 insertions(+), 2
enable it if there is need to cache the
translation result.
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
Reviewed-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 35 ++-
1 file changed, 34 insertions(+), 1 deletion(-)
diff --git a/hw/i386
are
supported. Instead cap/ecap bits should be checked.
Signed-off-by: Yu Zhang
Signed-off-by: Zhenzhong Duan
Reviewed-by: Clément Mathieu--Drif
Reviewed-by: Yi Liu
Acked-by: Jason Wang
---
hw/i386/intel_iommu_internal.h | 9 -
hw/i386/intel_iommu.c | 25
: Clément Mathieu--Drif
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
Acked-by: Jason Wang
Reviewed-by: Yi Liu
---
hw/i386/intel_iommu_internal.h | 24 +++---
include/hw/i386/intel_iommu.h | 2 +-
hw/i386/intel_iommu.c | 129 +
3 files changed
igned-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
Acked-by: Jason Wang
---
include/hw/i386/intel_iommu.h | 1 +
hw/i386/intel_iommu.c | 23 ++-
2 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/include/hw/i386/intel_iommu.h b/include/hw/i386/intel_io
n scalable modern
mode.
Signed-off-by: Zhenzhong Duan
Reviewed-by: Clément Mathieu--Drif
---
include/hw/i386/intel_iommu.h | 1 +
hw/i386/intel_iommu.c | 5 -
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/hw/i386/intel_iommu.h b/include/hw/i386/intel_iommu.h
index
Add the framework to test the intel-iommu device.
Currently only tested cap/ecap bits correctness in scalable
modern mode. Also tested cap/ecap bits consistency before
and after system reset.
Signed-off-by: Zhenzhong Duan
Acked-by: Thomas Huth
Reviewed-by: Clément Mathieu--Drif
Acked-by: Jason
canonical
intel_iommu: Set accessed and dirty bits during first stage
translation
intel_iommu: Add an internal API to find an address space with PASID
intel_iommu: Add support for PASID-based device IOTLB invalidation
Yi Liu (2):
intel_iommu: Rename slpte to pte
intel_iommu: Implement
601 - 700 of 946 matches
Mail list logo