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:	Tue, 30 Nov 2010 15:10:51 +0900
From:	Paul Mundt <lethal@...ux-sh.org>
To:	Thomas Schlichter <thomas.schlichter@....de>
Cc:	Michal Januszewski <spock@...too.org>, linux-fbdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] uvesafb,vesafb: create write-combining or write-back PAT entries

On Sat, Nov 27, 2010 at 02:37:37PM +0100, Thomas Schlichter wrote:
> diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
> index 52ec095..5a34bc8 100644
> --- a/drivers/video/uvesafb.c
> +++ b/drivers/video/uvesafb.c
...

> -	info->screen_base = ioremap(info->fix.smem_start, info->fix.smem_len);
> +	uvesafb_init_mtrr(info);
> +
> +	switch (mtrr) {
> +	case 1: /* uncachable */
> +		info->screen_base = ioremap_nocache(info->fix.smem_start, info->fix.smem_len);
> +		break;
> +	case 2: /* write-back */
> +		info->screen_base = ioremap_cache(info->fix.smem_start, info->fix.smem_len);
> +		break;
> +	case 3: /* write-combining */
> +		info->screen_base = ioremap_wc(info->fix.smem_start, info->fix.smem_len);
> +		break;
> +	case 4: /* write-through */
> +	default:
> +		info->screen_base = ioremap(info->fix.smem_start, info->fix.smem_len);
> +		break;
> +	}
>  
>  	if (!info->screen_base) {
>  		printk(KERN_ERR

uvesafb presently has no special architecture dependencies, but
ioremap_wc() is not as of yet a wholly generic interface. Some
architectures that don't set ARCH_HAS_IOREMAP_WC get it by virtue of the
asm-generic/iomap.h include, and most of the nommu architectures will
stub it in via asm-generic/io.h, but this still leaves quite a long list
of platforms that don't handle it at all.

Your options at this point are either to establish ioremap_wc() as a
generic API, and layer this patch on top of that, or rework
uvesafb_init_mtrr() to do the actual broken-out remapping and rework it
in to something like a uvesafb_remap(), where you bury the MTRR details
under CONFIG_MTRR.

While there's probably value in exposing ioremap_wc() as a generic
interface, you're never going to hit any of the non-default ioremap()
calls on platforms lacking MTRRs anyways, so special-casing it is ok.
--
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