From: Jonathan Cameron <Jonathan.Cameron-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
linuxarm-hv44wF8Li93QT0dZR+AlfA@public.gmane.org
Subject: Preferred method to detect if a device is behind an enabled iommu.
Date: Thu, 1 Feb 2018 10:18:21 +0000 [thread overview]
Message-ID: <20180201101821.00006a16@huawei.com> (raw)
Hi All,
We have a crypto accelerator which needs to have a few different settings
depending on whether or not the SMMUv3 is enabled and translating addresses
or not.
https://marc.info/?l=linux-crypto-vger&m=151732626428206&w=2
1) A quirk of the hardware revision means we need to turn some elements
off if the iommu is enabled.
2) The device has certain cache related settings that means it needs to know
if it is dealing with VAs or PAs.
Current approach is to see if the iommu_group is set in struct device.
We could fine one instance of another driver doing this and copied that,
(drivers/dma/rcar-dmac.c)
but the precedence is weak enough that confirmation would be good.
So whilst it 'works' the question is whether it is safe in general
and whether there is a better way.
Thanks,
--
Jonathan Cameron
Huawei
next reply other threads:[~2018-02-01 10:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-01 10:18 Jonathan Cameron [this message]
[not found] ` <20180201101821.00006a16-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-02-01 12:49 ` Preferred method to detect if a device is behind an enabled iommu Robin Murphy
[not found] ` <433fcde8-bcd6-9ab0-ffc5-baf0a6634379-5wv7dgnIgG8@public.gmane.org>
2018-02-01 13:25 ` Jonathan Cameron
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=20180201101821.00006a16@huawei.com \
--to=jonathan.cameron-hv44wf8li93qt0dzr+alfa@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=linuxarm-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.