Skip to content

Commit 9a58b35

Browse files
jbeulichbostrovs
authored andcommitted
xen/x86: restrict PV Dom0 identity mapping
When moving away RAM pages, there having been a mapping of those is not a proper indication that instead MMIO should be mapped there. At the point in time this effectively covers the low megabyte only. Mapping of that is, however, the job of init_mem_mapping(). Comparing the two one can also spot that we've been wrongly (or at least inconsistently) using PAGE_KERNEL_IO here. Simply zap any such mappings instead. Signed-off-by: Jan Beulich <[email protected]> Reviewed-by: Boris Ostrovsky <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Boris Ostrovsky <[email protected]>
1 parent 344485a commit 9a58b35

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/x86/xen/setup.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,13 +425,13 @@ static unsigned long __init xen_set_identity_and_remap_chunk(
425425
}
426426

427427
/*
428-
* If the PFNs are currently mapped, the VA mapping also needs
429-
* to be updated to be 1:1.
428+
* If the PFNs are currently mapped, their VA mappings need to be
429+
* zapped.
430430
*/
431431
for (pfn = start_pfn; pfn <= max_pfn_mapped && pfn < end_pfn; pfn++)
432432
(void)HYPERVISOR_update_va_mapping(
433433
(unsigned long)__va(pfn << PAGE_SHIFT),
434-
mfn_pte(pfn, PAGE_KERNEL_IO), 0);
434+
native_make_pte(0), 0);
435435

436436
return remap_pfn;
437437
}

0 commit comments

Comments
 (0)