]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/xen: avoid m2p lookup when setting early page table entries
authorDavid Vrabel <david.vrabel@citrix.com>
Tue, 17 May 2016 14:54:50 +0000 (15:54 +0100)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Wed, 6 Jul 2016 16:13:32 +0000 (12:13 -0400)
commitc959a5555878265cd44448691938f31f3322d95c
tree64477a145d934534c50bbb62ea5c5d053e859d94
parent150acc10c4b6568983a72831d5641adfd0bb2f2d
x86/xen: avoid m2p lookup when setting early page table entries

When page tables entries are set using xen_set_pte_init() during early
boot there is no page fault handler that could handle a fault when
performing an M2P lookup.

In 64 bit guests (usually dom0) early_ioremap() would fault in
xen_set_pte_init() because an M2P lookup faults because the MFN is in
MMIO space and not mapped in the M2P.  This lookup is done to see if
the PFN in in the range used for the initial page table pages, so that
the PTE may be set as read-only.

The M2P lookup can be avoided by moving the check (and clear of RW)
earlier when the PFN is still available.

Reported-by: Kevin Moraga <kmoragas@riseup.net>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
(cherry picked from commit d6b186c1e2d852a92c43f090d0d8fad4704d51ef)
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
OraBug: 23585393
arch/x86/xen/mmu.c