From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Maciej S. Szmigiero" Date: Tue, 09 Nov 2021 00:39:53 +0000 Subject: Re: [PATCH v5.5 07/30] KVM: Let/force architectures to deal with arch specific memslot data Message-Id: List-Id: References: <20211104002531.1176691-1-seanjc@google.com> <20211104002531.1176691-8-seanjc@google.com> In-Reply-To: <20211104002531.1176691-8-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Sean Christopherson Cc: James Morse , Alexandru Elisei , Suzuki K Poulose , Atish Patra , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-mips@vger.kernel.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, kvm-riscv@lists.infradead.org, Palmer Dabbelt , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Ben Gardon , Marc Zyngier , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Anup Patel , Paul Walmsley , Albert Ou , Christian Borntraeger , Janosch Frank , Paolo Bonzini On 04.11.2021 01:25, Sean Christopherson wrote: > 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 > --- > 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. Thanks, Maciej