On 10/09/2024 18:40, Steve Sistare wrote:
> IOMMU_GET_HW_INFO fails for a vfio mediated device (aka mdev), because
> the devid is associated with kernel type IOMMUFD_OBJ_ACCESS, not
> IOMMUFD_OBJ_DEVICE. Assume IOMMU_HW_INFO_TYPE_NONE and proceed.
>
> Signed-off-by: Steve Sistare
> ---
> hw/vf
On 23/07/2024 15:23, Yi Liu wrote:
> On 2024/7/23 05:13, Joao Martins wrote:
>> This small series adds support for IOMMU dirty tracking support via the
>> IOMMUFD backend. The hardware capability is available on most recent x86
>> hardware (and these SMMUv3 in upcoming
On 23/07/2024 09:35, Cédric Le Goater wrote:
> On 7/22/24 23:13, Joao Martins wrote:
>> This small series adds support for IOMMU dirty tracking support via the
>> IOMMUFD backend. The hardware capability is available on most recent x86
>> hardware (and these SMMUv3 in upcomi
On 23/07/2024 09:31, Eric Auger wrote:
>
>
> On 7/22/24 23:13, Joao Martins wrote:
>> The property 'x-pre-copy-dirty-page-tracking' allows disabling the whole
>> tracking of VF pre-copy phase of dirty page tracking, though it means
>> that it will only b
On 23/07/2024 09:24, Eric Auger wrote:
>
>
> On 7/23/24 10:20, Duan, Zhenzhong wrote:
>>
>>> -Original Message-
>>> From: Joao Martins
>>> Subject: Re: [PATCH v6 4/9] vfio/{iommufd,container}: Invoke
>>> HostIOMMUDevice::realize() durin
On 23/07/2024 09:09, Eric Auger wrote:
>
>
> On 7/23/24 10:00, Joao Martins wrote:
>> On 23/07/2024 08:50, Eric Auger wrote:
>>> Hi Joao,
>>>
>>> On 7/22/24 23:13, Joao Martins wrote:
>>>> In preparation to using the dirty tracking UAPI, prob
On 23/07/2024 09:03, Eric Auger wrote:
> Hi Joao,
>
> On 7/22/24 23:13, Joao Martins wrote:
>> ioctl(iommufd, IOMMU_HWPT_SET_DIRTY_TRACKING, arg) is the UAPI that
>> enables or disables dirty page tracking. The ioctl is used if the hwpt
>> has been created with dirt
On 23/07/2024 08:55, Eric Auger wrote:
>
>
> On 7/23/24 09:44, Cédric Le Goater wrote:
>> On 7/23/24 09:38, Eric Auger wrote:
>>> Hi Joao,
>>>
>>> On 7/22/24 23:13, Joao Martins wrote:
>>>> Move the HostIOMMUDevice::realize() to be invok
On 23/07/2024 08:50, Eric Auger wrote:
> Hi Joao,
>
> On 7/22/24 23:13, Joao Martins wrote:
>> In preparation to using the dirty tracking UAPI, probe whether the IOMMU
>> supports dirty tracking. This is done via the data stored in
>> hiod::caps::hw_caps initialized f
On 23/07/2024 08:38, Eric Auger wrote:
> Hi Joao,
>
> On 7/22/24 23:13, Joao Martins wrote:
>> Move the HostIOMMUDevice::realize() to be invoked during the attach of the
>> device
>> before we allocate IOMMUFD hardware pagetable objects (HWPT). This allows
>> t
On 23/07/2024 06:11, Duan, Zhenzhong wrote:
>
>
>> -Original Message-----
>> From: Joao Martins
>> Subject: [PATCH v6 5/9] vfio/iommufd: Probe and request hwpt dirty
>> tracking capability
>>
>> In preparation to using the dirty tracking UAPI,
ioctl(iommufd, IOMMU_HWPT_GET_DIRTY_BITMAP, arg) is the UAPI
that fetches the bitmap that tells what was dirty in an IOVA
range.
A single bitmap is allocated and used across all the hwpts
sharing an IOAS which is then used in log_sync() to set Qemu
global bitmaps.
Signed-off-by: Joao Martins
cides to use VF dirty tracking instead.
Signed-off-by: Joao Martins
---
include/hw/vfio/vfio-common.h | 2 ++
hw/vfio/iommufd.c | 20
2 files changed, 22 insertions(+)
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index 4e44b26d3c4
g/qemu-devel/20240708143420.16953-1-joao.m.mart...@oracle.com/
[6]
https://lore.kernel.org/qemu-devel/20240719120501.81279-1-joao.m.mart...@oracle.com/
Joao Martins (9):
vfio/iommufd: Introduce auto domain creation
vfio/{iommufd,container}: Remove caps::aw_bits
vfio/iommufd: Add hw_caps
ioctl(iommufd, IOMMU_HWPT_SET_DIRTY_TRACKING, arg) is the UAPI that
enables or disables dirty page tracking. The ioctl is used if the hwpt
has been created with dirty tracking supported domain (stored in
hwpt::flags) and it is called on the whole list of iommu domains.
Signed-off-by: Joao Martins
means vfio_device_hiod_realize() is called in
different places within the backend .attach_device() implementation.
Suggested-by: Cédric Le Goater
Signed-off-by: Joao Martins
Reviewed-by: Zhenzhong Duan
---
include/hw/vfio/vfio-common.h | 1 +
hw/vfio/common.c | 16 ++-
().
Suggested-by: Zhenzhong Duan
Signed-off-by: Joao Martins
Reviewed-by: Cédric Le Goater
#include
@@ -269,7 +270,7 @@ static int hiod_iommufd_get_cap(HostIOMMUDevice *hiod, int
cap, Error **errp)
case HOST_IOMMU_DEVICE_CAP_IOMMU_TYPE:
return caps->type;
c
iner-based dirty page tracking. This also allows to
use IOMMU dirty tracking even on VFs with their own dirty
tracker scheme.
Signed-off-by: Joao Martins
---
include/hw/vfio/vfio-common.h | 1 +
hw/vfio/common.c | 3 +++
hw/vfio/migration.c | 4 +++-
hw/vfio/pci.c
during attach_device().
Signed-off-by: Joao Martins
Reviewed-by: Cédric Le Goater
---
include/sysemu/host_iommu_device.h | 4
hw/vfio/iommufd.c | 1 +
2 files changed, 5 insertions(+)
diff --git a/include/sysemu/host_iommu_device.h
b/include/sysemu/host_iommu_device.h
index
.
Signed-off-by: Joao Martins
---
hw/vfio/migration.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
index 34d4be2ce1b1..cbfaef7afffe 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -1036,16 +1036,16 @@ bool
of type1 approach that we have
been using so far between container vs device dirty tracking.
Signed-off-by: Joao Martins
---
include/hw/vfio/vfio-common.h | 9
include/sysemu/iommufd.h | 5 +++
backends/iommufd.c| 30 +
hw/v
On 22/07/2024 18:15, Cédric Le Goater wrote:
> On 7/22/24 19:04, Cédric Le Goater wrote:
>> On 7/22/24 18:29, Joao Martins wrote:
>>> On 22/07/2024 16:58, Cédric Le Goater wrote:
>>>> On 7/22/24 17:42, Joao Martins wrote:
>>>>> On 22/07/2024 16:13, Cé
On 22/07/2024 18:04, Cédric Le Goater wrote:
> On 7/22/24 18:29, Joao Martins wrote:
>> On 22/07/2024 16:58, Cédric Le Goater wrote:
>>> On 7/22/24 17:42, Joao Martins wrote:
>>>> On 22/07/2024 16:13, Cédric Le Goater wrote:
>>>>> On 7/22/24 17:01, J
On 22/07/2024 16:58, Cédric Le Goater wrote:
> On 7/22/24 17:42, Joao Martins wrote:
>> On 22/07/2024 16:13, Cédric Le Goater wrote:
>>> On 7/22/24 17:01, Joao Martins wrote:
>>>> On 22/07/2024 15:53, Cédric Le Goater wrote:
>>>>> On 7/19/24 19:26, J
On 22/07/2024 16:46, Anthony Krowiak wrote:
>
> On 7/22/24 5:18 AM, Joao Martins wrote:
>> On 22/07/2024 08:07, Zhenzhong Duan wrote:
>>> mdevs aren't "physical" devices and when asking for backing IOMMU info,
>>> it fails the entire provisioning o
On 22/07/2024 16:13, Cédric Le Goater wrote:
> On 7/22/24 17:01, Joao Martins wrote:
>> On 22/07/2024 15:53, Cédric Le Goater wrote:
>>> On 7/19/24 19:26, Joao Martins wrote:
>>>> On 19/07/2024 15:24, Joao Martins wrote:
>>>>> On 19/07/2024 15:17, Cé
On 22/07/2024 15:57, Eric Farman wrote:
> On Mon, 2024-07-22 at 15:07 +0800, Zhenzhong Duan wrote:
>> mdevs aren't "physical" devices and when asking for backing IOMMU info,
>> it fails the entire provisioning of the guest. Fix that by setting
>> vbasedev->mdev true so skipping HostIOMMUDevice init
On 22/07/2024 15:53, Cédric Le Goater wrote:
> On 7/19/24 19:26, Joao Martins wrote:
>> On 19/07/2024 15:24, Joao Martins wrote:
>>> On 19/07/2024 15:17, Cédric Le Goater wrote:
>>>> On 7/19/24 14:05, Joao Martins wrote:
>>>>> By default VFIO migr
On 22/07/2024 15:09, Joao Martins wrote:
> On 22/07/2024 09:58, Joao Martins wrote:
>> On 22/07/2024 07:05, Duan, Zhenzhong wrote:
>>>
>>>
>>>> -----Original Message-
>>>> From: Joao Martins
>>>> Subject: [PATCH v5 09/13] vfio
On 22/07/2024 09:58, Joao Martins wrote:
> On 22/07/2024 07:05, Duan, Zhenzhong wrote:
>>
>>
>>> -Original Message-
>>> From: Joao Martins
>>> Subject: [PATCH v5 09/13] vfio/iommufd: Probe and request hwpt dirty
>>> tracking capability
presence of mdevs.
>
> Fixes: 930589520128 ("vfio/iommufd: Implement HostIOMMUDeviceClass::realize()
> handler")
> Signed-off-by: Zhenzhong Duan
Reviewed-by: Joao Martins
> ---
> hw/vfio/ap.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/hw/vfio/a
presence of mdevs.
>
> Fixes: 930589520128 ("vfio/iommufd: Implement HostIOMMUDeviceClass::realize()
> handler")
> Signed-off-by: Zhenzhong Duan
Reviewed-by: Joao Martins
> ---
> hw/vfio/ccw.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/hw/vfio/
On 22/07/2024 07:05, Duan, Zhenzhong wrote:
>
>
>> -Original Message-----
>> From: Joao Martins
>> Subject: [PATCH v5 09/13] vfio/iommufd: Probe and request hwpt dirty
>> tracking capability
>>
>> In preparation to using the dirty tracking UAPI,
On 22/07/2024 06:22, Duan, Zhenzhong wrote:
>
>
>> -Original Message-----
>> From: Joao Martins
>> Subject: [PATCH v5 06/13] vfio/{iommufd,container}: Remove caps::aw_bits
>>
>> Remove caps::aw_bits which requires the bcontainer::iova_ranges being
>
On 22/07/2024 06:16, Duan, Zhenzhong wrote:
>> -Original Message-
>> From: Joao Martins
>> Subject: [PATCH v5 05/13] vfio/iommufd: Introduce auto domain creation
>>
>> There's generally two modes of operation for IOMMUFD:
>>
>> 1) The simp
.
Signed-off-by: Joao Martins
---
Same patch as v5, but fixes builds that have CONFIG_IOMMUFD=n
Sending just this one as it doesn't justify sending the whole series
again.
---
hw/vfio/iommufd.c | 2 +-
hw/vfio/migration.c | 11 ++-
include/hw/vfio/vfio-common.h
On 19/07/2024 15:24, Joao Martins wrote:
> On 19/07/2024 15:17, Cédric Le Goater wrote:
>> On 7/19/24 14:05, Joao Martins wrote:
>>> By default VFIO migration is set to auto, which will support live
>>> migration if the migration capability is set *and* also dirty pag
On 19/07/2024 15:24, Joao Martins wrote:
> On 19/07/2024 15:17, Cédric Le Goater wrote:
>> On 7/19/24 14:05, Joao Martins wrote:
>>> By default VFIO migration is set to auto, which will support live
>>> migration if the migration capability is set *and* also dirty pag
On 19/07/2024 15:17, Cédric Le Goater wrote:
> On 7/19/24 14:05, Joao Martins wrote:
>> By default VFIO migration is set to auto, which will support live
>> migration if the migration capability is set *and* also dirty page
>> tracking is supported.
>>
>> For test
of type1 approach that we have
been using so far between container vs device dirty tracking.
Signed-off-by: Joao Martins
---
include/hw/vfio/vfio-common.h | 9
include/sysemu/iommufd.h | 5 +++
backends/iommufd.c| 30 +
hw/v
Hey Cedric,
On 19/07/2024 13:04, Joao Martins wrote:
> The unmap case is deferred until further vIOMMU support with migration
> is added[3] which will then introduce the usage of
> IOMMU_HWPT_GET_DIRTY_BITMAP_NO_CLEAR in GET_DIRTY_BITMAP ioctl in the
> dma unmap bitmap flow.
>
The helper will be able to fetch vendor agnostic IOMMU capabilities
supported both by hardware and software. Right now it is only iommu dirty
tracking.
Signed-off-by: Joao Martins
Reviewed-by: Zhenzhong Duan
Reviewed-by: Cédric Le Goater
---
include/sysemu/iommufd.h | 2 +-
backends/iommufd.c
0.16953-1-joao.m.mart...@oracle.com/
[6]
https://lore.kernel.org/qemu-devel/20240712114704.8708-1-joao.m.mart...@oracle.com/#t
Joao Martins (13):
vfio/pci: Extract mdev check into an helper
vfio/iommufd: Don't initialize nor set a HOST_IOMMU_DEVICE with mdev
backends/iommufd: Extend io
iner-based dirty page tracking. This also allows to
use IOMMU dirty tracking even on VFs with their own dirty
tracker scheme.
Signed-off-by: Joao Martins
---
include/hw/vfio/vfio-common.h | 1 +
hw/vfio/common.c | 3 +++
hw/vfio/migration.c | 3 ++-
hw/vfio/pci.c
In preparation to implement auto domains have the attach function
return the errno it got during domain attach instead of a bool.
-EINVAL is tracked to track domain incompatibilities, and decide whether
to create a new IOMMU domain.
Signed-off-by: Joao Martins
Reviewed-by: Cédric Le Goater
cides to use VF dirty tracking instead.
Signed-off-by: Joao Martins
---
include/hw/vfio/vfio-common.h | 1 +
hw/vfio/iommufd.c | 19 +++
2 files changed, 20 insertions(+)
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index 4e44b26d3c4
In preparation to skip initialization of the HostIOMMUDevice for mdev,
extract the checks that validate if a device is an mdev into helpers.
A vfio_device_is_mdev() is created, and subsystems consult VFIODevice::mdev
to check if it's mdev or not.
Signed-off-by: Joao Martins
---
include/hw
ong Duan
Fixes: 930589520128 ("vfio/iommufd: Implement HostIOMMUDeviceClass::realize()
handler")
Signed-off-by: Joao Martins
Reviewed-by: Eric Auger
Reviewed-by: Zhenzhong Duan
---
hw/vfio/common.c | 4
hw/vfio/pci.c| 11 ---
2 files changed, 12 insertions(+), 3 deletions
().
Suggested-by: Zhenzhong Duan
Signed-off-by: Joao Martins
Reviewed-by: Cédric Le Goater
#include
@@ -270,7 +271,7 @@ static int hiod_iommufd_get_cap(HostIOMMUDevice *hiod, int
cap, Error **errp)
case HOST_IOMMU_DEVICE_CAP_IOMMU_TYPE:
return caps->type;
c
.
Signed-off-by: Joao Martins
---
include/hw/vfio/vfio-common.h | 1 +
hw/vfio/iommufd.c | 2 +-
hw/vfio/migration.c | 11 ++-
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index
ioctl(iommufd, IOMMU_HWPT_GET_DIRTY_BITMAP, arg) is the UAPI
that fetches the bitmap that tells what was dirty in an IOVA
range.
A single bitmap is allocated and used across all the hwpts
sharing an IOAS which is then used in log_sync() to set Qemu
global bitmaps.
Signed-off-by: Joao Martins
means vfio_device_hiod_realize() is called in
different places within the backend .attach_device() implementation.
Suggested-by: Cédric Le Goater
Signed-off-by: Joao Martins
---
include/hw/vfio/vfio-common.h | 1 +
hw/vfio/common.c | 16 ++--
hw/vfio/contai
ioctl(iommufd, IOMMU_HWPT_SET_DIRTY_TRACKING, arg) is the UAPI that
enables or disables dirty page tracking. The ioctl is used if the hwpt
has been created with dirty tracking supported domain (stored in
hwpt::flags) and it is called on the whole list of iommu domains.
Signed-off-by: Joao Martins
during attach_device().
Signed-off-by: Joao Martins
---
include/sysemu/host_iommu_device.h | 4
hw/vfio/iommufd.c | 1 +
2 files changed, 5 insertions(+)
diff --git a/include/sysemu/host_iommu_device.h
b/include/sysemu/host_iommu_device.h
index cdeeccec7671..fd03ce766522
On 17/07/2024 10:31, Joao Martins wrote:
> On 17/07/2024 10:28, Cédric Le Goater wrote:
>>>>>>>> @@ -224,6 +300,11 @@ static void
>>>>> iommufd_cdev_detach_container(VFIODevice *vbasedev,
>>>>>>>> {
>>&
On 18/07/2024 08:44, Duan, Zhenzhong wrote:
> If existing hwpt doesn't support dirty tracking.
> Another device supporting dirty tracking attaches to that hwpt, what
>> will
happen?
>
Hmm, It succeeds as there's no incompatbility. At the very least I plan on
blocking
On 18/07/2024 08:20, Duan, Zhenzhong wrote:
>
>
>> -Original Message-----
>> From: Joao Martins
>> Subject: Re: [PATCH v4 11/12] vfio/migration: Don't block migration device
>> dirty tracking is unsupported
>>
>> On 17/07/2024 03:38, Duan, Zhen
On 17/07/2024 17:02, Joao Martins wrote:
> On 17/07/2024 16:35, Joao Martins wrote:
>> On 17/07/2024 10:20, Joao Martins wrote:
>>> On 17/07/2024 03:38, Duan, Zhenzhong wrote:
>>>>> diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
>>>>> index
On 17/07/2024 16:35, Joao Martins wrote:
> On 17/07/2024 10:20, Joao Martins wrote:
>> On 17/07/2024 03:38, Duan, Zhenzhong wrote:
>>>> diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
>>>> index 34d4be2ce1b1..ce3d1b6e9a25 100644
>>>> --- a/hw/vf
On 17/07/2024 10:20, Joao Martins wrote:
> On 17/07/2024 03:38, Duan, Zhenzhong wrote:
>>
>>
>>> -Original Message-
>>> From: Joao Martins
>>> Subject: [PATCH v4 11/12] vfio/migration: Don't block migration device dirty
>>> tracking
On 17/07/2024 14:41, Eric Auger wrote:
> On 7/17/24 14:33, Joao Martins wrote:
>> On 17/07/2024 13:19, Eric Auger wrote:
>>> Hi Joao,
>>>
>>> On 7/12/24 13:46, Joao Martins wrote:
>>>> Fetch IOMMU hw raw caps behind the device and thus move the
&g
On 17/07/2024 14:34, Eric Auger wrote:
> On 7/17/24 14:41, Joao Martins wrote:
>> On 17/07/2024 13:36, Eric Auger wrote:
>>> On 7/12/24 13:47, Joao Martins wrote:
>>>> The checking of hwpt::flags is introduced here as a second user
>>> ?? -> introduce iom
On 17/07/2024 13:36, Eric Auger wrote:
>
>
> On 7/12/24 13:47, Joao Martins wrote:
>> ioctl(iommufd, IOMMU_HWPT_SET_DIRTY_TRACKING, arg) is the UAPI that
>> enables or disables dirty page tracking. It is used if the hwpt
>> has been created with dirty tracking supporte
On 17/07/2024 13:27, Eric Auger wrote:
> Hi Joao,
>
> On 7/12/24 13:47, Joao Martins wrote:
>> Probe hardware dirty tracking support by querying device hw capabilities via
>> IOMMUFD_GET_HW_INFO.
> this is not what the patch brings. GET_HW_INFO is always in place.
Ye
On 17/07/2024 13:19, Eric Auger wrote:
> Hi Joao,
>
> On 7/12/24 13:46, Joao Martins wrote:
>> Fetch IOMMU hw raw caps behind the device and thus move the
> what does mean "Fetch IOMMU hw raw caps behind the device'"
Fetching the out_capabilities field from GET_
On 17/07/2024 11:05, Duan, Zhenzhong wrote:
>> -Original Message-
>> From: Joao Martins
>> Subject: Re: [PATCH v4 05/12] vfio/iommufd: Introduce auto domain
>> creation
>>
>> On 17/07/2024 03:18, Duan, Zhenzhong wrote:
>>>
>>>
&
On 17/07/2024 10:48, Duan, Zhenzhong wrote:
>
>
>> -Original Message-----
>> From: Joao Martins
>> Subject: Re: [PATCH v4 05/12] vfio/iommufd: Introduce auto domain
>> creation
>>
>> On 17/07/2024 03:52, Duan, Zhenzhong wrote:
>>>
>>
On 17/07/2024 03:38, Duan, Zhenzhong wrote:
>
>
>> -Original Message-----
>> From: Joao Martins
>> Subject: [PATCH v4 11/12] vfio/migration: Don't block migration device dirty
>> tracking is unsupported
>>
>> By default VFIO migration is set t
On 17/07/2024 10:28, Cédric Le Goater wrote:
>>> @@ -224,6 +300,11 @@ static void
iommufd_cdev_detach_container(VFIODevice *vbasedev,
>>> {
>>> Error *err = NULL;
>>>
>>> + if (vbasedev->hwpt) {
>>> + iommufd_cdev_autodomains_put(vbasedev, container);
On 17/07/2024 03:24, Duan, Zhenzhong wrote:
>
>
>> -Original Message-----
>> From: Joao Martins
>> Subject: [PATCH v4 09/12] vfio/iommufd: Implement
>> VFIOIOMMUClass::set_dirty_tracking support
>>
>> ioctl(iommufd, IOMMU_HWPT_SET_DIRTY_TRACKING, ar
On 17/07/2024 03:52, Duan, Zhenzhong wrote:
>
>
>> -Original Message-----
>> From: Joao Martins
>> Subject: Re: [PATCH v4 05/12] vfio/iommufd: Introduce auto domain
>> creation
>>
>> On 16/07/2024 17:44, Joao Martins wrote:
>>>
On 17/07/2024 03:18, Duan, Zhenzhong wrote:
>
>
>> -Original Message-----
>> From: Joao Martins
>> Subject: [PATCH v4 05/12] vfio/iommufd: Introduce auto domain creation
>>
>> There's generally two modes of operation for IOMMUFD:
>>
&g
On 17/07/2024 03:05, Duan, Zhenzhong wrote:
>
>
>> -Original Message-----
>> From: Joao Martins
>> Subject: [PATCH v4 07/12] vfio/{iommufd,container}: Initialize
>> HostIOMMUDeviceCaps during attach_device()
>>
>> Fetch IOMMU hw ra
On 16/07/2024 18:40, Eric Auger wrote:
> Hi Joao,
>
> On 7/12/24 13:46, Joao Martins wrote:
>> In preparation to moving HostIOMMUDevice realize() being able to called
>> early during attach_device(), remove properties that rely on container
>> being initialized.
>
On 16/07/2024 17:44, Joao Martins wrote:
> On 16/07/2024 17:04, Eric Auger wrote:
>> Hi Joao,
>>
>> On 7/12/24 13:46, Joao Martins wrote:
>>> There's generally two modes of operation for IOMMUFD:
>>>
>>> * The simple user API which intends to
On 16/07/2024 17:04, Eric Auger wrote:
> Hi Joao,
>
> On 7/12/24 13:46, Joao Martins wrote:
>> There's generally two modes of operation for IOMMUFD:
>>
>> * The simple user API which intends to perform relatively simple things
>> with IOMMUs e.g. DPDK. It g
On 16/07/2024 11:20, Cédric Le Goater wrote:
> On 7/12/24 13:46, Joao Martins wrote:
>> Fetch IOMMU hw raw caps behind the device and thus move the
>> HostIOMMUDevice::realize() to be done during the attach of the device. It
>> allows it to cache the information obtained f
On 16/07/2024 10:39, Cédric Le Goater wrote:
> On 7/12/24 13:46, Joao Martins wrote:
>> There's generally two modes of operation for IOMMUFD:
>>
>> * The simple user API which intends to perform relatively simple things
>> with IOMMUs e.g. DPDK. It generally cr
On 16/07/2024 10:21, Cédric Le Goater wrote:
> Hello Joao
>
> On 7/12/24 13:46, Joao Martins wrote:
>> In preparation to skip initialization of the HostIOMMUDevice for mdev,
>> extract the checks that validate if a device is an mdev into helpers.
>>
>> A vfio_set_
On 16/07/2024 09:20, Duan, Zhenzhong wrote:
>
>
>> -Original Message-----
>> From: Joao Martins
>> Subject: [PATCH v4 00/12] hw/iommufd: IOMMUFD Dirty Tracking
>>
>> This small series adds support for IOMMU dirty tracking support via the
>> I
rolls it back.
The checking of hwpt::flags is introduced here as a second user
and thus consolidate such check into a helper function
iommufd_hwpt_dirty_tracking().
Signed-off-by: Joao Martins
---
include/sysemu/iommufd.h | 3 +++
backends/iommufd.c | 23 +++
hw/vfio
purposes.
So starting with IOMMU dirty tracking it can use to acomodate the lack of
VF dirty page tracking allowing us to minimize the VF requirements for
migration and thus enabling migration by default for those too.
Signed-off-by: Joao Martins
---
hw/vfio/migration.c | 3 ++-
1 file changed
The helper will be able to fetch vendor agnostic IOMMU capabilities
supported both by hardware and software. Right now it is only iommu dirty
tracking.
Signed-off-by: Joao Martins
Reviewed-by: Zhenzhong Duan
---
include/sysemu/iommufd.h | 2 +-
backends/iommufd.c | 4 +++-
hw/vfio
ioctl(iommufd, IOMMU_HWPT_GET_DIRTY_BITMAP, arg) is the UAPI
that fetches the bitmap that tells what was dirty in an IOVA
range.
A single bitmap is allocated and used across all the hwpts
sharing an IOAS which is then used in log_sync() to set Qemu
global bitmaps.
Signed-off-by: Joao Martins
ach that we have
been using so far between container vs device dirty tracking.
Signed-off-by: Joao Martins
---
include/hw/vfio/vfio-common.h | 9
include/sysemu/iommufd.h | 5 +++
backends/iommufd.c| 30 +
hw/vfio/iommufd.c | 82 +++
In preparation to skip initialization of the HostIOMMUDevice for mdev,
extract the checks that validate if a device is an mdev into helpers.
A vfio_set_mdev() is created, and subsystems consult VFIODevice::mdev
to check if it's mdev or not.
Signed-off-by: Joao Martins
---
include/hw/vfio
fetch parse hw capabilities and understand if
dirty tracking is supported by device backing IOMMU without necessarily
duplicating the amount of calls we do to IOMMU_GET_HW_INFO.
Suggested-by: Cédric Le Goater
Signed-off-by: Joao Martins
---
include/sysemu/host_iommu_device.h | 1 +
hw/vfio/com
In preparation to implement auto domains have the attach function
return the errno it got during domain attach instead of a bool.
-EINVAL is tracked to track domain incompatibilities, and decide whether
to create a new IOMMU domain.
Signed-off-by: Joao Martins
---
hw/vfio/iommufd.c | 8
ong Duan
Fixes: 930589520128 ("vfio/iommufd: Implement HostIOMMUDeviceClass::realize()
handler")
Signed-off-by: Joao Martins
---
hw/vfio/common.c | 4
hw/vfio/pci.c| 10 +++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/hw/vfio/common.c b/hw/vfio/co
. Instead defer that to .get_cap() and call
vfio_device_get_aw_bits() directly.
Suggested-by: Zhenzhong Duan
Signed-off-by: Joao Martins
---
include/sysemu/host_iommu_device.h | 1 -
backends/iommufd.c | 3 ++-
hw/vfio/container.c| 5 +
hw/vfio/iommufd.c
iner-based dirty page tracking. This also allows to
use IOMMU dirty tracking even on VFs with their own dirty
tracker scheme.
Signed-off-by: Joao Martins
---
include/hw/vfio/vfio-common.h | 1 +
hw/vfio/common.c | 3 +++
hw/vfio/migration.c | 3 ++-
hw/vfio/pci.c
when DMA
dirty tracking is not desired (and VF can provide it) while others doesn't have
it and want the IOMMU capability. This is not used in this way here given how
VFIODevice migration capability checking takes place *after* the device
attachment.
Signed-off-by: Joao Martins
---
include/hw
/
[5]
https://lore.kernel.org/qemu-devel/20240708143420.16953-1-joao.m.mart...@oracle.com/
Joao Martins (12):
vfio/pci: Extract mdev check into an helper
vfio/iommufd: Don't initialize nor set a HOST_IOMMU_DEVICE with mdev
backends/iommufd: Extend iommufd_backend_get_device_info() to
On 11/07/2024 11:22, Duan, Zhenzhong wrote:
>
>
>> -Original Message-----
>> From: Joao Martins
>> Subject: Re: [PATCH v3 00/10] hw/vfio: IOMMUFD Dirty Tracking
>>
>> On 11/07/2024 08:41, Cédric Le Goater wrote:
>>> Hello Joao,
>>>
>
On 11/07/2024 08:41, Cédric Le Goater wrote:
> Hello Joao,
>
> On 7/8/24 4:34 PM, Joao Martins wrote:
>> This small series adds support for IOMMU dirty tracking support via the
>> IOMMUFD backend. The hardware capability is available on most recent x86
>> hardware. The
On 10/07/2024 11:38, Duan, Zhenzhong wrote:
>
>
>> -Original Message-----
>> From: Joao Martins
>> Subject: [PATCH v3 09/10] vfio/migration: Don't block migration device dirty
>> tracking is unsupported
>>
>> By default VFIO migration is set t
On 10/07/2024 11:42, Duan, Zhenzhong wrote:
>
>
>> -Original Message-----
>> From: Joao Martins
>> Subject: [PATCH v3 10/10] vfio/common: Allow disabling device dirty page
>> tracking
>>
>> The property 'x-pre-copy-dirty-page-tracking' a
On 10/07/2024 10:54, Duan, Zhenzhong wrote:
>
>
>> -Original Message-----
>> From: Joao Martins
>> Subject: Re: [PATCH v3 01/10] vfio/iommufd: Don't fail to realize on
>> IOMMU_GET_HW_INFO failure
>>
>> On 10/07/2024 03:53, Duan, Zhen
On 10/07/2024 03:53, Duan, Zhenzhong wrote:
>
>
>> -Original Message-----
>> From: Joao Martins
>> Subject: Re: [PATCH v3 01/10] vfio/iommufd: Don't fail to realize on
>> IOMMU_GET_HW_INFO failure
>>
>> On 09/07/2024 12:45, Joao Martins wro
On 09/07/2024 13:47, Joao Martins wrote:
> On 09/07/2024 10:04, Joao Martins wrote:
>> On 09/07/2024 07:28, Cédric Le Goater wrote:
>>> On 7/8/24 4:34 PM, Joao Martins wrote:
>>>> diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c
>>>> index 2ca9a32cc7
1 - 100 of 609 matches
Mail list logo