Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1574252rwd; Thu, 8 Jun 2023 21:57:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5skNw/sAR3F08gnTJRVO7Ea4HZYnHgvPou16q0lT3gn1g/1pNbekVbCAvg55vJUYMVLFLK X-Received: by 2002:a05:6808:5c2:b0:398:6292:23f5 with SMTP id d2-20020a05680805c200b00398629223f5mr550519oij.53.1686286679669; Thu, 08 Jun 2023 21:57:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686286679; cv=none; d=google.com; s=arc-20160816; b=NhIR1G576yHhyzOMk23pkUuzFPKxLNGN3a9uHWCu/OZenB0Zn2MEdTTeUTGEleUJvP GpMEaHYnxRcX6adZRd9k8OWII0imDwC6APeIukCnSZ/+pamVtTsMNu6RubVJ+4+o/CPe 1ObqCzvC3mZfaItoa+NP6fur78WKHhjTdfWND7IEaUIR1Sf/OiEmAGevZseWXHxzy8S4 5FjkIHhnPyElCgtYZp8z8djlXNGhrsc+Y8orvUSce+9TTbPlKVOmLJUUXN1UbHafl/+R +V50BezzXTZk6ekEKqyOGsNmBEog4IBdabRKVO59QpckCExJZl8mk1DaCdvMqeTvHP/h aFpA== 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=KiKCBkrXaQ6isj0sfjYE+mfWn/N3Nl5NYDkug/TP5Kg=; b=CXhmmobmnc+Moo7GI84bhkSX+V6NMHWN2rIq73rdp/Vx6U+3Fpf3r+4RxIrjdiNIAi Kbqt4Xk15/yQlug41BgIP5U6F5ukf4cqzZzm3otSE9RtaVqGeVpEB0E5i6imGfrcghRY 4v7pvKkbmjBgPVzbzI6Bp00l5epVNyCIxm3hva4AjxM0TxSdhvVduDiToUfRKPSuraFr ueHShjnwalbViKnQr3aZl4vtHR5F8II8zV/BCNMCG3Ysbbu4gHjgFTkatUViv8yVcFBN BWAZaYdkBUmP04OhvsWmX34zfiK2CpBYvUbTMlgEmHdmACj++KgdxNRk6YLZHDGXXieF 9spw== 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 x16-20020a17090a789000b00253160141c7si3841093pjk.83.2023.06.08.21.57.44; Thu, 08 Jun 2023 21:57:59 -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 S236923AbjFIErd (ORCPT + 99 others); Fri, 9 Jun 2023 00:47:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229726AbjFIErb (ORCPT ); Fri, 9 Jun 2023 00:47:31 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BD69330ED; Thu, 8 Jun 2023 21:47:29 -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 B5BEFAB6; Thu, 8 Jun 2023 21:48:14 -0700 (PDT) Received: from [10.163.44.201] (unknown [10.163.44.201]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B22F53F587; Thu, 8 Jun 2023 21:47:23 -0700 (PDT) Message-ID: Date: Fri, 9 Jun 2023 10:17:19 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH V11 06/10] arm64/perf: Enable branch stack events via FEAT_BRBE Content-Language: en-US To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, will@kernel.org, catalin.marinas@arm.com, Mark Brown , James Clark , Rob Herring , Marc Zyngier , Suzuki Poulose , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , linux-perf-users@vger.kernel.org References: <20230531040428.501523-1-anshuman.khandual@arm.com> <20230531040428.501523-7-anshuman.khandual@arm.com> From: Anshuman Khandual In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 6/5/23 19:13, Mark Rutland wrote: >> +/* >> + * A branch record with BRBINFx_EL1.LASTFAILED set, implies that all >> + * preceding consecutive branch records, that were in a transaction >> + * (i.e their BRBINFx_EL1.TX set) have been aborted. >> + * >> + * Similarly BRBFCR_EL1.LASTFAILED set, indicate that all preceding >> + * consecutive branch records up to the last record, which were in a >> + * transaction (i.e their BRBINFx_EL1.TX set) have been aborted. >> + * >> + * --------------------------------- ------------------- >> + * | 00 | BRBSRC | BRBTGT | BRBINF | | TX = 1 | LF = 0 | [TX success] >> + * --------------------------------- ------------------- >> + * | 01 | BRBSRC | BRBTGT | BRBINF | | TX = 1 | LF = 0 | [TX success] >> + * --------------------------------- ------------------- >> + * | 02 | BRBSRC | BRBTGT | BRBINF | | TX = 0 | LF = 0 | >> + * --------------------------------- ------------------- >> + * | 03 | BRBSRC | BRBTGT | BRBINF | | TX = 1 | LF = 0 | [TX failed] >> + * --------------------------------- ------------------- >> + * | 04 | BRBSRC | BRBTGT | BRBINF | | TX = 1 | LF = 0 | [TX failed] >> + * --------------------------------- ------------------- >> + * | 05 | BRBSRC | BRBTGT | BRBINF | | TX = 0 | LF = 1 | >> + * --------------------------------- ------------------- >> + * | .. | BRBSRC | BRBTGT | BRBINF | | TX = 0 | LF = 0 | >> + * --------------------------------- ------------------- >> + * | 61 | BRBSRC | BRBTGT | BRBINF | | TX = 1 | LF = 0 | [TX failed] >> + * --------------------------------- ------------------- >> + * | 62 | BRBSRC | BRBTGT | BRBINF | | TX = 1 | LF = 0 | [TX failed] >> + * --------------------------------- ------------------- >> + * | 63 | BRBSRC | BRBTGT | BRBINF | | TX = 1 | LF = 0 | [TX failed] >> + * --------------------------------- ------------------- >> + * >> + * BRBFCR_EL1.LASTFAILED == 1 >> + * >> + * BRBFCR_EL1.LASTFAILED fails all those consecutive, in transaction >> + * branches records near the end of the BRBE buffer. >> + * >> + * Architecture does not guarantee a non transaction (TX = 0) branch >> + * record between two different transactions. So it is possible that >> + * a subsequent lastfailed record (TX = 0, LF = 1) might erroneously >> + * mark more than required transactions as aborted. >> + */ > Linux doesn't currently support TME (and IIUC no-one has built it), so can't we > delete the transaction handling for now? We can add a comment with somehing like: > > /* > * TODO: add transaction handling for TME. > */ > > Assuming no-one has built TME, we might also be able to get an architectural > fix to disambiguate the boundary between two transactions, and avoid the > problem described above. > > [...] > OR can leave this unchanged for now. Then update it if and when the relevant architectural fix comes in. The current TME branch records handling here, is as per the current architectural specification.