Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

xen/x86: streamline set_pte_mfn()

In preparation for restoring xen_set_pte_init()'s original behavior of
avoiding hypercalls, make set_pte_mfn() no longer use the standard
set_pte() code path. That one is more complicated than the alternative
of simply using an available hypercall directly. This way we can avoid
introducing a fair number (2k on my test system) of cases where the
hypervisor would trap-and-emulate page table updates.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Link: https://lore.kernel.org/r/b39c08e8-4a53-8bca-e6e7-3684a6cab8d0@suse.com
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

authored by

Jan Beulich and committed by
Boris Ostrovsky
dc4bd2a2 bfc484fe

+4 -2
+4 -2
arch/x86/xen/mmu_pv.c
··· 241 241 * Associate a virtual page frame with a given physical page frame 242 242 * and protection flags for that frame. 243 243 */ 244 - void set_pte_mfn(unsigned long vaddr, unsigned long mfn, pgprot_t flags) 244 + void __init set_pte_mfn(unsigned long vaddr, unsigned long mfn, pgprot_t flags) 245 245 { 246 - set_pte_vaddr(vaddr, mfn_pte(mfn, flags)); 246 + if (HYPERVISOR_update_va_mapping(vaddr, mfn_pte(mfn, flags), 247 + UVMF_INVLPG)) 248 + BUG(); 247 249 } 248 250 249 251 static bool xen_batched_set_pte(pte_t *ptep, pte_t pteval)