<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/include/linux/highmem.h, branch linux-2.6.36.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.36.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.36.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2010-08-10T03:44:58Z</updated>
<entry>
<title>gcc-4.6: mm: fix unused but set warnings</title>
<updated>2010-08-10T03:44:58Z</updated>
<author>
<name>Andi Kleen</name>
</author>
<published>2010-08-10T00:19:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4e60c86bd9e5a7110ed28874d0b6592186550ae8'/>
<id>urn:sha1:4e60c86bd9e5a7110ed28874d0b6592186550ae8</id>
<content type='text'>
No real bugs, just some dead code and some fixups.

Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>kmap_atomic: make kunmap_atomic() harder to misuse</title>
<updated>2010-08-10T03:44:54Z</updated>
<author>
<name>Cesar Eduardo Barros</name>
</author>
<published>2010-08-10T00:18:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=597781f3e51f48ef8e67be772196d9e9673752c4'/>
<id>urn:sha1:597781f3e51f48ef8e67be772196d9e9673752c4</id>
<content type='text'>
kunmap_atomic() is currently at level -4 on Rusty's "Hard To Misuse"
list[1] ("Follow common convention and you'll get it wrong"), except in
some architectures when CONFIG_DEBUG_HIGHMEM is set[2][3].

kunmap() takes a pointer to a struct page; kunmap_atomic(), however, takes
takes a pointer to within the page itself.  This seems to once in a while
trip people up (the convention they are following is the one from
kunmap()).

Make it much harder to misuse, by moving it to level 9 on Rusty's list[4]
("The compiler/linker won't let you get it wrong").  This is done by
refusing to build if the type of its first argument is a pointer to a
struct page.

The real kunmap_atomic() is renamed to kunmap_atomic_notypecheck()
(which is what you would call in case for some strange reason calling it
with a pointer to a struct page is not incorrect in your code).

The previous version of this patch was compile tested on x86-64.

[1] http://ozlabs.org/~rusty/index.cgi/tech/2008-04-01.html
[2] In these cases, it is at level 5, "Do it right or it will always
    break at runtime."
[3] At least mips and powerpc look very similar, and sparc also seems to
    share a common ancestor with both; there seems to be quite some
    degree of copy-and-paste coding here. The include/asm/highmem.h file
    for these three archs mention x86 CPUs at its top.
[4] http://ozlabs.org/~rusty/index.cgi/tech/2008-03-30.html
[5] As an aside, could someone tell me why mn10300 uses unsigned long as
    the first parameter of kunmap_atomic() instead of void *?

Signed-off-by: Cesar Eduardo Barros &lt;cesarb@cesarb.net&gt;
Cc: Russell King &lt;linux@arm.linux.org.uk&gt; (arch/arm)
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt; (arch/mips)
Cc: David Howells &lt;dhowells@redhat.com&gt; (arch/frv, arch/mn10300)
Cc: Koichi Yasutake &lt;yasutake.koichi@jp.panasonic.com&gt; (arch/mn10300)
Cc: Kyle McMartin &lt;kyle@mcmartin.ca&gt; (arch/parisc)
Cc: Helge Deller &lt;deller@gmx.de&gt; (arch/parisc)
Cc: "James E.J. Bottomley" &lt;jejb@parisc-linux.org&gt; (arch/parisc)
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt; (arch/powerpc)
Cc: Paul Mackerras &lt;paulus@samba.org&gt; (arch/powerpc)
Cc: "David S. Miller" &lt;davem@davemloft.net&gt; (arch/sparc)
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt; (arch/x86)
Cc: Ingo Molnar &lt;mingo@redhat.com&gt; (arch/x86)
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt; (arch/x86)
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt; (include/asm-generic)
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt; ("Hard To Misuse" list)
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>highmem: remove unneeded #ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT for debug_kmap_atomic()</title>
<updated>2010-05-25T15:07:01Z</updated>
<author>
<name>Akinobu Mita</name>
</author>
<published>2010-05-24T21:32:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ff3d58c22b6827039983911d3460cf0c1657f8cc'/>
<id>urn:sha1:ff3d58c22b6827039983911d3460cf0c1657f8cc</id>
<content type='text'>
In f4112de6b679d84bd9b9681c7504be7bdfb7c7d5 ("mm: introduce
debug_kmap_atomic") I said that debug_kmap_atomic() needs
CONFIG_TRACE_IRQFLAGS_SUPPORT.

It was wrong.  (I thought irqs_disabled() is only available when the
architecture has CONFIG_TRACE_IRQFLAGS_SUPPORT)

Remove the #ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT check to enable
kmap_atomic() debugging for the architectures which do not have
CONFIG_TRACE_IRQFLAGS_SUPPORT.

Reported-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/xfs-vipt</title>
<updated>2010-02-27T01:05:10Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2010-02-27T01:05:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f24407d2bde27a4eb75ce5e52069bf4f1ba0e8a5'/>
<id>urn:sha1:f24407d2bde27a4eb75ce5e52069bf4f1ba0e8a5</id>
<content type='text'>
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/xfs-vipt:
  xfs: fix xfs to work with Virtually Indexed architectures
  sh: add mm API for DMA to vmalloc/vmap areas
  arm: add mm API for DMA to vmalloc/vmap areas
  parisc: add mm API for DMA to vmalloc/vmap areas
  mm: add coherence API for DMA to vmalloc/vmap areas
</content>
</entry>
<entry>
<title>mm: add coherence API for DMA to vmalloc/vmap areas</title>
<updated>2010-01-25T17:42:20Z</updated>
<author>
<name>James Bottomley</name>
</author>
<published>2010-01-25T17:42:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9df5f74194871ebd0e51ef5ad2eca5084acaaaba'/>
<id>urn:sha1:9df5f74194871ebd0e51ef5ad2eca5084acaaaba</id>
<content type='text'>
On Virtually Indexed architectures (which don't do automatic alias
resolution in their caches), we have to flush via the correct
virtual address to prepare pages for DMA.  On some architectures
(like arm) we cannot prevent the CPU from doing data movein along
the alias (and thus giving stale read data), so we not only have to
introduce a flush API to push dirty cache lines out, but also an invalidate
API to kill inconsistent cache lines that may have moved in before
DMA changed the data

Signed-off-by: James Bottomley &lt;James.Bottomley@suse.de&gt;
</content>
</entry>
<entry>
<title>mm: make totalhigh_pages unsigned long</title>
<updated>2010-01-11T17:34:03Z</updated>
<author>
<name>Andreas Fenkart</name>
</author>
<published>2010-01-08T22:42:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4b529401c5089cf33f7165607cbc2fde43357bfb'/>
<id>urn:sha1:4b529401c5089cf33f7165607cbc2fde43357bfb</id>
<content type='text'>
Makes it consistent with the extern declaration, used when CONFIG_HIGHMEM
is set Removes redundant casts in printout messages

Signed-off-by: Andreas Fenkart &lt;andreas.fenkart@streamunlimited.com&gt;
Acked-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Chen Liqin &lt;liqin.chen@sunplusct.com&gt;
Cc: Lennox Wu &lt;lennox.wu@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm: check the argument of kunmap on architectures without highmem</title>
<updated>2009-06-17T02:47:41Z</updated>
<author>
<name>Matthew Wilcox</name>
</author>
<published>2009-06-16T22:32:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=31c911329e048b715a1dfeaaf617be9430fd7f4e'/>
<id>urn:sha1:31c911329e048b715a1dfeaaf617be9430fd7f4e</id>
<content type='text'>
If you're using a non-highmem architecture, passing an argument with the
wrong type to kunmap() doesn't give you a warning because the ifdef
doesn't check the type.

Using a static inline function solves the problem nicely.

Reported-by: David Woodhouse &lt;dwmw2@infradead.org&gt;
Signed-off-by: Matthew Wilcox &lt;willy@linux.intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Fix highmem PPC build failure</title>
<updated>2009-04-03T16:48:29Z</updated>
<author>
<name>Kumar Gala</name>
</author>
<published>2009-04-02T04:38:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3688e07f83d81941c4a8b20e29602c6d0c883539'/>
<id>urn:sha1:3688e07f83d81941c4a8b20e29602c6d0c883539</id>
<content type='text'>
Commit f4112de6b679d84bd9b9681c7504be7bdfb7c7d5 ("mm: introduce
debug_kmap_atomic") broke PPC builds with CONFIG_HIGHMEM=y:

   CC      init/main.o
  In file included from include/linux/highmem.h:25,
                   from include/linux/pagemap.h:11,
                   from include/linux/mempolicy.h:63,
                   from init/main.c:53:
  arch/powerpc/include/asm/highmem.h: In function 'kmap_atomic_prot':
  arch/powerpc/include/asm/highmem.h:98: error: implicit declaration of function 'debug_kmap_atomic'
  In file included from include/linux/pagemap.h:11,
                   from include/linux/mempolicy.h:63,
                   from init/main.c:53:
  include/linux/highmem.h: At top level:
  include/linux/highmem.h:196: warning: conflicting types for 'debug_kmap_atomic'
  include/linux/highmem.h:196: error: static declaration of 'debug_kmap_atomic' follows non-static declaration
  include/asm/highmem.h:98: error: previous implicit declaration of 'debug_kmap_atomic' was here
  make[1]: *** [init/main.o] Error 1
  make: *** [init] Error 2

Signed-off-by: Kumar Gala &lt;galak@kernel.crashing.org&gt;
Acked-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mm: introduce debug_kmap_atomic</title>
<updated>2009-04-01T15:59:14Z</updated>
<author>
<name>Akinobu Mita</name>
</author>
<published>2009-03-31T22:23:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f4112de6b679d84bd9b9681c7504be7bdfb7c7d5'/>
<id>urn:sha1:f4112de6b679d84bd9b9681c7504be7bdfb7c7d5</id>
<content type='text'>
x86 has debug_kmap_atomic_prot() which is error checking function for
kmap_atomic.  It is usefull for the other architectures, although it needs
CONFIG_TRACE_IRQFLAGS_SUPPORT.

This patch exposes it to the other architectures.

Signed-off-by: Akinobu Mita &lt;akinobu.mita@gmail.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: &lt;linux-arch@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Allow architectures to override copy_user_highpage()</title>
<updated>2008-11-27T23:39:48Z</updated>
<author>
<name>Russell King</name>
</author>
<published>2008-11-27T11:13:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=487ff32082a9bd7489d8185cf7d7a2fdf18a22fa'/>
<id>urn:sha1:487ff32082a9bd7489d8185cf7d7a2fdf18a22fa</id>
<content type='text'>
With aliasing VIPT cache support, the ARM implementation of
clear_user_page() and copy_user_page() sets up a temporary kernel space
mapping such that we have the same cache colour as the userspace page.
This avoids having to consider any userspace aliases from this operation.

However, when highmem is enabled, kmap_atomic() have to setup mappings.
The copy_user_highpage() and clear_user_highpage() call these functions
before delegating the copies to copy_user_page() and clear_user_page().

The effect of this is that each of the *_user_highpage() functions setup
their own kmap mapping, followed by the *_user_page() functions setting
up another mapping.  This is rather wasteful.

Thankfully, copy_user_highpage() can be overriden by architectures by
defining __HAVE_ARCH_COPY_USER_HIGHPAGE.  However, replacement of
clear_user_highpage() is more difficult because its inline definition
is not conditional.  It seems that you're expected to define
__HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE and provide a replacement
__alloc_zeroed_user_highpage() implementation instead.

The allocation itself is fine, so we don't want to override that.  What
we really want to do is to override clear_user_highpage() with our own
version which doesn't kmap_atomic() unnecessarily.

Other VIPT architectures (PARISC and SH) would also like to override
this function as well.

Acked-by: Hugh Dickins &lt;hugh@veritas.com&gt;
Acked-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
Acked-by: Paul Mundt &lt;lethal@linux-sh.org&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
</feed>
