Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp1229335rwl; Thu, 10 Aug 2023 08:12:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF4HBkXnaGXKKfQ68TBWLmJn0caGXKxVglva5ADjTEpwTXycrCF66stXuACuNb4NliGfN4c X-Received: by 2002:a17:902:c193:b0:1bb:2020:be0d with SMTP id d19-20020a170902c19300b001bb2020be0dmr2655679pld.14.1691680345851; Thu, 10 Aug 2023 08:12:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691680345; cv=none; d=google.com; s=arc-20160816; b=BANhz6MClNxbjjhC/RA275qT+beh07FwK48K2vSu/nB8sBnupwxd3NIb/1IeW7NexR 5BV3YRN4wRk3iiZkTHkCD+ZfZvOhfgSH8V5RbS71RtqdtEbSxT3Nq+N6G74N/yUKzMwX eEnx65CRbfedHXtfVaNnfP1L6oRkxuEOqXMK4y2cAkr6i69YYF1HFN7eQEZpVEGGHXXo NzgFo+wHzJcoCBNOBeesjp18Bsz8fPouXC36nv5bzK1MY/MDRTGbv6YLrGYzvUr5DMo/ lg7AUs+kyf42rDTEeRG/eyBdpiIFe9uSHfC+azQlPhLoBVQ7R+T2U89drrDyvmW5qVZN p8CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=IUkdTFfcSSV4dEIj5sKOpp2TWG5ORBhMHlltOyfJ8wY=; fh=UcPNuZLtXCMWvwdFRdGd6IzVV+LZMFlmkGHKUGI1KtY=; b=q0NhaL2zm/9w9Jt0wGgqVV0UTaesg3rCiYsR0OTyWB2ylioLOWFsBJafwfJNfhTAsk OU/7pqOf0jKeowawDsEZRUbrdqd1PJCvgFdLxGZ+Zhzs4jor22cp0BMm0i8pp8cs8j7m HeP8NzX5W1LSuupKkq+ojI6UMuNhjfu0sg+xdX6svVTzJu1caDIwx0Hno7V6HCOrwdQG +ydgGLBEcETlIHI4okXlz9xF6tKxcFuzPzXfiNA7C/IDURBeUYq1kiXxSjMRx0RZMV1C GMZ4HF+LyWctN0fwYXN7gc2NVX1c0vq9Ti7OvnP/hdwPhee+8pd/jHrCxxjBw0k5vc8B gEvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CEfmHSss; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h13-20020a170902f54d00b001bc17ab8d6esi1685763plf.530.2023.08.10.08.11.59; Thu, 10 Aug 2023 08:12:25 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=CEfmHSss; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235794AbjHJOe4 (ORCPT + 99 others); Thu, 10 Aug 2023 10:34:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235637AbjHJOez (ORCPT ); Thu, 10 Aug 2023 10:34:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0166A2698 for ; Thu, 10 Aug 2023 07:34:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8B03E65E46 for ; Thu, 10 Aug 2023 14:34:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81231C433C7; Thu, 10 Aug 2023 14:34:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691678094; bh=qFb1AWXSv0ptnyqYb+YQ+216zdRiP+gYPb0xgmTKYqQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CEfmHSssrdc2+ny+nS195Z3pwQlAZ3ergx6I9Wva+RFjs3CazccFz9W9TnGpT25CT nOBeQopYo4AN/lyJIjnI9ycBidOYhH6S5RE7n1XO/3HHKGP+7o4VBNtBCgwS3FUuB7 yl4m/zfCpGvyuK6fG0SnYcuVngtU42PjsyVJ42iX652WA4Ty+rusPH5f2bBvAyqgXC U10GuLWOYLKNv/s1WZjWkqklAVSCfc7Mg/+GbuIIUNVZ5Etbzzq3fOZ0vwv3UXmpWC avm2WSynsMThlIljQzcwfdKeevAhGe9cNofemwI3uSqt4s6cCTjxXlgu0OMoGNrl5e kPf87cCoCaLHw== Date: Thu, 10 Aug 2023 15:34:49 +0100 From: Will Deacon To: Michael Shavit Cc: iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, robin.murphy@arm.com, nicolinc@nvidia.com, jgg@nvidia.com, jean-philippe@linaro.org Subject: Re: [PATCH v5 6/9] iommu/arm-smmu-v3: Move CD table to arm_smmu_master Message-ID: <20230810143448.GB5795@willie-the-truck> References: <20230808171446.2187795-1-mshavit@google.com> <20230809011204.v5.6.Ice063dcf87d1b777a72e008d9e3406d2bcf6d876@changeid> <20230809135024.GD4226@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,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 Thu, Aug 10, 2023 at 05:45:03PM +0800, Michael Shavit wrote: > On Wed, Aug 9, 2023 at 9:50 PM Will Deacon wrote: > > > > On Wed, Aug 09, 2023 at 01:12:02AM +0800, Michael Shavit wrote: > > > @@ -2203,7 +2186,7 @@ static int arm_smmu_domain_finalise(struct iommu_domain *domain, > > > ias = min_t(unsigned long, ias, VA_BITS); > > > oas = smmu->ias; > > > fmt = ARM_64_LPAE_S1; > > > - finalise_stage_fn = arm_smmu_domain_finalise_s1; > > > + finalise_stage_fn = arm_smmu_domain_finalise_cd; > > > > Why is this a better name? Now we have inconsistency with > > arm_smmu_domain_finalise_s2(). > > There was a time where s1cfg represented the entire STE and carried > the entire cd table. We've gotten rid of s1cfg, and now only store > arm_smmu_ctx_desc in the arm_smmu_domain for stage 1 domains. > arm_smmu_domain_finalise_cd is IMO more clear, especially given the > historical baggage around `s1`. Ok, but it's the inconsistency I object to. I don't think it's clear at all to have arm_smmu_domain_finalise_cd() and arm_smmu_domain_finalise_s2(). The easiest thing is to leave it as-is. Will