Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp865970rdf; Tue, 21 Nov 2023 21:15:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IGDQaebWywaVXtgv8u2K8pOlBAE6K6Tdh81KP9cbK7qsNVYej2C3Pem0t72vE5OrjXheUae X-Received: by 2002:a05:6359:3917:b0:16e:159:1eeb with SMTP id xa23-20020a056359391700b0016e01591eebmr197013rwb.13.1700630133265; Tue, 21 Nov 2023 21:15:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700630133; cv=none; d=google.com; s=arc-20160816; b=YCHEswUTglVHrNxtPpCQfKopYwukDEXg4p7W4CoaXR4RZtQukWZG1EjEF7p2ivENIK UL8EAtHCscZZ60+kQ4DAgkjbMe01ULpvYuppm8iCgzURUMcSmQQZEkAjebVnB66hrDIh PFl5Wt/0LdRiYsjY/NcW9Nck7mRuDWUA2JrxkG22c0YKf/kbVg0KHPYZYdiIo2JJYtwc wrfb3ZB7kKndBvJLPrhpjWAOAQ1lls5K68Ha49ez7XXrROpbSTCRVv3M3XMRyA9y2Qc7 qsx85fFQ4EL2jvNrnonzBMK7gbHHCxIWNYJZh5LeF7MAb8dwBOCDjzP7PgEXXYO27Opd o6fA== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=z7QoGCX0jTU1QHhjtOteVtFcuGRPbTw+kUxkeC0W1cE=; fh=pE2uB+Pj5ycJqeAHmrQX21zOyGN5AMkM6doeLbKSOMs=; b=wqINYB8Vaih0Ee5qvyAUOms8a9xY/dr8hvAmMksOIk9WgWNRa+aEuMVim/Mhx5nNVx 9eRxtASQnckapgpVH3Q3MtLUCL85DD7coq5h4yeONCiI4S6DbD5aVd5VUYU0d1CCljKk SBS0Gx0ipiJuw0+3jRHaPtev8OFJF4NMDso1Pan4yxTKDVBae4u2kcZNldaqPRiYrEQg 2l2tsq27VfR/YhLa/Poi/jlcKYHlJm5HWZoEC0jC0y+0I5nFsQwIO/tc7pgi9hBswbKZ fTrxBjdXbXw3J9jGlfgTtzyyRkymhdpK7YJ5Ebrt2l20wQg1OqwUDEu2+pgVQHGopWaB HMBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id y16-20020a634b10000000b005bddca8236dsi11965464pga.699.2023.11.21.21.15.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 21:15:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 1FA7C8197E8A; Tue, 21 Nov 2023 21:15:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229576AbjKVFPb (ORCPT + 99 others); Wed, 22 Nov 2023 00:15:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbjKVFPa (ORCPT ); Wed, 22 Nov 2023 00:15:30 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7862F100; Tue, 21 Nov 2023 21:15:26 -0800 (PST) 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 1F3F6168F; Tue, 21 Nov 2023 21:16:13 -0800 (PST) Received: from [10.162.41.8] (a077893.blr.arm.com [10.162.41.8]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 086DE3F73F; Tue, 21 Nov 2023 21:15:21 -0800 (PST) Message-ID: Date: Wed, 22 Nov 2023 10:45:19 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [V14 0/8] arm64/perf: Enable branch stack sampling To: James Clark Cc: Mark Brown , Rob Herring , Marc Zyngier , Suzuki Poulose , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com References: <20231114051329.327572-1-anshuman.khandual@arm.com> Content-Language: en-US From: Anshuman Khandual In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 21 Nov 2023 21:15:32 -0800 (PST) On 11/14/23 22:47, James Clark wrote: > > > On 14/11/2023 05:13, Anshuman Khandual wrote: >> This series enables perf branch stack sampling support on arm64 platform >> via a new arch feature called Branch Record Buffer Extension (BRBE). All >> the relevant register definitions could be accessed here. >> > [...] >> >> --------------------------- Virtualisation support ------------------------ >> >> - Branch stack sampling is not currently supported inside the guest (TODO) >> >> - FEAT_BRBE advertised as absent via clearing ID_AA64DFR0_EL1.BRBE >> - Future support in guest requires emulating FEAT_BRBE > > If you never add support for the host looking into a guest, and you save But that seems to be a valid use case though. Is there a particular concern why such capability should or could not be added for BRBE ? > and restore all the BRBINF[n] registers, I think you might be able to > just let the guest do whatever it wants with BRBE and not trap and > emulate it? Maybe there is some edge case why that wouldn't work, but > it's worth thinking about. Right, in case host tracing of the guest is not supported (although still wondering why it should not be), saving and restoring complete BRBE state i.e all system registers that can be accessed from guest, would let guest do what ever it wants with BRBE without requiring the trap-emulate model. > > For BRBE specifically I don't see much of a use case for hosts looking > into a guest, at least not like with PMU counters. But how is it any different from normal PMU counters ? Branch records do provide statistical insights into hot sections in the guest.