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] [day] [month] [year] [list]
Message-ID: <1434749332.11808.113.camel@misato.fc.hp.com>
Date:	Fri, 19 Jun 2015 15:28:52 -0600
From:	Toshi Kani <toshi.kani@...com>
To:	Dan Williams <dan.j.williams@...el.com>
Cc:	arnd@...db.de, mingo@...hat.com, bp@...en8.de, hpa@...or.com,
	tglx@...utronix.de, ross.zwisler@...ux.intel.com,
	akpm@...ux-foundation.org, jgross@...e.com, x86@...nel.org,
	konrad.wilk@...cle.com, benh@...nel.crashing.org, mcgrof@...e.com,
	linux-nvdimm@...ts.01.org, linux-kernel@...r.kernel.org,
	stefan.bader@...onical.com, luto@...capital.net,
	linux-mm@...ck.org, Andy Shevchenko <andy.shevchenko@...il.com>,
	geert@...ux-m68k.org, ralf@...ux-mips.org, hmh@....eng.br,
	mpe@...erman.id.au, tj@...nel.org, paulus@...ba.org, hch@....de
Subject: Re: [PATCH v4 5/6] arch: introduce memremap_cache() and
 memremap_wt()

On Thu, 2015-06-11 at 17:19 -0400, Dan Williams wrote:
> Existing users of ioremap_cache() are mapping memory that is known in
> advance to not have i/o side effects.  These users are forced to cast
> away the __iomem annotation, or otherwise neglect to fix the sparse
> errors thrown when dereferencing pointers to this memory.  Provide
> memremap_*() as a non __iomem annotated ioremap_*().
> 
> The ARCH_HAS_MEMREMAP kconfig symbol is introduced for archs to assert
> that it is safe to recast / reuse the return value from ioremap as a
> normal pointer to memory.  In other words, archs that mandate specific
> accessors for __iomem are not memremap() capable and drivers that care,
> like pmem, can add a dependency to disable themselves on these archs.
  : 
> +#ifdef CONFIG_ARCH_HAS_MEMREMAP
> +/*
> + * memremap() is "ioremap" for cases where it is known that the resource
> + * being mapped does not have i/o side effects and the __iomem
> + * annotation is not applicable.
> + */
> +static bool memremap_valid(resource_size_t offset, size_t size)
> +{
> +	if (region_is_ram(offset, size) != 0) {

I noticed that region_is_ram() is buggy and always returns -1.  I will
submit the fix shortly.

Thanks,
-Toshi


> +		WARN_ONCE(1, "memremap attempted on ram %pa size: %zu\n",
> +				&offset, size);
> +		return false;
> +	}
> +	return true;
> +}



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ