Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3488933rwb; Fri, 9 Dec 2022 15:30:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf5odtoSs/l17dNRpLY8mzJP4iFyiOOzlmFUqQRR0EDBAVIO1KWhPlqxboXazusEDUAXoBZB X-Received: by 2002:a05:6a20:e60f:b0:9d:efbe:e5f0 with SMTP id my15-20020a056a20e60f00b0009defbee5f0mr8969507pzb.12.1670628646134; Fri, 09 Dec 2022 15:30:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670628646; cv=none; d=google.com; s=arc-20160816; b=XA4lcpFtP2K214IlvsVSbZ6XiEsub9/n+TvGVdXM6lFWQVlIZlApYXJHdmdjk1yX7V avuxM53UyjW8S/7G6zBMrOrBqFpPpAQ5+ZYGOhAvPFULP5bx44BuMV0Ebgw5CkWsBhnE BFtFZ67aP+sa7yMmh5eflOW+3PFLFEl7WDFuFqOczTlnODImLP6n5CAzL0JLgelXc7Mn mqyECuaAo5/nfOM/ldxIjhXSr4uTrwrigHyaLRs8p2jBrz8IaekNh/vEU6UjLNzVFCWC ykc8GeFMuKKgBUQFi39gMY14V6Uh26lseVcMgCxWXlT3VDL3QIx1EwHtu5NGg29fkE4I rYNw== 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=KjWt06caLftDUr8Va4Y4h1LGtA5Zj5segiez9gIs88A=; b=Ud/p9TIE3vSdabKw+pjztZykTjFfmdK3ERZ3AqDrD9AIBbIz7zlkHvMdMm99a2Bb8c pppbZRLS/XKzCe38/NURqs1Fs8XkLU8gMhUN6Nbr1T62xjV6M8UWIO+bORbQJqE2NuFb WlcKGuDry1mXy0V91MdJF2FeAYbEngKVZ/SPnRnhA/0VpBmkpwixbXNOTg81NKgISDz/ w1niivV4xyxniquJ3gOP2JzEpBpfFh9cRbUMnmwgtPJcPCjfe8SFQBxVALkWFgQamJPr IHGskKtc+SAwai+no/6kVJPYuN7g7xARC/QHh7iNSk1Oz6vJc1eXG2/sF0DuQ+0DCK8P sujQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=bcr8Dicu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q18-20020a17090aa01200b0020cedba54fcsi2801125pjp.55.2022.12.09.15.30.35; Fri, 09 Dec 2022 15:30:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=bcr8Dicu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229917AbiLIXOk (ORCPT + 75 others); Fri, 9 Dec 2022 18:14:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229779AbiLIXOh (ORCPT ); Fri, 9 Dec 2022 18:14:37 -0500 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF15896572 for ; Fri, 9 Dec 2022 15:14:36 -0800 (PST) Received: by mail-pg1-x530.google.com with SMTP id f9so4519160pgf.7 for ; Fri, 09 Dec 2022 15:14:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=KjWt06caLftDUr8Va4Y4h1LGtA5Zj5segiez9gIs88A=; b=bcr8Dicuab3vxBke8uhwSm18glsWJM52rBtl5b/OwBK5UhIhIVhQE7EOE5fdMUJ7qn VS1IiKlq3CLUle6UoWj/9xH4ktiZf1L0TscM3UC9P7bpx+96orNymQcPTReEoKBsE78e fZ5E1qZYzF8lxrl9eFlvkTyAZvu9c9bTGoKaypaMnO0/LwIxjoudocaHHLHmr+kh3GDc iwqF7ubbZUx9Ky/7ndRnsThl+mFWIKLOEPb8XpuPzKquPQ07P95bscsf8mu3DJcFepqt NsvUeyw1+LM5Sto3PxUUMwVMlhUx8IW2K+5cGRd+ro1bHzBCZznSDrN7sPQgCkkbdIGT 0K5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=KjWt06caLftDUr8Va4Y4h1LGtA5Zj5segiez9gIs88A=; b=oWC1vlO/ClmLDIDSZ2RYqau/Y3ZJloISXR/vmgdspcy/eJpeTNPgyeuKpDKE7wWcNN joUO5iBYEGJTmGqV8k15DDXvWj3W1dPyvdAkqaK3kq5nZtVuy2iNRUEk31ZbNwVP9P+5 cMty2FmoOgZqg0qXdcBhZDkiOf1m5iz8wSm+7+ZsJmivORMvBfSDkeD+U67RORvH5VzX Ygf9bK3r/L7a+YqUP9mh/MpFFKIJ+mVhgOG9zk9MUGRhYgPErQknKKXowqPnwt8Lggyc qgQr84ZNcf+tRVR3I9ZsAC5iQz9PGqhSddUCi4zb35xVJHKTzMH6sXHPLQIq5ELmPMJu 5Erw== X-Gm-Message-State: ANoB5pldoIgUDCoJBIaArtlIA8m5oiKO/baYIF8LnMq6/iDSlrbztN8f nY4htMdGb7E9xZaDo9N3AhTVLA== X-Received: by 2002:aa7:87ca:0:b0:56c:5e2:3064 with SMTP id i10-20020aa787ca000000b0056c05e23064mr5663001pfo.0.1670627676131; Fri, 09 Dec 2022 15:14:36 -0800 (PST) Received: from google.com (223.103.125.34.bc.googleusercontent.com. [34.125.103.223]) by smtp.gmail.com with ESMTPSA id c206-20020a621cd7000000b005771d583893sm1748579pfc.96.2022.12.09.15.14.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 15:14:35 -0800 (PST) Date: Fri, 9 Dec 2022 15:14:32 -0800 From: David Matlack To: Ben Gardon Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Paolo Bonzini , Peter Xu , Sean Christopherson , Vipin Sharma Subject: Re: [PATCH 0/7] KVM: x86/MMU: Factor rmap operations out of mmu.c Message-ID: References: <20221206173601.549281-1-bgardon@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221206173601.549281-1-bgardon@google.com> X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 06, 2022 at 05:35:54PM +0000, Ben Gardon wrote: > Move the basic operations for manipulating an rmap out of mmu.c, into > their own files. memslot_rmap_alloc() and memslot_rmap_free() from x86.c look like good candidates to move to rmap.c as well as they are pure setup/teardown. > > This is the first step in a series of series to split the Shadow MMU out of > mmu.c. Splitting the shadow MMU out results in about a 50% reduction in line > count of mmu.c, from ~7K to ~3.5K. The rmap operations only represent about > 10% of the Shadow MMU but are split out first becase the are relatively > self-contained. > > This split may also help facilitate the addition of kUnit tests for rmap > manipulation, especially the fiddly bit flag which diferentiates a direct > pointer from a pte_list_desc. > > This effort is complimentary to David Matlack's proposal to refactor > the TDP MMU into an arch-neutral implementation because it further > clarifies the distinction between the Shadow MMU and TDP MMU within x86. > > This series contains no functional changes. It's just a direct movement > of code from one file to another. > > Whether this rmap code should stay in its own file or get merged with > the rest of the shadow MMU code as it is factored out is open for > debate. > > Ben Gardon (7): > KVM: x86/MMU: Move pte_list operations to rmap.c > KVM: x86/MMU: Move rmap_iterator to rmap.h > KVM: x86/MMU: Move gfn_to_rmap() to rmap.c > KVM: x86/MMU: Move rmap_can_add() and rmap_remove() to rmap.c > KVM: x86/MMU: Move the rmap walk iterator out of mmu.c > KVM: x86/MMU: Move rmap zap operations to rmap.c > KVM: x86/MMU: Move rmap_add() to rmap.c > > arch/x86/kvm/Makefile | 2 +- > arch/x86/kvm/debugfs.c | 1 + > arch/x86/kvm/mmu/mmu.c | 438 +------------------------------- > arch/x86/kvm/mmu/mmu_internal.h | 9 +- > arch/x86/kvm/mmu/rmap.c | 368 +++++++++++++++++++++++++++ > arch/x86/kvm/mmu/rmap.h | 106 ++++++++ > 6 files changed, 492 insertions(+), 432 deletions(-) > create mode 100644 arch/x86/kvm/mmu/rmap.c > create mode 100644 arch/x86/kvm/mmu/rmap.h > > -- > 2.39.0.rc0.267.gcb52ba06e7-goog >