From nobody Wed Dec 17 23:39:54 2025 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 240442D321B for ; Wed, 10 Dec 2025 16:14:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765383252; cv=none; b=lELb3wKEEMqLSKXeWoswRh6yqfsXbo6yuoEAWxZiLWPMtfctghcymx4XnmcT2wtGc8fPI9x2NKrEDBCRtWMjL0KYJsNdsJx+fKnJbETp+RBQ24Um3BKohdHJxpWkamG5oeWmG9XlhbXh5sAkPvnCa9OEstjNC0kHno6KB0tVtUs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765383252; c=relaxed/simple; bh=oW54abbRysZHDMCyrE264IqhApYvMrvVoe7o3AdfEeo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UkrZbj0GSpQwjS4rwwT5DkFHNY0r0R1bMx1f3NZQOppN7DJeHvp/tpGwbJHLtNZCg2z3nihg0XfGhwUkJzSv/Rbm0NwN4XPZ7XQKLM9SdcfLhyGd5bbn4KLwiqCuqIc96RUq4fiNVq2URsCh4Zsuz3oPR+KbUq8EFRTqsFqYfgQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc.com header.i=@rivosinc.com header.b=KdauQeMs; arc=none smtp.client-ip=209.85.216.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc.com header.i=@rivosinc.com header.b="KdauQeMs" Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-343dd5aa6e7so16432a91.0 for ; Wed, 10 Dec 2025 08:14:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc.com; s=google; t=1765383247; x=1765988047; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=IN+0Higah65/S0OE4unSZjOSg4pcnk5MJNS5zeLBR1I=; b=KdauQeMs93w5FA8CfQhlwSqdtkdAR+eVfimxISwckYyi973KJMJewoD0bj9OMyrMyR /2LyBWqdQ7shNo73ool+9jGHsqYggzoP2Vc4kfr0PnASghS2xEIZh70nk1ObljUmrCHv k/BTX4iSIZqOOTcA/vmmX+LEmaOgbDmOEDbg9gpZpK9dmVUwYtRFdk1KC2g+4awU163W el7FeIrnB053UEmQUb9WmW2XLT6mpzfAA5CJBP0YL6mExP5Rl8d8tz0/yuPD5vxDRPuU jL1Aqvq1K69EgXLbQ9pq/+Ua3Pycf1599ru30Ts7O8pAvPPW+H52JlmRTEARWf0JHNpw eqDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765383247; x=1765988047; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=IN+0Higah65/S0OE4unSZjOSg4pcnk5MJNS5zeLBR1I=; b=wstozy8EQKwOyHX2MJ4M6B4BdCppBp7+aqgaRvw652k8H7libxWAaVb0OdIA8vS32j 0+gOgESAOqCVuGHzQBmwUve3g9/vRTTKXBenCb5/Oi1JZi5FXBz9qzC6UyDs8g4z9yAi 6BMDY4GslXIXB6v6mv0RE6tg4oSnB1zm6Y7Povpq8GwCvaoSbyjwg/ApTOlCUwmSIWi5 aTmrSKUJi7Kbpc8udiZx2l8lshRhXFhxcQxUxkVRbCi2V0u0VznfAMcTcfTKpKnIORr3 PvB5lPOP3XNZf7zesB/AtGcALZsYeIRz7TD4eKzKnWxK5lF2bjFf/Em8yJ5mzVOwDvLN pNYQ== X-Forwarded-Encrypted: i=1; AJvYcCX08HgPFWbfWODxbPpS9yI8nZJXKMqL3Tht3D5qKSd6HoavNq2VW8DK4ui07IvF0GwK69OolIj3QuZBYmM=@vger.kernel.org X-Gm-Message-State: AOJu0YyipCQMlFit4mrhaJ/L4rmj9Hv9nMfsihZf60m5ol8H0mFy+//C Jgh4ozeTn7zodHjiv+hGlrQEv6DgjsAChilOK+uXGNYr2i0AOa4qVJZ18c4Y4LQjw3M= X-Gm-Gg: ASbGncsfY31A6BsC5YYgTmuT493qNye9JxKcd0hPH2W5/dSzTk4XslYR6MHpfu7zxWZ bswMownLZDXduSRJM/Smu3Qq94ssUPiJFJWqPJElkBV/GuP+DgMpsdcpJBp0wVTGHVrJoxIXksZ ehO5M3vAk8e/5zj6B9gmN6Uj4vaXDC1S3In7qKsHWZpivxgN2l9oIaZ4OJZE2qCFBOtE6A1AerK 83xq9zAoSUTStuSJHDxa+ikBGE2rItOPnKyvzWYsJqu/+DCY8TmI3nJh+KtQLecvt+JWd9am4R/ FiyFesEafehU4tXXXaK4NvBH/iLCax9vwQZT3iJX1elqsFYttJy6tpTbG/8oEn1v0W6MzeE2jyG P6t4H6nQJSMzp/SeblR0gtEig163qc4LntMZBNH7wRuMRfieJOcOXIaYLZtdY+7d5XvZ5eEocbw gIgnoW3IvlZEBnY6Dfwba5hUwWsiaBANAN4tmNDnQxqfT67Owl8qz++FYdXjTxmKaQhvaUASGkI x9YNjua0Ij/ X-Google-Smtp-Source: AGHT+IHfK46v7u7eEqOcag0osBQ23eDRG13EMnU5VZ1bavuPhSTrBEmVb1TzlKvZ5dAAoeNgscf/Yg== X-Received: by 2002:a05:7022:604:b0:11e:395:7dfc with SMTP id a92af1059eb24-11f296c8ba9mr1801860c88.28.1765383247383; Wed, 10 Dec 2025 08:14:07 -0800 (PST) Received: from [127.0.1.1] (p7838222-ipoefx.ipoe.ocn.ne.jp. [123.225.39.221]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-11f283d4733sm10364600c88.17.2025.12.10.08.14.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Dec 2025 08:14:07 -0800 (PST) From: Charlie Jenkins X-Google-Original-From: Charlie Jenkins Date: Wed, 10 Dec 2025 08:13:44 -0800 Subject: [PATCH RFC 07/10] riscv: kconfig: Make vendor extensions tristate Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251210-profiles-v1-7-315a6ff2ca5a@gmail.com> References: <20251210-profiles-v1-0-315a6ff2ca5a@gmail.com> In-Reply-To: <20251210-profiles-v1-0-315a6ff2ca5a@gmail.com> To: Paul Walmsley , Palmer Dabbelt , Alexandre Ghiti , Anup Patel , Atish Patra , Samuel Holland , =?utf-8?q?Bj=C3=B6rn_T=C3=B6pel?= , Luke Nelson , Xi Wang , Eric Biggers , Conor Dooley Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1765383226; l=3908; i=thecharlesjenkins@gmail.com; s=20240124; h=from:subject:message-id; bh=oW54abbRysZHDMCyrE264IqhApYvMrvVoe7o3AdfEeo=; b=A2kGAVqVMr9wlv2Sb6EOoVmU3H2XBDyOEevuJaXq2h60+M/QGKVqHoFbj1fYiEmEFHrJZNmpb cNjKpYZs9+wCrNUE+zxNnJ2VpNB1Ny3yB+T8TQSEk7e59UdSxzTs6DL X-Developer-Key: i=thecharlesjenkins@gmail.com; a=ed25519; pk=eVndo3OHViAjwuqHqbJB4ZtzJzzvk/r6fUf84tZ3rw4= Adjust the vendor extensions to use the same tristate selection as the standard extensions. This will allow the vendor extensions to use the same code paths as the standard extensions for discovery and optimization. Signed-off-by: Charlie Jenkins --- arch/riscv/Kconfig.vendor | 25 ++++++++++++++++++++++--- arch/riscv/kernel/vendor_extensions/Makefile | 22 +++++++++++++++------- drivers/perf/Kconfig | 2 +- 3 files changed, 38 insertions(+), 11 deletions(-) diff --git a/arch/riscv/Kconfig.vendor b/arch/riscv/Kconfig.vendor index 3c1f92e406c3..74155c5b642f 100644 --- a/arch/riscv/Kconfig.vendor +++ b/arch/riscv/Kconfig.vendor @@ -14,6 +14,20 @@ config RISCV_ISA_VENDOR_EXT_ANDES requested by hardware probing to be ignored. =20 If you don't know what to do here, say Y. + +config RISCV_ISA_XANDESPMU + tristate "xandespmu extension support" + depends on NONPORTABLE || m + default m + help + The Andes cores implement the PMU overflow extension very + similar to the standard Sscofpmf and Smcntrpmf extension. + + Select "m" for boot-time detection for portability. + + Select "y" for compile-time detection for optimization. Only available = with NONPORTABLE. + + If you don't know what to do here, say m. endmenu =20 menu "MIPS" @@ -55,17 +69,22 @@ config RISCV_ISA_VENDOR_EXT_THEAD If you don't know what to do here, say Y. =20 config RISCV_ISA_XTHEADVECTOR - bool "xtheadvector extension support" + tristate "xtheadvector extension support" depends on RISCV_ISA_VENDOR_EXT_THEAD depends on RISCV_ISA_V depends on FPU - default y + depends on NONPORTABLE || m + default m help Say N here if you want to disable all xtheadvector related procedures in the kernel. This will disable vector for any T-Head board that contains xtheadvector rather than the standard vector. =20 - If you don't know what to do here, say Y. + Select "m" for boot-time detection for portability. + + Select "y" for compile-time detection for optimization. Only available= with NONPORTABLE. + + If you don't know what to do here, say m. endmenu =20 endmenu diff --git a/arch/riscv/kernel/vendor_extensions/Makefile b/arch/riscv/kern= el/vendor_extensions/Makefile index bf116c82b6bd..e5ef5219a050 100644 --- a/arch/riscv/kernel/vendor_extensions/Makefile +++ b/arch/riscv/kernel/vendor_extensions/Makefile @@ -1,9 +1,17 @@ # SPDX-License-Identifier: GPL-2.0-only =20 -obj-$(CONFIG_RISCV_ISA_VENDOR_EXT_ANDES) +=3D andes.o -obj-$(CONFIG_RISCV_ISA_VENDOR_EXT_MIPS) +=3D mips.o -obj-$(CONFIG_RISCV_ISA_VENDOR_EXT_MIPS) +=3D mips_hwprobe.o -obj-$(CONFIG_RISCV_ISA_VENDOR_EXT_SIFIVE) +=3D sifive.o -obj-$(CONFIG_RISCV_ISA_VENDOR_EXT_SIFIVE) +=3D sifive_hwprobe.o -obj-$(CONFIG_RISCV_ISA_VENDOR_EXT_THEAD) +=3D thead.o -obj-$(CONFIG_RISCV_ISA_VENDOR_EXT_THEAD) +=3D thead_hwprobe.o +ifneq ($(filter y m,$(CONFIG_RISCV_ISA_VENDOR_EXT_ANDES)),) +obj-y +=3D andes.o +endif +ifneq ($(filter y m,$(CONFIG_RISCV_ISA_VENDOR_EXT_MIPS)),) +obj-y +=3D mips.o +obj-y +=3D mips_hwprobe.o +endif +ifneq ($(filter y m,$(CONFIG_RISCV_ISA_VENDOR_EXT_SIFIVE)),) +obj-y +=3D sifive.o +obj-y +=3D sifive_hwprobe.o +endif +ifneq ($(filter y m,$(CONFIG_RISCV_ISA_VENDOR_EXT_THEAD)),) +obj-y +=3D thead.o +obj-y +=3D thead_hwprobe.o +endif diff --git a/drivers/perf/Kconfig b/drivers/perf/Kconfig index 638321fc9800..dfbd02d28c3f 100644 --- a/drivers/perf/Kconfig +++ b/drivers/perf/Kconfig @@ -117,7 +117,7 @@ config STARFIVE_STARLINK_PMU =20 config ANDES_CUSTOM_PMU bool "Andes custom PMU support" - depends on ARCH_RENESAS && RISCV_ALTERNATIVE && RISCV_PMU_SBI + depends on ARCH_RENESAS && RISCV_ALTERNATIVE && RISCV_PMU_SBI && RISCV_IS= A_XANDESPMU default y help The Andes cores implement the PMU overflow extension very --=20 2.43.0