From nobody Mon Dec 1 22:38:59 2025 Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) (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 B8A6C330B1F for ; Thu, 27 Nov 2025 12:53:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764248018; cv=none; b=l84pLzWtvNaAnX6pjpdUcBpfUefaKwfTJjID+u3cPd2xm5LJT3axzzRvsYoyfAYyOFbfSmPr3r/yDZWvC2MRkCPNMZYgD7AZNoTwwXrzxAK4RajD80xW/64phPJ9byQx45aiITjCkFU99fnLr9gxxIAKuwbMs1/4hRPiEDfOkZM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764248018; c=relaxed/simple; bh=TRyEBRIpgT7BYzdRENjXaC7C9gx2hEXpB/ykhPrxgFM=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=X6jBm0+NgNDLnM7Hy20MMAi0/EkFVuNcJmMGiCtmITINwIGe5KhyzUhfRxAOmR6uCNJDEISCj/8Jb0tHKz2GzcrpVgxCiTqK4ZIrkAA+sG8GrmaTm3gDE16Ac4T0hEvSYMAG6B+9ngboXDLHtNIKJ6jVu4DEaC2VCLywXFcMoQg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=iagV1Z/j; arc=none smtp.client-ip=209.85.215.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="iagV1Z/j" Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-bcfd82f55ebso903355a12.1 for ; Thu, 27 Nov 2025 04:53:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1764248016; x=1764852816; darn=vger.kernel.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=kWEVz8RQkOVIjQiYoeWau+DA1cwiHSk9Obrie6fKLfw=; b=iagV1Z/jyHtaoaU7lRqjxik7p6OXr8tLOEWYaDPWYfCQ5MdS2s3keg0GQuk7qLe4ct rZXxajwBwbMWy3WYa5jbAMBAsojbYSelSb6aRlty1DU2eW8Zq/Mv1OjsnhulsxY+Jlt7 JcQI+4YZANrzMy+zWwzTVuQDa4a78W5tNUQOM8GFU2qKN2xT/BmlSIyzgb8+5BdBakTz S2HtrzIhGAIocu4/P5ZBhgRzcjfmNVbpcy6vCMwchKtjL7S1wMtZ8BnAJWJl6lk+rHAM GQo6BdHNKZaCc/mLlauFPJm8vbRpSUP4EykalkiiekMEcvv61KoYNupUTeI1FGnxk/91 IRyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764248016; x=1764852816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=kWEVz8RQkOVIjQiYoeWau+DA1cwiHSk9Obrie6fKLfw=; b=hBRLn23J5GiS/birHrRGEztvgoMgV8Rjd9VVi1T7+gky7TdFFRUtosDGjuXZ9Fqi7h BX71lpMZOcr/GSjXWi0WaojoCUcU78shatxn/VZpkexH6yg+vAjBlpfcnzBpUB+IyebE VDdDpuXkfoiQXAZlsQFMSWaew3REnMnxm7SiWwY9BK6CErcV2MSTIi01YuWSc1uJfx3f QpTPzBoQDlCsPaVPILx8t3BNWzb0HSCnOF/HzDmVd6g3UT1sBvA9rA639Wsx0oupE6Ut W/gsaxTVk0Wc1svbInJ1uAWKHxWhL7MCHrd9B8cqnc5LcYIDjyFqBVza0Ekd7X92ifjN x6ug== X-Forwarded-Encrypted: i=1; AJvYcCUFCFtM8cfU86+vggkjbnGs2Va1CH9lc0/Gh0dUW5seZXxI/Cz+UyYya2191yfdXMtFwfpJ1Z5rHcJJ2Sc=@vger.kernel.org X-Gm-Message-State: AOJu0YxTv4jmD9e0pRSya5Vqsp75S4pexOM9AzPgOXP6cswxxJ43KNXe WMsDz5JJIhy34jW8twm79XuPr+Qec2iVknXeTjMk/LQ+aRdoCGlYfg2yT9NsSa5G1mE= X-Gm-Gg: ASbGncudZZ4oGTruV56/wCw0GQKj5nYk3jyWWa4apSP7X00LgQarJA2dBdIUQf702hA NrTqRPNbZljTj5jUIVrb8mtByEC/Grm1f+BAW06iKdYWxkWtKIC71vgoIjCDGkms3+hr8UKIL9i dBc9ulPSxCjubRB262s4em+sjNn3mw7Kkh2ntXzKUWOXut7798FTk5bTUDsYDBqG+DtutU0eT6U Q0KNFSeOyK/05CXurJPZ4yu0hKwlKmdEycgA5mCbVnIKr6durkvz+l3bnbVkJweOfgabkDv2rCG GM+6ufOoG9xK7Ke/I23LvzKnpTUL43qheKrdcBVxexjqLNslYBI6lbO3esVfd+CxVg/FZJypzXk aFaipg0qnfGP3RvoiZNPhJagIih5S4yZkhsLSEPHy1OV3JilqbLblYPjUyo1sGr8PhBgC/WNSNz lIvC+N0bwhlvQfgKE+AWUbDdRxLVtc++jx3sjiLBa/D2Nd X-Google-Smtp-Source: AGHT+IFo3oRBJLdJi4pyyDpZGbMQhtVuztEKKK6FGAEfrCPL8DYRN7thK8HfinjkzsY3+0il8FhHiQ== X-Received: by 2002:a17:903:384f:b0:29a:4a5:d688 with SMTP id d9443c01a7336-29b5e38c2efmr326573335ad.15.1764248015652; Thu, 27 Nov 2025 04:53:35 -0800 (PST) Received: from L6YN4KR4K9.bytedance.net ([139.177.225.225]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-29bce470347sm17771255ad.41.2025.11.27.04.53.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 27 Nov 2025 04:53:35 -0800 (PST) From: Yunhui Cui To: conor@kernel.org, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, cuiyunhui@bytedance.com, luxu.kernel@bytedance.com, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, jassisinghbrar@gmail.com, conor.dooley@microchip.com, valentina.fernandezalanis@microchip.com, catalin.marinas@arm.com, will@kernel.org, maz@kernel.org, timothy.hayes@arm.com, lpieralisi@kernel.org, arnd@arndb.de, kees@kernel.org, tglx@linutronix.de, viresh.kumar@linaro.org, boqun.feng@gmail.com, linux-arm-kernel@lists.infradead.org, cleger@rivosinc.com, atishp@rivosinc.com, ajones@ventanamicro.com Subject: [PATCH v3 2/8] riscv: smp: move ipi_cpu_crash_stop() declaration to smp.h Date: Thu, 27 Nov 2025 20:52:59 +0800 Message-Id: <20251127125305.89961-3-cuiyunhui@bytedance.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20251127125305.89961-1-cuiyunhui@bytedance.com> References: <20251127125305.89961-1-cuiyunhui@bytedance.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Move ipi_cpu_crash_stop() declaration from smp.c to smp.h to enable external reference, and rename it to cpu_crash_stop(). Signed-off-by: Yunhui Cui --- arch/riscv/include/asm/smp.h | 9 +++++++++ arch/riscv/kernel/smp.c | 9 ++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/arch/riscv/include/asm/smp.h b/arch/riscv/include/asm/smp.h index 7ac80e9f22889..f53f1f0e7aa9e 100644 --- a/arch/riscv/include/asm/smp.h +++ b/arch/riscv/include/asm/smp.h @@ -54,6 +54,15 @@ void riscv_ipi_set_virq_range(int virq, int nr); /* Check other CPUs stop or not */ bool smp_crash_stop_failed(void); =20 +#ifdef CONFIG_KEXEC_CORE +void cpu_crash_stop(unsigned int cpu, struct pt_regs *regs); +#else +static inline void cpu_crash_stop(unsigned int cpu, struct pt_regs *regs) +{ + unreachable(); +} +#endif + /* Secondary hart entry */ asmlinkage void smp_callin(void); =20 diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c index e650dec448176..9dbcb9a06a96d 100644 --- a/arch/riscv/kernel/smp.c +++ b/arch/riscv/kernel/smp.c @@ -78,7 +78,7 @@ static void ipi_stop(void) #ifdef CONFIG_KEXEC_CORE static atomic_t waiting_for_crash_ipi =3D ATOMIC_INIT(0); =20 -static inline void ipi_cpu_crash_stop(unsigned int cpu, struct pt_regs *re= gs) +void cpu_crash_stop(unsigned int cpu, struct pt_regs *regs) { crash_save_cpu(regs, cpu); =20 @@ -94,11 +94,6 @@ static inline void ipi_cpu_crash_stop(unsigned int cpu, = struct pt_regs *regs) for(;;) wait_for_interrupt(); } -#else -static inline void ipi_cpu_crash_stop(unsigned int cpu, struct pt_regs *re= gs) -{ - unreachable(); -} #endif =20 static void send_ipi_mask(const struct cpumask *mask, enum ipi_message_typ= e op) @@ -134,7 +129,7 @@ static irqreturn_t handle_IPI(int irq, void *data) ipi_stop(); break; case IPI_CPU_CRASH_STOP: - ipi_cpu_crash_stop(cpu, get_irq_regs()); + cpu_crash_stop(cpu, get_irq_regs()); break; case IPI_IRQ_WORK: irq_work_run(); --=20 2.39.5