Re: [PATCH iommufd 4/9] iommufd: Convert to msi_device_has_secure_msi()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 09 2022 at 13:38, Jason Gunthorpe wrote:
> On Fri, Dec 09, 2022 at 04:44:06PM +0000, Robin Murphy wrote:
>
>> Isn't the problem with this that it's super-early, and a device's MSI domain
>> may not actually be resolved until someone starts requesting MSIs for it?
>> Maybe Thomas' ongoing per-device stuff changes that, but I'm not
>> sure :/
>
> Yes, this looks correct, OK, so I will do Kevin's thought

The device MSI domain has to be valid before a device can be probed, at
least that's the case for PCI/MSI devices. The pointer is established
during PCI discovery.

The per device MSI domains do not change that requirement. The only
difference is that device->msi.domain now points to the MSI parent
domain.

In the "global" PCI/MSI domain case the hierarchy walk will (on x86)
start at the PCI/MSI domain and end up either at the remapping unit,
which has the protection property, or at the vector (root) domain, which
does not.

For the per device domain case the walk will start at the parent domain,
which is (on x86) either the remapping unit or the vector (root) domain.

The same is true for ARM(64) and other hierarchy users, just the naming
conventions and possible scenarios are different.

So for both scenarios (global and per-device) searching for that
protection property down the hierarchy starting from device->msi.domain
is correct.

Obvioulsy unless it's done somewhere early in the PCI discovery,
i.e. before the discovery associated the domain pointer.

Thanks,

        tglx



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux