aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/xen/mmu.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 3f1783a79a3c..27336dfcda8e 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -1432,6 +1432,10 @@ static pte_t __init mask_rw_pte(pte_t *ptep, pte_t pte)
1432 * Init-time set_pte while constructing initial pagetables, which 1432 * Init-time set_pte while constructing initial pagetables, which
1433 * doesn't allow RO page table pages to be remapped RW. 1433 * doesn't allow RO page table pages to be remapped RW.
1434 * 1434 *
1435 * If there is no MFN for this PFN then this page is initially
1436 * ballooned out so clear the PTE (as in decrease_reservation() in
1437 * drivers/xen/balloon.c).
1438 *
1435 * Many of these PTE updates are done on unpinned and writable pages 1439 * Many of these PTE updates are done on unpinned and writable pages
1436 * and doing a hypercall for these is unnecessary and expensive. At 1440 * and doing a hypercall for these is unnecessary and expensive. At
1437 * this point it is not possible to tell if a page is pinned or not, 1441 * this point it is not possible to tell if a page is pinned or not,
@@ -1440,7 +1444,10 @@ static pte_t __init mask_rw_pte(pte_t *ptep, pte_t pte)
1440 */ 1444 */
1441static void __init xen_set_pte_init(pte_t *ptep, pte_t pte) 1445static void __init xen_set_pte_init(pte_t *ptep, pte_t pte)
1442{ 1446{
1443 pte = mask_rw_pte(ptep, pte); 1447 if (pte_mfn(pte) != INVALID_P2M_ENTRY)
1448 pte = mask_rw_pte(ptep, pte);
1449 else
1450 pte = __pte_ma(0);
1444 1451
1445 native_set_pte(ptep, pte); 1452 native_set_pte(ptep, pte);
1446} 1453}