Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1131530pxb; Thu, 4 Mar 2021 04:15:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJxp1UZGst1Hh0DSGRY4bYyiC0dmgN4XnDmkfzUOTWk4KIruAnpNbHmm6Cti5u1c2y+0WJPS X-Received: by 2002:a17:906:110d:: with SMTP id h13mr3954425eja.357.1614860144317; Thu, 04 Mar 2021 04:15:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614860144; cv=none; d=google.com; s=arc-20160816; b=MuJ0eZ9R4qGrRH2LXFiwW7gZrNKRwb9QoKTBjWbAwJdyYNHvN0Wn65OnRCM5unNSCm ZLdkOfk59AQ7ffJiBj84ChF8sdib2ZhqYgNUh6K4bsNFmRGfHGOJLAh+r3fXELUKfHdK UB5gSrRos3zf6JRK6zFeaFP+0c17wfLdRwKSxhJnVPIAyOofJwyyxpY7kmVCD9KT+qD1 lZm5tSvNLdmVpnVdmAftAeepRCussMi7qNZKQ1gJrft56L86KOb7OqWw5AR3TOmAu1TU 2zmemHJ4pMZcgvHprw0qIVmQzmbtKWhlMa7b2u8+bxIyaOs7hy4V76XRRxl76oyEyyGy ZKew== 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=I6oAOf+1ZMeSBc0SuKKOMGczX7volpKJqxQn9uhodGs=; b=x/xkm8j9Lj00+EA/DoQZaht9wQp4wJpV1KCQd2umIJcyuHhOHdWoF0HQQfR/fTUepJ Ih1e/5lNPI5hag0ixfm/lr8j5B1xH/uXc/v+KQoLfdsi8tEfI+MbxR//LBb/qZ/xt9s8 fGCM7A+Zrk1nh7FKraeF/Ba0OHvZBnuqEysIEDMK3RvRcbPWi4hIpxccstth3qX9mR7y HnbZoaP6rsF/CyK6mBPlAhVeLC+5ANJFjV6t+2xflVHp4T8Px9XjuCs99gfOtM8VlwEN qEwnvOyUsuEvFQEfF9l/Ik+OuFJm01czOH+3DqIjhNROMPXQTGh3yMntrcgXIZeXfzlU oeSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VwJ+VHKJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bh4si3725191ejb.554.2021.03.04.04.15.21; Thu, 04 Mar 2021 04:15:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VwJ+VHKJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1580871AbhCCSfW (ORCPT + 99 others); Wed, 3 Mar 2021 13:35:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345206AbhCCRRL (ORCPT ); Wed, 3 Mar 2021 12:17:11 -0500 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DAFFC06175F for ; Wed, 3 Mar 2021 09:16:30 -0800 (PST) Received: by mail-wm1-x32e.google.com with SMTP id n4so7042508wmq.3 for ; Wed, 03 Mar 2021 09:16:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=I6oAOf+1ZMeSBc0SuKKOMGczX7volpKJqxQn9uhodGs=; b=VwJ+VHKJcT2Nf/kj3+7hqNO+M8Jub4xI+zPtfFYoQaqgHTl43E/lHcDJW8zwY4eHUq PiLw+a7S0TTjtZt0wIdcfocKW4sdtFAs+BSeXQZ7Un71ucylyW/orAbwxZOd7ajhi3GX BrLrJ0idIv26+gJboNFBabl6If2U02DArAp2HxxleK+xXxnRqmRLke66PLBm06i/jUHb /08oxS3l20Pa7g0INWbcIVqHiKWSiGijLLQ2QZcfFHHpI5KTNRRHdE3+U6JeNHXDdKBq A43uJFcfy0NniInhBbUpqMWuHe8aZYtoy4MIMq65vyW2fo9cxrlohPDpfXYdJndR4OVD 4CPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=I6oAOf+1ZMeSBc0SuKKOMGczX7volpKJqxQn9uhodGs=; b=qHT3cCqAsQrPLzECxdL0rNGRobM6PXGvs1KQTZPg3pfKvBPJ/HSzWE5hM7J1NgWs26 5cbHQLPWEEToAP2rj+q0JQJtaLbSEWYqqBmdufCWPAHkhFLpFtWLooUxY+sYgQsUGRTI 9h92SNLe4YM1TTxmhaCeklmy0j1XeD6HLRw7r5KsUKwrlgLYCong6LIQCM+VqY/bAHxr Qz7VY6QV2ylLeGQHT7xlH3+eOzK1OmuvDeLvp5XpV9wxg0wsW8bgZDEmXv7V+BgNr2Mc CvySEMyoPWUBQdb80bYsjFCRW8FXBFA9UGmA86X4hpI0Kb427isOHNqd3Y2UxjIvM0q3 DB2Q== X-Gm-Message-State: AOAM533xrzUv6RPNafzfXCTzRKU0nbPaUwo+i3JxiqzyKV3THSRemv5F Z7y5VWqMb4tx2NZ+guhUZd9myA== X-Received: by 2002:a1c:3c02:: with SMTP id j2mr62026wma.92.1614791779611; Wed, 03 Mar 2021 09:16:19 -0800 (PST) Received: from myrica ([2001:1715:4e26:a7e0:116c:c27a:3e7f:5eaf]) by smtp.gmail.com with ESMTPSA id o2sm6209999wme.16.2021.03.03.09.16.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 09:16:18 -0800 (PST) Date: Wed, 3 Mar 2021 18:15:57 +0100 From: Jean-Philippe Brucker To: Vivek Gautam Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, virtualization@lists.linux-foundation.org, joro@8bytes.org, will.deacon@arm.com, mst@redhat.com, robin.murphy@arm.com, eric.auger@redhat.com, alex.williamson@redhat.com, kevin.tian@intel.com, jacob.jun.pan@linux.intel.com, yi.l.liu@intel.com, lorenzo.pieralisi@arm.com, shameerali.kolothum.thodi@huawei.com Subject: Re: [PATCH RFC v1 05/15] iommu/arm-smmu-v3: Set sync op from consumer driver of cd-lib Message-ID: References: <20210115121342.15093-1-vivek.gautam@arm.com> <20210115121342.15093-6-vivek.gautam@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210115121342.15093-6-vivek.gautam@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 15, 2021 at 05:43:32PM +0530, Vivek Gautam wrote: > Te change allows different consumers of arm-smmu-v3-cd-lib to set > their respective sync op for pasid entries. > > Signed-off-by: Vivek Gautam > Cc: Joerg Roedel > Cc: Will Deacon > Cc: Robin Murphy > Cc: Jean-Philippe Brucker > Cc: Eric Auger > Cc: Alex Williamson > Cc: Kevin Tian > Cc: Jacob Pan > Cc: Liu Yi L > Cc: Lorenzo Pieralisi > Cc: Shameerali Kolothum Thodi > --- > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-cd-lib.c | 1 - > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 7 +++++++ > 2 files changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-cd-lib.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-cd-lib.c > index ec37476c8d09..acaa09acecdd 100644 > --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-cd-lib.c > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-cd-lib.c > @@ -265,7 +265,6 @@ struct iommu_vendor_psdtable_ops arm_cd_table_ops = { > .free = arm_smmu_free_cd_tables, > .prepare = arm_smmu_prepare_cd, > .write = arm_smmu_write_ctx_desc, > - .sync = arm_smmu_sync_cd, > }; > > struct iommu_pasid_table *arm_smmu_register_cd_table(struct device *dev, > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > index 2f86c6ac42b6..0c644be22b4b 100644 > --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > @@ -1869,6 +1869,13 @@ static int arm_smmu_domain_finalise_s1(struct arm_smmu_domain *smmu_domain, > if (ret) > goto out_free_cd_tables; > > + /* > + * Strange to setup an op here? > + * cd-lib is the actual user of sync op, and therefore the platform > + * drivers should assign this sync/maintenance ops as per need. > + */ > + tbl->ops->sync = arm_smmu_sync_cd; > + Modifying a static struct from here doesn't feel right. I think the interface should be roughly similar to io-pgtable since the principle is the same. So the sync() op should be separate from arm_cd_table_ops since it's a callback into the driver. Maybe pass it to iommu_register_pasid_table(). Thanks, Jean