Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp1216019rwe; Fri, 14 Apr 2023 16:46:02 -0700 (PDT) X-Google-Smtp-Source: AKy350YpNG7jHxRLw1wQBq0bVGdbMHPhP58HBUIdoeGJWzcUE/K8txSv3KTMO4+8DudDgmYZ9ott X-Received: by 2002:a05:6a00:189f:b0:5a8:ad9d:83f with SMTP id x31-20020a056a00189f00b005a8ad9d083fmr12615778pfh.24.1681515961919; Fri, 14 Apr 2023 16:46:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681515961; cv=none; d=google.com; s=arc-20160816; b=aIWpQmhL8KUqJtQ0gc1S6UVTSkHpH7m2yp/Mm5YZLLFr03omMEOXxEcB1sGc80YLZ8 TsKMZ16YAzdPOL1+09JpUX52v92JJWthS3W2xSS4L+E+FAtuEXmLNqYcmAIVOFVTjxIp KPYHV5xWsXSEnNxHhyYCJ+zYWYIkEQeCM2UQW5nKwqUB4y+wcmwD9914aaBkBqDy7m3c QqLr3U68Cp4/DdXIsFD8JC3z0eajWqqHyOTyKJ2SrSVeM92kR3YaBz92Wo14dmdCI5E+ M2aob2AtRguNLeMeyiWosrPZeXucfCzsLbauvO9k8veMcRlFfpZ4plWo0IuPa+98ZjGS B5kw== 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=yXU88DPM4+gDgwwKQLancKUxDjIhod/zoYFzhLlkywE=; b=qj/7BpQjH6P/QATvJIesyif9zNSxpOUwgGVrXWMdx9TX+jiD+AZ4X9R5mEMQ4fqxBT la94KR6mw2kl/aiCDxfIrBabl7cz/rBIMTDXcqspDsBcPNh9A8KYnJ13+SH1agdfICir xF0O+ehReCVgSl6c22jySuHmjIzPIixIeJMqV3vhEhhqCvmXucPUVMm6kn7d2FLqL5aG +KkezwbyzSyWMy5HCcKxaIQwv8hgqS1KLxBWcboN8DBsHcyAPR9EBTNN5Hb8stZtQZR/ Ma5Zp319ZLd9FID0hHU4ZVD/wPmrMzfwEWyZhKg6BtnghOWXOLdk+CxiZGO/SVj8PrFP 9GYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="uB/cdoo+"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=MdNuozlh; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z19-20020a63e113000000b00518b499da4csi5737945pgh.71.2023.04.14.16.45.47; Fri, 14 Apr 2023 16:46:01 -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="uB/cdoo+"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=MdNuozlh; 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 S230177AbjDNXor (ORCPT + 99 others); Fri, 14 Apr 2023 19:44:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229989AbjDNXoi (ORCPT ); Fri, 14 Apr 2023 19:44:38 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D18A483C8; Fri, 14 Apr 2023 16:44:26 -0700 (PDT) Message-ID: <20230414232309.634953473@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1681515865; 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=yXU88DPM4+gDgwwKQLancKUxDjIhod/zoYFzhLlkywE=; b=uB/cdoo+FiKgxcyt6ua+eofd7Uy6FRsG6/M919LHeLaRDCm0uyHoc5a1FuwimG9z0Kg1xr I101+cnRHFikD4fqEm6lZOTxsA3yV9LXW61rrHUVlF3AiOWiBC00yRq0VhWdSwUelUpctI 5IcE3x4R3zXRKbqt7SSBKBa4oYiQTpXazjMN/L2oMlO9K+07Nyr22exnb4k00l3spzvmVc 9LRa6JkEMAonr+NJM4O1ggTmXWPqwz4bV0FKYjWVuxuelWC7S0/bYUbnT566jHXu359fFE 1kF7NH3ihq64cycQYcnuOz7AxFm2QZeP5t1J5QjP8JiYPJKiwyKDhh8WCXeClA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1681515865; 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=yXU88DPM4+gDgwwKQLancKUxDjIhod/zoYFzhLlkywE=; b=MdNuozlhNGUku1R1Tw5i7+TfSWnt88h5jzNnGTOji+filOi1PFWkM9UpldmpxTl1Bs6qoB RP/SXlqo2sMOuJDA== 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 , David Woodhouse , 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 Subject: [patch 07/37] x86/smpboot: Restrict soft_restart_cpu() to SEV References: <20230414225551.858160935@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Sat, 15 Apr 2023 01:44:24 +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 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 Now that the CPU0 hotplug cruft is gone, the only user is AMD SEV. Signed-off-by: Thomas Gleixner Cc: Tom Lendacky --- 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(-) --- 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 --- 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 --- 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