Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp997426pxb; Tue, 9 Nov 2021 03:32:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJw4qVLh+iwkgTwe/Jlbk3GRw5z7DHUhx536zCU/hPYWJ/ZcGy+BiPAmBBDj7xaXH5t5WMxU X-Received: by 2002:a05:6638:1923:: with SMTP id p35mr5021198jal.16.1636457577174; Tue, 09 Nov 2021 03:32:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636457577; cv=none; d=google.com; s=arc-20160816; b=b6E5GZpyCE4lfs4Wx4P4DJW+SnON5LV26Wr0++E+DHiMTeavcBOqstX17VbOPTEWeF YqRyW8aL5ojTjxtHzMx5yM8Hl96NNjy5kscTlIGKG8I5O/76MqtpS4UQFOTpu8bsyhO7 Ok0bKuKH+4glzO1uEZHXjtt+k9OSQxTX9YzCBIicG1QvJUFvE0tpuKLY5TmeFCbyjMqZ TX1HADcK57NVtKDyQDlivVgfTwsG1DYWZua5rHivGH7Bpp+TpJ+KExBT+CpLw+asqwyz VWhQDojPUzpA/G2yLu7lYRou1dR6ekcSpAiyNTIRLfuFercyTun92PySC2556BbxgkrU Zc4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OY5KYqUbBGpBDQ1k/TLXaDPEogjFGrqFLQuez5gL1qA=; b=M4nKv8+ngCUAtQ1Qog9CqDyjc2vJ+WwPoNPNOY4EowD0KrP3BALXlg9gxXp23jKYx4 /Ho7h17Yin559ufWETqqmX12mpDDQET28elPTeXBOam9q21c/zUJUWuitSfDKIYa4p2i EH+U532VvmTTBOjkzisA1U/EUduDzfl6hebZ+uSg0Uxi/CP72nzCU8NOAyYXT9yTFOci ESumFujXI3JWE9ER+XwmkuJ9c/VaM04VxbkYsStZsqaM5VPSErqJFb8UoFJypFVsouAI /g5fmRdLl/BL6eEJoMIcp6AO6xNmO6xy7Q5ELwOi+x8GOb4ptHMldktFFyHP3Yn+aV6D /3aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=te7Nw2Dv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h11si37953493ila.52.2021.11.09.03.32.44; Tue, 09 Nov 2021 03:32:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=te7Nw2Dv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240058AbhKIBkN (ORCPT + 99 others); Mon, 8 Nov 2021 20:40:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239118AbhKIBkI (ORCPT ); Mon, 8 Nov 2021 20:40:08 -0500 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19E85C0432E9 for ; Mon, 8 Nov 2021 17:13:14 -0800 (PST) Received: by mail-pl1-x631.google.com with SMTP id q17so5761988plr.11 for ; Mon, 08 Nov 2021 17:13:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=OY5KYqUbBGpBDQ1k/TLXaDPEogjFGrqFLQuez5gL1qA=; b=te7Nw2DvzfZp/BOqwknAvOUpfBhundhcdPJe1dNUemJpr+5tBnfyFRHnMzcPLxJFqN KujEpDxbDQg9UP19BIas9xWrfjlUr8iNQnw44E4nNiuCXPw9XE2oUUEO4vm6LObg4EhG d4Eh18RhxnXj0DeQQGDa0fItbHkrWTp2aGHdm8SLozmyzGYlENGO46rSxB1omAxCZquV 0SE2otTQgQ85nJvIEamMaKTrGUdltz0CPMYpQRIdj8uIl5/rXQOmwBDoJILcZ8QF1Jqs zpka1GweINt+W1Mdx9Gb5XIPiYSJXz2XTgcNv6K30CkWtk/7XN35z66PabO6xsFDyCBN K+Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=OY5KYqUbBGpBDQ1k/TLXaDPEogjFGrqFLQuez5gL1qA=; b=wzKs4f1DlIYH8RGwLcLz/7Tj10h6zxclKHmdZ/CJoC+uIEafNBlWzuDvAJnpMffamC q7KQFCmy7focJ0H5Ju0lwx4a9/44O+kwveMN50rjGHynnjxrzwQW963hUqd/KP77WoYc uMbe3YHyy4eDOf+q5dmHzjEGg28jpMy/oXD67QEzlhJzHguTlr+EuV4cJeRUvlB3kh6e 82MslWAfVwjKI/Dchzg0B29Tvl8X/QHQt3TRT+NQNEp3MIit3FpDQgIv8nf6a4z1Ou3K jml7CV7nEm95Ls7agpMxO0NW1FmFtO/4yy3Y+OpMBepiQSjmjUbfn+SyLUhIbnRaH0V+ sQKw== X-Gm-Message-State: AOAM531y/D+jlt5U2GUN2yZm4OPcfKLY9bRVkQsYQsuDBR0LFCM8iwCr hTOEzihIEtGY8eUHejSTUs0SJw== X-Received: by 2002:a17:902:7c0e:b0:142:53c3:39d9 with SMTP id x14-20020a1709027c0e00b0014253c339d9mr3570608pll.66.1636420393180; Mon, 08 Nov 2021 17:13:13 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id t135sm13421760pgc.51.2021.11.08.17.13.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Nov 2021 17:13:12 -0800 (PST) Date: Tue, 9 Nov 2021 01:13:08 +0000 From: Sean Christopherson To: "Maciej S. Szmigiero" 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 Subject: Re: [PATCH v5.5 07/30] KVM: Let/force architectures to deal with arch specific memslot data Message-ID: References: <20211104002531.1176691-1-seanjc@google.com> <20211104002531.1176691-8-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.