linux/arch/mips/kvm
Sean Christopherson 537a17b314 KVM: Let/force architectures to deal with arch specific memslot data
Pass the "old" slot to kvm_arch_prepare_memory_region() and force arch
code to handle propagating arch specific data from "new" to "old" when
necessary.  This is a baby step towards dynamically allocating "new" from
the get go, and is a (very) minor performance boost on x86 due to not
unnecessarily copying arch data.

For PPC HV, copy the rmap in the !CREATE and !DELETE paths, i.e. for MOVE
and FLAGS_ONLY.  This is functionally a nop as the previous behavior
would overwrite the pointer for CREATE, and eventually discard/ignore it
for DELETE.

For x86, copy the arch data only for FLAGS_ONLY changes.  Unlike PPC HV,
x86 needs to reallocate arch data in the MOVE case as the size of x86's
allocations depend on the alignment of the memslot's gfn.

Opportunistically tweak kvm_arch_prepare_memory_region()'s param order to
match the "commit" prototype.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
[mss: add missing RISCV kvm_arch_prepare_memory_region() change]
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Message-Id: <67dea5f11bbcfd71e3da5986f11e87f5dd4013f9.1638817639.git.maciej.szmigiero@oracle.com>
2021-12-08 04:24:20 -05:00
..
callback.c MIPS: KVM: Convert EXPORT_SYMBOL to _GPL 2016-01-24 03:13:24 +01:00
emulate.c MIPS: Remove KVM_TE support 2021-03-10 15:18:48 +01:00
entry.c MIPS: Remove NETLOGIC support 2021-10-24 17:24:47 +02:00
fpu.S MIPS: KVM: Fix fpu.S misassembly with r6 2016-07-05 16:09:11 +02:00
hypcall.c KVM: MIPS: Implement HYPCALL emulation 2017-03-28 14:53:33 +01:00
interrupt.c MIPS: Remove KVM_TE support 2021-03-10 15:18:48 +01:00
interrupt.h MIPS: Remove KVM_TE support 2021-03-10 15:18:48 +01:00
Kconfig MIPS: Remove KVM_TE support 2021-03-10 15:18:48 +01:00
loongson_ipi.c KVM: mips: Use kvm_get_vcpu() instead of open-coded access 2021-12-08 04:24:13 -05:00
Makefile mips: clean up kvm Makefile 2021-07-22 12:01:25 +02:00
mips.c KVM: Let/force architectures to deal with arch specific memslot data 2021-12-08 04:24:20 -05:00
mmu.c MIPS: Return true/false (not 1/0) from bool functions 2021-08-21 10:37:30 +02:00
msa.S MIPS: KVM: Add base guest MSA support 2015-03-27 21:25:19 +00:00
stats.c MIPS: KVM: Clean up kvm_exit trace event 2016-06-14 11:16:23 +02:00
tlb.c mips/kvm: Use BUG_ON instead of if condition followed by BUG 2021-06-21 11:40:54 +02:00
trace.h KVM: MIPS/VZ: Trace guest mode changes 2017-03-28 14:54:00 +01:00
vz.c KVM: MIPS: Remove a "set but not used" variable 2021-09-06 06:52:10 -04:00