From patchwork Thu May 4 19:02:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 90194 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:3046:b0:115:7a1d:dabb with SMTP id p6csp514899rwl; Thu, 4 May 2023 12:09:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4jS92EQJEwUPgU5pBgOs3/rSMnknYAFmfkyG3vIRzoXLVVgjoWhElZMrx5XGbyMXieEEd+ X-Received: by 2002:a17:903:22d2:b0:1a9:5c41:3f8e with SMTP id y18-20020a17090322d200b001a95c413f8emr5926664plg.42.1683227374497; Thu, 04 May 2023 12:09:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683227374; cv=none; d=google.com; s=arc-20160816; b=gIok2aG2ImQsUHBP6+nYNAyIyPJ9HpuH0BSYtvlH4RQxrNaES5QIvZzJH4EEFhEcH3 Vm60qUWUUx/l5FfL0i5rn1f6boJafJXixC1Scm34sTCksoRhsC0CQLM/FYiqP16XJPI3 isPFuI/JIIbjte2+doFhBMfHhSqzD7/ZTCjzajG9i1ncUIRj/IsfyA91OVKxxQKI3Ycn P0yzXu5ocF4BjAke0/9fCz/0pOP/tGGrbqSZkLz2lxWwPtrn5U5BoWxv5DIJNYhoZaxy Lamqaov+pM2NfgGH5G98sOhv1kkLIXiys9wsRrzxz5SL8VnI9HyNnhcgC3wvbf54WLAA e9Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=4k8WG2dAJ3uFYn2Qtg5bZA2RHhZEaXZ+bewsd+BJr/I=; b=K5GqkvaSwQzmETSoAzbapRBDiwp/Ae5mCT6dNer2BUBiVEXjo74Kx0LWrO0zi9IMKX fUw9saepRGYaOO6CzLSrBWnYSU/W4j46ElBslHhDXeg60hH6Dt/eK5MwqJZnRkzBiL5L OpbrQq3M+I7elOssM4bJKjo7CaYovi4OnZV17CwpTXH6sjhBUlPker+FqkWbOeYYjUKU QsoYWq2JaHlIdjGfrbIv0A92MibpkaVgfXtvDtELTSHO435DjpULiBMqHzdUB8IAw6+h p3hRq1ciWyBA3cbhb8DVrnebL6kyjytzZt1brd2W2r9r65PEOPCkggboTcn4UrTl9R3y gDgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=bBh0CVpZ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 ix22-20020a170902f81600b001a93c1d66e0si5977649plb.269.2023.05.04.12.09.21; Thu, 04 May 2023 12:09:34 -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=bBh0CVpZ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 S229915AbjEDTCU (ORCPT + 99 others); Thu, 4 May 2023 15:02:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229981AbjEDTCI (ORCPT ); Thu, 4 May 2023 15:02:08 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54EC17ECD; Thu, 4 May 2023 12:02:06 -0700 (PDT) Message-ID: <20230504185936.536756506@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1683226925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=4k8WG2dAJ3uFYn2Qtg5bZA2RHhZEaXZ+bewsd+BJr/I=; b=bBh0CVpZWL+6hsvPUZtXnSdOBPa/K5CfY4sntqqXgNMtxpi+d2yUs3ECpJ289P0ZQAUrXv k7Gw7YnHFskIzQ/7fPEMWNfUyqW1tXD0Y5j9mjC9fHiZESm2nV58xOjcYTcUtICW4PGtib L7qAfpVjhgaAOAD2zQ57omRWjLADm+xmVTWvdqyhIzFRzilnUByYjHcwGeBKFMcYVRiiaY VaFLAq4WMscxLSALxvyX5KYN3LoP2rAtooUlf6qigkW3PSIl7OwVv0Em5tfeehe2sTShbV Tm0yzzDkfXdyeVnTbNUMouES/vmiS2pcR636jskZtx14ouKlyWxaen2mjAF6Eg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1683226925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=4k8WG2dAJ3uFYn2Qtg5bZA2RHhZEaXZ+bewsd+BJr/I=; b=zT9oEAybbsH/w7G2lAyNh7UEoHso+OvSBYaHY787eM4NlqSRBZnZMUdOCeyvsS0fDgQH3V RekIpVEMD5NisxDQ== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, David Woodhouse , Andrew Cooper , Brian Gerst , Arjan van de Veen , Paolo Bonzini , Paul McKenney , Tom Lendacky , Sean Christopherson , Oleksandr Natalenko , Paul Menzel , "Guilherme G. Piccoli" , Piotr Gorski , Usama Arif , Juergen Gross , Boris Ostrovsky , xen-devel@lists.xenproject.org, Russell King , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , Guo Ren , linux-csky@vger.kernel.org, Thomas Bogendoerfer , linux-mips@vger.kernel.org, "James E.J. Bottomley" , Helge Deller , linux-parisc@vger.kernel.org, Paul Walmsley , Palmer Dabbelt , linux-riscv@lists.infradead.org, Mark Rutland , Sabin Rapan , "Michael Kelley (LINUX)" Subject: [patch V2 04/38] x86/smpboot: Rename start_cpu0() to soft_restart_cpu() References: <20230504185733.126511787@linutronix.de> MIME-Version: 1.0 Date: Thu, 4 May 2023 21:02:04 +0200 (CEST) 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?1764991827424805964?= X-GMAIL-MSGID: =?utf-8?q?1764991827424805964?= From: Thomas Gleixner 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 Cc: Tom Lendacky --- 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(-) --- --- 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 --- 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 --- 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 /* --- 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 --- 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