Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2615842lqb; Tue, 28 May 2024 05:45:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUWukN+9D/dSV2LZo6gGLOz+oRS/WYoZIOxD6SCyJvPgwrB/JainQWKMpcI6Q+JNSsEJoZwCeQy9amMKS7COLi2rbmrbYGTH3roQlHg/w== X-Google-Smtp-Source: AGHT+IHgJT7oaPeS8hL/dgWrUlwlBKD6cCE0ZHnqyejs1hi7cYP/vAjo4E/7sagUm9H2g5EqbUPM X-Received: by 2002:a05:6a20:3d95:b0:1ad:7ff5:cb38 with SMTP id adf61e73a8af0-1b212f94555mr14622064637.60.1716900353652; Tue, 28 May 2024 05:45:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716900353; cv=pass; d=google.com; s=arc-20160816; b=uAlKcLqAfL07+fa5HM64gVI0A0N1ku82kyxkxIeF4Nq+Dm+Z+JwVsHTs5K1YQEnyAS seNIt940/L0Rdk2IGDMmtqHUocsZ4KS4OPYpoBtp9NSmkfv8lYLV/hkc0+BRatiPSrqU OAn9pC57BF0lGSHVfJxt+qb9Kogml+EKVQJqVWg4FJFpOuRyN9iv5fLaEUlddtVohHiJ zsTzBvN9XpCCpacAg3he0aqP9wtwD10vDK1vlzCqcMUw0q7vA51uIqdfIjvAgLIpR1jT +/5un2fbrgfblh1B+OBLeyxNkZjVI6Nxnee1GzQFuDMErJBCEn4ZJ+Zr7DxV8iQ7G4Wf Jhdg== 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=06naKssng1uof/BVJECe2BWa6KdfZQfL9UPUo0SJL8Q=; fh=jKzY+IJTxktZ685R93VhJUbGF0rvTl3iTwtLazyIugI=; b=MngE8QOdw/PqCOmLaEqPHqlegJAVpjSjTdfieqUpRAw6vlZUktsmeDVOpsZRvYGO5E pDvt0X6Lx5ymrwfsH65nOm6Gt7HUciiVvbv3L/kPGNn92I08X0vrCyHoq/+HXhkRLRKX Kuw9FM9Tm0FD46y7dWfISQb9kCWwld+Drhm+wWq6xe8cLsQ/MzYl/BAWh3XRCy4wGTC/ uWW+wtC1Ve6eJrJ4XrNsLGy9FwKQhFxPI+ki3+aYF0O8BLfIwKyG794h9aRRjyOO95Mj SJUwk6UGfJ4sEQ6LnI46oWGH9dBlMzfferLwNA9qf1CeQplMZ1kIBZIuG3JUMFkuph6G tBHw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mRXf46ld; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-192047-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192047-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. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-682288e661asi8120682a12.488.2024.05.28.05.45.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 05:45:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192047-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mRXf46ld; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-192047-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192047-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 A49712875C4 for ; Tue, 28 May 2024 09:57:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 23D8A16B724; Tue, 28 May 2024 09:55:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="mRXf46ld" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 ED13C16D4D1; Tue, 28 May 2024 09:55:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716890150; cv=none; b=BU4xaWXupCoc5jzzY/vZINnxmw48xQwUj/8CcJ9cE5HP2Jll7j299LoZ8PetFZCwV+bU2pDZ3gAlZltmPavgMZYlhoSr5ABtqV3fCoOzZKUK56OS6oiNScWYBiVrYHy5KZ+v05nW5kZS3qEZN0Wc6jrdBkvNx0aUSengPN00mIo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716890150; c=relaxed/simple; bh=r9Wukz3LMtiE4FgG1pnaOuL/XYUpxKOHH2ibiZ96dYY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MeOMU4EgYdW+hGIRQHN2y5pASDf4BhGZ1RWg8wFYFQBQJxA67R5uKQKpqV1y9lXa6yc6HXNvS9FfUb2lUjVfrMZW9OUYlnzL+V9n5PIE2auUEKnPw3eKYQIbqhDft5se75O8EN4Z414GJ6pGCZaz931wNgQ3UmjXRlDoxQ84QR8= 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=mRXf46ld; arc=none smtp.client-ip=198.175.65.21 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=1716890149; x=1748426149; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=r9Wukz3LMtiE4FgG1pnaOuL/XYUpxKOHH2ibiZ96dYY=; b=mRXf46ld3IwEKFVVa5LMXDW5BpSt0lZIU0nU/AhfNe8xCU0NAXlcqmah BWEAJu1ETwSVu8v6IJ2hqHkQnxYhx9CUvQNY5pjQlEx+VpY9W9T+h3r67 3cVH0FISnaGlrrZ059n1Yl3NN1qns9OeJhFwFv01msWxixorRl7bJuM7x +u2ZZ7FKT1Dz7a8wTf+7G59hyXGLe8SpfgWyPHT/CkkWsaTb9tWLHmsjj wVZwLLma7bI20INFHi8yCSjRrwyg1q/tC9+8ASUKpxcPK2pa2N3zZ57CK 8VibampaGPluyhXFhHVeEB3c6zREi3OuyoaDDqmV2FSbYgOvYKvNCeQdd Q==; X-CSE-ConnectionGUID: 85k+e4YpTpaP5f/S4fdXWg== X-CSE-MsgGUID: EXafPIMKQZ6KAxIVrG9K+w== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13172072" X-IronPort-AV: E=Sophos;i="6.08,194,1712646000"; d="scan'208";a="13172072" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2024 02:55:34 -0700 X-CSE-ConnectionGUID: S/YF0HKNTieVPdBDuVMg7Q== X-CSE-MsgGUID: oruyWRoVTnW99vOGHaDdNA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,194,1712646000"; d="scan'208";a="39984733" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa004.jf.intel.com with ESMTP; 28 May 2024 02:55:27 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 68FEE46A; Tue, 28 May 2024 12:55:26 +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" , Ard Biesheuvel , Baoquan He , "H. Peter Anvin" , "Kirill A. Shutemov" , "K. Y. Srinivasan" , Haiyang Zhang , kexec@lists.infradead.org, linux-hyperv@vger.kernel.org, linux-acpi@vger.kernel.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, Tao Liu Subject: [PATCHv11 04/19] cpu/hotplug, x86/acpi: Disable CPU offlining for ACPI MADT wakeup Date: Tue, 28 May 2024 12:55:07 +0300 Message-ID: <20240528095522.509667-5-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240528095522.509667-1-kirill.shutemov@linux.intel.com> References: <20240528095522.509667-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. Any platform that uses ACPI MADT wakeup method cannot offline CPU. Disable CPU offlining on ACPI MADT wakeup enumeration. The change has no visible effects for users: currently, TDX guest is the only platform that uses the ACPI MADT wakeup method. 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 4c15b478e2bc..a609385c7f99 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -1481,8 +1481,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