Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2646223rdb; Wed, 15 Nov 2023 06:53:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IFApnNVyALLceJ+BOUpWO5s2BB05h5lAzTKgHbXD6+J5z0CvqUYekwvwakp1K3f2vMCM0Wv X-Received: by 2002:a05:6a00:27a9:b0:6b2:7a88:7128 with SMTP id bd41-20020a056a0027a900b006b27a887128mr12582975pfb.22.1700060004876; Wed, 15 Nov 2023 06:53:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700060004; cv=none; d=google.com; s=arc-20160816; b=oBkwvJfBP9DL1BjB6/j3XxIlWxqIvs9sFnvI++POnZvRgwsexmB+IQJaXDMDeynogC HNYGbjF1dT+3qrHyL+WAYrhr66+FY0tfgTmyRG3BNEPRhHTnHoiF0CKcvc430ikDHCSw Lwm9mqcqP161y++Cn0qxbmNdG/wnYDOuMe8SzPoxpa4/2N3vtksJmJi7U0GhpWl1qHKY iWCJAjZ8cy1LUZfYfxXuwu3Yk0Dx2YTHjP3xFXwJZCagxUJeh3TSjJqPMO95houfACxr CcobNDSQW/VS/cJ5RLqqSvNDjqizA01X/SEnqr412Qs+dEB911iG7jYVHw4m0Hu3xmUd P/aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=2ubx/NngL/iwKKCM4WwyG+5IoM8JO6sKaWNp21mi5Us=; fh=VmMUTRhJr0azYbrrY0CN1zjZsTXZ7ZLjg9BDB7KItW0=; b=WqBycl3vkAJdwKPhm26qgoNC7mE223fBcn1lB3r9Qdvcd8zj/lnnhmfAHcrvyXevHn kkFGWw9kZKXqBY8KrTCKk/Ux8SRLyI6Qyqbny8YNwd0OyWBDpt2GZGUGst3Ec9EfqMtm RKxpfGqZn956DQ4zIYaqGCs0G7HP9P0BAZyKdNjRjf0AaK0hMnxFhSORqcjeUw83bOwz llajUFJuDqHewa5+gqS1jftQMhiGEhUuc6og1ymzNXuryLI2zie9yin+SuRuOCpBQz5E 3AwnapgETeSxTyebF05M8eFh2l7h8cVIdCIgFUVroieo71ssYGbiqFxBcclijSuQx5oZ BJxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id i7-20020a6561a7000000b005b86b35778fsi9973464pgv.180.2023.11.15.06.53.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 06:53:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 95B06802A6F7; Wed, 15 Nov 2023 06:53:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344173AbjKOOxM (ORCPT + 99 others); Wed, 15 Nov 2023 09:53:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344036AbjKOOxL (ORCPT ); Wed, 15 Nov 2023 09:53:11 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 107678E; Wed, 15 Nov 2023 06:53:08 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 706491FB; Wed, 15 Nov 2023 06:53:53 -0800 (PST) Received: from [10.57.83.164] (unknown [10.57.83.164]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E01893F641; Wed, 15 Nov 2023 06:53:05 -0800 (PST) Message-ID: Date: Wed, 15 Nov 2023 14:53:04 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/3] iommu/arm-smmu: introduction of ACTLR for custom prefetcher settings Content-Language: en-GB To: Bibek Kumar Patro , will@kernel.org, joro@8bytes.org, dmitry.baryshkov@linaro.org, a39.skl@gmail.com, konrad.dybcio@linaro.org, quic_pkondeti@quicinc.com, quic_molvera@quicinc.com Cc: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, qipl.kernel.upstream@quicinc.com References: <20231114135654.30475-1-quic_bibekkum@quicinc.com> <20231114135654.30475-2-quic_bibekkum@quicinc.com> <372885ab-b24d-44ae-afb8-76755bcd6e21@arm.com> <40282b6e-9524-4a88-97ca-3ce890317279@quicinc.com> From: Robin Murphy In-Reply-To: <40282b6e-9524-4a88-97ca-3ce890317279@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 15 Nov 2023 06:53:21 -0800 (PST) On 2023-11-15 1:54 pm, Bibek Kumar Patro wrote: > >>> @@ -467,6 +505,9 @@ static struct arm_smmu_device >>> *qcom_smmu_create(struct arm_smmu_device *smmu, >>>       qsmmu->smmu.impl = impl; >>>       qsmmu->cfg = data->cfg; >>> >>> +    if (data->actlrcfg && (data->actlrcfg->size)) >>> +        qsmmu->actlrcfg = data->actlrcfg; >> >> Do we really need to replicate multiple parts of the data, or would it >> be sensible to just replace qsmmu->cfg with qsmmu->data and handle the >> further dereferences in the places that want them? >> > > Mm, could not understand this properly. :( Could you help explain more > please? > As per my understanding aren't data and qsmmu different structures. > qcom_smmu is a superset of arm_smmu housing additonal properties > and qcom_smmu_match_data is kind of a superset of arm_smmu_impl with > additional specific implmentations, so both needs to be in place? > Apologies if I understood your statement incorrectly. My point is that the data is static and constant, so there's really no point storing multiple pointers into different bits of it. So rather than: qsmmu->cfg = data->cfg; qssmu->actlrcfg = data->actlrcfg; ... do_something(qsmmu->cfg); ... do_other_thing(qsmmu->actlrcfg); we can just store the one pointer and have: qsmmu->data = data; ... do_something(qsmmu->data->cfg); ... do_other_thing(qsmmu->data->actlrcfg); Thanks, Robin. >>> + >>>       return &qsmmu->smmu; >>>   } >>> >>> diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.h >>> b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.h >>> index 593910567b88..4b6862715070 100644 >>> --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.h >>> +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.h >>> @@ -9,6 +9,7 @@ >>>   struct qcom_smmu { >>>       struct arm_smmu_device smmu; >>>       const struct qcom_smmu_config *cfg; >>> +    const struct actlr_config *actlrcfg; >>>       bool bypass_quirk; >>>       u8 bypass_cbndx; >>>       u32 stall_enabled; >>> @@ -25,6 +26,7 @@ struct qcom_smmu_config { >>>   }; >>>