Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp13544095rwd; Sat, 24 Jun 2023 02:09:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4uEC8kiCrVJ+bd8Z/VAQpdqz2fXPuHsFFYPMiX9JPkyiFXta0op67H9MT9yVCvQpMg6lIm X-Received: by 2002:a05:6870:4312:b0:19d:6f68:c3f with SMTP id w18-20020a056870431200b0019d6f680c3fmr20247210oah.33.1687597757978; Sat, 24 Jun 2023 02:09:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687597757; cv=none; d=google.com; s=arc-20160816; b=uRc04EoCt/Eq+CZGDXySrjfL9V8If2x2nJ0RjV0UQPi3+HQapNZQk5KUvk5x8UDjzP WH+jEMAuxfa3b9Srrc4+lTfzfwRjtHnTmXKtvOCiPwg0dtYZY0sEJlZftRSgNOO/4b7y 53PGOZUBaQers9Qd1Cv368R5R6ox6/codfEtakBiiPuVy/j7uEg8kyTCdKfk/Dsd3mL2 DpxwZ6clIx1a6l0l5uOChJikL21XW++AIc/noZikmwpK/eISf9doEZe6DFZenoq6z0h1 QDxXR1Xp8LUDNOeux+jtRLFD1DJxmlzDxy5LRhEYFkvNiMkB/A2zYQOBmQJ1C1eihUT6 TRXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=j5QDhnfNkpXmoKmWTQie6rAmvY+Z8BTCiXdARaObzRM=; fh=AHK0Xc0DJDN4yuJOI9zFrziR0eX04IyesVAVapgoKHQ=; b=VbtMOZLaibWMYTh5ct2MWnAHCgpOj8gxMzDNr96D9xCpGDLOPRGHIZlycue4tIeCDD aHJXen5zSkMFxJEPIU6hoIyI8GQ/hpTM6k0mSeGXPUshdRJmLUzKQCKho495oXMCy2kb 3LC/8wZM7BCoizmWgJ6m0M5SGdEtMpVEYvdDS50uxF4VapROqI+ixYpE8Cg2jdSmO2jA bYpqDJnKHn7PhYBLW0iuViiw+d8Fh1tOy5M/iWoqTmfImmFGYZnVY6rISXHIdzR9un9l /TUb0YJJwYhIiREzBdYFFeCBe5w++2ZRs1uZD4WjuDDmqIR8osPG9jzTyvWTkUFIIVDQ E7XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aFtMAM8b; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k26-20020a635a5a000000b00543cca81bb9si1177836pgm.329.2023.06.24.02.09.04; Sat, 24 Jun 2023 02:09:17 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aFtMAM8b; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232775AbjFXIzA (ORCPT + 99 others); Sat, 24 Jun 2023 04:55:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231202AbjFXIy6 (ORCPT ); Sat, 24 Jun 2023 04:54:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C83A118B; Sat, 24 Jun 2023 01:54:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4E35E60C3E; Sat, 24 Jun 2023 08:54:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B133C433C0; Sat, 24 Jun 2023 08:54:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687596896; bh=P0AKloJHoPY0vVaH7+W9a/W3b8lwXqRDYLtUxhBSYL0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aFtMAM8bi0y4Bp+oBX1Eb/QknPMGyQ3S+5T7xUgNwj4tYfwYe5vCVTyUEMg+veaas SO+FVI9TEGpyzY/A5QXci5lheHBKhVjymfJbCLtClUT9Wd7hPGoeaOVaQm3DfBUXvc u5pn/SWwBluNh+ufE8oPF0684cVzqilo/VRmLQ/t+we3xnTH0GlRQK8gM32Hg//vEu +9tX+A3aBrGAALKbmynTNxfPTuX/v/eO5nsHo9YnQaoAIZzH9Lkaf4Kq47GdF9UyFn pqY5ihSbXhsgNIdQIRRP+pG6eB0XfoHw8IxjMqPTQiagm63Dy6XAQNzXvTKatVJrBi AO9wI8Jkb8sAA== Date: Sat, 24 Jun 2023 09:54:50 +0100 From: Conor Dooley To: Namhyung Kim Cc: Inochi Amaoto , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , Albert Ou , Nikita Shubin , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH V3] perf vendor events riscv: add T-HEAD C9xx JSON file Message-ID: <20230624-supermom-disparity-37546ffed0a4@spud> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dzXjnwP3OWEoTm01" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 --dzXjnwP3OWEoTm01 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 23, 2023 at 09:35:01PM -0700, Namhyung Kim wrote: > On Fri, Jun 23, 2023 at 6:33=E2=80=AFPM Inochi Amaoto wrote: > > > > As for c9xx wildcard, the T-HEAD provides a `MCPUID` vendor CSR to allow > > its CKLINK to get the detail CPU info. The format of this CSR are: > > > > ------------------------------------------------ > > |31 28|27 26|25 22|21 18|17 8|7 0| > > | index | WLRL | family | class | model | WLRL | > > ------------------------------------------------ > > > > And for C9xx series (only index 0000 is vaild for us, as `MCPUID` also > > provides other index). > > > > | 0000 | xx | 0100 | class | xxxxxxxxxx | xxxxxxxx | > > > > The class codes are: > > > > C910: 0011 > > c906: 0100 > > > > The CSR is a M-mode only CSR, so now I'm exploring a clean way to > > integrate this CSR into the kernel. Any advice? See for example how riscv_cpuinfo_starting() reads mvendorid & Co. > I don't know about the details. Is this CSR available from user space? > If not, you could add it somewhere in the sysfs. Machine mode is the highest privilege level, Supervisor mode is next & User mode is the lowest. Typically the kernel runs in Supervisor mode. --dzXjnwP3OWEoTm01 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZJavWgAKCRB4tDGHoIJi 0nfzAPwN3X0swkvrSVf8ck8JWpqyr9/NjbbeDsSElciyJFoqDQD9E/lEdIn9KVve N9l4vjuyVseuxyUV74TZmag+74774gE= =ndGS -----END PGP SIGNATURE----- --dzXjnwP3OWEoTm01--