Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1911752lqe; Tue, 9 Apr 2024 04:31:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXeX7kcB+4s8F5POjuiqTqRWcXIckRP0YnvGqhjDpchdDptsNQyGH8SU1HvTyTNETlIuihQ31WJUq0/QqXf5soou6tczGG+rNY4fDvc+w== X-Google-Smtp-Source: AGHT+IHH9h5zKLlChojqg4sPKS33ZRWAXlavCvqYZDpaPFRykvG0IQz1hnzao+ROeMLgR7M9xls8 X-Received: by 2002:a05:6358:7289:b0:183:9ea4:74a9 with SMTP id w9-20020a056358728900b001839ea474a9mr8424929rwf.15.1712662269283; Tue, 09 Apr 2024 04:31:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712662268; cv=pass; d=google.com; s=arc-20160816; b=pFZqH/YNAnufX02Rv8o9QFL0MMsJE2AXrcW8bi5HWA8VLwf359VFkkVo45GLqbd3Xd duCJDzAdcZgiVtJnmnpCEcUexgmEYSJcCc0C4MTSpE0qkEG7XS/Bx132YZe9suwzOz6m rrM3jhXjVuo3THZrbgefVRfydNWEjwOeNYhsNcx4hZcwToEFgDigwP8KWxhnhIs7pI0i cjX8Z+rj326VlvcvWZQwehSZbMCsfSz1NoqDEeeGD0Sspr65YALhdUDvDXO2zyH0+mmH aAExlDTrhZhfuBFG2om2IY/piHd76T3LJyC2a2OFrIkrWGsYW5BKIf7u8DcI/hzIYymF RHXw== 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=lFkPKKtKSN7+fAVPKKH4yuFaTqSdsg/y+a0MNtU6hpc=; fh=Yw2S7s1ZcF7+jfnU9Zy13ghDfPt/cQWqfRpyK6FQAJQ=; b=Q9miiy5a1UUAP6UiNcUyvhnQ411M5VqcnZ/rr5H5SqLwM57gUM3Knik+FfZzOiEA8V BplJ/J+Xfj3SedCYLbmPTWx9Vut0WZSsWVIKmsNMz3FvKyTPV93dobOlnv6DGRCCmt0w R00Y6RY7ARhYOQyDkLnw6UaHycq1/LPwSP+Fz2prlyNzqt+7ef2WfzX3Q+idnutiv8EW 3MHSQjCefW2SYY0hLmhEGYjYCKAQeVN500pmEfWf15mbcg1KALDu7q+0RTxKMYMUtPDq j5SuHxj+QySUk2VVLreVC/uVoUqpacPP2Vs5zH2fpi4SS1pY6urm92EpMHp8AW3sdc7w F+kg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QANIiwI8; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-136751-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136751-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id f17-20020a635111000000b005d8c5595ddbsi8244686pgb.271.2024.04.09.04.31.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 04:31:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-136751-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QANIiwI8; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-136751-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136751-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 90107286590 for ; Tue, 9 Apr 2024 11:31:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5BC2512C805; Tue, 9 Apr 2024 11:30:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="QANIiwI8" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 D3327128806 for ; Tue, 9 Apr 2024 11:30:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712662229; cv=none; b=n4ykG8QBiqBLGDXlKbaexBPGTWqp/Ki7Hzx1LN8k4+5MgVPaJA7qxV1EmkUtGS0MeKcdrUSgm5Wg+15s9vtjK1wHfPX5McHHSxTvTjDfbKfdbwFPNdYrSHjbboCtvvUpudAJk42/37cpPfQpLLnCjipPc8Ns91wj3q7W9OgC/W8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712662229; c=relaxed/simple; bh=IXySMsd1LbCuYXSWDngaVCbkpG0HLAxIAN3nQj47ksE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=anO2p3kEzubo552q8d90WYw+4VRBWEYDiwwhd2jtVdW13CmJYT1JYICV89F25VGIhgtJifI7orESd8Rkv2grOgIY/Iy9GzKgmOcTl4GFvLsojNuVqaumzQPQCR8MWTSAGIUzsFWMYbtbE/4/qF4WvTvocrYHi7oycbp0lufJSwA= 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=QANIiwI8; arc=none smtp.client-ip=198.175.65.9 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=1712662228; x=1744198228; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IXySMsd1LbCuYXSWDngaVCbkpG0HLAxIAN3nQj47ksE=; b=QANIiwI8cX1pvUpzWP7rAaIXH8eeFx9rZs3yhBJ4k5UeSRJp0SSWOo/4 QjfqF7NmP+JQBF5MSyaPp/dP1BsYe30hayTALI7uUh5qgwO5TvRSLuAlN fqGP7T2nwVfWeqa8JHUo86D9Ft0ewDlakr74ekLhBCigGsmUCIfedtEVU FU9qIN3JfogqHclzA8WwDRStE6OJ9NNyLDuO0epcvYSS8ULsuUXb3Dn+D wQ+0whhxGaLGWzVyVg1Vv4VxM0O81wDcTTzs72Dm7Lhn0LU2pUENqAqkA RmqTGqkuZOYQpN+0+7uuTH9Tee8kc2lW9ceDsgYGESe+FZbBXYG2Z7wJE w==; X-CSE-ConnectionGUID: s0wYpC75TxedTdWpm4AUNA== X-CSE-MsgGUID: TxN69dd4Q0m71ut3RziHJw== X-IronPort-AV: E=McAfee;i="6600,9927,11038"; a="30460342" X-IronPort-AV: E=Sophos;i="6.07,189,1708416000"; d="scan'208";a="30460342" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2024 04:30:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11038"; a="937093315" X-IronPort-AV: E=Sophos;i="6.07,189,1708416000"; d="scan'208";a="937093315" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 09 Apr 2024 04:30:18 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 9EFDA8CA; Tue, 9 Apr 2024 14:30:17 +0300 (EEST) 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" , Tao Liu Subject: [PATCHv10 04/18] cpu/hotplug, x86/acpi: Disable CPU offlining for ACPI MADT wakeup Date: Tue, 9 Apr 2024 14:29:56 +0300 Message-ID: <20240409113010.465412-5-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240409113010.465412-1-kirill.shutemov@linux.intel.com> References: <20240409113010.465412-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 Tested-by: Tao Liu --- 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 b31ef2424d19..0f81f70aca82 100644 --- a/arch/x86/coco/core.c +++ b/arch/x86/coco/core.c @@ -29,7 +29,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 60693a145894..caa4b4430634 100644 --- a/include/linux/cc_platform.h +++ b/include/linux/cc_platform.h @@ -81,16 +81,6 @@ enum cc_attr { */ 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, - /** * @CC_ATTR_HOST_SEV_SNP: AMD SNP enabled on the host. * diff --git a/kernel/cpu.c b/kernel/cpu.c index 08860baa6ce0..a70767aee9d0 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -1528,8 +1528,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