From: "Yicong Yang" <yang.yicong@picoheart.com>
To: "Yunhui Cui" <cuiyunhui@bytedance.com>
Cc: <akpm@linux-foundation.org>, <alex@ghiti.fr>,
<anup@brainfault.org>, <aou@eecs.berkeley.edu>,
<atish.patra@linux.dev>, <catalin.marinas@arm.com>,
<dianders@chromium.org>, <johannes@sipsolutions.net>,
<lihuafei1@huawei.com>, <mark.rutland@arm.com>,
<masahiroy@kernel.org>, <maz@kernel.org>, <mingo@kernel.org>,
<nicolas.schier@linux.dev>, <palmer@dabbelt.com>,
<paul.walmsley@sifive.com>, <suzuki.poulose@arm.com>,
<thorsten.blum@linux.dev>, <wangjinchao600@gmail.com>,
<will@kernel.org>, <yangyicong@hisilicon.com>,
<zhanjie9@hisilicon.com>, <linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>,
<linux-perf-users@vger.kernel.org>,
<linux-riscv@lists.infradead.org>,
"Paul Walmsley" <pjw@kernel.org>, <yang.yicong@picoheart.com>,
<geshijian@picoheart.com>
Subject: Re: [PATCH v6 2/2] riscv: add HARDLOCKUP_DETECTOR_PERF support
Date: Fri, 5 Dec 2025 14:12:33 +0800 [thread overview]
Message-ID: <96fd2a69-baf4-4109-8341-0d4bb6c60393@picoheart.com> (raw)
In-Reply-To: <20251114033243.76509-3-cuiyunhui@bytedance.com>
Hi Yunhui,
this has conflicts on the mainline master. looks like you have a dependency
on the SSE PMU support patchset [1], need to mention it for the maintainer
to apply.
[1] https://lore.kernel.org/linux-riscv/20250908181717.1997461-5-cleger@rivosinc.com/
one comment below.
On 2025/11/14 11:32, Yunhui Cui wrote:
> Enable the HARDLOCKUP_DETECTOR_PERF function based on RISC-V SSE.
>
> Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com>
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
> Acked-by: Paul Walmsley <pjw@kernel.org>
> ---
> arch/riscv/Kconfig | 3 +++
> drivers/perf/riscv_pmu_sbi.c | 10 ++++++++++
> 2 files changed, 13 insertions(+)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index fadec20b87a8e..46ccd33732fa8 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -186,6 +186,9 @@ config RISCV
> select HAVE_PAGE_SIZE_4KB
> select HAVE_PCI
> select HAVE_PERF_EVENTS
> + select HAVE_PERF_EVENTS_NMI if RISCV_PMU_SBI_SSE
> + select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && HAVE_PERF_EVENTS_NMI
> + select WATCHDOG_PERF_ADJUST_PERIOD if HARDLOCKUP_DETECTOR_PERF
> select HAVE_PERF_REGS
> select HAVE_PERF_USER_STACK_DUMP
> select HAVE_POSIX_CPU_TIMERS_TASK_WORK
> diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c
> index c852f64a50221..0c7c5924687c9 100644
> --- a/drivers/perf/riscv_pmu_sbi.c
> +++ b/drivers/perf/riscv_pmu_sbi.c
> @@ -22,6 +22,7 @@
> #include <linux/sched/clock.h>
> #include <linux/soc/andes/irq.h>
> #include <linux/workqueue.h>
> +#include <linux/nmi.h>
>
> #include <asm/errata_list.h>
> #include <asm/sbi.h>
> @@ -1192,6 +1193,13 @@ static int pmu_sbi_setup_sse(struct riscv_pmu *pmu)
> }
> #endif
>
> +#ifdef CONFIG_HARDLOCKUP_DETECTOR_PERF
> +bool arch_perf_nmi_is_available(void)
> +{
> + return IS_ENABLED(CONFIG_RISCV_PMU_SBI_SSE);
this looks incorrect per implementation in [1]. we'll fallback to the normal
interrupt if failed to register the SSE event, in which case NMI is not
available for the PMU. Check the kconfig is not sufficient.
you can check pmu->sse_evt instead for the NMI support here, or cached the
NMI status somewhere like how arm_pmu does.
Thanks.
> +}
> +#endif
> +
> static int pmu_sbi_starting_cpu(unsigned int cpu, struct hlist_node *node)
> {
> struct riscv_pmu *pmu = hlist_entry_safe(node, struct riscv_pmu, node);
> @@ -1618,6 +1626,8 @@ static int __init pmu_sbi_devinit(void)
> /* Notify legacy implementation that SBI pmu is available*/
> riscv_pmu_legacy_skip_init();
>
> + lockup_detector_retry_init();
> +
> return ret;
> }
> device_initcall(pmu_sbi_devinit)
next prev parent reply other threads:[~2025-12-05 6:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-14 3:32 [PATCH v6 0/2] Add HARDLOCKUP_DETECTOR_PERF support for RISC-V Yunhui Cui
2025-11-14 3:32 ` [PATCH v6 1/2] watchdog: move arm64 watchdog_hld into common code Yunhui Cui
2025-12-05 6:53 ` Yicong Yang
2025-11-14 3:32 ` [PATCH v6 2/2] riscv: add HARDLOCKUP_DETECTOR_PERF support Yunhui Cui
2025-12-05 6:12 ` Yicong Yang [this message]
2025-11-14 19:13 ` [PATCH v6 0/2] Add HARDLOCKUP_DETECTOR_PERF support for RISC-V Doug Anderson
2025-12-04 5:00 ` [External] " yunhui cui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=96fd2a69-baf4-4109-8341-0d4bb6c60393@picoheart.com \
--to=yang.yicong@picoheart.com \
--cc=akpm@linux-foundation.org \
--cc=alex@ghiti.fr \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=atish.patra@linux.dev \
--cc=catalin.marinas@arm.com \
--cc=cuiyunhui@bytedance.com \
--cc=dianders@chromium.org \
--cc=geshijian@picoheart.com \
--cc=johannes@sipsolutions.net \
--cc=lihuafei1@huawei.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=masahiroy@kernel.org \
--cc=maz@kernel.org \
--cc=mingo@kernel.org \
--cc=nicolas.schier@linux.dev \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=pjw@kernel.org \
--cc=suzuki.poulose@arm.com \
--cc=thorsten.blum@linux.dev \
--cc=wangjinchao600@gmail.com \
--cc=will@kernel.org \
--cc=yangyicong@hisilicon.com \
--cc=zhanjie9@hisilicon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).