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: <20101015142310.GD16893@pengutronix.de>
Date:	Fri, 15 Oct 2010 16:23:10 +0200
From:	Uwe Kleine-König 
	<u.kleine-koenig@...gutronix.de>
To:	Felipe Contreras <felipe.contreras@...il.com>
Cc:	linux-main <linux-kernel@...r.kernel.org>,
	linux-arm <linux-arm-kernel@...ts.infradead.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Catalin Marinas <catalin.marinas@....com>,
	Russell King <linux@....linux.org.uk>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Richard Woodruff <r-woodruff2@...com>
Subject: Re: [PATCH .36-rc8] arm: mm: allow, but warn, when issuing
	ioremap() on RAM

On Fri, Oct 15, 2010 at 05:15:20PM +0300, Felipe Contreras wrote:
> From: Catalin Marinas <catalin.marinas@....com>
> 
> Drivers have been relying on this behavior, but done so wrongly.
> However, rather than breaking drivers from .35 to .36, we should warn on
> .36 and only break on .37. This way we give a chance for contributors to
> fix the issues.
> 
> According to ARM, the behavior of having multiple mappings is
> unspecified from ARMv6+. This causes real issues specially on modern
> hardware, and specially with speculative prefetching. So drivers need to
> be fixed.
> 
> Also, since current hardware has palliative meassures to deal with
> multiple mappings with the same memory type but diferent cacheability
> attributes, ensure that such restriction is taking place.
> 
> Cc: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
> Cc: Russell King <linux@....linux.org.uk>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: Richard Woodruff <r-woodruff2@...com>
> Signed-off-by: Catalin Marinas <catalin.marinas@....com>
> Signed-off-by: Felipe Contreras <felipe.contreras@...il.com>
> ---
>  arch/arm/mm/ioremap.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
> index ab50627..7dfd6dd 100644
> --- a/arch/arm/mm/ioremap.c
> +++ b/arch/arm/mm/ioremap.c
> @@ -202,10 +202,14 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
>  		return NULL;
>  
>  	/*
> -	 * Don't allow RAM to be mapped - this causes problems with ARMv6+
> +	 * This causes problems with ARMv6+. Will be disallowed soon.
s/soon/for 2.6.37/ ?

> +	 * Also avoid a second mapping with different shareability, which is
> +	 * not supposed to work anyway.
>  	 */
>  	if (WARN_ON(pfn_valid(pfn)))
> -		return NULL;
> +		if (__LINUX_ARM_ARCH__ >= 6 &&
> +		    (mtype != MT_DEVICE_CACHED && mtype != MT_DEVICE_WC))
> +			mtype = MT_DEVICE_WC;
>  
>  	type = get_mem_type(mtype);
>  	if (!type)
> -- 
> 1.7.3.1.2.g7fe2b
> 
> 

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
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