Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1760330pxb; Wed, 9 Feb 2022 04:02:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKRKlRhYj7nrWakP38P5y4mmn2qbd/EynQu+msLATMtRqtNLdqdG+H0OEHDlqNYAerbAzY X-Received: by 2002:a63:e909:: with SMTP id i9mr1658037pgh.202.1644408155286; Wed, 09 Feb 2022 04:02:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644408155; cv=none; d=google.com; s=arc-20160816; b=Peob8eL+my3BUVOPXY8Eee7b+MRqD/0fEb5Qz1ycN/1iBjBYE4qmhX6+7EZJNtWUQt YPsLymdyvlEHlmAEA2QxTmIMSwBqYQ2hPrgwHRLvBeFpjbeyGIpRafNgUnUNL6rR4ig/ gRBMN5L8kmHdHlDLIuGXyNVSTrQf/3rKt1f64CAmgSzc3ekQ/070BIaWPkuIdLXxV7+w g1Ns38k9QACByMZdvENOi596kEcN39nVJrEFvxuDOZ30mEXMhg9QKXGvrl73zNJMOHCz h7PPyshgTW9v+0BJUREk0FhM5t2Bvs0LKnQO/yPB1G0fQTCI5/aPpTrQcpUgJBm/ZTDK Qc/A== 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:subject:user-agent:mime-version:date:message-id; bh=tKEgnmXRAVKOverpf644kI6gOQRYBUxZoozZhCpThtw=; b=PeTA/qswsx+aLld/SnbALzPjKwsJ5jQWeNfXP3bCISH95gbPkN00hwCizMwivr4UNA QRsvn2SGGNQ1FT32PXI4nZU55ILnOpKKKhwnMMVZjOUBNymsJICMjacrDyEkmeWCBYHv 83SpxOPLC/bGtklEU0TergdYojc9ciVBuhZHlczG4nuLWyr9aoUn2o1g3ETwtcndIwg9 3gaa5CutHqIMWX+nFXBnRAoBKYCGl5us9uvn7IrqXxliHd5v1y0Jgl1h8kvaZnpiw6c/ xVKm5thSQSGTjuUysBL4HAlShs9bDD8BB3U1bsjBppZkYEbtTDhSHxt6nk9caNTIs1lA /nSA== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id s10si8647384plg.590.2022.02.09.04.02.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 04:02:35 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0E6D4E080BD4; Wed, 9 Feb 2022 02:04:25 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356384AbiBHL5M (ORCPT + 99 others); Tue, 8 Feb 2022 06:57:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233434AbiBHL5L (ORCPT ); Tue, 8 Feb 2022 06:57:11 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38EFEC03FEC0; Tue, 8 Feb 2022 03:57:10 -0800 (PST) Received: from fraeml704-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4JtLw80t75z688jd; Tue, 8 Feb 2022 19:52:08 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml704-chm.china.huawei.com (10.206.15.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.21; Tue, 8 Feb 2022 12:57:07 +0100 Received: from [10.47.82.28] (10.47.82.28) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 8 Feb 2022 11:56:53 +0000 Message-ID: <144329a3-8125-1975-7f23-a247343a679e@huawei.com> Date: Tue, 8 Feb 2022 11:56:48 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH v3 8/8] iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity To: Yicong Yang , Yicong Yang , "gregkh@linuxfoundation.org" , "helgaas@kernel.org" , "alexander.shishkin@linux.intel.com" , "lorenzo.pieralisi@arm.com" , "will@kernel.org" , "mark.rutland@arm.com" , "mathieu.poirier@linaro.org" , "suzuki.poulose@arm.com" , "mike.leach@linaro.org" , "leo.yan@linaro.org" , "Jonathan Cameron" , "daniel.thompson@linaro.org" , "joro@8bytes.org" , "Shameerali Kolothum Thodi" , "robin.murphy@arm.com" , "peterz@infradead.org" , "mingo@redhat.com" , "acme@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "coresight@lists.linaro.org" , "linux-pci@vger.kernel.org" , "linux-perf-users@vger.kernel.org" , "iommu@lists.linux-foundation.org" CC: "Zengtao (B)" , "liuqi (BA)" , Zhangshaokun , Linuxarm , "Song Bao Hua (Barry Song)" References: <20220124131118.17887-1-yangyicong@hisilicon.com> <20220124131118.17887-9-yangyicong@hisilicon.com> <4f6f6e0f-4398-3018-cc35-6aa7ea1305fe@huawei.com> From: John Garry In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.47.82.28] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 08/02/2022 11:21, Yicong Yang wrote: >> This patch should be earlier in the series, before the PTT driver, and the comment on hisi_ptt_check_iommu_mapping() should mention what is going on here. >> > ok I'll reorder the serives and modify the comments of hisi_ptt_check_iommu_mapping() like: > > /* > * The DMA of PTT trace can only use direct mapping, due to some > * hardware restriction. Check whether there is an iommu or the > * policy of the iommu domain is passthrough, otherwise the trace > * cannot work. IOMMU, capitalize acronyms > * > * The PTT device is supposed to behind the arm smmu v3, which > * should have passthrough the device by a quirk. Otherwise user > * should manually set the iommu domain type to identity through > * sysfs. Sorry, but I don't really understand your meaning here. I did not think that if we have a default domain then we can change via sysfs to anything else. > */ > >>> Signed-off-by: Yicong Yang >>> --- >>>   drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 16 ++++++++++++++++ >>>   1 file changed, 16 insertions(+) >>> >>> 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 6dc6d8b6b368..6f67a2b1dd27 100644 >>> --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c >>> +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c >>> @@ -2838,6 +2838,21 @@ static int arm_smmu_dev_disable_feature(struct device *dev, >>>       } >>>   } >>>   +#define IS_HISI_PTT_DEVICE(pdev)    ((pdev)->vendor == PCI_VENDOR_ID_HUAWEI && \ >>> +                     (pdev)->device == 0xa12e) >> I assume that not all revisions will require this check, right? So if you are very confident that the next revision will be fixed then I would add a check for this current broken revision. >> > For current revisions it's necessary. >