Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2183102rbb; Tue, 27 Feb 2024 13:25:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVN02/E1u7NlUAEmkwuRFfgCYephFn8Bo78zEF/hsML8P5RN6G94hqC/X6547/04swmGUEnKOnbVuQUM4yjRt4uqeD7KWTnf5kvKbhndA== X-Google-Smtp-Source: AGHT+IHWS0mVC2XBqkk+T1qYLrul4qu1lIOxX3OExod9ms7YE8HrAHJXoMCQnY6Y3vN2zvugo5Pp X-Received: by 2002:a05:651c:1a21:b0:2d2:3aea:bc78 with SMTP id by33-20020a05651c1a2100b002d23aeabc78mr8719372ljb.38.1709069142985; Tue, 27 Feb 2024 13:25:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709069142; cv=pass; d=google.com; s=arc-20160816; b=GzcB/SNLKx5DFGNrwblEAyKWemuWLxl2Bb11I/AY1jbeWBvCHXpfXs8wGxQ/lVawNi CIRNFQX+T+ogwkhr3FEHJjU4BPanwg7DR0ocEsaOapakGct4r6wusTZ5N0MdzDdF5ihs 2hUR8bfLC6tNxovVvXbDiMU4zCyZF+qrzQw8P3o85ouc+ULqF36p+4hf+8EPOpMJ9cMl 2my1ogiBIbgATXwJWn23nRlru1gRpmMJSs5YfFqSnj8qqI9koXO/y92FZka7Y8vOfgLE LkFxW2GJmZV9ht3vJxfopmLM3u/mANw52VAIOCIAYjZ67gJC6O72+PNOd/g6M73lwnc2 1kIQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=oFPg1e4W+3x1wKJbkqedQVfBDACBojy0SZp4GcA/qI4=; fh=OvJRnOqsMTm9XoNmEwebcqh9Ud7yh1CTeKAP84ols98=; b=aXmT3cy8TD4+0pOMedQnMYGvVswOxe02+Z87E45BRm6zgDG8Vx8Vj9D5f4SzzB/2Um 8kyfJmSSMSeck0ubNHbv3b2+k04kbaPxxvQfILC0mcpWx7rAWW6znK/g+kDQpGf5cYDq NvAZwcwiQk4Z6G+o7l9/3jrwYkRBwBg4hQJq3TWTDpLnlYNZO++X8XHmDdLCaNK5KC33 140NvgoFnQWtbQyTkmL/Mom3F53aB8UUNmdvWC32mCFFFbYMLXJkQ9xdQwXhIvjJ4XSu D3CMyTvuUTtA+CztYxhYttqGuxRNEcjXs04c4GdJmuEiI3KZGaVspT7ei1jPDNNCcef0 XYVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MEasphmp; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-84035-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84035-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id cx4-20020a05640222a400b00565bdc4b9d1si982439edb.462.2024.02.27.13.25.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 13:25:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84035-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MEasphmp; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-84035-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84035-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B6E3F1F2B983 for ; Tue, 27 Feb 2024 21:25:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E9651534ED; Tue, 27 Feb 2024 21:25:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="MEasphmp" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59F6414F991 for ; Tue, 27 Feb 2024 21:25:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709069107; cv=none; b=FL+i8loLVlCLmSOWJhbXHwWt1z5lOtoEUgikpm6EL2uQ0yVzM35faFD4MDM0Z7Zdo+w1UtMo9yYjUqlMzN7xdHPHmUQYiRRp7+HDjklPfWznewRoFROQVaqlkp7s7T6siNUhH5N59HdSgxQXLZuH57WJKTpqG8pBwyNHUdr8wa8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709069107; c=relaxed/simple; bh=YLm/cL+dHPnuzS6G3vl9X6RCyiyNqBmXpbxGqPOhV1s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V7Rf9WaDBj4VUmO226/1Zu1P3gsnIIoovjc1LEhDFz4sKS8fWM/iHB6zrcamuKgZB35OsP3Y8d6fBlRwzQMXYVIaEKGem/slL864QwsmQxYTZXjGVA+RTlq6BFb++HVc8ktYJcFckI1Lnf23FYSTzMZsHUKgCIBRGrmRib/5kdQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.helo=mgamail.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=MEasphmp; arc=none smtp.client-ip=198.175.65.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.helo=mgamail.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709069107; x=1740605107; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YLm/cL+dHPnuzS6G3vl9X6RCyiyNqBmXpbxGqPOhV1s=; b=MEasphmpA6dV5qLkyxYnitimEcN3wqJ3Lsz7U6G2REvX1j+/Ht8XpcsM j3imYxV0v7jOq0rJ/5a+rmSrptWkvwk4y4Zrkikiwqjtr2/jqBPC6oqNB j+nDiBbxGnjFhyK5r8N/y26guTIWQaelpnjEHeZMSmKlwHH2PQEezXY1Y odRhIxil7nL9MEOXB2l7BsCLjYWEOJUScIcE5IyZDpnWFGcKQQ0wkDDDP ziGRqJWCaB2WEpR3EG4+hLR0tTPsqEHBEYvi7/V6PJgsP7h1brOY2sfRI w+UussrHbfztuKH73Q1VbVN+M8BfN4h0nihgN/ziaDeO31rmfeSJ86BiC A==; X-IronPort-AV: E=McAfee;i="6600,9927,10996"; a="3566941" X-IronPort-AV: E=Sophos;i="6.06,188,1705392000"; d="scan'208";a="3566941" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2024 13:25:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10996"; a="937032892" X-IronPort-AV: E=Sophos;i="6.06,188,1705392000"; d="scan'208";a="937032892" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 27 Feb 2024 13:24:57 -0800 Received: by black.fi.intel.com (Postfix, from userid 1000) id 0D322537; Tue, 27 Feb 2024 23:24:56 +0200 (EET) From: "Kirill A. Shutemov" To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org Cc: "Rafael J. Wysocki" , Peter Zijlstra , Adrian Hunter , Kuppuswamy Sathyanarayanan , Elena Reshetova , Jun Nakajima , Rick Edgecombe , Tom Lendacky , "Kalra, Ashish" , Sean Christopherson , "Huang, Kai" , Baoquan He , kexec@lists.infradead.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" Subject: [PATCHv8 04/17] cpu/hotplug, x86/acpi: Disable CPU offlining for ACPI MADT wakeup Date: Tue, 27 Feb 2024 23:24:39 +0200 Message-ID: <20240227212452.3228893-5-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240227212452.3228893-1-kirill.shutemov@linux.intel.com> References: <20240227212452.3228893-1-kirill.shutemov@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ACPI MADT doesn't allow to offline CPU after it got woke up. Currently CPU hotplug is prevented based on the confidential computing attribute which is set for Intel TDX. But TDX is not the only possible user of the wake up method. Disable CPU offlining on ACPI MADT wakeup enumeration. Signed-off-by: Kirill A. Shutemov Reviewed-by: Thomas Gleixner --- arch/x86/coco/core.c | 1 - arch/x86/kernel/acpi/madt_wakeup.c | 3 +++ include/linux/cc_platform.h | 10 ---------- kernel/cpu.c | 3 +-- 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/arch/x86/coco/core.c b/arch/x86/coco/core.c index d07be9d05cd0..19614302e0c4 100644 --- a/arch/x86/coco/core.c +++ b/arch/x86/coco/core.c @@ -20,7 +20,6 @@ static bool noinstr intel_cc_platform_has(enum cc_attr attr) { switch (attr) { case CC_ATTR_GUEST_UNROLL_STRING_IO: - case CC_ATTR_HOTPLUG_DISABLED: case CC_ATTR_GUEST_MEM_ENCRYPT: case CC_ATTR_MEM_ENCRYPT: return true; diff --git a/arch/x86/kernel/acpi/madt_wakeup.c b/arch/x86/kernel/acpi/madt_wakeup.c index cf79ea6f3007..d222be8d7a07 100644 --- a/arch/x86/kernel/acpi/madt_wakeup.c +++ b/arch/x86/kernel/acpi/madt_wakeup.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include +#include #include #include #include @@ -76,6 +77,8 @@ int __init acpi_parse_mp_wake(union acpi_subtable_headers *header, acpi_mp_wake_mailbox_paddr = mp_wake->base_address; + cpu_hotplug_disable_offlining(); + apic_update_callback(wakeup_secondary_cpu_64, acpi_wakeup_cpu); return 0; diff --git a/include/linux/cc_platform.h b/include/linux/cc_platform.h index cb0d6cd1c12f..d08dd65b5c43 100644 --- a/include/linux/cc_platform.h +++ b/include/linux/cc_platform.h @@ -80,16 +80,6 @@ enum cc_attr { * using AMD SEV-SNP features. */ CC_ATTR_GUEST_SEV_SNP, - - /** - * @CC_ATTR_HOTPLUG_DISABLED: Hotplug is not supported or disabled. - * - * The platform/OS is running as a guest/virtual machine does not - * support CPU hotplug feature. - * - * Examples include TDX Guest. - */ - CC_ATTR_HOTPLUG_DISABLED, }; #ifdef CONFIG_ARCH_HAS_CC_PLATFORM diff --git a/kernel/cpu.c b/kernel/cpu.c index ac6af196c6f5..dde8e8472897 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -1531,8 +1531,7 @@ static int cpu_down_maps_locked(unsigned int cpu, enum cpuhp_state target) * If the platform does not support hotplug, report it explicitly to * differentiate it from a transient offlining failure. */ - if (cc_platform_has(CC_ATTR_HOTPLUG_DISABLED) || - cpu_hotplug_offline_disabled) + if (cpu_hotplug_offline_disabled) return -EOPNOTSUPP; if (cpu_hotplug_disabled) return -EBUSY; -- 2.43.0