From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAB86C433DB for ; Thu, 4 Mar 2021 00:06:54 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 51DF064E6F for ; Thu, 4 Mar 2021 00:06:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 51DF064E6F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LHX7vrhvFKm1jjusvrMG5c+F/vNl7DTDHPp+JrROYv4=; b=ccYO/T7IoP63JtONgy9x9Q1r0 h1UTvLbPURjDIXCfRt+tolyHEJGKOKafFICZeaZNlp0M66YiH6lbgCfwaxK1CJB0Of5iidbWpKTpB Bn3/S+9qaTKNXZw2HewL/jWCEnub5+IsjpMTONITZygmtKKGLyPIcT6VfbzeGPiOwW/1DnU9n3Ieo w81i1/vC2oIPEhXZx/rXlttg0iQL35JM7HzUdo763dfPj0eQZ0K6DwfDVxytadyVnyFiJGOPqIA3K WJkVz4C6FkSnIAlHsh3YWyx0IJ41y2WALMDZvgDa2fFTLU2oz1osW/ngRo4FqGlXYM1vW/GRoqpde XXM5jpM/A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lHbSN-0073wg-MM; Thu, 04 Mar 2021 00:03:07 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHV6z-005lDe-KV for linux-arm-kernel@lists.infradead.org; Wed, 03 Mar 2021 17:16:40 +0000 Received: by mail-wm1-x332.google.com with SMTP id i9so5815787wml.0 for ; Wed, 03 Mar 2021 09:16:36 -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=fmYiVkJzLGu2asvbF/O8m2B/CnztTYhGHth6CNhc2fyUURengzLKWsxPYEnj4EfaWT L/MjEmn2kl3idsbeWrIn/0xyEqBi+HLGCEl9ZSWmARSVLnZiiwdk2S6oJzaH9M9S8VLO rvxLHTGD/ExJoBCv3gCqg8LuR/MNdKJku0j8wvQTMPXxjcUa9tlKil7IjpZYhuZiUXLf m2SQkoMYR+JDjfX/IjvBQkEQQpY3151RbNupAzYSUnxt+RxAKTa5JRFIQI4AVsmMBukh Q/8HwQnFe6E6dIoBJHblgH+4DCbCsdCxAns5426kC21Y2F8EAlI4AnjO5DBepM8r/MKG i68g== X-Gm-Message-State: AOAM533n3zMPsgpPoFo9YnG6xPVTbl1WR+SF9LiBDOBMJr2IRfnpaW7b 2dF7NcKHBaJzzrXjs0KIYjnCmQ== X-Google-Smtp-Source: ABdhPJxEGFLtLtT2CVJqW85OgSqITesZWdYSO96CmRmaHjOUEzXMjLr6QhIIoiQz8us9HKvesrIHzQ== 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-Disposition: inline In-Reply-To: <20210115121342.15093-6-vivek.gautam@arm.com> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel