Re: [RFC 1/5] ARM: dev_archdata: add private iommu extension

2 messages, 2 authors, 2011-10-02 · open the first message on its own page

Re: [RFC 1/5] ARM: dev_archdata: add private iommu extension

From: Grant Likely <hidden>
Date: 2011-09-27 01:30:07

On Sun, Sep 25, 2011 at 01:58:53PM +0300, Ohad Ben-Cohen wrote:
quoted hunk
Add a private iommu pointer to the ARM-specific arch data in the
device struct, which will be used to attach iommu-specific data
to devices which require iommu support.

Different iommu implementations (on different platforms) will attach
different types of data to this pointer, so 'void *' is currently used
(the downside is reduced typesafety).

Note: ia64, x86 and sparc have this exact iommu extension as well, and
if others are likely to adopt it too, we might want to consider
adding this to the device struct itself directly.

Signed-off-by: Ohad Ben-Cohen <redacted>
Cc: Russell King <redacted>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Grant Likely <redacted>
---
 arch/arm/include/asm/device.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/device.h b/arch/arm/include/asm/device.h
index 9f390ce..6615f03 100644
--- a/arch/arm/include/asm/device.h
+++ b/arch/arm/include/asm/device.h
@@ -10,6 +10,9 @@ struct dev_archdata {
 #ifdef CONFIG_DMABOUNCE
 	struct dmabounce_device_info *dmabounce;
 #endif
+#ifdef CONFIG_IOMMU_API
+	void *iommu; /* private IOMMU data */
+#endif
Blech.  Oh well.  Not much point in doing something different if x86
uses a void*.

g.

Re: [RFC 1/5] ARM: dev_archdata: add private iommu extension

From: Ohad Ben-Cohen <hidden>
Date: 2011-10-02 18:49:08

On Tue, Sep 27, 2011 at 4:30 AM, Grant Likely [off-list ref] wrote:
Blech. ?Oh well. ?Not much point in doing something different if x86
uses a void*.
x86 probably does this because two different implementations needs to
plug their private data there: intel-iommu plugs there a 'struct
device_domain_info *' and amd_iommu uses it with a 'struct
iommu_dev_data *'.

On ARM we'd eventually end up with even a bigger variety, and I guess
that even if we'd use a type-safe member here, it would itself end up
having 'void *'.

If it looks reasonable to you, can I please have your Ack ?

Russell, can you please take a look too and ack/nack ?

Thanks,
Ohad.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help