x86/paravirt: Merge activate_mm() and dup_mmap() callbacks
authorJuergen Gross <jgross@suse.com>
Tue, 7 Feb 2023 07:59:02 +0000 (08:59 +0100)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 6 Mar 2023 08:41:37 +0000 (09:41 +0100)
commitc9ae1b10d9561012a222e05f0d3ab4e93d301f06
tree595ac62963b2b659ef304b5ba51d41d27cacc87c
parentfe15c26ee26efa11741a7b632e9f23b01aca4cc6
x86/paravirt: Merge activate_mm() and dup_mmap() callbacks

The two paravirt callbacks .mmu.activate_mm() and .mmu.dup_mmap() are
sharing the same implementations in all cases: for Xen PV guests they
are pinning the PGD of the new mm_struct, and for all other cases they
are a NOP.

In the end, both callbacks are meant to register an address space with
the underlying hypervisor, so there needs to be only a single callback
for that purpose.

So merge them to a common callback .mmu.enter_mmap() (in contrast to the
corresponding already existing .mmu.exit_mmap()).

As the first parameter of the old callbacks isn't used, drop it from the
replacement one.

  [ bp: Remove last occurrence of paravirt_activate_mm() in
    asm/mmu_context.h ]

Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu>
Link: https://lore.kernel.org/r/20230207075902.7539-1-jgross@suse.com
arch/x86/include/asm/mmu_context.h
arch/x86/include/asm/paravirt.h
arch/x86/include/asm/paravirt_types.h
arch/x86/kernel/paravirt.c
arch/x86/mm/init.c
arch/x86/xen/mmu_pv.c