<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/include/asm/pgtable.h, branch linux-3.7.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.7.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.7.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2013-02-17T18:53:12Z</updated>
<entry>
<title>x86/mm: Check if PUD is large when validating a kernel address</title>
<updated>2013-02-17T18:53:12Z</updated>
<author>
<name>Mel Gorman</name>
</author>
<published>2013-02-11T14:52:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d0944379e4915dd58835ba79d51173fa88c29b62'/>
<id>urn:sha1:d0944379e4915dd58835ba79d51173fa88c29b62</id>
<content type='text'>
commit 0ee364eb316348ddf3e0dfcd986f5f13f528f821 upstream.

A user reported the following oops when a backup process reads
/proc/kcore:

 BUG: unable to handle kernel paging request at ffffbb00ff33b000
 IP: [&lt;ffffffff8103157e&gt;] kern_addr_valid+0xbe/0x110
 [...]

 Call Trace:
  [&lt;ffffffff811b8aaa&gt;] read_kcore+0x17a/0x370
  [&lt;ffffffff811ad847&gt;] proc_reg_read+0x77/0xc0
  [&lt;ffffffff81151687&gt;] vfs_read+0xc7/0x130
  [&lt;ffffffff811517f3&gt;] sys_read+0x53/0xa0
  [&lt;ffffffff81449692&gt;] system_call_fastpath+0x16/0x1b

Investigation determined that the bug triggered when reading
system RAM at the 4G mark. On this system, that was the first
address using 1G pages for the virt-&gt;phys direct mapping so the
PUD is pointing to a physical address, not a PMD page.

The problem is that the page table walker in kern_addr_valid() is
not checking pud_large() and treats the physical address as if
it was a PMD.  If it happens to look like pmd_none then it'll
silently fail, probably returning zeros instead of real data. If
the data happens to look like a present PMD though, it will be
walked resulting in the oops above.

This patch adds the necessary pud_large() check.

Unfortunately the problem was not readily reproducible and now
they are running the backup program without accessing
/proc/kcore so the patch has not been validated but I think it
makes sense.

Signed-off-by: Mel Gorman &lt;mgorman@suse.de&gt;
Reviewed-by: Rik van Riel &lt;riel@redhat.coM&gt;
Reviewed-by: Michal Hocko &lt;mhocko@suse.cz&gt;
Acked-by: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/20130211145236.GX21389@suse.de
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>mm: thp: fix pmd_present for split_huge_page and PROT_NONE with THP</title>
<updated>2012-10-09T07:22:57Z</updated>
<author>
<name>Andrea Arcangeli</name>
</author>
<published>2012-10-08T23:33:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=027ef6c87853b0a9df53175063028edb4950d476'/>
<id>urn:sha1:027ef6c87853b0a9df53175063028edb4950d476</id>
<content type='text'>
In many places !pmd_present has been converted to pmd_none.  For pmds
that's equivalent and pmd_none is quicker so using pmd_none is better.

However (unless we delete pmd_present) we should provide an accurate
pmd_present too.  This will avoid the risk of code thinking the pmd is non
present because it's under __split_huge_page_map, see the pmd_mknotpresent
there and the comment above it.

If the page has been mprotected as PROT_NONE, it would also lead to a
pmd_present false negative in the same way as the race with
split_huge_page.

Because the PSE bit stays on at all times (both during split_huge_page and
when the _PAGE_PROTNONE bit get set), we could only check for the PSE bit,
but checking the PROTNONE bit too is still good to remember pmd_present
must always keep PROT_NONE into account.

This explains a not reproducible BUG_ON that was seldom reported on the
lists.

The same issue is in pmd_large, it would go wrong with both PROT_NONE and
if it races with split_huge_page.

Signed-off-by: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Acked-by: Rik van Riel &lt;riel@redhat.com&gt;
Cc: Johannes Weiner &lt;jweiner@redhat.com&gt;
Cc: Hugh Dickins &lt;hughd@google.com&gt;
Cc: Mel Gorman &lt;mgorman@suse.de&gt;
Cc: &lt;stable@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>UAPI: (Scripted) Convert #include "..." to #include &lt;path/...&gt; in kernel system headers</title>
<updated>2012-10-02T17:01:25Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2012-10-02T17:01:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a1ce39288e6fbefdd8d607021d02384eb4a20b99'/>
<id>urn:sha1:a1ce39288e6fbefdd8d607021d02384eb4a20b99</id>
<content type='text'>
Convert #include "..." to #include &lt;path/...&gt; in kernel system headers.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Acked-by: Dave Jones &lt;davej@redhat.com&gt;
</content>
</entry>
<entry>
<title>x86: Use "do { } while(0)" for empty flush_tlb_fix_spurious_fault() macro</title>
<updated>2011-12-18T08:14:18Z</updated>
<author>
<name>Jesper Juhl</name>
</author>
<published>2011-12-18T00:32:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2ac13462b6d242684996e88a07fbed6dec6af622'/>
<id>urn:sha1:2ac13462b6d242684996e88a07fbed6dec6af622</id>
<content type='text'>
If one builds the kernel with -Wempty-body one gets this
warning:

  mm/memory.c:3432:46: warning: suggest braces around empty body in an ¡if¢ statement [-Wempty-body]

due to the fact that 'flush_tlb_fix_spurious_fault' is a macro
that can sometimes be defined to nothing.

Signed-off-by: Jesper Juhl &lt;jj@chaosbits.net&gt;
Cc: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Cc: linux-mm@kvack.org
Cc: Michel Lespinasse &lt;walken@google.com&gt;
Cc: Hugh Dickins &lt;hughd@google.com&gt;
Cc: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Cc: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Cc: Rik van Riel &lt;riel@redhat.com&gt;
Cc: Mel Gorman &lt;mel@csn.ul.ie&gt;
Cc: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Link: http://lkml.kernel.org/r/alpine.LNX.2.00.1112180128070.21784@swampdragon.chaosbits.net
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>thp: don't allow transparent hugepage support without PSE</title>
<updated>2011-01-14T01:32:45Z</updated>
<author>
<name>Andrea Arcangeli</name>
</author>
<published>2011-01-13T23:47:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4b7167b9ff9b7f3f528cbc4c7d02ebd275b9b10c'/>
<id>urn:sha1:4b7167b9ff9b7f3f528cbc4c7d02ebd275b9b10c</id>
<content type='text'>
Archs implementing Transparent Hugepage Support must implement a function
called has_transparent_hugepage to be sure the virtual or physical CPU
supports Transparent Hugepages.

Signed-off-by: Andrea Arcangeli &lt;aarcange@redhat.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>thp: add pmd_modify</title>
<updated>2011-01-14T01:32:44Z</updated>
<author>
<name>Johannes Weiner</name>
</author>
<published>2011-01-13T23:47:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c489f1257b8cacd4881a18da1e93659f934a8e98'/>
<id>urn:sha1:c489f1257b8cacd4881a18da1e93659f934a8e98</id>
<content type='text'>
Add pmd_modify() for use with mprotect() on huge pmds.

Signed-off-by: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Signed-off-by: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Reviewed-by: Rik van Riel &lt;riel@redhat.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>thp: add x86 32bit support</title>
<updated>2011-01-14T01:32:44Z</updated>
<author>
<name>Johannes Weiner</name>
</author>
<published>2011-01-13T23:47:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f2d6bfe9ff0acec30b713614260e78b03d20e909'/>
<id>urn:sha1:f2d6bfe9ff0acec30b713614260e78b03d20e909</id>
<content type='text'>
Add support for transparent hugepages to x86 32bit.

Share the same VM_ bitflag for VM_MAPPED_COPY.  mm/nommu.c will never
support transparent hugepages.

Signed-off-by: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Signed-off-by: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Reviewed-by: Rik van Riel &lt;riel@redhat.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>thp: add pmd mangling functions to x86</title>
<updated>2011-01-14T01:32:40Z</updated>
<author>
<name>Andrea Arcangeli</name>
</author>
<published>2011-01-13T23:46:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=db3eb96f4e6281b84dd33c8980dacc27f2efe177'/>
<id>urn:sha1:db3eb96f4e6281b84dd33c8980dacc27f2efe177</id>
<content type='text'>
Add needed pmd mangling functions with symmetry with their pte
counterparts.  pmdp_splitting_flush() is the only new addition on the pmd_
methods and it's needed to serialize the VM against split_huge_page.  It
simply atomically sets the splitting bit in a similar way
pmdp_clear_flush_young atomically clears the accessed bit.
pmdp_splitting_flush() also has to flush the tlb to make it effective
against gup_fast, but it wouldn't really require to flush the tlb too.
Just the tlb flush is the simplest operation we can invoke to serialize
pmdp_splitting_flush() against gup_fast.

Signed-off-by: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Acked-by: Rik van Riel &lt;riel@redhat.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>thp: no paravirt version of pmd ops</title>
<updated>2011-01-14T01:32:39Z</updated>
<author>
<name>Andrea Arcangeli</name>
</author>
<published>2011-01-13T23:46:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2609ae6d10af0531e826335bd1445d1ace17c847'/>
<id>urn:sha1:2609ae6d10af0531e826335bd1445d1ace17c847</id>
<content type='text'>
No paravirt version of set_pmd_at/pmd_update/pmd_update_defer.

Signed-off-by: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Acked-by: Rik van Riel &lt;riel@redhat.com&gt;
Acked-by: Mel Gorman &lt;mel@csn.ul.ie&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>thp: add native_set_pmd_at</title>
<updated>2011-01-14T01:32:39Z</updated>
<author>
<name>Andrea Arcangeli</name>
</author>
<published>2011-01-13T23:46:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0a47de52db04c5eb346e99a8d038e693689bedca'/>
<id>urn:sha1:0a47de52db04c5eb346e99a8d038e693689bedca</id>
<content type='text'>
Used by paravirt and not paravirt set_pmd_at.

Signed-off-by: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Acked-by: Rik van Riel &lt;riel@redhat.com&gt;
Acked-by: Mel Gorman &lt;mel@csn.ul.ie&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>
</feed>
