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]
Date:	Mon, 11 Oct 2010 13:39:13 +0300
From:	Felipe Contreras <felipe.contreras@...il.com>
To:	Catalin Marinas <catalin.marinas@....com>
Cc:	Nicolas Pitre <nico@...xnic.net>,
	Russell King - ARM Linux <linux@....linux.org.uk>,
	Arnd Hannemann <arnd@...dnet.de>,
	Hemant Pedanekar <hemantp@...com>, Greg KH <greg@...ah.com>,
	linux-main <linux-kernel@...r.kernel.org>,
	Uwe Kleine-König 
	<u.kleine-koenig@...gutronix.de>,
	Han Jonghun <jonghun79.han@...il.com>,
	linux-arm <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH] ARM: allow, but warn, when issuing ioremap() on RAM

On Mon, Oct 11, 2010 at 1:05 PM, Catalin Marinas
<catalin.marinas@....com> wrote:
> We could be a bit more flexible as a temporary solution. But that's a
> hack and doesn't guarantee the attributes that the driver requested. If
> the driver would use writel/readl, that's not too bad since we pushed
> explicit barriers in these macros.
>
> It would need to be improved to invalidate the corresponding cache lines
> (using the DMA API?) but it would look even worse.
>
>
> diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
> index 6bdf42c..082bbd0 100644
> --- a/arch/arm/mm/ioremap.c
> +++ b/arch/arm/mm/ioremap.c
> @@ -204,10 +204,13 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
>  #endif
>
>        /*
> -        * Don't allow RAM to be mapped - this causes problems with ARMv6+
> +        * Don't allow RAM to be mapped as Device memory - this causes
> +        * problems with ARMv6+
>         */
>        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)

I will try that, but from what I can see this might still break some
drivers, right? I still think just having the warning for now should
be enough.

Anyway, I'm reading the TRM and I can't find any mention of this.
Catalin, can you point out where is this mentioned, and also, can you
confirm if this would affect only the memory that has the double
mapping, or it can corrupt other memory as well?

Cheers.

-- 
Felipe Contreras
--
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