Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp6394356ybp; Tue, 15 Oct 2019 14:22:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqyE7kLCvHcehebD470zjFLwE5TEJN5N6sbxOOuP2R3Ade675RP+EEVM2CxkEdLXIzfaasYp X-Received: by 2002:a17:906:7094:: with SMTP id b20mr37179316ejk.134.1571174548629; Tue, 15 Oct 2019 14:22:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571174548; cv=none; d=google.com; s=arc-20160816; b=gq/jyHv/vOxC0eBfhIIJSfHBBgKCxxdifz4C2grFE02OA61ZBKMxJ0uf7hckIod8wP IdUaNUJ8g8UPqiM8ijePoNUtmXcrDUZ1MUnuLCKj85M2XOHItnxU2b6/41IXgJ497RVJ 93Sd4YRRKzApDfCAF3GO2LoyrKyrXR1htJldE80tU2JRnK6OUxn5BC2msjp63gd5X7E6 bMwq7GBHK63nus6Q0ucGPHZ+efi3yzu/RxWJl7yVLxvAuMjOrmMqdhlT3iZc1vTlq3sV 3JSUpnsxfptc+pFsNr7XUAZBUqvn3nJ61AeBziPvv8DCpBw0jPb5WJ0jYILc5WC8M0HO ZdHw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=3kMay4lMVXeGXO6pDZgEomUUZABoYJ+FZn8brxiDH6Q=; b=OEd7nNvXTk10j7EMuW1gmr/fVPCoJal0xEJJTgLcjzLBk53qmxMWic/F4DIZgNL9MJ ijCDWDMzC6zruYOIB9cMEKWeA76zMvUXfzXTwLfJpHS5lil04HsLz86jl4w7eQte3iWS y0J5VN281sqWDk+X9C8K/970OdEt2Jky0OPatsl9dAQmA/xBmGPZT6wMvHAwcUdrUUeL c1JgYuCmWatfsULXoKEzjzPP2jJQEKB83WkijkhzPlwxLCJT6CUvfCEMRAv+h5mVRvuQ 3R/plkuCx0TUn3cCyEidCix6GzyvsFrSbL5rw9yYGVQnq18wUj64xjDcFHWgk4PTSOA/ 7XYg== 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 v31si13632204edm.402.2019.10.15.14.22.05; Tue, 15 Oct 2019 14:22:28 -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 S2388914AbfJOSAV (ORCPT + 99 others); Tue, 15 Oct 2019 14:00:21 -0400 Received: from foss.arm.com ([217.140.110.172]:44858 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725820AbfJOSAV (ORCPT ); Tue, 15 Oct 2019 14:00:21 -0400 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 B79BE337; Tue, 15 Oct 2019 11:00:20 -0700 (PDT) Received: from [10.1.197.57] (e110467-lin.cambridge.arm.com [10.1.197.57]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EA7303F6C4; Tue, 15 Oct 2019 11:00:18 -0700 (PDT) Subject: Re: [RFC PATCH 0/6] SMMUv3 PMCG IMP DEF event support To: John Garry , lorenzo.pieralisi@arm.com, guohanjun@huawei.com, sudeep.holla@arm.com, mark.rutland@arm.com, will@kernel.org Cc: shameerali.kolothum.thodi@huawei.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, rjw@rjwysocki.net, lenb@kernel.org, nleeder@codeaurora.org, linuxarm@huawei.com References: <1569854031-237636-1-git-send-email-john.garry@huawei.com> From: Robin Murphy Message-ID: <66a3ce9f-d3cd-110f-7353-46e6eaf25b7c@arm.com> Date: Tue, 15 Oct 2019 19:00:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <1569854031-237636-1-git-send-email-john.garry@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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?) - This seems like a step in entirely the wrong direction for supporting PMCGs that reference a Named Component or Root Complex. 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). 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(-) >