]> git.baikalelectronics.ru Git - kernel.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)
committerDavid Vrabel <david.vrabel@citrix.com>
Thu, 23 Jun 2016 13:50:30 +0000 (14:50 +0100)
commit0572f36c062794c8541706e42dadd604ccf115e9
tree987a93a917bb2d377d52482e1a4da8010d1a37f1
parent6e3a3094fbc9065a839179dd44c19486687593c2
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>
arch/x86/xen/mmu.c