Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2498030rdb; Mon, 12 Feb 2024 06:56:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IGAB/JwVcAZwXLhhcsAk63JGSon5wYrzGgufHL/F5ZuNlR8ftbIjlgI8lIaF7MnB1NLFth3 X-Received: by 2002:a17:902:7241:b0:1d9:b3ea:25ef with SMTP id c1-20020a170902724100b001d9b3ea25efmr7844772pll.10.1707749765771; Mon, 12 Feb 2024 06:56:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707749765; cv=pass; d=google.com; s=arc-20160816; b=PGEeWxFKGSjWKG6WI50+WV7qAlHQ4DslVEwlk1sILwS0PZO1PmFNQxW6ssVYccL02U z0cYt1JUTw2mmKRx43+Z/sEoyxeoppKK9uASGqJ2ZjkTfThHqpk3vrUJcqN/03/Lx9hW We11zWbABZiUt2NUyVIaL3Eam2TYpHqYgg2ANhoFxSzsuRe+wbDP2lJEAVdD0zvmdlzh YMIa6QohAYMG43bjG/SxKhSUS1TPP+aCJWL9ia4LZNYqVvxZe4SaPtukE8j+/NJVxxJk NHvhNlMQEqCxj7sZK5yTboyg+5xQnHqQ02uyX4bhGGPm2BVgx6hY9+Wlcd71NmmfLLkb g1dA== 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=iU1ZlftgLUZTKojE64KaxxDuYt8xfxFymPnSI3m2MEY=; fh=appxyho0xP7d6nMSZ7J+KVl5Wc0rswnLf0CCZjJyg2k=; b=ViDIatDejKGP5hhCxZrX3XlvyoRY7/Cl7WrRyXLxhRBK1j1sD1ttQfDXLiXFiSWJDL b/Tk2OvFqZhFQnOuEA8Kkjp05+s55DTOUofoMP8WUFB5Dqgs7cxEdEJhhrN8aNNW30R8 ltRftxOBpmbN2qgsRzdreazy0CZnaRT6n1st5+rjY8QBn8OS6TFtdnxnigrJGvoKM4Gd ph5zMmAv5ZrqZrVDBjDo1YkOC/nMxeN03A8IADuIDnynDXUb+wJHaIMA6VRLFYi1tzoj XJaVULf2J9Pw8/wt/cqhfEEBcaWj2eA6G+wLmyAqcXD2lsDws4buv8FuzVF2Jc3sfEF6 r0kw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WCYdhkOQ; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-61354-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61354-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCUD/iWSN6xwo7IPx3EaW1T60zvd7myjYX2QbeCM9SO1qFfVJvcWBNkDrarvwCanyFQrfdsAmoKwDaW2wGChu7X4Or/qRaSE7vfbhWV/Mw== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id x6-20020a170902ec8600b001db28cd72f9si360778plg.466.2024.02.12.06.56.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 06:56:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61354-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WCYdhkOQ; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-61354-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61354-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 8AF99B22BCA for ; Mon, 12 Feb 2024 10:47:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B885338FA0; Mon, 12 Feb 2024 10:45:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="WCYdhkOQ" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (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 B7F633984A for ; Mon, 12 Feb 2024 10:45:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707734706; cv=none; b=l0MX1Ik6YwIT+ScHjF9AQhb10VpdVQLVEoQRJkcbPbf2BEx6vX6OtuuwzS6kNsqpb2vtsZlAuSd9wcvdXfQC7/MwTn4vh8na6W7hs6DIJJLhh5e6KbS91PTefNa7vtk/zSCH/AxB5po2q5pcCp/NBS3/tW50+sggheFovNJw0/8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707734706; c=relaxed/simple; bh=ihRAX/Eyt4LbMVM80nu0CT6hBURKtph1gZYnA+gKNPw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R45KJ88uMAbq2gynnOQmql5z8+dU5wsTSlHpjLevOc2NsVlObiBFxwYPdSa3/QJyPwoYoZjbX28xBXLsHm/I5IR6KH0Go7WiqMbo0EEeNFOHs6TQiTc9JjMc15f+W83/DFxb3+wqjEe3M8LQo46c0yORffTsL0N/Cxt5SKK2py0= 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=WCYdhkOQ; arc=none smtp.client-ip=192.198.163.17 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=1707734704; x=1739270704; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ihRAX/Eyt4LbMVM80nu0CT6hBURKtph1gZYnA+gKNPw=; b=WCYdhkOQISDp65W69B3IfwjyGx+9y1w2jfGMx+pepBoaWmyfLNqS9rgO obxpNrws5Zn2da/rJyRs19+Q27GuBSqDhnJ15F/rWRJGN5ZmlI8HVNt4k NDZQzkul+feRdHRD/IIzf9CeyDJnK8WkANeZH8Ee7vlcZWJkx6/Rod+HI kxMH4h/Y7IVLvPyZfVaupsd965sgsgDWS7gaouflvBIt+KGVJCZFnmTbq aSESAotfsENAYBVYqPpeqvaKv4EUayH5U8PAgnTy7CExuT14tPoNa/P98 J8LNJQTJXIlUW+5nliMeNLNNZUU6sKYTzSr1BNyOVpOUSgbjPCeFOuZRe A==; X-IronPort-AV: E=McAfee;i="6600,9927,10981"; a="1585015" X-IronPort-AV: E=Sophos;i="6.05,263,1701158400"; d="scan'208";a="1585015" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Feb 2024 02:44:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10981"; a="935035577" X-IronPort-AV: E=Sophos;i="6.05,262,1701158400"; d="scan'208";a="935035577" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 12 Feb 2024 02:44:54 -0800 Received: by black.fi.intel.com (Postfix, from userid 1000) id 1C79D532; Mon, 12 Feb 2024 12:44:53 +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: [PATCHv7 04/16] cpu/hotplug, x86/acpi: Disable CPU offlining for ACPI MADT wakeup Date: Mon, 12 Feb 2024 12:44:36 +0200 Message-ID: <20240212104448.2589568-5-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240212104448.2589568-1-kirill.shutemov@linux.intel.com> References: <20240212104448.2589568-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 eeec9986570e..f07c3bb7deab 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 7c28a07afe8b..3ffdbb1f7bb4 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -1532,8 +1532,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