dirty_rate
Status: measured
Start Time: 11646834 (ms)
Sample Pages: 0 (per GB)
Period: 10 (sec)
Mode: dirty-bitmap
Dirty rate: 2 (MB/s)
While it's totally useless in dirty-ring and dirty-bitmap mode, fix to
show it only in page-sampling mode.
Signed-off-by: Zhenzhong Duan
---
migration/d
The comment of flatview_access_allowed() suggests to pass address
within that memory region, this isn't true in some call sites.
This makes qemu log in flatview_access_allowed() confusing and
potential risk if the input parameter will be checked in the future.
Signed-off-by: Zhenzhong
.
IOMMUFDDevice is willingly not a QOM object because we don't want
it to be visible from the user interface.
Introduce a helper iommufd_device_init to initialize IOMMUFDDevice.
Originally-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
include/sysemu/iommufd.h
HostIOMMUDevice will be inherited by two sub classes,
legacy and iommufd currently.
Introduce a helper function host_iommu_base_device_init to initialize it.
Suggested-by: Eric Auger
Signed-off-by: Zhenzhong Duan
---
include/sysemu/host_iommu_device.h | 22 ++
1 file
This callback will be used to initialize base and public elements in
IOMMULegacyDevice.
Signed-off-by: Zhenzhong Duan
---
hw/vfio/container.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/hw/vfio/container.c b/hw/vfio/container.c
index bd25b9fbad..2e8ff32284 100644
--- a/hw/vfio
& 0x3fULL' a MACRO and add missed '+1' (Cédric)
- block migration if vIOMMU cap/ecap updated based on host IOMMU cap/ecap
- add R-B
Yi Liu (1):
hw/pci: Introduce pci_device_set/unset_iommu_device()
Zhenzhong Duan (10):
Introduce a common abstract struct HostIOMMUDevi
Signed-off-by: Zhenzhong Duan
---
hw/vfio/pci.c | 4
1 file changed, 4 insertions(+)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 4fa387f043..6cc7de5d10 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -3006,6 +3006,9 @@ static void vfio_realize(PCIDevice *pdev, Error **errp
.
IOMMULegacyDevice is willingly not a QOM object because we don't want
it to be visible from the user interface.
Suggested-by: Eric Auger
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-common.h | 6 ++
1 file changed, 6 insertions(+)
diff --git a/include/hw/vfio/vfio-common.h b/in
Support both iommufd and legacy backend.
Originally-by: Yi Liu
Signed-off-by: Nicolin Chen
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
hw/vfio/pci.c | 20 +++-
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index
Liu
Signed-off-by: Yi Sun
Signed-off-by: Nicolin Chen
Signed-off-by: Zhenzhong Duan
---
include/hw/pci/pci.h | 38 ++-
hw/pci/pci.c | 62 +---
2 files changed, 96 insertions(+), 4 deletions(-)
diff --git a/include/hw/pci
Introduce a helper function iommufd_device_get_info() to get
host IOMMU related information through iommufd uAPI.
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
include/sysemu/iommufd.h | 4
backends/iommufd.c | 23 ++-
2 files
This handle points to either IOMMULegacyDevice or IOMMUFDDevice variant,
neither both.
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-common.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index 8bfb9cbe94..b6676c9f79
Introduce host_iommu_device_create callback and a wrapper for it.
This callback is used to allocate a host iommu device instance and
initialize it based on type.
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-common.h | 1 +
include/hw/vfio/vfio-container-base.h | 1 +
hw/vfio
This callback will be used to initialize base and public elements
in IOMMUFDDevice.
Signed-off-by: Zhenzhong Duan
---
hw/vfio/iommufd.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c
index 9bfddc1360..1c2f5da0d0 100644
--- a/hw/vfio
alue sanity
check and s->cap initialization.
ACPI DMAR table is also updated with right mgaw value.
Signed-off-by: Zhenzhong Duan
---
hw/i386/acpi-build.c | 3 ++-
hw/i386/intel_iommu.c | 44 ++-
2 files changed, 25 insertions(+), 22 deletions(-)
When there is VFIO device and vIOMMU cap/ecap is updated based on host
IOMMU cap/ecap, migration should be blocked.
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu.c | 16 ++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386
sed on host IOMMU cap/ecap
- add R-B
Yi Liu (2):
intel_iommu: Add set/unset_iommu_device callback
intel_iommu: Add a framework to check and sync host IOMMU cap/ecap
Zhenzhong Duan (4):
intel_iommu: Extract out vtd_cap_init to initialize cap/ecap
intel_iommu: Implement check and sync mechanism in
From: Yi Liu
This adds set/unset_iommu_device() implementation in Intel vIOMMU.
In set call, a pointer to host IOMMU device info is stored in hash
table indexed by PCI BDF.
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu_internal.h | 8
>cap/ecap become readonly.
Implementation details for different backends will be in following patches.
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 | 50 ++-
2 f
This is a prerequisite for host cap/ecap sync.
No functional change intended.
Reviewed-by: Eric Auger
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu.c | 93 ---
1 file changed, 51 insertions(+), 42 deletions(-)
diff --git a/hw/i386/intel_iommu.c
tage-1 translation is supported in future, a.k.a. scalable
modern mode, this mechanism will be further extended to check more
bits.
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu_internal.h | 1 +
include/hw/i386/intel_iommu.h | 1 +
hw/
Hi,
This is a simple optimization to user_creatable_add_type error path.
Removed local_err and its check in err path, use *errp instead.
Thanks
Zhenzhong
Zhenzhong Duan (2):
qom/object_interfaces: Remove unnecessary local error check
qom/object_interfaces: Remove local_err in
In user_creatable_add_type, there is mixed usage of ERRP_GUARD and
local_err. This makes error_abort not taking effect in those callee
functions with local_err passed.
Now that we already has ERRP_GUARD, remove local_err and use *errp
instead.
Signed-off-by: Zhenzhong Duan
---
qom
In the error return path, local_err is always set, no need to check it.
Signed-off-by: Zhenzhong Duan
---
qom/object_interfaces.c | 10 --
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c
index e0833c8bfe..255a7bf659 100644
Either IOMMULegacyDevice or IOMMUFDDevice into VFIODevice, neither
both.
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-common.h | 11 +++
1 file changed, 11 insertions(+)
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index 8bfb9cbe94..1bbad003ee
.
IOMMUFDDevice is willingly not a QOM object because we don't want
it to be visible from the user interface.
Introduce a helper iommufd_device_init to initialize IOMMUFDDevice.
Originally-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
include/sysemu/iommufd.h
Introduce host_iommu_device_init callback and a wrapper for it.
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-common.h | 1 +
include/hw/vfio/vfio-container-base.h | 1 +
hw/vfio/common.c | 8
3 files changed, 10 insertions(+)
diff --git a/include
This callback will be used to initialize base and public elements
in IOMMUFDDevice, with the exception of iommufd and devid which
are initialized early in attachment.
Signed-off-by: Zhenzhong Duan
---
hw/vfio/iommufd.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/hw/vfio/iommufd.c
Signed-off-by: Zhenzhong Duan
---
hw/vfio/pci.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index d1e1b8cb89..dedb64fc08 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -3006,6 +3006,9 @@ static void vfio_realize(PCIDevice *pdev, Error **errp
Initialize host IOMMU device in vfio and pass to vIOMMU, so that vIOMMU
could get hw IOMMU information.
Support both iommufd and legacy backend.
Originally-by: Yi Liu
Signed-off-by: Nicolin Chen
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
hw/vfio/pci.c | 20
1' (Cédric)
- block migration if vIOMMU cap/ecap updated based on host IOMMU cap/ecap
- add R-B
Yi Liu (3):
hw/pci: Introduce pci_device_set/unset_iommu_device()
intel_iommu: Add set/unset_iommu_device callback
intel_iommu: Add a framework to check and sync host IOMMU cap/ecap
Zhen
Introduce a helper function iommufd_device_get_info() to get
host IOMMU related information through iommufd uAPI.
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
include/sysemu/iommufd.h | 4
backends/iommufd.c | 25 -
2 files
This callback will be used to initialize base and public elements
in IOMMULegacyDevice.
Signed-off-by: Zhenzhong Duan
---
hw/vfio/container.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/hw/vfio/container.c b/hw/vfio/container.c
index bd25b9fbad..8fafd4b4e5 100644
--- a/hw/vfio
alue sanity
check and s->cap initialization.
ACPI DMAR table is also updated with right mgaw value.
Signed-off-by: Zhenzhong Duan
---
hw/i386/acpi-build.c | 3 ++-
hw/i386/intel_iommu.c | 44 ++-
2 files changed, 25 insertions(+), 22 deletions(-)
.
IOMMULegacyDevice is willingly not a QOM object because we don't want
it to be visible from the user interface.
Suggested-by: Eric Auger
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-common.h | 6 ++
1 file changed, 6 insertions(+)
diff --git a/include/hw/vfio/vfio-common.h b/in
>cap/ecap become readonly.
Implementation details for different backends will be in following patches.
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 | 41 ++-
2 f
Liu
Signed-off-by: Yi Sun
Signed-off-by: Nicolin Chen
Signed-off-by: Zhenzhong Duan
---
include/hw/pci/pci.h | 38 ++-
hw/pci/pci.c | 62 +---
2 files changed, 96 insertions(+), 4 deletions(-)
diff --git a/include/hw/pci
iommufd and devid in VFIODevice are redundant with the ones
in IOMMUFDDevice, so remove them.
Suggested-by: Eric Auger
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-common.h | 2 --
hw/vfio/ap.c | 2 +-
hw/vfio/ccw.c | 2 +-
hw/vfio/common.c
HostIOMMUDevice will be inherited by two sub classes,
legacy and iommufd currently.
Introduce a helper function host_iommu_base_device_init to initialize it.
Suggested-by: Eric Auger
Signed-off-by: Zhenzhong Duan
---
include/sysemu/host_iommu_device.h | 22 ++
1 file
When there is VFIO device and vIOMMU cap/ecap is updated based on host
IOMMU cap/ecap, migration should be blocked.
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu.c | 16 ++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386
tage-1 translation is supported in future, a.k.a. scalable
modern mode, this mechanism will be further extended to check more
bits.
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu_internal.h | 1 +
include/hw/i386/intel_iommu.h | 1 +
hw/
From: Yi Liu
This adds set/unset_iommu_device() implementation in Intel vIOMMU.
In set call, a pointer to host IOMMU device info is stored in hash
table indexed by PCI BDF.
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu_internal.h | 14
This is a prerequisite for host cap/ecap sync.
No functional change intended.
Reviewed-by: Eric Auger
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu.c | 93 ---
1 file changed, 51 insertions(+), 42 deletions(-)
diff --git a/hw/i386/intel_iommu.c
evice declaration to intel_iommu_internal.h (Cédric)
- make '(vtd->cap_reg >> 16) & 0x3fULL' a MACRO and add missed '+1' (Cédric)
- block migration if vIOMMU cap/ecap updated based on host IOMMU cap/ecap
- add R-B
Yi Liu (1):
hw/pci: Introduce pci_device_set/unset_iommu_de
HIODIOMMUFD
device.
Suggested-by: Cédric Le Goater
Originally-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
include/sysemu/iommufd.h | 22 +++
backends/iommufd.c | 47 ++--
2 files changed, 53 insertions(+), 16 deletions
HIODIOMMUFDVFIO represents a host IOMMU device under VFIO iommufd
backend. It will be created during VFIO device attaching and passed
to vIOMMU.
It includes a link to VFIODevice so that we can do VFIO device
specific hwpt attaching/detaching.
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio
Introduce a helper function iommufd_backend_get_device_info() to get
host IOMMU related information through iommufd uAPI.
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
include/sysemu/iommufd.h | 4
backends/iommufd.c | 23 ++-
2
HIODLegacyVFIO represents a host IOMMU device under VFIO legacy
container backend.
It includes a link to VFIODevice.
Suggested-by: Eric Auger
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-common.h | 11 +++
hw/vfio/container.c | 11
With HostIOMMUDevice passed, vIOMMU can check compatibility with host
IOMMU, call into IOMMUFD specific methods, etc.
Originally-by: Yi Liu
Signed-off-by: Nicolin Chen
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
hw/vfio/pci.c | 20 +++-
1 file changed, 15
It calls iommufd_backend_get_device_info() to get host IOMMU
related information.
Define a common structure HIOD_IOMMUFD_INFO to describe the info
returned from kernel. Currently only vtd, but easy to add arm smmu
when kernel supports.
Signed-off-by: Zhenzhong Duan
---
include/sysemu/iommufd.h
.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
---
MAINTAINERS| 2 ++
include/sysemu/host_iommu_device.h | 19 +++
backends/host_iommu_device.c | 19 +++
backends/Kconfig | 5 +
backends/meson.build
Utilize iova_ranges to calculate host IOMMU address width and
package it in HIOD_LEGACY_INFO for vIOMMU usage.
HIOD_LEGACY_INFO will be used by both VFIO and VDPA so declare
it in host_iommu_device.h.
Signed-off-by: Zhenzhong Duan
---
include/sysemu/host_iommu_device.h | 10 ++
hw/vfio
Create host IOMMU device instance and initialize it based on backend.
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-common.h | 1 +
hw/vfio/container.c | 5 +
hw/vfio/iommufd.c | 8
3 files changed, 14 insertions(+)
diff --git a/include/hw/vfio/vfio
Liu
Signed-off-by: Yi Sun
Signed-off-by: Nicolin Chen
Signed-off-by: Zhenzhong Duan
---
include/hw/pci/pci.h | 40 ++-
hw/pci/pci.c | 75 ++--
2 files changed, 111 insertions(+), 4 deletions(-)
diff --git a/include/hw/pci
aw-bits <= host IOMMU aw-bits, which is missed before.
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu.c | 15 +++
1 file changed, 15 insertions(+)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index a49b587c73..d2cd186df0 100644
--- a/hw/
mu: Implement set/unset_iommu_device() callback
intel_iommu: Add a framework to do compatibility check with host IOMMU
cap/ecap
Zhenzhong Duan (3):
intel_iommu: Extract out vtd_cap_init() to initialize cap/ecap
intel_iommu: Check for compatibility with legacy device
intel
Extract cap/ecap initialization in vtd_cap_init() to make code
cleaner.
No functional change intended.
Reviewed-by: Eric Auger
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu.c | 93 ---
1 file changed, 51 insertions(+), 42 deletions(-)
diff
From: Yi Liu
Implement set/unset_iommu_device() callback in Intel vIOMMU.
In set call, a new structure VTDHostIOMMUDevice which holds
a reference to HostIOMMUDevice is stored in hash table
indexed by PCI BDF.
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
hw
From: Yi Liu
If check fails, the host side device(either vfio or vdpa device) should not
be passed to guest.
Implementation details for different backends will be in following patches.
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu.c | 35
aw-bits <= host IOMMU aw-bits, which is missed before.
When stage-1 translation is supported in future, a.k.a. scalable
modern mode, this mechanism will be further extended to check more
bits.
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
include/hw/i386/
In user_creatable_add_type, there is mixed usage of ERRP_GUARD and
local_err. This makes error_abort not taking effect in those callee
functions with &local_err passed.
Now that we already use ERRP_GUARD, remove local_err and pass errp.
Signed-off-by: Zhenzhong Duan
---
qom/object_interfac
The original error handling code indicates "local_err is always set",
and error_propagate() can handle the case that local_err is NULL.
Use err label instead of out label for error path.
Reviewed-by: Zhao Liu
Signed-off-by: Zhenzhong Duan
---
qom/object_interfaces.c | 16 +++--
Signed-off-by: Zhenzhong Duan
---
qom/object_interfaces.c | 21 ++---
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c
index 70179877f1..e17e2de46d 100644
--- a/qom/object_interfaces.c
+++ b/qom/object_interfaces.c
(Zhao Liu)
- Make object_set_properties_from_qdict return bool (Zhao Liu)
- Check return value of object_property_try_add_child (Zhao Liu)
- Add R-B
Zhenzhong Duan (3):
qom/object_interfaces: Remove unnecessary local error check
qom/object_interfaces: Make object_set_properties_from_qdict return
omments welcome!
Thanks
Zhenzhong
Zhenzhong Duan (1):
target/i386: Introduce Icelake-Server-v7 to enable TSX
target/i386/cpu.c | 10 ++
1 file changed, 10 insertions(+)
--
2.34.1
Fixes: d965dc35592d ("target/i386: Add ARCH_CAPABILITIES related bits into
Icelake-Server CPU model")
Tested-by: Xiangfei Ma
Signed-off-by: Zhenzhong Duan
---
target/i386/cpu.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 9a210d8d9
: Zhenzhong Duan
---
MAINTAINERS| 2 ++
include/sysemu/host_iommu_device.h | 51 ++
backends/host_iommu_device.c | 30 ++
backends/Kconfig | 5 +++
backends/meson.build | 1 +
5 files changed, 89
HostIOMMUDeviceLegacyVFIO represents a host IOMMU device under VFIO
legacy container backend.
It includes a link to VFIODevice.
Suggested-by: Eric Auger
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-common.h | 12
hw/vfio/container.c
and add missed '+1' (Cédric)
- block migration if vIOMMU cap/ecap updated based on host IOMMU cap/ecap
- add R-B
Yi Liu (2):
hw/pci: Introduce pci_device_[set|unset]_iommu_device()
intel_iommu: Implement [set|unset]_iommu_device() callbacks
Zhenzhong Duan (17):
backends: Int
HostIOMMUDeviceIOMMUFDVFIO represents a host IOMMU device under VFIO
iommufd backend. It will be created during VFIO device attaching and
passed to vIOMMU.
It includes a link to VFIODevice so that we can do VFIO device
specific operations, i.e., [at/de]taching hwpt, etc.
Signed-off-by: Zhenzhong
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
---
backends/iommufd.c | 18 ++
1 file changed, 18 insertions(+)
diff --git a/backends/iommufd.c b/backends/iommufd.c
index d61209788a..28faec528e 100644
--- a/backends/iommufd.c
+++ b/backends/iommufd.c
@@ -233,6
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
---
hw/vfio/container.c | 12
1 file changed, 12 insertions(+)
diff --git a/hw/vfio/container.c b/hw/vfio/container.c
index 863eec3943..3683487605 100644
--- a/hw/vfio/container.c
+++ b/hw/vfio/container.c
@@ -1164,11
It calls iommufd_backend_get_device_info() to get host IOMMU
related information and translate it into HostIOMMUDeviceCaps
for query with .check_cap().
Introduce macro VTD_MGAW_FROM_CAP to get MGAW which equals to
(aw_bits - 1).
Signed-off-by: Zhenzhong Duan
---
include/hw/i386/intel_iommu.h
With HostIOMMUDevice passed, vIOMMU can check compatibility with host
IOMMU, call into IOMMUFD specific methods, etc.
Originally-by: Yi Liu
Signed-off-by: Nicolin Chen
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
hw/vfio/pci.c | 20 +++-
1 file changed, 15
ned-off-by: Zhenzhong Duan
---
include/hw/pci/pci.h | 38 +-
hw/pci/pci.c | 27 +++
2 files changed, 64 insertions(+), 1 deletion(-)
diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
index eaa3fc99d8..849e391813 100644
--
Utilize range_get_last_bit() to get host IOMMU address width and
package it in HostIOMMUDeviceCaps for query with .check_cap().
Signed-off-by: Zhenzhong Duan
---
hw/vfio/container.c | 29 +
1 file changed, 29 insertions(+)
diff --git a/hw/vfio/container.c b/hw/vfio
From: Yi Liu
Implement [set|unset]_iommu_device() callbacks in Intel vIOMMU.
In set call, a new structure VTDHostIOMMUDevice which holds
a reference to HostIOMMUDevice is stored in hash table
indexed by PCI BDF.
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
Create host IOMMU device instance in vfio_attach_device() and call
.realize() to initialize it further.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-common.h | 1 +
hw/vfio/common.c | 18 +-
2 files changed, 18 insertions
If check fails, host device (either VFIO or VDPA device) is not
compatible with current vIOMMU config and should not be passed to
guest.
Only aw_bits is checked for now, we don't care other capabilities
before scalable modern mode is introduced.
Signed-off-by: Yi Liu
Signed-off-by: Zhen
t platform IOMMUs.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
---
include/sysemu/host_iommu_device.h | 44 ++
backends/host_iommu_device.c | 29
2 files changed, 73 insertions(+)
diff --git a/include/sysemu/host_iommu_d
: Zhenzhong Duan
---
hw/pci/pci.c | 48 +---
1 file changed, 45 insertions(+), 3 deletions(-)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 324c1302d2..02a4bb2af6 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -2648,11 +2648,27 @@ static void
Introduce a helper function iommufd_backend_get_device_info() to get
host IOMMU related information through iommufd uAPI.
Signed-off-by: Yi Liu
Signed-off-by: Yi Sun
Signed-off-by: Zhenzhong Duan
---
include/sysemu/iommufd.h | 4
backends/iommufd.c | 24 +++-
2
Initialize attribute VFIOIOMMUClass::hiod_typename based on
VFIO backend type.
This attribute will facilitate HostIOMMUDevice creation in
vfio_attach_device().
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-container-base.h | 3 +++
hw/vfio/container.c
Extract cap/ecap initialization in vtd_cap_init() to make code
cleaner.
No functional change intended.
Reviewed-by: Eric Auger
Signed-off-by: Zhenzhong Duan
---
hw/i386/intel_iommu.c | 93 ---
1 file changed, 51 insertions(+), 42 deletions(-)
diff
: Cédric Le Goater
Signed-off-by: Yi Liu
Signed-off-by: Zhenzhong Duan
---
include/sysemu/iommufd.h | 30 ++
backends/iommufd.c | 37 -
2 files changed, 50 insertions(+), 17 deletions(-)
diff --git a/include/sysemu/iommufd.h b
This helper get the highest 1 bit position of the upper bound.
If the range is empty or upper bound is zero, -1 is returned.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
---
include/qemu/range.h | 11 +++
1 file changed, 11 insertions(+)
diff --git a/include/qemu
very first series.
Test done on x86 platform:
vfio device hotplug/unplug with different backend
reboot
Thanks
Zhenzhong
Zhenzhong Duan (3):
vfio: Make VFIOIOMMUClass::attach_device() and its wrapper return bool
vfio: Make VFIOIOMMUClass::setup() return bool
vfio: Make VFIOIOMMUClass
This is to follow the coding standand to return bool if 'Error **'
is used to pass error.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-container-base.h | 2 +-
hw/vfio/container.c | 10 +-
hw/vf
Make VFIOIOMMUClass::add_window() and its wrapper function
vfio_container_add_section_window() return bool.
This is to follow the coding standand to return bool if 'Error **'
is used to pass error.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio
Make VFIOIOMMUClass::attach_device() and its wrapper function
vfio_attach_device() return bool.
This is to follow the coding standand to return bool if 'Error **'
is used to pass error.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-common.h
patch (Cédric)
- add processing for more files
Zhenzhong Duan (11):
vfio/pci: Use g_autofree in vfio_realize
vfio/pci: Use g_autofree in iommufd_cdev_get_info_iova_range()
vfio: Make VFIOIOMMUClass::attach_device() and its wrapper return bool
vfio: Make VFIOIOMMUClass::setup() return bool
Make VFIOIOMMUClass::attach_device() and its wrapper function
vfio_attach_device() return bool.
This is to follow the coding standand to return bool if 'Error **'
is used to pass error.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-common.h
This is to follow the coding standand to return bool if 'Error **'
is used to pass error.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
---
include/hw/vfio/vfio-container-base.h | 2 +-
hw/vfio/container.c | 10
Local pointer info is freed before return from
iommufd_cdev_get_info_iova_range().
Use 'g_autofree' to avoid the g_free() calls.
Signed-off-by: Zhenzhong Duan
---
hw/vfio/iommufd.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/hw/vfio/iommufd.c b/hw/vfio
Local pointer name is allocated before vfio_attach_device() call
and freed after the call.
Same for tmp when calling realpath().
Use 'g_autofree' to avoid the g_free() calls.
Signed-off-by: Zhenzhong Duan
---
hw/vfio/pci.c | 7 +++
1 file changed, 3 insertions(+), 4 deletion
This is to follow the coding standand to return bool if 'Error **'
is used to pass error.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
---
include/hw/vfio/vfio-common.h | 2 +-
hw/vfio/container.c | 3 +--
hw/vfio/cpr.c | 4 ++--
hw/vfio
This is to follow the coding standand to return bool if 'Error **'
is used to pass error.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
---
hw/vfio/container.c | 18 +++---
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/hw/vfio/container.c
This is to follow the coding standand to return bool if 'Error **'
is used to pass error.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
---
hw/vfio/container.c | 22 ++
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/hw/vfio/contai
_container
iommufd_cdev_get_info_iova_range
After the change, all functions in hw/vfio/iommufd.c follows the
standand.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
---
hw/vfio/iommufd.c | 88 +--
1 file changed, 39 insertions(+), 49 deletions(-)
diff --git
Make VFIOIOMMUClass::add_window() and its wrapper function
vfio_container_add_section_window() return bool.
This is to follow the coding standand to return bool if 'Error **'
is used to pass error.
Suggested-by: Cédric Le Goater
Signed-off-by: Zhenzhong Duan
Reviewed-by: Cédric
1 - 100 of 780 matches
Mail list logo