public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Lu Baolu <baolu.lu@linux.intel.com>,
	Robin Murphy <robin.murphy@arm.com>,
	 Intel-gfx@lists.freedesktop.org
Cc: Lucas De Marchi <lucas.demarchi@intel.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Use per device iommu check
Date: Fri, 26 Nov 2021 14:00:37 +0000	[thread overview]
Message-ID: <deee7289-17ab-436a-ad58-98a588926b7e@linux.intel.com> (raw)
In-Reply-To: <aedb0861-f6d6-0568-f7cb-2afc0f9ceb01@linux.intel.com>


On 26/11/2021 08:26, Lu Baolu wrote:
> On 2021/11/25 19:47, Robin Murphy wrote:
>> On 2021-11-25 10:42, Tvrtko Ursulin wrote:
>>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>>
>>> With both integrated and discrete Intel GPUs in a system, the current
>>> global check of intel_iommu_gfx_mapped, as done from intel_vtd_active()
>>> may not be completely accurate.
>>>
>>> In this patch we add i915 parameter to intel_vtd_active() in order to
>>> prepare it for multiple GPUs and we also change the check away from 
>>> Intel
>>> specific intel_iommu_gfx_mapped (global exported by the Intel IOMMU
>>> driver) to probing the presence of IOMMU domain on a specific device
>>> using iommu_get_domain_for_dev().
>>
>> FWIW the way you have it now is functionally equivalent to using 
>> device_iommu_mapped(), which I think might be slightly clearer for the 
>> current intent, but I don't have a significantly strong preference 
>> (after all, this *was* the de-facto way of checking before 
>> device_iommu_mapped() was introduced, and there are still other 
>> examples of it around). So from the IOMMU perspective,
>>
>> Acked-by: Robin Murphy <robin.murphy@arm.com>
>>
>> Perhaps the AGP driver could also be tweaked and 
>> intel_iommu_gfx_mapped cleaned away entirely, but I'll leave that for 
>> Baolu to think about :)
> 
> I fully agreed with Robin.
> 
> I prefer device_iommu_mapped() more than iommu_get_domain_for_dev().
> 
> "iommu_get_domain_for_dev(dev) == NULL" simply means that the device
> does not have any domain attached. Although at present, it is equivalent
> to device DMAing without IOMMU translation. But I'm sure it will change
> in the future.
> 
> With device_iommu_mapped() replaced,
> 
> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>

I have empirically established device_iommu_mapped() matches 1:1 with 
intel_iommu_gfx_mapped and a simple non-NULL check against 
iommu_get_domain_for_dev(), so okay, I will respin with that change.

We leave the problem of being able to distinguish between pass-through 
and address translation from the drivers for later. Thanks both!

Regards,

Tvrtko

  reply	other threads:[~2021-11-26 14:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-25 10:42 [Intel-gfx] [PATCH] drm/i915: Use per device iommu check Tvrtko Ursulin
2021-11-25 11:47 ` Robin Murphy
2021-11-26  8:26   ` Lu Baolu
2021-11-26 14:00     ` Tvrtko Ursulin [this message]
2021-11-25 11:57 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: Use per device iommu check (rev3) Patchwork
2021-11-25 12:26 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-11-25 14:23 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2021-11-09 12:17 [Intel-gfx] [PATCH] drm/i915: Use per device iommu check Tvrtko Ursulin
2021-11-09 17:19 ` Lucas De Marchi
2021-11-09 17:35   ` Tvrtko Ursulin
2021-11-10  7:25     ` Lu Baolu
2021-11-10  9:35       ` Tvrtko Ursulin
2021-11-10 12:16         ` Robin Murphy
2021-11-10 12:26         ` Lu Baolu
2021-11-10  7:12 ` Lu Baolu
2021-11-10  9:30   ` Tvrtko Ursulin
2021-11-10 12:04     ` Lu Baolu
2021-11-10 12:08       ` Tvrtko Ursulin
2021-11-10 12:35         ` Lu Baolu
2021-11-10 14:11           ` Tvrtko Ursulin
2021-11-10 14:37             ` Robin Murphy
2021-11-11 15:18               ` Tvrtko Ursulin
2021-11-12  0:58                 ` Lu Baolu
2021-11-12 14:10                   ` Tvrtko Ursulin
2021-11-11 15:06           ` Tvrtko Ursulin
2021-11-12  0:53             ` Lu Baolu
2021-11-12 13:40               ` Tvrtko Ursulin
2021-11-25 10:00                 ` Tvrtko Ursulin

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=deee7289-17ab-436a-ad58-98a588926b7e@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=baolu.lu@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --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