From patchwork Tue May 16 09:10:01 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: 94590 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp288705vqo; Tue, 16 May 2023 02:23:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4+XAnnOpJd+r+MwkD5YbuUDsyeicjHvliOlEJiO8ZvmS8HFeBRNFkW9/GOlnwCZhoUH7gU X-Received: by 2002:a05:6a20:4411:b0:101:2ad0:1347 with SMTP id ce17-20020a056a20441100b001012ad01347mr29456982pzb.23.1684228983331; Tue, 16 May 2023 02:23:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684228983; cv=none; d=google.com; s=arc-20160816; b=IcnKEL3Oqp2vsyADI1s9c0SRybeDMp8Vl6MrXQc1Mx96N9j8w4syvYpC9euYpQRpRv o7PyaSvK3Ky9hJNJKHvvZnbDenob6AwiOFhr0LwD3Zx1136XNR5lf0gzLSUJovhD+RHh Gd2apeOtC3y3f5FSvv1ftsV4IunxMNNxFzZScJM2rbv/1e3CBrACpxVXuGVgQ6g1215R nhNQB8cZVTu6foGD+V1okzG/4lSRELpqfrM8pDfr1bPZwev/9KI7VggYf9kGG3xitdJO jZTbQ0kJLCBeXOFygydA31Wb9fFkKJWpCVzMPA/X7XTtcB15ZBhiHix9u2gBQK2yipLd FKbw== 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=vtPS3FEksJveqjX7Rw94wRodUNzQDjafkjMK+nFq8yo=; b=QIrPO8wpilfvTJi0drciv09kAf4P9AmRLqyzh+pKPhZEhd8KVz0TcmSMkM1fnNDPuo LtD5C0CycOYKLkgckTIAQoSuD97JjttsdqaNfuHsRkRm53+z8/CYPCMyZ8a5FSNMokTF lHfm/A4l0j//y1Jve5VvSYpWFlC4BmPO/uOLKIjmcAaS7EOGSrBD1AWNXWadG0JYMWqd w3DE5EWZUt2qvf+ceOuyOupv8PmUN8mSODaIe1JLRjYBVcoiprw2b9yYYqjo1fuHIq0n mmEHGsQnASJLnNUaveU2sSbJHzaZbwYZCJbHUBNwd9oIgIZ+UzegpbdXdM1l5MjvbuGt YNxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=wr3rKwWa; dkim=neutral (no key) header.i=@linutronix.de; 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 q2-20020a63bc02000000b00528d0d8b7bbsi18046920pge.595.2023.05.16.02.22.49; Tue, 16 May 2023 02:23:03 -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=wr3rKwWa; dkim=neutral (no key) header.i=@linutronix.de; 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 S232014AbjEPJMA (ORCPT + 99 others); Tue, 16 May 2023 05:12:00 -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 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?1765724557321913061?= X-GMAIL-MSGID: =?utf-8?q?1766042090599747960?= The following commit has been merged into the smp/core branch of tip: Commit-ID: cded367976587ed4d160ed7d6bb118992a8b82ab Gitweb: https://git.kernel.org/tip/cded367976587ed4d160ed7d6bb118992a8b82ab 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 == ret_from_fork) return true; -#ifdef CONFIG_HOTPLUG_CPU +#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_AMD_MEM_ENCRYPT) if (dest == 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) -#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" -#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