From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sean Christopherson Date: Tue, 09 Nov 2021 01:13:08 +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: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: "Maciej S. Szmigiero" Cc: Anup Patel , Wanpeng Li , kvm@vger.kernel.org, David Hildenbrand , linux-kernel@vger.kernel.org, Paul Mackerras , Atish Patra , Ben Gardon , linux-riscv@lists.infradead.org, Claudio Imbrenda , kvmarm@lists.cs.columbia.edu, Janosch Frank , Marc Zyngier , Joerg Roedel , Huacai Chen , Christian Borntraeger , Aleksandar Markovic , Palmer Dabbelt , Albert Ou , kvm-ppc@vger.kernel.org, Paul Walmsley , linux-arm-kernel@lists.infradead.org, Jim Mattson , Cornelia Huck , linux-mips@vger.kernel.org, kvm-riscv@lists.infradead.org, Paolo Bonzini , Vitaly Kuznetsov On Tue, Nov 09, 2021, Maciej S. Szmigiero wrote: > 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. Argh, I thought I had found all of those. :-/ Thanks.