mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Auger <eric.auger@redhat.com>
To: Robin Murphy <robin.murphy@arm.com>,
	eric.auger.pro@gmail.com, rafael@kernel.org, bhelgaas@google.com,
	jgg@ziepe.ca, lpieralisi@kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, lenb@kernel.org,
	jean-philippe@linaro.org, jsnitsel@redhat.com
Subject: Re: [RFC] iommu: Fix virtio-iommu probing
Date: Thu, 14 Aug 2025 17:34:43 +0200	[thread overview]
Message-ID: <e9212299-d66c-4779-93f9-3bb5833e5c07@redhat.com> (raw)
In-Reply-To: <6065d82b-0a07-4f82-8b4e-9c00374d2f71@arm.com>



On 8/14/25 5:28 PM, Robin Murphy wrote:
> 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?
No easy recipe. on my end I am using qemu/kvm with a rhel guest and
custom kernel. I guess it was integrated in kvmtool, wasn't it? I am
just testing with protected virtio devices.

Thanks

Eric
>
> 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@vger.kernel.org # v6.15+
>>>> Signed-off-by: Eric Auger <eric.auger@redhat.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;
>>>>    }
>>>>    
>>>
>>
>


      reply	other threads:[~2025-08-14 15:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-14 14:17 Eric Auger
2025-08-14 14:53 ` Robin Murphy
2025-08-14 15:19   ` Eric Auger
2025-08-14 15:28     ` Robin Murphy
2025-08-14 15:34       ` Eric Auger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e9212299-d66c-4779-93f9-3bb5833e5c07@redhat.com \
    --to=eric.auger@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=eric.auger.pro@gmail.com \
    --cc=jean-philippe@linaro.org \
    --cc=jgg@ziepe.ca \
    --cc=jsnitsel@redhat.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=rafael@kernel.org \
    --cc=robin.murphy@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®