1
1
2
> -----Original Message-----
2
> -----Original Message-----
3
> From: Jason Gunthorpe <jgg@nvidia.com>
3
> From: Jason Gunthorpe <jgg@nvidia.com>
4
> Sent: Thursday, February 6, 2025 5:47 PM
4
> Sent: Thursday, February 6, 2025 5:59 PM
5
> To: Daniel P. Berrangé <berrange@redhat.com>
5
> To: Daniel P. Berrangé <berrange@redhat.com>
6
> Cc: Shameerali Kolothum Thodi
6
> Cc: Shameerali Kolothum Thodi
7
> <shameerali.kolothum.thodi@huawei.com>; qemu-arm@nongnu.org;
7
> <shameerali.kolothum.thodi@huawei.com>; qemu-arm@nongnu.org;
8
> qemu-devel@nongnu.org; eric.auger@redhat.com;
8
> qemu-devel@nongnu.org; eric.auger@redhat.com;
9
> peter.maydell@linaro.org; nicolinc@nvidia.com; ddutile@redhat.com;
9
> peter.maydell@linaro.org; nicolinc@nvidia.com; ddutile@redhat.com;
...
...
12
> Jonathan Cameron <jonathan.cameron@huawei.com>;
12
> Jonathan Cameron <jonathan.cameron@huawei.com>;
13
> zhangfei.gao@linaro.org; nathanc@nvidia.com
13
> zhangfei.gao@linaro.org; nathanc@nvidia.com
14
> Subject: Re: [RFC PATCH 0/5] hw/arm/virt: Add support for user-creatable
14
> Subject: Re: [RFC PATCH 0/5] hw/arm/virt: Add support for user-creatable
15
> nested SMMUv3
15
> nested SMMUv3
16
>
16
>
17
> On Thu, Feb 06, 2025 at 05:10:32PM +0000, Daniel P. Berrangé wrote:
17
> On Thu, Feb 06, 2025 at 05:54:57PM +0000, Daniel P. Berrangé wrote:
18
> > On Thu, Feb 06, 2025 at 01:02:38PM -0400, Jason Gunthorpe wrote:
18
> > > > We shouldn't assume any VFIO device exists in the QEMU cnofig at the
19
> > > On Thu, Feb 06, 2025 at 03:07:06PM +0000, Shameerali Kolothum Thodi
19
> time
20
> wrote:
20
> > > > we realize the virtual ssmu. I expect the SMMU may be cold plugged,
21
> > > > > If we set the physical/guest SMMU relationship directly, then at the
21
> while
22
> > > > > time the VFIO device is plugged, we can diagnose the incorrectly
22
> > > > the VFIO devices may be hot plugged arbitrarly later, and we should
23
> > > > > placed VFIO device, and better reason about behaviour.
23
> have
24
> > > >
24
> > > > the association initialized the SMMU is realized.
25
> > > > Agree.
26
> > >
25
> > >
27
> > > Can you just take in a VFIO cdev FD reference on this command line:
26
> > > This is not supported kernel side, you can't instantiate a vIOMMU
28
> > >
27
> > > without a VFIO device that uses it. For security.
29
> > > -device arm-smmuv3-accel,id=smmuv2,bus=pcie.2
30
> > >
31
> > > And that will lock the pSMMU/vSMMU relationship?
32
> >
28
> >
33
> > We shouldn't assume any VFIO device exists in the QEMU cnofig at the
29
> > What are the security concerns here ?
34
> time
35
> > we realize the virtual ssmu. I expect the SMMU may be cold plugged,
36
> while
37
> > the VFIO devices may be hot plugged arbitrarly later, and we should have
38
> > the association initialized the SMMU is realized.
39
>
30
>
40
> This is not supported kernel side, you can't instantiate a vIOMMU
31
> You should not be able to open iommufd and manipulate iommu HW that
41
> without a VFIO device that uses it. For security.
32
> you don't have a VFIO descriptor for, including creating physical
33
> vIOMMU resources, allocating command queues and whatever else.
34
>
35
> Some kind of hot plug smmu would have to create a vSMMU without any
36
> kernel backing and then later bind it to a kernel implementation.
42
37
43
I think that is fine if Qemu knows about association beforehand. During
38
Not sure I get the problem with associating vSMMU with a pSMMU. Something
44
vIOMMU instantiation it can cross check whether the user specified
39
like an iommu instance id mentioned before,
45
pSMMU <->vSMMU is correct for the device.
46
40
47
Also how do we do it with multiple VF devices under a pSUMMU ? Which
41
-device arm-smmuv3-accel,id=smmuv2,bus=pcie.2,host-smmu=iommu.1
48
cdev fd in that case?
42
43
This can realize the vSMMU without actually creating a vIOMMU in kernel.
44
And when the dev gets attached/realized, check (GET_HW_INFO)the specified
45
iommu instance id matches or not.
46
47
Or the concern here is exporting an iommu instance id to user space?
49
48
50
Thanks,
49
Thanks,
51
Shameer
50
Shameer
51
diff view generated by jsdifflib