From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sean Christopherson Date: Tue, 9 Nov 2021 01:13:08 +0000 Subject: [PATCH v5.5 07/30] KVM: Let/force architectures to deal with arch specific memslot data In-Reply-To: References: <20211104002531.1176691-1-seanjc@google.com> <20211104002531.1176691-8-seanjc@google.com> Message-ID: List-Id: To: kvm-riscv@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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. 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. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D94E0C433EF for ; Tue, 9 Nov 2021 01:13:18 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 5D08361A8D for ; Tue, 9 Nov 2021 01:13:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5D08361A8D Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id E0BFC4B1AF; Mon, 8 Nov 2021 20:13:17 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8aYQA93iKN32; Mon, 8 Nov 2021 20:13:16 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id B42014B116; Mon, 8 Nov 2021 20:13:16 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id E47674B0C0 for ; Mon, 8 Nov 2021 20:13:15 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZOSrpx44lovm for ; Mon, 8 Nov 2021 20:13:14 -0500 (EST) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 740174B0BF for ; Mon, 8 Nov 2021 20:13:14 -0500 (EST) Received: by mail-pl1-f171.google.com with SMTP id k4so17830146plx.8 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=TtG+3Xr3MN8dyBRwmyAKYB8Wa4ZzN2lWcg0pAAv/epQbzxRrTufHCeqqfuYRBsyoR/ tcbRxPQslTVHtbtB6U6ZD0Om+qxewqSLpcAYcaimHmHD9a4YAHf7qbqYQGm8iF9jxKRr f6cmD5djCd5OyGwL9WQdTD6K8QefXOLf+r6NPyV6Ygv9wSav08oX+NC1kCV5qZd4jZ4G LDmQeg9r1rU6ld28p2SAYdEo9r2z7MLPdOMxqbMgL8Sh9EZDJtXP3zhGq5WntAsaiPDe UOh5lQhc7KO1x8wwXdYcJ5WlebJBSp4x4wBlJZpia8x72xF+TCu6RhXDjeBq8w3KcocE +jJw== X-Gm-Message-State: AOAM530NX993FIDh1DuBJ1n5cSOoy22rGdB83huXbiiPyYf+BkKAOVRr om8jgbI5VmCz8jrfi42aFLoGSQ== X-Google-Smtp-Source: ABdhPJzcevbnubHEXgv1M6rLX2JGTzdlefd4kCjCHHTj8uzt2X4SJm7iMiDLodL/pGyJRFtYyjZrnw== 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" 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-Disposition: inline In-Reply-To: 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 X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu 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. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24B37C433F5 for ; Tue, 9 Nov 2021 01:37:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0BD066103B for ; Tue, 9 Nov 2021 01:37:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239806AbhKIBkM (ORCPT ); Mon, 8 Nov 2021 20:40:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239029AbhKIBkI (ORCPT ); Mon, 8 Nov 2021 20:40:08 -0500 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01DE2C0432E7 for ; Mon, 8 Nov 2021 17:13:14 -0800 (PST) Received: by mail-pl1-x632.google.com with SMTP id b11so4612955pld.12 for ; Mon, 08 Nov 2021 17:13:13 -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=RPkjsVXqwHMVbyeP7dZoyn7zpB1+rDZ+IdDcWxzJTDH/n4ZB2UYNt+GwskfnLy8BpT Zd0gYifhlQrUQ0h/cLyf/JkqPfMZrZ+i9T0BjUYtfFoxMYAwEBXDA29MYS2Kke6ty9Wu 123lOUk3fMmIcBleN4R3KFNYcNm4lUFKlTRgOT0bVn6bgFoDSS8Acd9Son/7bgTYo33F 86xUl58rmNgE28pc8Pp502i5qE9OTM188nsKDCop/damxEnN3VA8xxm5FVh1ArEy3vhd 7D2jBPc2HMFnuHHv5W3432huWfk/sb10X9fFm2Edm5N7CMViauRTzPBCgFUqfH9+kbmB DEwQ== X-Gm-Message-State: AOAM531z72ES6RubqyCeN41kd3agI9usw8IHBDLBGJ+vvESn/9a+2IAA diBErWpnjddFBGPWZMel5U6rtQ== X-Google-Smtp-Source: ABdhPJzcevbnubHEXgv1M6rLX2JGTzdlefd4kCjCHHTj8uzt2X4SJm7iMiDLodL/pGyJRFtYyjZrnw== 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-mips@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. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BE6DC433F5 for ; Tue, 9 Nov 2021 01:40:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D3BB3610F7 for ; Tue, 9 Nov 2021 01:40:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D3BB3610F7 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HR+UmgyT2E6tXgAzxtP6hJctHgMj7tdOX5jh4LlRGfM=; b=XkYC6QgPLt7fR2 r5iNp/Q32xJdArlMwEEAhR+ObBpg8jIdw56gExrNe0n2i6PwUhPOBX9QzO321126nSVSnKSVhTMUn D6VUFibTWJY0kTHDh1ySPFL71Rbm+sewr2WInM8E5rsROqBjKqeusj0wA/RRMKDrah6ZBUOovqkF2 aIxUFzyCMOPB9heNiCorCvorI4zNYuMG4E65Fbdxs5Thr9CQrFqEJNGpN50Jv2ok0ywY5dBjRonTY BOD9YILc8EoYjkWv90WQE531UMP31XvEwyZbtgsps89UvNTXR7ocj+eGm8zEANh8LfhU316+op4zM 1HZ6uMkZiKilmBgfYNwg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkG71-000Pr2-Bb; Tue, 09 Nov 2021 01:39:47 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkFhO-000Fc7-HZ for linux-riscv@lists.infradead.org; Tue, 09 Nov 2021 01:13:20 +0000 Received: by mail-pl1-x631.google.com with SMTP id p18so17779247plf.13 for ; Mon, 08 Nov 2021 17:13:13 -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=yheAVkMo2f5W+aelTCTmnTr/tnlKwvA2gEyhwFuxgAX1o8L9h9CzOJFncWM4UyIA7O mgQihlHXTy8U0vPPWs5VaGQGthbY81sSheGFml0aCJHaNGL5blcS0dgl4+AS0HNhyMgF NOcL9VIEr7QYbxSCJhfYSjG4sOBIcNAorCSreGqEiR3+nhOO5/I22iwm0PcuNFg1G/Ne wGPtM04wIiYlqDiTFQ/zCaZf30Bv/HLdT4Zd3JmNiqa2X6fjBb3k+iW1ROidsuFLBWue qhUsB9baNC8dllPN0qsp/Q7bYmJ2bbY0uruzN0KiEs/JiRwHQWJzRQ263txlgaI3RdNR vPTg== X-Gm-Message-State: AOAM533K8r0d5D5Zah0KbttZqlZTpSyCWm+aZN+HuOIojmLoKX+WiHnb 16JvqZ7to6HJK2I+BrJ17VPohQ== X-Google-Smtp-Source: ABdhPJzcevbnubHEXgv1M6rLX2JGTzdlefd4kCjCHHTj8uzt2X4SJm7iMiDLodL/pGyJRFtYyjZrnw== 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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211108_171318_652805_CAE27887 X-CRM114-Status: GOOD ( 19.30 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1F7AC433F5 for ; Tue, 9 Nov 2021 01:42:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 61A38610F8 for ; Tue, 9 Nov 2021 01:42:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 61A38610F8 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IjP92qikjoT4YyPwQMBgfttNz9D+KMeDWRRLzfncG/A=; b=guXihDmDX0L7+q MYUdrEC7v06qBYYVvCJE1MjeO0LOFl0/wLMzMulWc+AdKjb2CZspAYL48eFOo/XIzOOhkqpKHQvHa 1hyJT3bqGC8pKMHIVSLc3gXAByySoIayd2gsvIPU5n/WmFUjgoremLA+DS+64oXmPXr/xmoTCHBMr O25cegV/7mp2Bj9U3m7hRptdId/QrOhvvzMGtWfhamB8bdU5DcGwDkCY3B0rPL9WWuEV31YWjU0y7 7HmdUk3/d4ODHEVWhYxMfem4KXWzu8eTtR52H9d/YqB0ohi7YuY81POlc8GXhe1kwI8gLQJknCNrF 05IRg3HAftKKnvu4+8QA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkG7H-000PuV-CC; Tue, 09 Nov 2021 01:40:05 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkFhO-000Fc9-HC for linux-arm-kernel@lists.infradead.org; Tue, 09 Nov 2021 01:13:21 +0000 Received: by mail-pl1-x62f.google.com with SMTP id u11so17861757plf.3 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=SwUYg/HJ4Y80S9AWdRkEEBapJgDs/75ydtKwojS62JQ6UaqWn354sQdyT4mazBmDhY WsQOBYG3Y2s4p9d9GxoxpkodRNv4nM1wTOWjfTp8bkEh/W41tJOhwcrWUbGoCrloovwh QGzz/tbAmpl5Sl14Xmwiy3E4hgWel7BpsmGac8/Na+AAkIjHm9dWe73lKxNfsFK8g9w9 CJpDrcFHqkDamqbclchpaOJ5Kzw4lCyDBcI8NyV7mMbErSNPO/vM8OFZcI8AtPjJJJYS jP4u9B3G7FopFvqJncs9YP93NUW6VB/NS3tfDKJ55I1FGAEUTYIWImC5CLA9oL1BbAOO bpLw== X-Gm-Message-State: AOAM5302o0scTCQU5+Epj3ql+O+7uNQyp0rJCEL5IL5+UE1cV1DFs/qd AVQII1b4ZEZ3/SrSBPf2GZxTda3eQAIJbA== X-Google-Smtp-Source: ABdhPJzcevbnubHEXgv1M6rLX2JGTzdlefd4kCjCHHTj8uzt2X4SJm7iMiDLodL/pGyJRFtYyjZrnw== 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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211108_171318_656580_A6004F0C X-CRM114-Status: GOOD ( 20.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel