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: <20130201135456.GG25591@8bytes.org>
Date:	Fri, 1 Feb 2013 14:54:57 +0100
From:	Joerg Roedel <joro@...tes.org>
To:	Hideki EIRAKU <hdk@...l.co.jp>
Cc:	Paul Mundt <lethal@...ux-sh.org>,
	Magnus Damm <magnus.damm@...il.com>,
	Russell King <linux@....linux.org.uk>,
	Simon Horman <horms@...ge.net.au>,
	Laurent Pinchart <laurent.pinchart@...asonboard.com>,
	Katsuya MATSUBARA <matsu@...l.co.jp>, linux-sh@...r.kernel.org,
	linux-kernel@...r.kernel.org, iommu@...ts.linux-foundation.org,
	Damian Hobson-Garcia <dhobsong@...l.co.jp>,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v6 1/4] iommu/shmobile: Add iommu driver for Renesas
 IPMMU modules

On Mon, Jan 21, 2013 at 07:54:26PM +0900, Hideki EIRAKU wrote:
> This is the Renesas IPMMU driver and IOMMU API implementation.
> 
> The IPMMU module supports the MMU function and the PMB function.  The
> MMU function provides address translation by pagetable compatible with
> ARMv6.  The PMB function provides address translation including
> tile-linear translation.  This patch implements the MMU function.
> 
> The iommu driver does not register a platform driver directly because:
> - the register space of the MMU function and the PMB function
>   have a common register (used for settings flush), so they should ideally
>   have a way to appropriately share this register.
> - the MMU function uses the IOMMU API while the PMB function does not.
> - the two functions may be used independently.
> 
> Signed-off-by: Hideki EIRAKU <hdk@...l.co.jp>

The patch looks good in general. Just one question inline.

> +static int pgtable_alloc(struct shmobile_iommu_domain_pgtable *pgtable,
> +			 struct kmem_cache *cache, size_t size)
> +{
> +	pgtable->pgtable = kmem_cache_zalloc(cache, GFP_ATOMIC);
> +	if (!pgtable->pgtable)
> +		return -ENOMEM;
> +	pgtable->handle = dma_map_single(NULL, pgtable->pgtable, size,
> +					 DMA_TO_DEVICE);
> +	return 0;
> +}

Why is it necessary to call dma_map_single() for IOMMU page-tables?
usually the dma_* functions call into IOMMU drivers, so why are they
used inside an IOMMU driver?

Regards,

	Joerg


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ