Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6248403iob; Tue, 10 May 2022 13:56:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy58OLSfcszUkM6RpvYD4QFKawABqStXicNh6swfvkISNOXdap56vR2weFPjxESfLNDULj5 X-Received: by 2002:a17:906:6a1b:b0:6f4:a9b8:e027 with SMTP id qw27-20020a1709066a1b00b006f4a9b8e027mr21351424ejc.222.1652216189429; Tue, 10 May 2022 13:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652216189; cv=none; d=google.com; s=arc-20160816; b=rSa2/bF63I+q5s0Gy1Wk4IjXIdm2ddoib5T1ol83T55hK3qW1fL0onPznesCUx+D8S u8L/yZZCPLcXajexJ2EW+yAykkcKNY0LrEhWZOLgo7y4CwRkD0ajFesVt0ZwV3tFsY6j O6wq/IalJ4dtU1EdJlgg7mrCVxPJTYik7ZXZdbwu/WKF+OKOMO50epHGeY6JBUJClSdo 02qIpux4fdY9yNsVk0ph4DWTAjdFvvsSw+FAyzCazsraBOSUOyqyGsbvQubVEJ6xQGcN 8+R2nJ2uwZhtVI394xIxpbRb14/b3kdXq3TlRoOM+dTNI7TyhYP+KUMiOnrrIvNbJ2VT j+EA== 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=YSmsfs4Gmow5Cf7XDjmVHUhfwjxzLauKY/9XNRCxdok=; b=MASSd1oI5CVzDSlQSYbjghvY6kM5avuvn4iJiGUb4Wd55R5QdhHL1Ax8WgEeIgLb5n NjADUx9+SrHhLJSRALE1fuFQWzGNckMVr1uedobHWMSsaxVWk343xvIFiamK8zFM6Dmh BOzDTjYAS7GXwG1SBuLPOBwtnoRxjd63p3B7yBoBX4iaYh5I1Z6IfesjFp6CeZhdxJd9 CFumNwBVK0nposaEpF6c6inMtKywVPHP46pmKdOVKMi7CYXohkh6UkkLicM05LE2Pl7z pYUgqvd/7EcZjLAXddxIv6u3I95RY8FX2r2RhGglZ0pPV++v27n8Iv5VoxCOyhgIkMNP uS3A== 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 ho15-20020a1709070e8f00b006f458fb419dsi424471ejc.223.2022.05.10.13.56.05; Tue, 10 May 2022 13:56:29 -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 S238930AbiEJJiw (ORCPT + 99 others); Tue, 10 May 2022 05:38:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235891AbiEJJip (ORCPT ); Tue, 10 May 2022 05:38:45 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 19A6A28F7FE; Tue, 10 May 2022 02:34:48 -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 AADEF1042; Tue, 10 May 2022 02:34:48 -0700 (PDT) Received: from [10.57.2.65] (unknown [10.57.2.65]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9D2163F66F; Tue, 10 May 2022 02:34:46 -0700 (PDT) Message-ID: <34e48640-24a1-eaa2-e873-f7137aa47ba3@arm.com> Date: Tue, 10 May 2022 10:34:45 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v1 1/6] perf: arm64: Add SVE vector granule register to user regs Content-Language: en-US To: Mark Brown Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, german.gomez@arm.com, John Garry , Will Deacon , Mathieu Poirier , Leo Yan , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-doc@vger.kernel.org References: <20220509144257.1623063-1-james.clark@arm.com> <20220509144257.1623063-2-james.clark@arm.com> From: James Clark In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 On 09/05/2022 16:48, Mark Brown wrote: > On Mon, May 09, 2022 at 03:42:49PM +0100, James Clark wrote: >> Dwarf based unwinding in a function that pushes SVE registers onto >> the stack requires the unwinder to know the length of the SVE register >> to calculate the stack offsets correctly. This was added to the Arm >> specific Dwarf spec as the VG pseudo register[1]. >> >> Add the vector length at position 46 if it's requested by userspace and >> SVE is supported. If it's not supported then fail to open the event. >> >> The vector length must be on each sample because it can be changed >> at runtime via a prctl or ptrace call. Also by adding it as a register >> rather than a separate attribute, minimal changes will be required in an >> unwinder that already indexes into the register list. > >> +static u64 perf_ext_regs_value(int idx) >> +{ >> + switch (idx) { >> + case PERF_REG_ARM64_VG: >> + if (WARN_ON_ONCE(!system_supports_sve())) >> + return 0; > > These WARN_ON_ONCE()s seem a bit loud but I do see they are idiomatic > for this code so They should never ever be hit because the mask is validated when opening the event so hopefully it's not an issue. > > Reviewed-by: Mark Brown Thanks Mark