From patchwork Tue Mar 12 02:08:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qingfang Deng X-Patchwork-Id: 1910783 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=O/dBSka/; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=ESa+qFqh; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TtxtY1jTGz1yWn for ; Tue, 12 Mar 2024 13:10:13 +1100 (AEDT) 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:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=G2bmplzpDvjpHeE4uHSubkf+2tXtm6bYAdJ9sj+FRFs=; b=O/dBSka/gaoIqr KRsHrOCjA8sh7PSjSxzaWlTBbLd5B86YELZbqKhGvcxbNwI+w1/Odr/V9PyVOpkxwJtmJtYd+Uty3 8rCmOl0a8PXJH/79HaTC2BlB/TMd/zMyUrYDqItXHxqhxKXHDIWwMIqW4y3DHmXSmTsEYpfX22+h1 8Af3SJEMdW3gLja9My2jxzSFCShpjLZNinPWrXYpNBFcmcQKU9Y5xWt6Y2fr/tj74eTmaEycHic33 9bfRYbxF+WyWyzNQ3H0Gh/bNujS+H2XTz3GB5lcEcot5Au7y0/6CJdisQq9eAukcos8Xd5Ayx7lBd qMJ0r2K2qitWShxYaCBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rjrZf-00000003wGZ-0rOH; Tue, 12 Mar 2024 02:09:03 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rjrZc-00000003wFY-0Tsm for openwrt-devel@lists.openwrt.org; Tue, 12 Mar 2024 02:09:01 +0000 Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-29c09ee1bceso1206643a91.2 for ; Mon, 11 Mar 2024 19:08:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710209339; x=1710814139; darn=lists.openwrt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=0zU8iZZTeXxFWM9cECZ7D8SbhnVE1Ww+bDk7pApgzbU=; b=ESa+qFqhS9GmKu3x8c70LXfnpn74vWY7dE68pZeJ1pjCp1Kwq2/7+8+HHraa47UheU Trfdxf/kq8Ay4M+dB6RPvuHh1hijuRyiX9Q5LFrxhz8t9C/sFkWxGZQGVsCAp+ZnPxe3 ncGHEmPkLlV/CfC1pGA9FHfO0ToYaCd7h3FPzJ0gTK2J9ZUUKIlW00Rg6t4fa9ZTseUV DRUQ6KVfXF1XBeMWSTfZ4uggDMKETckibNXZm2tLMh7ZlGySlfmXcI+n19to4ycNVIE+ frA9+DnprYA6Gwnud+Ak7uN9Wx3VXmPRFOu6WHH4XmB3LO02MNI9z75LfYvoyx/LxFnU TC5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710209339; x=1710814139; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0zU8iZZTeXxFWM9cECZ7D8SbhnVE1Ww+bDk7pApgzbU=; b=onyAapsTXn/izkY274B7lnXYvwlbI1mluDm/Zr9l3kGe+/dTtkbzpm85sFtiweGZ0Q uEFQnIGB0cxpDpo8SgLwY2vQVigOjDzcur3XEyJtcAFHb9ViTWw8Q6a9gYzS6n4Dr1bv p1+p8DGexXZpeN2IE6JWIQf/yum0gIASATBe0LaiGtpLZHg98s/puwlV30kjFYWXFe/P WKaDSfQC5pcjXgVjnow14N0FySS/bQCkgGJQgPmNhF0N5J7S6rua/zkWze5iZR/qyoh9 4MSB3yETikURY0Wuj27823iWh4HfvdURAYc28ewEPhROGkhFTUGqrrlsZFc0c906lqwK sy1g== X-Gm-Message-State: AOJu0YwWoDHWVCfJAz1w1Y+gsS/VyzItY8ogL+NzCNOV5L3WINXVdIa/ dXWD9VS387l4Ts5/IHfDqzpaOqjyxByeiFsZtJnPKgNmnEp+sfsivj8tJiEYe6XdWg== X-Google-Smtp-Source: AGHT+IE8v/BNtLyVxl8iV1sIKDK2hP110HgQuT4ZQ8oX7fpiyWQ+w/fR/OX7OkCX07QRps28ZmDrMQ== X-Received: by 2002:a17:90a:b38b:b0:29a:46d2:e877 with SMTP id e11-20020a17090ab38b00b0029a46d2e877mr6832399pjr.48.1710209338772; Mon, 11 Mar 2024 19:08:58 -0700 (PDT) Received: from DESKTOP-4R0U3NR.siflower.com ([2a09:bac5:80c9:183c::26a:36]) by smtp.gmail.com with ESMTPSA id x8-20020a17090a1f8800b002992f49922csm5295344pja.25.2024.03.11.19.08.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 19:08:58 -0700 (PDT) From: Qingfang Deng To: openwrt-devel@lists.openwrt.org Subject: [PATCH v2] kernel: support RISC-V PMU Date: Tue, 12 Mar 2024 10:08:30 +0800 Message-Id: <20240312020830.2714762-1-dqfext@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240308025220.239524-1-dqfext@gmail.com> References: <20240308025220.239524-1-dqfext@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240311_190900_336567_E0724FB2 X-CRM114-Status: UNSURE ( 9.62 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Add RISC-V PMU config symbols and enable them for riscv64. Signed-off-by: Qingfang Deng --- v2: add symbols to 6.6 config/Config-kernel.in | 10 ++++++++++ target/linux/generic/config-6.1 | 3 +++ target/linux/generic/config-6.6 | 3 +++ 3 files changed, 16 insertions(+) Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [dqfext(at)gmail.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1031 listed in] [list.dnswl.org] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Add RISC-V PMU config symbols and enable them for riscv64. Signed-off-by: Qingfang Deng --- v2: add symbols to 6.6 config/Config-kernel.in | 10 ++++++++++ target/linux/generic/config-6.1 | 3 +++ target/linux/generic/config-6.6 | 3 +++ 3 files changed, 16 insertions(+) diff --git a/config/Config-kernel.in b/config/Config-kernel.in index 2e59bc9551..f4ea6ccbe8 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -50,6 +50,15 @@ config KERNEL_ARM_PMU default y if TARGET_armsr_armv8 depends on (arm || aarch64) +config KERNEL_RISCV_PMU + bool + select KERNEL_RISCV_PMU_SBI + depends on riscv64 + +config KERNEL_RISCV_PMU_SBI + bool + depends on riscv64 + config KERNEL_X86_VSYSCALL_EMULATION bool "Enable vsyscall emulation" depends on x86_64 @@ -70,6 +79,7 @@ config KERNEL_X86_VSYSCALL_EMULATION config KERNEL_PERF_EVENTS bool "Compile the kernel with performance events and counters" select KERNEL_ARM_PMU if (arm || aarch64) + select KERNEL_RISCV_PMU if riscv64 config KERNEL_PROFILING bool "Compile the kernel with profiling enabled" diff --git a/target/linux/generic/config-6.1 b/target/linux/generic/config-6.1 index fabe7029c5..3bcf66b267 100644 --- a/target/linux/generic/config-6.1 +++ b/target/linux/generic/config-6.1 @@ -5304,6 +5304,9 @@ CONFIG_RFKILL=y # CONFIG_RING_BUFFER_BENCHMARK is not set # CONFIG_RING_BUFFER_STARTUP_TEST is not set # CONFIG_RING_BUFFER_VALIDATE_TIME_DELTAS is not set +# CONFIG_RISCV_PMU is not set +# CONFIG_RISCV_PMU_LEGACY is not set +# CONFIG_RISCV_PMU_SBI is not set # CONFIG_RMI4_CORE is not set # CONFIG_RMNET is not set # CONFIG_ROCKCHIP_PHY is not set diff --git a/target/linux/generic/config-6.6 b/target/linux/generic/config-6.6 index 319f56fe01..8210d9d245 100644 --- a/target/linux/generic/config-6.6 +++ b/target/linux/generic/config-6.6 @@ -5421,6 +5421,9 @@ CONFIG_RFKILL=y # CONFIG_RING_BUFFER_BENCHMARK is not set # CONFIG_RING_BUFFER_STARTUP_TEST is not set # CONFIG_RING_BUFFER_VALIDATE_TIME_DELTAS is not set +# CONFIG_RISCV_PMU is not set +# CONFIG_RISCV_PMU_LEGACY is not set +# CONFIG_RISCV_PMU_SBI is not set # CONFIG_RMI4_CORE is not set # CONFIG_RMNET is not set # CONFIG_ROCKCHIP_ERRATUM_3588001 is not set