From nobody Sun Feb 8 14:57:15 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C194C77B75 for ; Tue, 16 May 2023 09:12:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231928AbjEPJMB (ORCPT ); Tue, 16 May 2023 05:12:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231834AbjEPJKK (ORCPT ); Tue, 16 May 2023 05:10:10 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06816421A; Tue, 16 May 2023 02:10:05 -0700 (PDT) Date: Tue, 16 May 2023 09:10:01 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1684228202; 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=vtPS3FEksJveqjX7Rw94wRodUNzQDjafkjMK+nFq8yo=; b=wr3rKwWaIzxBeTqbyZsKbxV3R7ZYsR4bhk/NBFgFZj/9Vhnb64PYmwmUr6iaQeCnmlFexh dS2VujcBFKLDMigZy2L4HHZIZCf9xZWj5iAK2T4d3ITFoAIZQ5hu7A16Z5sT0tgYYVhpnc YYqtg0o1d79di1Mt1sxmNgHwfUM3QUzCxeejrS13P5zurLxmn5JPFI+fMjGSBNdCzY1vHm CuLscYM4HMqZnYE3lUsv34ssIPHwkh4p82QR2kMg5nf5sab06TMyIGz3W8S4Z6+xr8qqIu Lily3eBA9ScLDIvXCQldnOpGInr1iUseB0kgTSTwHgd0//EE7VHIhNwJ9g2QoA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684228202; 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=vtPS3FEksJveqjX7Rw94wRodUNzQDjafkjMK+nFq8yo=; b=Fa3EBpgNX845C34MOXHNHQ84TXz/7WjgG+YCCjJsPFn8cqQtjlcebsp1eiLIm3rxWLR8yF +xPEEfQCpPoAvMDA== 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: Restrict soft_restart_cpu() to SEV 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.822234014@linutronix.de> References: <20230512205255.822234014@linutronix.de> MIME-Version: 1.0 Message-ID: <168422820194.404.14111988409187208899.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the smp/core branch of tip: Commit-ID: cded367976587ed4d160ed7d6bb118992a8b82ab Gitweb: https://git.kernel.org/tip/cded367976587ed4d160ed7d6bb118992= a8b82ab Author: Thomas Gleixner AuthorDate: Fri, 12 May 2023 23:07:08 +02:00 Committer: Peter Zijlstra CommitterDate: Mon, 15 May 2023 13:44:50 +02:00 x86/smpboot: Restrict soft_restart_cpu() to SEV Now that the CPU0 hotplug cruft is gone, the only user is AMD SEV. 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.822234014@linutronix.de --- arch/x86/kernel/callthunks.c | 2 +- arch/x86/kernel/head_32.S | 14 -------------- arch/x86/kernel/head_64.S | 2 +- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/arch/x86/kernel/callthunks.c b/arch/x86/kernel/callthunks.c index f5a6236..8bb9373 100644 --- a/arch/x86/kernel/callthunks.c +++ b/arch/x86/kernel/callthunks.c @@ -133,7 +133,7 @@ static bool skip_addr(void *dest) /* Accounts directly */ if (dest =3D=3D ret_from_fork) return true; -#ifdef CONFIG_HOTPLUG_CPU +#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_AMD_MEM_ENCRYPT) if (dest =3D=3D soft_restart_cpu) return true; #endif diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S index 805abf1..c931899 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86/kernel/head_32.S @@ -138,20 +138,6 @@ SYM_CODE_START(startup_32) jmp .Ldefault_entry SYM_CODE_END(startup_32) =20 -#ifdef CONFIG_HOTPLUG_CPU -/* - * 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(soft_restart_cpu) - movl initial_stack, %ecx - movl %ecx, %esp - call *(initial_code) -1: jmp 1b -SYM_FUNC_END(soft_restart_cpu) -#endif - /* * Non-boot CPU entry point; entered from trampoline.S * We can't lgdt here, because lgdt itself uses a data segment, but diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index fc86bc1..8458033 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S @@ -375,7 +375,7 @@ SYM_CODE_END(secondary_startup_64) #include "verify_cpu.S" #include "sev_verify_cbit.S" =20 -#ifdef CONFIG_HOTPLUG_CPU +#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_AMD_MEM_ENCRYPT) /* * 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