Thread (66 messages) 66 messages, 5 authors, 2021-11-26

Re: [PATCH v5.5 07/30] KVM: Let/force architectures to deal with arch specific memslot data

From: Sean Christopherson <seanjc@google.com>
Date: 2021-11-09 01:37:36
Also in: kvm, kvm-riscv, kvmarm, linux-mips, linux-riscv, lkml

On Tue, Nov 09, 2021, Maciej S. Szmigiero wrote:
On 04.11.2021 01:25, Sean Christopherson wrote:
quoted
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>
---
  arch/arm64/kvm/mmu.c               |  7 ++++---
  arch/mips/kvm/mips.c               |  3 ++-
  arch/powerpc/include/asm/kvm_ppc.h | 18 ++++++++++--------
  arch/powerpc/kvm/book3s.c          | 12 ++++++------
  arch/powerpc/kvm/book3s_hv.c       | 17 ++++++++++-------
  arch/powerpc/kvm/book3s_pr.c       | 17 +++++++++--------
  arch/powerpc/kvm/booke.c           |  5 +++--
  arch/powerpc/kvm/powerpc.c         |  5 +++--
  arch/s390/kvm/kvm-s390.c           |  3 ++-
  arch/x86/kvm/x86.c                 | 15 +++++++++++----
  include/linux/kvm_host.h           |  3 ++-
  virt/kvm/kvm_main.c                |  5 +----
  12 files changed, 63 insertions(+), 47 deletions(-)
You didn't include the RISCV kvm_arch_prepare_memory_region() change here
(that's actually in patch 13 of this series) so bisection on that arch
will be broken between this patch and patch 13.
Argh, I thought I had found all of those.  :-/  Thanks.  

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help