Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4136962iob; Tue, 17 May 2022 15:03:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdcefnhPRkcGPeqyhjN9YxeAAAB9f87rAXis8TkfSQ9buC6ETPFec+47mMrD45OouLUa3H X-Received: by 2002:a63:1001:0:b0:3f5:f4e8:730a with SMTP id f1-20020a631001000000b003f5f4e8730amr875005pgl.115.1652825007261; Tue, 17 May 2022 15:03:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652825007; cv=none; d=google.com; s=arc-20160816; b=Gj6O5pKk+m55fxbsQ9ifWDLp42gajXcDM9YbSLPFX6XPtVzLUB5JQgAKO/n2KPg/53 +cZhoawvih+uqB9v9b/2YpkxoBqKrGqDVB5sROlUoMjw0GXsw05DgRLZLYZYQPkpX2q5 mQINlXyxfB2LBbN/n+3NfheNzy4oriAVartOotxlGXSeIsUSTJ2fXnj/iAmhOv95coNe t7hrgoVLvZcbdEbf5gmpBMY/L2s8k5qTDybCxmgyjNukFbJ3jzz0vQboNrQsan44VOoX 1bMoXB2tkNH1Ia0w67YmuegOu6gkiK8Xr5jmp4ArH0Hxhbbd2hvtUkHXrB79zDoLsff4 H2tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=NLQgu3TVfBbQW6t41oXMTnbIPybVKUGlklL3QTNAwJw=; b=0jW4WFayoGwaGQz3lRC5e8ECw7i43tws1NqlgeJmykHGX2h9C2lu77axL7SyhUMpAX ysAq6LZ7WlLceUb1a1A4xz1O4NTUFeHmP9eMdnzTm1DV84Qjxh+Bgnwp2VxqYC6kdzn7 I1kM82P4CR4P7+81LGYj6Titt/9iJSxfagiTJ53hBhONf3EPHcx0WEBOtXBXBzfSv8Ie DelrChmAdi5SB0Fxp3nquyRq6vjsXLUH1zjzx36OOvlek8bsvhGrAkR8woRxqten0VvQ rhE/0f+Dm/ToPcuLgzwYaJKtt7ZUQzDESUTtLbd/70ZOY20VxQM0hd52+VGovdeTkh/C jMDw== 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 p5-20020a170902e74500b001586f9a109fsi567925plf.0.2022.05.17.15.03.13; Tue, 17 May 2022 15:03:27 -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 S1343841AbiEQKMN (ORCPT + 99 others); Tue, 17 May 2022 06:12:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237342AbiEQKKh (ORCPT ); Tue, 17 May 2022 06:10:37 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A91A14B840; Tue, 17 May 2022 03:09:06 -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 772A312FC; Tue, 17 May 2022 03:09:06 -0700 (PDT) Received: from e121896.warwick.arm.com (e121896.warwick.arm.com [10.32.33.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 64DA93F66F; Tue, 17 May 2022 03:09:04 -0700 (PDT) From: James Clark To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, broonie@kernel.org, acme@kernel.org Cc: german.gomez@arm.com, leo.yan@linaro.org, mathieu.poirier@linaro.org, john.garry@huawei.com, James Clark , Catalin Marinas , Will Deacon , Jonathan Corbet , Mark Rutland , linux-doc@vger.kernel.org Subject: [PATCH v2 2/2] arm64/sve: Add Perf extensions documentation Date: Tue, 17 May 2022 11:07:43 +0100 Message-Id: <20220517100743.3020667-3-james.clark@arm.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20220517100743.3020667-1-james.clark@arm.com> References: <20220517100743.3020667-1-james.clark@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 Document that the VG register is available in Perf samples Signed-off-by: James Clark --- Documentation/arm64/sve.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Documentation/arm64/sve.rst b/Documentation/arm64/sve.rst index 9d9a4de5bc34..b34a1467057f 100644 --- a/Documentation/arm64/sve.rst +++ b/Documentation/arm64/sve.rst @@ -402,6 +402,24 @@ The regset data starts with struct user_sve_header, containing: * Modifying the system default vector length does not affect the vector length of any existing process or thread that does not make an execve() call. +10. Perf extensions +-------------------------------- + +* The arm64 specific DWARF standard [5] added the VG (Vector Granule) register + at index 46. This register is used for DWARF unwinding when variable length + SVE registers are pushed onto the stack. + +* Its value is equivalent to the current SVE vector length (VL) in bits divided + by 64. + +* The value is included in Perf samples in the regs[46] field if + PERF_SAMPLE_REGS_USER is set and the sample_regs_user mask has bit 46 set. + +* The value is the current value at the time the sample was taken, and it can + change over time. + +* If the system doesn't support SVE when perf_event_open is called with these + settings, the event will fail to open. Appendix A. SVE programmer's model (informative) ================================================= @@ -543,3 +561,5 @@ References http://infocenter.arm.com/help/topic/com.arm.doc.ihi0055c/IHI0055C_beta_aapcs64.pdf http://infocenter.arm.com/help/topic/com.arm.doc.subset.swdev.abi/index.html Procedure Call Standard for the ARM 64-bit Architecture (AArch64) + +[5] https://github.com/ARM-software/abi-aa/blob/main/aadwarf64/aadwarf64.rst -- 2.28.0