>-----Original Message-----
>From: Nicolin Chen <nicol...@nvidia.com>
>Subject: Re: [PATCH rfcv3 15/21] intel_iommu: Bind/unbind guest page table to
...
>> yes based on the current design. when guest GPTT==PT, attach device
>> to S2 hwpt, when it goes to S1, then attach it to a S1 hwpt whose
>> parent is the aforementioned S2 hwpt. This S2 hwpt is always there
>> for use.
>
>ARM is doing the same thing. And the exact point "this S2 hwpt is
>always there for use" has been telling me that the device can just
>stay at the S2 address space (system), since the guest kernel will
>take care of the S1 address space (iommu).
>
>Overall, the questions here have been two-fold:
>
>1.Why does VT-d need an internal listener?
>
> I can see the (only) reason is for the RO mappings.
It's not the only reason. Another reason is we want to support the
case that VFIO device and emulated device under same group,
e.g., they are under a PCIe-to-PCI bridge.
In fact, .get_address_space() returns the AS for the group rather
than device, see pci_device_get_iommu_bus_devfn().
>
> Yet, Is there anything that we can do to the VFIO listener to
> bypass these RO mappings?
>
>2.Why not return the system AS all the time when nesting is on?
> Why switch to the iommu AS when device attaches to S1 HWPT?
The emulated device wants the iommu AS and VFIO device wants
System AS, just curious how you handle this case in your series?
Thanks
Zhenzhong