x86/espfix/xen: Fix allocation of pages for paravirt page tables
commitf890caed2119e22e108ee7726fcb57255096f918
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Wed, 9 Jul 2014 17:18:18 +0000 (9 13:18 -0400)
committerWilly Tarreau <w@1wt.eu>
Sat, 13 Dec 2014 14:16:10 +0000 (13 15:16 +0100)
tree7670839c12c1a1d656197835d5e1a3367135a307
parent841d5934d7a249f4abf604976afda9e0b9c0f3bd
x86/espfix/xen: Fix allocation of pages for paravirt page tables

commit 8762e5092828c4dc0f49da5a47a644c670df77f3 upstream.

init_espfix_ap() is currently off by one level when informing hypervisor
that allocated pages will be used for ministacks' page tables.

The most immediate effect of this on a PV guest is that if
'stack_page = __get_free_page()' returns a non-zeroed-out page the hypervisor
will refuse to use it for a page table (which it shouldn't be anyway). This will
result in warnings by both Xen and Linux.

More importantly, a subsequent write to that page (again, by a PV guest) is
likely to result in fatal page fault.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Link: http://lkml.kernel.org/r/1404926298-5565-1-git-send-email-boris.ostrovsky@oracle.com
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
(cherry picked from 3.2 commit 060e7f67c88ebbcf8745505c7ccf44c53601f7de)
Signed-off-by: Willy Tarreau <w@1wt.eu>
arch/x86/kernel/espfix_64.c