Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2092245rbb; Tue, 27 Feb 2024 10:17:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWknF6exKRYS81MRRxiOQpqgRy3E/x+TZgyxFN5K117kj8aNytFed9Us2S7qbIN0NkvuI2d5pFdm4pn31vjtk+UGY8nYxrx9JRjoB37UQ== X-Google-Smtp-Source: AGHT+IE6DXyY4qWlQaaSNJbGJF41h9dVG4CYHxPt993xyF/YA1UYcqpkfa7471rmJQ3QFYE6ycvK X-Received: by 2002:ac2:4ac8:0:b0:512:f6d3:9998 with SMTP id m8-20020ac24ac8000000b00512f6d39998mr4593932lfp.17.1709057856397; Tue, 27 Feb 2024 10:17:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709057856; cv=pass; d=google.com; s=arc-20160816; b=lqLkWV/kBBPU7KSNJgPogrKgwZBZczg82ECjWaU0HMMEojKh+k88Y/ejbWvJc1j/TT 1w3EdxTnRTlXDg0ir86SX2rfwIaxQyNZm31FWpr/eBbDM1VCj+ctUTwTKP8mR4qUvnOZ vhYmuRqSo4xXm/rzB2h2K080xArGSReZQAv76TouYyrh+ygdsHZcfNW/n8Qu2pPL2G7l ANszMjrZiEvoXY4HkMPylz3NLl1EXNUcsxHSZwqlyd/HOdgtz3GEJm7hGUWYN+NJ9NMa DB9iGig23rhCNwAcgqhABX51r2s2ZQSerUCXGx3552zCeR7M6P+JBEibdgE77mqBjNiC Bhpw== 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=OvJRnOqsMTm9XoNmEwebcqh9Ud7yh1CTeKAP84ols98=; b=GKTkzBhjCDM5ckAnqM40QgIPre+5Lh927epQojkCMjc5d4+rwm6U1NVkQZRYWQ9pA/ IcFTMzdhJ7xqhdzk9N+3tTRaRuH93K5trGkrtcnrz3lG3a+K5ius0n3XsMDYXkfpTgLU DyWsA9o8vtxdayT/Cl2mDwxfO5k1s1an/DKMNfpHnQ3WSpYFsC0INyLSNC1YEzN703HD AlXiGDb/mqy4nnnBdFdlaKF2byEOQxLsZznL1gDpmQ7RwsVftA+zZuL1on8Z534xe0oK YDHmkVrdgB8sFKS5j4iugmoQDemrmWwCLXliGols68BLv65TT8eNkVVhZ5xwYZgNazx3 n/7w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ftf28WBX; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-83811-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83811-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id cw22-20020a170906c79600b00a3eb3e37f56si881593ejb.788.2024.02.27.10.17.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 10:17:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83811-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ftf28WBX; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-83811-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83811-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 6BAAB1F2726D for ; Tue, 27 Feb 2024 18:17:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 925F3149E15; Tue, 27 Feb 2024 18:17:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Ftf28WBX" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 E6C6414830D for ; Tue, 27 Feb 2024 18:16:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709057819; cv=none; b=caJ3P+IHCT5xMWQuuGEE7vG7jFG0u99DXEeO7HXO1F+BkmZK+cjqkWSYWJ+/QzoaZtbPL3UhL0VJTdCo/ZBgHGroSAI7qCeGUUYcI+sWsAlMORu1nmVJcNg43YWcOYtQrOL2suvTKX6/QrJC+EdRzLuQFpHFQEi65n3fTLzUHk4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709057819; c=relaxed/simple; bh=ihRAX/Eyt4LbMVM80nu0CT6hBURKtph1gZYnA+gKNPw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pF7P+xlYxLXQNoZ0AUlRR9zt9X04in4NXf04GOd74vHjr97iwXyE0joHQo7xhSEStGc5yKSmxp7KpZPKAkTX9rNEkv81XGq/VJ2d9OwCFs7eGzOG1YygdvzXmT92SofIMVlbPKpoNo3R4321VXBEnb+LyeAusS3ARkIreg2nQOw= 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=Ftf28WBX; arc=none smtp.client-ip=192.198.163.8 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=1709057818; x=1740593818; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ihRAX/Eyt4LbMVM80nu0CT6hBURKtph1gZYnA+gKNPw=; b=Ftf28WBXc2yw1cPpCjxWP+pVJItJg6QjwoT6gsPzW4JUEUgGEkck/xCY z2MULf/RoDoEezETNzCCOhXW6XicBm5tKDxBaMkrwgajagHAPoXrwkCQl xor5Ehjxg3mWa9Yro+3hLRUgCpilIcQ6T+hVyuSAJW/ZrxW/UBJAVayWD +kZ2zFBFPaSkAnyiX0zMSDn65TFZiAsmW7lVAsxHf0SmON0+2rP8i58O5 x1R8eEUeLEGtt5THcK6nTssNRUYSseZt4pt5Q6MMNSLyBHo8F3E5pyS5P nUsJhsZjOzi3oszKraUFQk6P0OIDug/+DpRgU80V/xc5cvo8Yufcdvj48 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10996"; a="20966070" X-IronPort-AV: E=Sophos;i="6.06,188,1705392000"; d="scan'208";a="20966070" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Feb 2024 10:16:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10996"; a="937032712" X-IronPort-AV: E=Sophos;i="6.06,188,1705392000"; d="scan'208";a="937032712" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 27 Feb 2024 10:16:20 -0800 Received: by black.fi.intel.com (Postfix, from userid 1000) id 69E614C1; Tue, 27 Feb 2024 20:16:19 +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/16] cpu/hotplug, x86/acpi: Disable CPU offlining for ACPI MADT wakeup Date: Tue, 27 Feb 2024 20:16:04 +0200 Message-ID: <20240227181616.3032032-5-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240227181616.3032032-1-kirill.shutemov@linux.intel.com> References: <20240227181616.3032032-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