Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7258057ybp; Wed, 16 Oct 2019 06:13:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzTsVFDQ09eGTkur1yoEGeiKRlp5cQQ10cdCsjBHBljJjpboZBxH165jSVq3dT6RnOX9wHF X-Received: by 2002:a17:906:3913:: with SMTP id f19mr40119851eje.161.1571231639509; Wed, 16 Oct 2019 06:13:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571231639; cv=none; d=google.com; s=arc-20160816; b=A/xqrUvTRAlo+szcOt0pQt1dpFxu5Y8GZp/0JkT30+6RTBFXonDQM0ILE99UWp0QFL jf7jXsgwMzrxgQgvKM3JO0/Y67wZ/uHflXsuaVY1BToVCKpq4zrlQxQYYjdz4K1V9o0W sWmuHwq7UjIAbVplALfjdFoK16TxaCKMw3IAwq363KQBXb/oemHO3DGBiLXRQ1vyRX58 bXTXdCjw+zlzjckyhdpw5nu8iH0ljwLqTn0VErrIVpHg7nhh+VgR+dvt6NTzcaLFxUA7 3SXMqOGQz2kxSSVORBvzOUrim5f3jaGe2mD1VzvQQG7M0Ho/3z2A1DstSNzwnW4fJirN L9og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=1wWuqXweyaUi+sNytl4oWe9vR70iwxB14ueze16QUfM=; b=V2AuiSS3QcTD+JRRWBTQZ3YOzE8zo3HcG+d5ZMunU8Acmj4y/NjDqTzrZq5IBAIv4J lLaEr1tf0fC5EpciwUnPlDDD6a69yn7XB/iOwmlaDtVdvetGI4pkO/oUsSQ7vRwW8fZV MZB/nekbH2yiJpQ5E/JqlNC53w9oEwJI8gcN1dhKi3mlLpmwNV/3JRQe7gYqYAvbowrx YRVKSMd8MMVPlox+lJVR7gscVauE5e6+kOoiM4IqPINfQ4Uv3qozw/xcuO/PHzB2kCRs oYYzZjyTpINkFgZMxfpbl8GBjRsqYl0VpgZLe1QpZEfYctPYjlcOYn8WtYifFK14b8eL UerQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10si14153924edk.115.2019.10.16.06.13.36; Wed, 16 Oct 2019 06:13:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388908AbfJPIsB (ORCPT + 99 others); Wed, 16 Oct 2019 04:48:01 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:4180 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726231AbfJPIsB (ORCPT ); Wed, 16 Oct 2019 04:48:01 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 8F356CBF38CF2F34D498; Wed, 16 Oct 2019 16:47:59 +0800 (CST) Received: from [127.0.0.1] (10.202.227.179) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.439.0; Wed, 16 Oct 2019 16:47:53 +0800 Subject: Re: [RFC PATCH 0/6] SMMUv3 PMCG IMP DEF event support To: Robin Murphy , , , , , References: <1569854031-237636-1-git-send-email-john.garry@huawei.com> <66a3ce9f-d3cd-110f-7353-46e6eaf25b7c@arm.com> CC: , , , , , , , From: John Garry Message-ID: <1d546b4b-a2ad-49da-b532-951232093a9f@huawei.com> Date: Wed, 16 Oct 2019 09:47:45 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <66a3ce9f-d3cd-110f-7353-46e6eaf25b7c@arm.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.179] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/10/2019 19:00, Robin Murphy wrote: > Hi John, > > On 30/09/2019 15:33, John Garry wrote: >> This patchset adds IMP DEF event support for the SMMUv3 PMCG. >> >> It is marked as an RFC as the method to identify the PMCG implementation >> may be a quite disliked. And, in general, the series is somewhat >> incomplete. >> >> So the background is that the PMCG supports IMP DEF events, yet we >> have no >> method to identify the PMCG to know the IMP DEF events. >> >> A method for identifying the PMCG implementation could be using >> PMDEVARCH, but we cannot rely on this being set properly, as whether this >> is implemented is not defined in SMMUv3 spec. >> >> Another method would be perf event aliasing, but this method of event >> matching is based on CPU id, which would not guarantee same >> uniqueness as PMCG implementation. >> >> Yet another method could be to continue using ACPI OEM ID in the IORT >> code, but this does not scale. And it is not suitable if we ever add DT >> support to the PMCG driver. >> >> The method used in this series is based on matching on the parent SMMUv3 >> IIDR. We store this IIDR contents in the arm smmu structure as the first >> element, which means that we don't have to expose SMMU APIs - this is >> the part which may be disliked. >> >> The final two patches switch the pre-existing PMCG model identification >> from ACPI OEM ID to the same parent SMMUv3 IIDR matching. >> >> For now, we only consider SMMUv3' nodes being the associated node for >> PMCG. > Hi Robin, > Two significant concerns right off the bat: > > - It seems more common than not for silicon designers to fail to > implement IIDR correctly, so it's only a matter of time before > inevitably needing to bring back some firmware-level identifier > abstraction (if not already - does Hi161x have PMCGs?) Maybe there's a way that we can switch to this method, and leave the door open for an easy way to support firmware-level identifier again, if ever needed. I'm not too pushed - this was secondary to just allowing the PMCG driver know the associated SMMU model. And, no, hi161x does not have any PMCGs. > > - This seems like a step in entirely the wrong direction for supporting >. So to support PMCGs that reference a Named Component or Root Complex, I thought that the IORT parsing code would have to do some secondary lookup to the associated SMMU, through the Named Component or Root Complex node. What was your idea here? Note: I do acknowledge that an overall issue is that we assume all PMCG IMP DEF events are same for a given SMMU model. > > Interpreting the Node Reference is definitely a welcome improvement over > matching table headers, but absent a truly compelling argument to the > contrary, I'd rather retain the "PMCG model" abstraction in between that > and the driver itself (especially since those can trivially be hung off > compatibles once it comes to DT support). For DT, I would assume that we just use compatible strings would allow us to identify the PMCG model. On a related matter, is there still a need to deal with scenarios of the PMCG being located within the SMMU register map? As you may remember, we did have this issue but relocated the PMCG to outside the SMMU register map in a later chip rev. Cheers, John > > Thanks, > Robin. > >> >> John Garry (6): >> ACPI/IORT: Set PMCG device parent >> iommu/arm-smmu-v3: Record IIDR in arm_smmu_device structure >> perf/smmuv3: Retrieve parent SMMUv3 IIDR >> perf/smmuv3: Support HiSilicon hip08 (hi1620) IMP DEF events >> perf/smmuv3: Match implementation options based on parent SMMU IIDR >> ACPI/IORT: Drop code to set the PMCG software-defined model >> >> drivers/acpi/arm64/iort.c | 69 ++++++++++++++-------------- >> drivers/iommu/arm-smmu-v3.c | 5 +++ >> drivers/perf/arm_smmuv3_pmu.c | 84 ++++++++++++++++++++++++++++++----- >> include/linux/acpi_iort.h | 8 ---- >> 4 files changed, 112 insertions(+), 54 deletions(-) >> > > . >