Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp1116022rdb; Fri, 22 Dec 2023 15:52:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IGHqgT//1RPax+ka6uZYMbYZDhbhuWVVYfNhoh2NDNeRoikQ4vAw5jvks4I2A60vwwJdIqY X-Received: by 2002:a05:6e02:1c4a:b0:35f:cb85:7773 with SMTP id d10-20020a056e021c4a00b0035fcb857773mr3138732ilg.32.1703289163093; Fri, 22 Dec 2023 15:52:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703289163; cv=none; d=google.com; s=arc-20160816; b=gfaYSGgwRbNxqIJHBkbSaCd1MKHKt19tjxORCMdojz4B1aksCF8Xd5/N8RIc5HUJcs qCbGtwSz28A5gHtObriY3D7pklTRl6CDsBNJjgwcUHiC4P7PBMtTHmVsrowrj3QNu9Mq neEpKBdUOyDqUjdFnRNfEadx64y9JfoVIYiaZ4qMm8H0VzRCnFB5br/93ASvI/evPFX5 M7cxFrkVJmb7YgzBJm7T1NPiPLoQcN2Nr8NFB7hK52DT5y5Raa08O+bSFhntkb5zsjSt bE84d/xPW4p9fdRwnLvjVvsJTZ5oP/KShQU+38ubTiIoGMZGvYHz7WW9i69X943Be6SN 8k0g== ARC-Message-Signature: i=1; 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=pyZW5KJD4F/wGTW2sSpjXW3Ih+6AlZJ5uX+Sso1EwXI=; fh=OvJRnOqsMTm9XoNmEwebcqh9Ud7yh1CTeKAP84ols98=; b=fx1Eq5L1R40hb6KzL/bFPjSK9RrPyXs9fs6cIWtVgvazXgBiUVSZhbtbl3WsY7Y975 zyOIOa8Qr2gTOLDEyvjFZh27DGJ3JRuVgJofuHhW94PjPELxUxwSKI1P40pEjKBTq4Dw Y7YCCspFxXmAOZKTPd3+83hZGrwxVgPJtIbYlm3kj161T+0iPo0bMqzS7XBG2QiIOy5U OmTpG/hFR3sTEMs703vWRo3xgYZ9J9v7IGvKzo8VYrYg1CQ3jOu3+6LA2YH4Crj4JRSU wbK5NbIwaQQXA0H4dWpzfYq5ITmJmqMS8oxY/GdmHrqHJD4nc0QXoUs+0bOomOTtvfTb wayQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Xbo/8kjW"; spf=pass (google.com: domain of linux-kernel+bounces-10128-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10128-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id ja10-20020a170902efca00b001d3da9ce5e0si3851870plb.467.2023.12.22.15.52.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 15:52:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10128-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="Xbo/8kjW"; spf=pass (google.com: domain of linux-kernel+bounces-10128-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10128-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 8EB5AB22351 for ; Fri, 22 Dec 2023 23:52:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 60D003608A; Fri, 22 Dec 2023 23:52:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Xbo/8kjW" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 97C3F35EEC for ; Fri, 22 Dec 2023 23:52:20 +0000 (UTC) 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.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703289141; x=1734825141; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VJQoaMr9pR2fhfjF3fTtKOF3w92bT2zKgTwlCgP2JIM=; b=Xbo/8kjWDGmWccLyZ5KMJpCZgQJnYIJASOGBCWWwcC3wJKMWXxSu/A4c XcqVukOspmXrlRb7gfwbjXbpGKrhDxTY42+8UR21sKSjggS6ssXLBKCvT sskVkdRWuGkGOR8rGPAmIQoZJILQmrmkQToSmIoVjwzjr0/4OZQ/+yNre wLWg0+HwROuO2GmsK+amHPJ0NtSF1Hc00CrG1OtxsghhiQdd6bB9Dq4le K/8+8rax2gJfCNTj+RG9YCpK5MHbgnHHZF2gGyjhQT16/Ffo+NSiG4gAV lZI6xxpVO8g1LENDJjg7z30OXHnYtwn4yRZP1HTwO0Oo/YUC697KyMOdo A==; X-IronPort-AV: E=McAfee;i="6600,9927,10932"; a="3414328" X-IronPort-AV: E=Sophos;i="6.04,297,1695711600"; d="scan'208";a="3414328" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2023 15:52:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10932"; a="726961474" X-IronPort-AV: E=Sophos;i="6.04,297,1695711600"; d="scan'208";a="726961474" Received: from jeroenke-mobl.ger.corp.intel.com (HELO box.shutemov.name) ([10.249.35.180]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2023 15:52:14 -0800 Received: by box.shutemov.name (Postfix, from userid 1000) id 0353E10A472; Sat, 23 Dec 2023 02:52:12 +0300 (+03) 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: [PATCHv5 04/16] cpu/hotplug, x86/acpi: Disable CPU offlining for ACPI MADT wakeup Date: Sat, 23 Dec 2023 02:51:56 +0300 Message-ID: <20231222235209.32143-5-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231222235209.32143-1-kirill.shutemov@linux.intel.com> References: <20231222235209.32143-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 a2e17f085079..a81475d2a5c0 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.41.0