Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp374910rdb; Sat, 19 Aug 2023 05:28:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHqTSRDuk6USBc3scsYi2KXa2JYWnwU19BG64qfPq/4iiTDTDTbIHLuUtWPh091/ZeyxmLL X-Received: by 2002:aa7:c508:0:b0:523:1004:1c9a with SMTP id o8-20020aa7c508000000b0052310041c9amr1231186edq.35.1692448100836; Sat, 19 Aug 2023 05:28:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692448100; cv=none; d=google.com; s=arc-20160816; b=xjYySSjyl2TrXrFoYrqMsdJYxRW4K1gDSqiqaKyW5A8MEZp5m4yuZsQ9SX9TL/IIWt l03jhlcrUkQn7WxfjXooJaDHoQkGNCNqUTyhCxgcGXBa6MVqcYof+g2gByhqrBfIrvh6 TH64eZNeMXol0SuMX4z7H6hMz15AiEu7de22VkTywuAq5oKepH9T4vEslr73gi4sr3mA iQsJmS7Qas77/qJbyPH1IrXu6XVLqf0vvjZKzkhd2tbw/7GTzsLAdxUNh8N5ZIWAt5XS 1QmbKoAbbWo33a1GGBWkP9euZvEL4TXsQ3y4E5sXW9LA5Rey19zPsaA/5E0hHXAn/Jfu Wd2g== 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:content-language:subject:user-agent:mime-version :date:message-id; bh=Bvmif7jIYblh/UyJoA8jISoYMrT+a7h+lCj9M8R0xbE=; fh=j0T7csxkjTPNCHPzjlC/gIAxf0M/4cf/pwEBc5Ogtpo=; b=zMp2TrPouOqms82vgX0+Bdwo8LVQ+HYQ7nbeS42LkSA2zkoZLKDCjkmNy9jKDEMHdE 2oJOiAggBy37ehglg/A6YyQIVr+Ul5vnSCqmtfdNNzUWItaYRnQSYEiVFjrt7sH0TYc6 VGf5xRaQNxxqoxPaeWF0YN+kX/a6pWzcb0HJkKECwgBluviVecoRCDHFbjSjkwX0NPHw p2Xv5WwoIRk6oj0l4rUSAQ391/AjIdoH62NQVj8/Un8ZG8mRwR8hpZCEom3c7WTG6TI3 iSylpCvxJ9Dmkg+B1rhf8Oh8BbfFJpxUPQ1er1vPLy1fo3bOaLHN9E479URKzrqD1zc0 reQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w18-20020aa7cb52000000b005255e7b69b8si2960115edt.669.2023.08.19.05.27.56; Sat, 19 Aug 2023 05:28:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243040AbjHPJC0 (ORCPT + 99 others); Wed, 16 Aug 2023 05:02:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242992AbjHPJCO (ORCPT ); Wed, 16 Aug 2023 05:02:14 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4C4F51990; Wed, 16 Aug 2023 02:02:12 -0700 (PDT) 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 3409D1063; Wed, 16 Aug 2023 02:02:53 -0700 (PDT) Received: from [10.57.2.104] (unknown [10.57.2.104]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 89E5A3F64C; Wed, 16 Aug 2023 02:02:03 -0700 (PDT) Message-ID: <7676ff3a-4afc-a26a-8e20-521054298c72@arm.com> Date: Wed, 16 Aug 2023 10:02:01 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v5 2/6] perf arm64: Allow version comparisons of CPU IDs Content-Language: en-US To: John Garry , linux-perf-users@vger.kernel.org, irogers@google.com, renyu.zj@linux.alibaba.com Cc: Will Deacon , Mike Leach , Leo Yan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Suzuki K Poulose , Kan Liang , Nick Forrington , Kajol Jain , Eduard Zingerman , Sohom Datta , Rob Herring , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org References: <20230811144017.491628-1-james.clark@arm.com> <20230811144017.491628-3-james.clark@arm.com> <47a32410-d9ca-627b-e8a3-f64d4a1ea95f@oracle.com> <4c6a4729-8331-5c47-a81e-f92915e2e848@arm.com> From: James Clark In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham 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 14/08/2023 15:43, John Garry wrote: > On 14/08/2023 15:15, James Clark wrote: >> >> On 14/08/2023 14:07, John Garry wrote: >>> On 11/08/2023 15:39, James Clark wrote: >>>> Currently variant and revision fields are masked out of the MIDR so >>>> it's not possible to compare different versions of the same CPU. >>>> In a later commit a workaround will be removed just for N2 r0p3, so >>>> enable comparisons on version. >>>> >>>> This has the side effect of changing the MIDR stored in the header of >>>> the perf.data file to no longer have masked version fields. >>> Did you consider adding a raw version of _get_cpuid(), which returns the >>> full MIDR just for the purpose of caller strcmp_cpuid_str()? >> I did, but I thought that seeing as it would only be used in one place, >> and that changing the existing one didn't break anything, that it was >> better to not fragment the CPU ID interface. I thought it might also >> have repercussions for the other architectures as well. It would also >> mean that the MIDR that's stored in the header wouldn't have the version >> information, which if we're starting to do things with that could be bad. >> >> There are already callers of strcmp_cpuid_str() so it's probably best to >> keep it using the same get_cpuid() string. Unless there is a reason >> _not_  to do it? There isn't really anything that can't be done with it >> accepting/returning the full unmasked MIDR. If you want the old >> behavior, you just set the version fields to 0, which I've also used in >> a later patch and is already done in mapfile.csv >> > > ok, fine, so we seems that we would be following x86 on this in terms of > using strcmp_cpuid_str(). It would be good to mention that there is > already a weak version of strcmp_cpuid_str() for !x86 in your commit > message. > Yep I can add this. > Let me check your code again... > > Thanks, > John