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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F21DC433EF for ; Thu, 5 May 2022 21:58:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380512AbiEEWCi (ORCPT ); Thu, 5 May 2022 18:02:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233742AbiEEWCh (ORCPT ); Thu, 5 May 2022 18:02:37 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B98F55C748 for ; Thu, 5 May 2022 14:58:56 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id w17-20020a17090a529100b001db302efed6so5257540pjh.4 for ; Thu, 05 May 2022 14:58:56 -0700 (PDT) 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=eAKJ/icQ2pJarmVikk6ugi8Bvpa8Rc3R9Y/ObEeqjH8=; b=M3ZzJgDT9ekyNJ96FH0MMSzeB14ns1BDlk016eZT1S0ep/cD4p1f1RTvih2cYmfuI6 vFHrqU+9vIndYuNNK3AH4Dgm7kuFxZWZJkhyzMR4YOGjxZkYm1Z0EMXaLClIa8P7IVwL QtyC+BFeYTLUFomnyGMTCsLedrWhZCqZ/iU5JEbvABbUYTbxAczSe3AxtOSaTXAdovrL gXSYBjiw/rhbl7qw1z1JlCdnFZNzo1cOnflppFA0mTKn0HVdVUWqg4ori73GbSGNuRUY Q0QxlbRs+rt1HWOWCDy8/jExhZUX/p+D3mWU5Dz1V6JSaLpCcsd9QEMbSyHxxECeDk4v uA6Q== 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=eAKJ/icQ2pJarmVikk6ugi8Bvpa8Rc3R9Y/ObEeqjH8=; b=O7PviHSwVAfZmZYbpWP/kdfni7MhSZbV5OKcSAWhwIlP/jPeCbA9039Hz975OP7x7+ nBJ6DYevE0+8BQQwhIK3oq5s/LH7anS8fbFpcZJnJrVLFZH6ftMpMlxPJAZqcQJ2jldy 6gYtGKYlC6BslW25OzxP03YK3dmZflHl7TMmgOqkABwGxwrm3wvy9r7/HcsmItRjYjwK MEG5Uvih/glyfvbbQuoAZ4mqpLwC9SShzbt6IbUw/FzLN78cfkYsfuRsWhF05YF+0BVo Kyh5Z8UHQ5s1opEvswuAnKEN5Y2fwZQVKAnZVWUIIugW5FVGFINb4ef7414biUXFILkO iJxQ== X-Gm-Message-State: AOAM533AS0UP5+TcWB2BveEiiefOnrUW1Azrgxufv3oIiED92s3zPYDR lWdmfMw/FRkhxETlJBke/C5ioA== X-Google-Smtp-Source: ABdhPJy4viwkpqIW9TUUZ8Fu3CuE6qIgT5lnM973mXUD1A/F1HkwRsjvVk5v2hTKHhjIcHpWlHRYYQ== X-Received: by 2002:a17:902:cf05:b0:156:8445:ce0f with SMTP id i5-20020a170902cf0500b001568445ce0fmr178549plg.99.1651787936011; Thu, 05 May 2022 14:58:56 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id a3-20020a170902900300b0015e8d4eb1e7sm128177plp.49.2022.05.05.14.58.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 May 2022 14:58:55 -0700 (PDT) Date: Thu, 5 May 2022 21:58:52 +0000 From: Sean Christopherson To: David Matlack Cc: Paolo Bonzini , Marc Zyngier , Huacai Chen , Aleksandar Markovic , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Andrew Jones , Ben Gardon , Peter Xu , maciej.szmigiero@oracle.com, "moderated list:KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64)" , "open list:KERNEL VIRTUAL MACHINE FOR MIPS (KVM/mips)" , "open list:KERNEL VIRTUAL MACHINE FOR MIPS (KVM/mips)" , "open list:KERNEL VIRTUAL MACHINE FOR RISC-V (KVM/riscv)" , Peter Feiner Subject: Re: [PATCH v4 04/20] KVM: x86/mmu: Decompose kvm_mmu_get_page() into separate functions Message-ID: References: <20220422210546.458943-1-dmatlack@google.com> <20220422210546.458943-5-dmatlack@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220422210546.458943-5-dmatlack@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org On Fri, Apr 22, 2022, David Matlack wrote: > Decompose kvm_mmu_get_page() into separate helper functions to increase > readability and prepare for allocating shadow pages without a vcpu > pointer. > > Specifically, pull the guts of kvm_mmu_get_page() into 2 helper > functions: > > kvm_mmu_find_shadow_page() - > Walks the page hash checking for any existing mmu pages that match the > given gfn and role. > > kvm_mmu_alloc_shadow_page() > Allocates and initializes an entirely new kvm_mmu_page. This currently > requries a vcpu pointer for allocation and looking up the memslot but > that will be removed in a future commit. > > No functional change intended. > > Signed-off-by: David Matlack > --- Nice! Reviewed-by: Sean Christopherson 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 mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F330C433F5 for ; Thu, 5 May 2022 21:59:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 1DEEB49EEB; Thu, 5 May 2022 17:59:00 -0400 (EDT) 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 2784diLZT10U; Thu, 5 May 2022 17:58:59 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 1E1D44B234; Thu, 5 May 2022 17:58:59 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 63EC94B0F5 for ; Thu, 5 May 2022 17:58:58 -0400 (EDT) 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 OKSfCOPn3lqG for ; Thu, 5 May 2022 17:58:57 -0400 (EDT) Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 52D1949EEB for ; Thu, 5 May 2022 17:58:57 -0400 (EDT) Received: by mail-pj1-f46.google.com with SMTP id a15-20020a17090ad80f00b001dc2e23ad84so9148034pjv.4 for ; Thu, 05 May 2022 14:58:57 -0700 (PDT) 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=eAKJ/icQ2pJarmVikk6ugi8Bvpa8Rc3R9Y/ObEeqjH8=; b=M3ZzJgDT9ekyNJ96FH0MMSzeB14ns1BDlk016eZT1S0ep/cD4p1f1RTvih2cYmfuI6 vFHrqU+9vIndYuNNK3AH4Dgm7kuFxZWZJkhyzMR4YOGjxZkYm1Z0EMXaLClIa8P7IVwL QtyC+BFeYTLUFomnyGMTCsLedrWhZCqZ/iU5JEbvABbUYTbxAczSe3AxtOSaTXAdovrL gXSYBjiw/rhbl7qw1z1JlCdnFZNzo1cOnflppFA0mTKn0HVdVUWqg4ori73GbSGNuRUY Q0QxlbRs+rt1HWOWCDy8/jExhZUX/p+D3mWU5Dz1V6JSaLpCcsd9QEMbSyHxxECeDk4v uA6Q== 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=eAKJ/icQ2pJarmVikk6ugi8Bvpa8Rc3R9Y/ObEeqjH8=; b=HPgQGuG4pVrJDRVc/IR6td8uqofPAQ1oft0CPenLQazEoCHzW415jQnvfvfw2weYFG VH8WaiitHCM+/Kyg8yNeNJFk5Tp04Ympv1wwKnHz8LiEJoPM0WRKaTQ5g30/iZngNUJQ rXB3HVQvqD3wYxgNDwZW7noQVY3nbGlvy3sP7iyfwglGfXQ5ctEFFomHydndk8RPdHF3 rwcO4WmKQeQWX3EpI7wHiCSx3qnmNiTR0Mj4ischQxFQLSyRBAkCoA+OkOW8bEnmt//T 2uK02/6oYv7CoB/FkspRC6k5cyPgh1jaJWAIEkzJHVFwK91l4fgiLHGG932YjS0Go878 S0ZA== X-Gm-Message-State: AOAM530oqPrtWFoBz8ZsSl5A8vtpVCny5MWg/HVhkv4uwRse1Pag0Kww fYZwwl3Rawed2jz+bIZPs27Vvw== X-Google-Smtp-Source: ABdhPJy4viwkpqIW9TUUZ8Fu3CuE6qIgT5lnM973mXUD1A/F1HkwRsjvVk5v2hTKHhjIcHpWlHRYYQ== X-Received: by 2002:a17:902:cf05:b0:156:8445:ce0f with SMTP id i5-20020a170902cf0500b001568445ce0fmr178549plg.99.1651787936011; Thu, 05 May 2022 14:58:56 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id a3-20020a170902900300b0015e8d4eb1e7sm128177plp.49.2022.05.05.14.58.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 May 2022 14:58:55 -0700 (PDT) Date: Thu, 5 May 2022 21:58:52 +0000 From: Sean Christopherson To: David Matlack Subject: Re: [PATCH v4 04/20] KVM: x86/mmu: Decompose kvm_mmu_get_page() into separate functions Message-ID: References: <20220422210546.458943-1-dmatlack@google.com> <20220422210546.458943-5-dmatlack@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220422210546.458943-5-dmatlack@google.com> Cc: Marc Zyngier , Albert Ou , "open list:KERNEL VIRTUAL MACHINE FOR MIPS \(KVM/mips\)" , Huacai Chen , "open list:KERNEL VIRTUAL MACHINE FOR MIPS \(KVM/mips\)" , Aleksandar Markovic , Palmer Dabbelt , "open list:KERNEL VIRTUAL MACHINE FOR RISC-V \(KVM/riscv\)" , Paul Walmsley , Ben Gardon , Paolo Bonzini , maciej.szmigiero@oracle.com, "moderated list:KERNEL VIRTUAL MACHINE FOR ARM64 \(KVM/arm64\)" , Peter Feiner 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 Fri, Apr 22, 2022, David Matlack wrote: > Decompose kvm_mmu_get_page() into separate helper functions to increase > readability and prepare for allocating shadow pages without a vcpu > pointer. > > Specifically, pull the guts of kvm_mmu_get_page() into 2 helper > functions: > > kvm_mmu_find_shadow_page() - > Walks the page hash checking for any existing mmu pages that match the > given gfn and role. > > kvm_mmu_alloc_shadow_page() > Allocates and initializes an entirely new kvm_mmu_page. This currently > requries a vcpu pointer for allocation and looking up the memslot but > that will be removed in a future commit. > > No functional change intended. > > Signed-off-by: David Matlack > --- Nice! Reviewed-by: Sean Christopherson _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm