Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp329038rwb; Wed, 16 Nov 2022 00:57:11 -0800 (PST) X-Google-Smtp-Source: AA0mqf7sA+fzPoHjqvonbh/5cvp+ljJ+ajEwdNwYHBEpssH7mm63reOyG+iEFj1OAH9EnLgc0DDA X-Received: by 2002:a63:4f04:0:b0:476:9244:5556 with SMTP id d4-20020a634f04000000b0047692445556mr10893376pgb.158.1668589031668; Wed, 16 Nov 2022 00:57:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668589031; cv=none; d=google.com; s=arc-20160816; b=MZvzs5wB/NXtXzbZdeo3WbykXyS2ZgJlmnp4VEmzBpnqnsLfT36lUU7jgm+FnKKSBv /Z6NB6RAfV0uu3z4gd03RK1sKZsHqOy7KcOZgeks9m9Zo4JXfJKi+fTBdgDH2R0eKRpO PzRFlGRwCxQw+swPZg1iEda6fpwCYBJI4Y05Cj8t/bxRc2GPbJIRY3ubNtd4QhF12hfz zr06w9wrr/PfHGqL17phOLMYDjtWaZmR0tp/XBQa2mFwZwChMyyizpHyRgFu02Rn1mS4 eIyq92JPmOcyRAT3u2hgWvWp05Tdn2XruEfNW6iDuNhFPkIDtB/+vUk3ZcKRsRH2l1XC vJGQ== 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:dkim-signature:date; bh=SmFKdEdkwEAGGvbba+Uew4TFmYCA4I8/v/XU6v8w0iw=; b=vEsFG9iNE6NNdaCmLtd+LjKRHwQAVpMNh2PtpMtqz0P1AKKomAUsROULu7VhBQ0tRC 5xWlaVgGYl1sJfex2Ny2Y3+yAClFhqHqeMdP63iQiqEv47O7ehulCXz7KlA/nHdh761a jac+RmFLsIkH+dr/TV902CGzet2h/8/tAmOCFh1LWA4GsQ/VwAf8HsUV0Hm1sYOmS0f8 pXkmpt11CaY/GiDbtPW3CRvGCJsra87tXwmZaIxeMrkfl+o1/obDxP500mBZ4u/0tTHl Hg+qJBiVr5DOzc7FeR61unOCtEPiVreNBoWaVjWgJsO4cGExhiS8DAMEUA1bGWDpV89Q PBjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=EiQC3QrF; 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=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d6-20020a63a706000000b004626957c3c7si14100208pgf.193.2022.11.16.00.56.59; Wed, 16 Nov 2022 00:57:11 -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=@linux.dev header.s=key1 header.b=EiQC3QrF; 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=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238758AbiKPIP2 (ORCPT + 90 others); Wed, 16 Nov 2022 03:15:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238521AbiKPIPC (ORCPT ); Wed, 16 Nov 2022 03:15:02 -0500 Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA54F10553; Wed, 16 Nov 2022 00:14:24 -0800 (PST) Date: Wed, 16 Nov 2022 08:14:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1668586463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SmFKdEdkwEAGGvbba+Uew4TFmYCA4I8/v/XU6v8w0iw=; b=EiQC3QrF9TRB/NYfKenXrf+k5M2yFh3QICvTBjAHp2S2AgBjJTR7+0EESbrJW9MZnTM2ku HalxstlcPjFrhMFiUG6PeC1w/Rn21yzoE6U8m4RxGK2nKHc8gl9WjePXjwLsyGfzBN/HBd WcAO9UckNtb5AMRTHW2N9kDIujgjrjQ= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Marc Zyngier Cc: kvm@vger.kernel.org, Will Deacon , Catalin Marinas , linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, Marek Szyprowski Subject: Re: [PATCH v2] KVM: arm64: Don't acquire RCU read lock for exclusive table walks Message-ID: References: <20221115225502.2240227-1-oliver.upton@linux.dev> <868rkbppdq.wl-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS autolearn=ham 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 Wed, Nov 16, 2022 at 07:27:27AM +0000, Oliver Upton wrote: > On Wed, Nov 16, 2022 at 03:08:49AM +0000, Marc Zyngier wrote: > > I'm not crazy about this sort of parameters. I think it would make a > > lot more sense to pass a pointer to the walker structure and do the > > flag check inside the helper. > > > > That way, we avoid extra churn if/when we need extra state or > > bookkeeping around the walk. > > Sure, let's go that way instead. v3 on the way lol :) Well, going this route is going to require hoisting around a few things. I'd very much prefer to keep the RCU indirection ifdeffery all in one place, but I'll need to haul it all after the definitions of kvm_pgtable_walker and kvm_pgtable_walk_flags but before the definition of kvm_pgtable (as it needs kvm_pteref_t). I'm not too bothered by it, but not quite as small of a bandaid this time around. -- Thanks, Oliver