lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6065d82b-0a07-4f82-8b4e-9c00374d2f71@arm.com>
Date: Thu, 14 Aug 2025 16:28:17 +0100
From: Robin Murphy <robin.murphy@....com>
To: eric.auger@...hat.com, eric.auger.pro@...il.com, rafael@...nel.org,
 bhelgaas@...gle.com, jgg@...pe.ca, lpieralisi@...nel.org,
 linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org, lenb@...nel.org,
 jean-philippe@...aro.org, jsnitsel@...hat.com
Subject: Re: [RFC] iommu: Fix virtio-iommu probing

On 14/08/2025 4:19 pm, Eric Auger wrote:
> Hi Robin
> 
> On 8/14/25 4:53 PM, Robin Murphy wrote:
>> On 14/08/2025 3:17 pm, Eric Auger wrote:
>>> Commit bcb81ac6ae3c ("iommu: Get DT/ACPI parsing into the proper
>>> probe path") broke virtio-iommu probing and no iommu group are
>>> produced anymore.
>>>
>>> When probe_iommu_group() gets called viommu_probe_device() fails
>>> because viommu_get_by_fwnode(fwspec->iommu_fwnode) returns NULL.
>>
>> ...which it's not supposed to. And *now* I remember, we never got this
>> finished, did we?
> Seems we did not ;-)
>>
>> https://lore.kernel.org/linux-iommu/9beaed48da83a0882dba153e65e6cfd0a8e21482.1742484773.git.robin.murphy@arm.com/
>>
> 
> Unfortunately it does not fix my issue. Still no iommu group when
> booting with ACPI.

Indeed the evidence at the time suggested the patch isn't quite right 
as-is, but that is definitely the place which needs fixing. Since 
Jean-Philippe's occupied with more exciting things at the moment, do you 
happen to have an easy recipe for testing virtio-iommu so I can try 
debugging it myself?

Cheers,
Robin.

> 
> Thanks
> 
> Eric
>>
>> Thanks,
>> Robin.
>>
>>> So it seems we need to restore the original iommu_probe_device
>>> call site in acpi_iommu_configure_id() to get a chance to probe
>>> the device again.
>>>
>>> Maybe this defeats the whole purpose of the original commit but
>>> at least it fixes the virtio-iommu probing.
>>>
>>> Fixes: bcb81ac6ae3c ("iommu: Get DT/ACPI parsing into the proper
>>> probe path")
>>> Cc: stable@...r.kernel.org # v6.15+
>>> Signed-off-by: Eric Auger <eric.auger@...hat.com>
>>>
>>> ---
>>>
>>> I also tested smmu probing and this seems to work fine.
>>> ---
>>>    drivers/acpi/scan.c | 7 +++++++
>>>    1 file changed, 7 insertions(+)
>>>
>>> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
>>> index fb1fe9f3b1a3..9f4efa8f75a6 100644
>>> --- a/drivers/acpi/scan.c
>>> +++ b/drivers/acpi/scan.c
>>> @@ -1632,6 +1632,13 @@ static int acpi_iommu_configure_id(struct
>>> device *dev, const u32 *id_in)
>>>            err = viot_iommu_configure(dev);
>>>        mutex_unlock(&iommu_probe_device_lock);
>>>    +    /*
>>> +     * If we have reason to believe the IOMMU driver missed the initial
>>> +     * iommu_probe_device() call for dev, replay it to get things in
>>> order.
>>> +     */
>>> +    if (!err && dev->bus)
>>> +        err = iommu_probe_device(dev);
>>> +
>>>        return err;
>>>    }
>>>    
>>
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ