Fix lguest page-pinning logic ("lguest: bad stack page 0xc057a000")
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 29 Aug 2007 20:35:08 +0000 (06:35 +1000)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 30 Aug 2007 16:58:22 +0000 (09:58 -0700)
commit8057d763ed7a7365dc3402db0aed7c87d8531ecb
tree5a04fee7709eeed4babb70296302b1d49e64b37c
parentb07d68b5ca4d55a16fab223d63d5fb36f89ff42f
Fix lguest page-pinning logic ("lguest: bad stack page 0xc057a000")

If the stack pointer is 0xc057a000, then the first stack page is at
0xc0579000 (the stack pointer is decremented before use).  Not
calculating this correctly caused guests with CONFIG_DEBUG_PAGEALLOC=y
to be killed with a "bad stack page" message: the initial kernel stack
was just proceeding the .smp_locks section which
CONFIG_DEBUG_PAGEALLOC marks read-only when freeing.

Thanks to Frederik Deweerdt for the bug report!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/lguest/interrupts_and_traps.c