From patchwork Tue May 16 09:10:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 94585 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp288180vqo; Tue, 16 May 2023 02:21:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7a/rCBj0qeN9jzpUSr/bzi4Be4xetqhJHNrxR6v49JEtCpdWw4oXG8FlnbPmMPxaPW8NVr X-Received: by 2002:a05:6a20:3d8a:b0:105:5caa:b49c with SMTP id s10-20020a056a203d8a00b001055caab49cmr12438687pzi.23.1684228904568; Tue, 16 May 2023 02:21:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684228904; cv=none; d=google.com; s=arc-20160816; b=jkGMtklUyLRvm0CEx6bdhOZzCoJdaWsOcExm1Nai9o+jvtwPswHo97ADChDmhkgTln SwilIllJrm2hvTXoqR7RYZjH/gJ36or4fbYYyda0NFLH4t5q7vo/kbq5W2L2GrJe+vlY YWdPMf1Hgv05AeSw1oq6bFjFd0OfW08qjc92NbBAVrTTNRnLh1CxoxFaadLS/aXhxcsc iQ6cog6cJk++C8W98zZRjmdd9kwyAJpbH+xamkY93ADR8vVekImO1dyMWciVnzvBnTPs AgppVMb1dNqAugjqhewthuGDLtpqCQAYNpp6lBnCTVS7cADVX4z8oM+krWj/3bLwjy1Y Dh5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=jEOB4TbsY4OLSvYrgTUnUnazkHtxm0f8iafS7O2hm7I=; b=vtWTSUggQSQstvU/J+yIFGt0QCxVELJTAVzNIhT5JRPA0QAZN00BTkJ1d2Lqr5sjIu QSecQlGSRR0W2RG61Pi9TCg0XH/QJSTrfolatHJHzU0cMml3yGvmlrdYkO0eaxRi8xYu ApF5mQvQUpCrU5wur43XpkOg5F/ZreYNxI2SHh2DC2AInSfm1GIAymsJxSUHI/Sh9l3w 2AjVe8MZilZMRKEjXaw4sg2TwlnWLXux8Kl9GngZOcCovPCdp46BpmeNdZLJb5iAI5GT JrVowSGKiuCFCpOz+QxNPepsDMrLPUJ2VzS9OO32Rqa0DnqIHNrvzBb8BKhplcjNsXrD YqyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=htwn8EHV; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=atN89+Tr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p30-20020a63951e000000b005289d0633e0si18234119pgd.229.2023.05.16.02.21.32; Tue, 16 May 2023 02:21:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=htwn8EHV; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=atN89+Tr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231951AbjEPJMU (ORCPT + 99 others); Tue, 16 May 2023 05:12:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231846AbjEPJKO (ORCPT ); Tue, 16 May 2023 05:10:14 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DCE54C3A; Tue, 16 May 2023 02:10:06 -0700 (PDT) Date: Tue, 16 May 2023 09:10:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1684228203; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jEOB4TbsY4OLSvYrgTUnUnazkHtxm0f8iafS7O2hm7I=; b=htwn8EHV/NBqAQUfGLyZO0yGUQbcdQ9CWmVnibavHQuttd0B1XR6WXbfci2TldWx7ZU59M FlQw+77IOGgkefOr0xheAvQnC04aaYzblyJzNHcUGtNjjmkWoBmof/mPTx/HPDnjbQ+Fqh Lh0LPzjxDGzx78TJZ/5NaRL0+mQLApqSF2cFwDGMKqeuW2gcyVe2HP7k15tU8mhHRUhmOO C16OLHs6DvfmNEOBjpv8ZsMHt8HvMYhvPycDhs67jUQqiCr51oj5e2JCFQZzLG43KnGKy6 Efnjo+OT3I8X4E42T5oMM8ha6O4XO0bIzB2mjWq50Orf+NgbIp4QX+UZ3oMwMg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684228203; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jEOB4TbsY4OLSvYrgTUnUnazkHtxm0f8iafS7O2hm7I=; b=atN89+TrQ43+FjZdFEzsZGlsem/jE+SH6MoYk5aiIivwTrj0prA63bdtGeG0R+QsU9MaHt dQWTfKLgeuqXEiAg== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: smp/core] x86/smpboot: Rename start_cpu0() to soft_restart_cpu() Cc: Thomas Gleixner , "Peter Zijlstra (Intel)" , Michael Kelley , Oleksandr Natalenko , Helge Deller , "Guilherme G. Piccoli" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230512205255.662319599@linutronix.de> References: <20230512205255.662319599@linutronix.de> MIME-Version: 1.0 Message-ID: <168422820288.404.1720586361371515866.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765724080821730951?= X-GMAIL-MSGID: =?utf-8?q?1766042007835444594?= The following commit has been merged into the smp/core branch of tip: Commit-ID: 666e1156b2c514f045827f50263ed2eb9d78671b Gitweb: https://git.kernel.org/tip/666e1156b2c514f045827f50263ed2eb9d78671b Author: Thomas Gleixner AuthorDate: Fri, 12 May 2023 23:07:03 +02:00 Committer: Peter Zijlstra CommitterDate: Mon, 15 May 2023 13:44:48 +02:00 x86/smpboot: Rename start_cpu0() to soft_restart_cpu() This is used in the SEV play_dead() implementation to re-online CPUs. But that has nothing to do with CPU0. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205255.662319599@linutronix.de --- arch/x86/include/asm/cpu.h | 2 +- arch/x86/kernel/callthunks.c | 2 +- arch/x86/kernel/head_32.S | 10 +++++----- arch/x86/kernel/head_64.S | 10 +++++----- arch/x86/kernel/sev.c | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h index 78796b9..b356464 100644 --- a/arch/x86/include/asm/cpu.h +++ b/arch/x86/include/asm/cpu.h @@ -30,7 +30,7 @@ struct x86_cpu { #ifdef CONFIG_HOTPLUG_CPU extern int arch_register_cpu(int num); extern void arch_unregister_cpu(int); -extern void start_cpu0(void); +extern void soft_restart_cpu(void); #ifdef CONFIG_DEBUG_HOTPLUG_CPU0 extern int _debug_hotplug_cpu(int cpu, int action); #endif diff --git a/arch/x86/kernel/callthunks.c b/arch/x86/kernel/callthunks.c index 22ab139..f5a6236 100644 --- a/arch/x86/kernel/callthunks.c +++ b/arch/x86/kernel/callthunks.c @@ -134,7 +134,7 @@ static bool skip_addr(void *dest) if (dest == ret_from_fork) return true; #ifdef CONFIG_HOTPLUG_CPU - if (dest == start_cpu0) + if (dest == soft_restart_cpu) return true; #endif #ifdef CONFIG_FUNCTION_TRACER diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S index 67c8ed9..805abf1 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86/kernel/head_32.S @@ -140,16 +140,16 @@ SYM_CODE_END(startup_32) #ifdef CONFIG_HOTPLUG_CPU /* - * Boot CPU0 entry point. It's called from play_dead(). Everything has been set - * up already except stack. We just set up stack here. Then call - * start_secondary(). + * Entry point for soft restart of a CPU. Invoked from xxx_play_dead() for + * restarting the boot CPU or for restarting SEV guest CPUs after CPU hot + * unplug. Everything is set up already except the stack. */ -SYM_FUNC_START(start_cpu0) +SYM_FUNC_START(soft_restart_cpu) movl initial_stack, %ecx movl %ecx, %esp call *(initial_code) 1: jmp 1b -SYM_FUNC_END(start_cpu0) +SYM_FUNC_END(soft_restart_cpu) #endif /* diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index a5df3e9..fc86bc1 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S @@ -377,11 +377,11 @@ SYM_CODE_END(secondary_startup_64) #ifdef CONFIG_HOTPLUG_CPU /* - * Boot CPU0 entry point. It's called from play_dead(). Everything has been set - * up already except stack. We just set up stack here. Then call - * start_secondary() via .Ljump_to_C_code. + * Entry point for soft restart of a CPU. Invoked from xxx_play_dead() for + * restarting the boot CPU or for restarting SEV guest CPUs after CPU hot + * unplug. Everything is set up already except the stack. */ -SYM_CODE_START(start_cpu0) +SYM_CODE_START(soft_restart_cpu) ANNOTATE_NOENDBR UNWIND_HINT_END_OF_STACK @@ -390,7 +390,7 @@ SYM_CODE_START(start_cpu0) movq TASK_threadsp(%rcx), %rsp jmp .Ljump_to_C_code -SYM_CODE_END(start_cpu0) +SYM_CODE_END(soft_restart_cpu) #endif #ifdef CONFIG_AMD_MEM_ENCRYPT diff --git a/arch/x86/kernel/sev.c b/arch/x86/kernel/sev.c index b031244..d095a5d 100644 --- a/arch/x86/kernel/sev.c +++ b/arch/x86/kernel/sev.c @@ -1328,7 +1328,7 @@ static void sev_es_play_dead(void) * If we get here, the VCPU was woken up again. Jump to CPU * startup code to get it back online. */ - start_cpu0(); + soft_restart_cpu(); } #else /* CONFIG_HOTPLUG_CPU */ #define sev_es_play_dead native_play_dead