From patchwork Wed Apr 19 11:10:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Drew Fustini X-Patchwork-Id: 13216658 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62132C77B73 for ; Wed, 19 Apr 2023 11:10:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=g2dl8YKwARtou7+f8LA35eC7B46U+bBXFS1u01D/PsU=; b=b+hnjqGfbTOUXQ StZfCu+1rXPMoKfnvPuRgLibF99QU2zZSgkUYTWWQFBrYUBBS/KQjRrH1eithUx5/8IRvgXn9mj1i W4zGTttGpzUO7kZquH9W3/Q8eqmCXyDOwTDngl3DDM+l87YYqn5KfoFkt6NpgSiN9yRshe+VDGJkk 23AqTLkQzLxxeGyPdArpQ6/39IcCRXicB1tu/LqPoMSp0b5p5aDfaI0AuD3YZ5gH9QARolNlZtv6B 9DcEEjykxcs3cc+SCL14LXssIKmf1btKvWqsYSs0StFv3KSObBVhRbOUriCB1wQ3idk8+4CK5JrUU AOoB/ohmRS5XpHl9nZkQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pp5hY-00585c-09; Wed, 19 Apr 2023 11:10:16 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pp5hT-005847-2S for linux-riscv@lists.infradead.org; Wed, 19 Apr 2023 11:10:14 +0000 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-247048f86c7so1754625a91.2 for ; Wed, 19 Apr 2023 04:10:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1681902609; x=1684494609; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qOmhE21FgoLvBz4/9K8B1nYj/1N6YhDVDpnvXhhmMHI=; b=MCc3RKujUUOi8hHvnbPZFeUjt8Qd74fXOJWfbDL8OnevMgMRtLCwWwwiC8fo+YtseC Z5CdLbzGTCTc4FrEZwKeoFosFYCULmjriRg7z6nNiNBZZHcqQYlcVxtc/8J/iXL6FnGM Ak1bog8/XCv67o576rPkqx6VVqQB2wiWJUaX4SuFrHLX9Y0r9Nriqgke9p5gwyKw4+mb 6ggfeHji4wYa2rfl88PSkZkxOMDnEFJ8zEx21rVh0Pi1oTVIcQlQYajwFvO958MKvKTP oex460ebviHF9yAeC9yopjk8xV4Lw4HLQclBLRYFseX4PFAQ3a+cloav1If/fEXDS+8S AqkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681902609; x=1684494609; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qOmhE21FgoLvBz4/9K8B1nYj/1N6YhDVDpnvXhhmMHI=; b=J+vKvMKmD+/GC79U/EOpxMq2sb/haODyBIPU6xpkucVyPjtPVrk/7g3YTbOyF58gR3 we5SwY3y70r2jUutccArdjXvsrpFkaJ6gXBESwLf8hLKg7DSSc60Ri+7Es+xKT5PJD6V 8nM2yYipGIvrOGYxVCkJxxlmIIBsN6tUgD4gC1b3J+BDoNkqYuWFDn00k8dX69GSGl/3 nKw+Tg0Y97GMDVQbEiWI5c1WtSvXPENiiizwMQ/I9uDlAwvtOGNLPHf26kgvgHkGle+Q 1ZJ84bp893lRdGVnrEadmEa5JaqiDCso3y0LhdMw3Weo2zc1VZjxgPv4J/xYH/Vol9Gm yTNw== X-Gm-Message-State: AAQBX9dBcn+q3Hq3cIOYQN7+sP6FU56RTtRsfmRJ+Yh3euarHxB6PJ0t UiNCpVR3RVIENmAezKR3hTB4ZrMA5dz/FolvqqA= X-Google-Smtp-Source: AKy350aog1v27ScFai211i+05TpdB/RC9uovpGnFFaweBZPoBKDGxR8qKvX3uA8bKz6iyCPjFywS4Q== X-Received: by 2002:a17:90b:3901:b0:247:193b:ce84 with SMTP id ob1-20020a17090b390100b00247193bce84mr2501295pjb.15.1681902609085; Wed, 19 Apr 2023 04:10:09 -0700 (PDT) Received: from x1.hsd1.or.comcast.net ([2601:1c2:1800:f680:eaf2:1d7a:7338:16cb]) by smtp.gmail.com with ESMTPSA id g12-20020a1709026b4c00b001a24cded097sm11180774plt.236.2023.04.19.04.10.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 04:10:08 -0700 (PDT) From: Drew Fustini To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , Paul Walmsley , Conor Dooley , Ved Shanbhogue , =?utf-8?q?Kornel_Dul=C4=99ba?= , Adrien Ricciardi , Nicolas Pitre , Fenghua Yu , Reinette Chatre , Babu Moger , Peter Newman , x86@kernel.org, Rob Herring , James Morse Cc: Drew Fustini Subject: [RFC PATCH 01/21] RISC-V: Detect the Ssqosid extension Date: Wed, 19 Apr 2023 04:10:51 -0700 Message-Id: <20230419111111.477118-2-dfustini@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230419111111.477118-1-dfustini@baylibre.com> References: <20230419111111.477118-1-dfustini@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230419_041011_801357_3FEA760D X-CRM114-Status: GOOD ( 13.95 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Ssqosid is the Supervisor QoS ID extension defined in the RISC-V CBQRI (Capacity and Bandwidth QoS Register Interface) specification. Link: https://github.com/riscv-non-isa/riscv-cbqri/blob/main/riscv-cbqri.pdf Signed-off-by: Kornel Dulęba [dfustini: rebase from v6.0 to v6.3] Signed-off-by: Drew Fustini --- Note: - A version of this patch rebased on riscv/for-next was already submitted as an RFC to linux-riscv [1] with Message-ID: 20230410043646.3138446-1-dfustini@baylibre.com - This patch is included in this RFC series so as to provide a cohesive demonstration in one series. [1] https://lore.kernel.org/lkml/20230410043646.3138446-1-dfustini@baylibre.com/ arch/riscv/include/asm/hwcap.h | 2 ++ arch/riscv/kernel/cpu.c | 1 + arch/riscv/kernel/cpufeature.c | 1 + 3 files changed, 4 insertions(+) diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h index e3021b2590de..255c5c4d0a24 100644 --- a/arch/riscv/include/asm/hwcap.h +++ b/arch/riscv/include/asm/hwcap.h @@ -42,6 +42,8 @@ #define RISCV_ISA_EXT_ZBB 30 #define RISCV_ISA_EXT_ZICBOM 31 #define RISCV_ISA_EXT_ZIHINTPAUSE 32 +#define RISCV_ISA_EXT_SSQOSID 35 + #define RISCV_ISA_EXT_MAX 64 #define RISCV_ISA_EXT_NAME_LEN_MAX 32 diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index 8400f0cc9704..d1441872f173 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -189,6 +189,7 @@ static struct riscv_isa_ext_data isa_ext_arr[] = { __RISCV_ISA_EXT_DATA(zihintpause, RISCV_ISA_EXT_ZIHINTPAUSE), __RISCV_ISA_EXT_DATA(zbb, RISCV_ISA_EXT_ZBB), __RISCV_ISA_EXT_DATA(sscofpmf, RISCV_ISA_EXT_SSCOFPMF), + __RISCV_ISA_EXT_DATA(ssqosid, RISCV_ISA_EXT_SSQOSID), __RISCV_ISA_EXT_DATA(sstc, RISCV_ISA_EXT_SSTC), __RISCV_ISA_EXT_DATA(svinval, RISCV_ISA_EXT_SVINVAL), __RISCV_ISA_EXT_DATA(svpbmt, RISCV_ISA_EXT_SVPBMT), diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c index 59d58ee0f68d..80317d2d3975 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -222,6 +222,7 @@ void __init riscv_fill_hwcap(void) } else { /* sorted alphabetically */ SET_ISA_EXT_MAP("sscofpmf", RISCV_ISA_EXT_SSCOFPMF); + SET_ISA_EXT_MAP("ssqosid", RISCV_ISA_EXT_SSQOSID); SET_ISA_EXT_MAP("sstc", RISCV_ISA_EXT_SSTC); SET_ISA_EXT_MAP("svinval", RISCV_ISA_EXT_SVINVAL); SET_ISA_EXT_MAP("svpbmt", RISCV_ISA_EXT_SVPBMT);