Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp146880rdg; Tue, 10 Oct 2023 06:43:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEKoDdSU6G0AOfA3tTWVgyPEkCXP+ODqiIIwNBqVJSEKB76KyeIiG8CM3ODo6jzGCLz4mhr X-Received: by 2002:a17:90a:b102:b0:26f:d6f4:9646 with SMTP id z2-20020a17090ab10200b0026fd6f49646mr14056893pjq.40.1696945403534; Tue, 10 Oct 2023 06:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696945403; cv=none; d=google.com; s=arc-20160816; b=Tp0Tbh7ZjRP+pusMBMrTgjEVT/GP28as1RKm3kkpZd92eAi4QdrkZWmKc7aPA5Z+Jj T5Ndj7YxcbWuHLpEoLu8w/DQjI25yveoYAX1SaTywb0boHlPtELHjTVKS8XSuStNSUse 6tLEkQ/4hrKh7Sj6erOeFv6gLyy27x9FRf1SEwF/hZZZUFdIBw6HThGe+cmllOaOsh87 NNcAxj/OGvQIwnSyh3XJNwchCf2ti7ePsq29cHn0Goy9+GeYucXIb13QgB9R8uk2LcaC SViCAFpZNlWn4fmvzNNI0dYX127KJ3z7smbQ9yqn2zlT0/alYOWqe0U/ZY8BCVLRYqsT C04g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=PneSYMqDAZas/S6841H49QYQxTPXqyR85SM37F8J3t4=; fh=cMyFVT0sh6ZwVP2rvst5CQqRq6dUn/5tjJx0MsDQfWQ=; b=zbsnCqnU8UKB30D3XpeDBHkb2cXy6IfoxzJIdIvGq4LQV08Y46I9bje54AkUrsJLPl hbRXs9UXHzThmse7+2mxqOjxye8AS5BTQFN5qCuWsrxcDyDvidDOiTAdU5tAOs+f/G9O 8kgqe26vGeBnsfAyZKR6Q+9hJPn2cPMmdlwOmI0/PLWBAogZ38Oxh54tJiUQnWQl7sj3 OYHzVyWTSZM2j8J2JR+mbAFlaQw/tGoHVvf5byqFJkgEg+Mu5sAaJd4F3gz0cFW2W5tU rYlinKIMV6ZBHNgOuaM1yA81dq13OAXSX2UeLfU/qx7O51Hob3HCHS7KsIFImoC3wIqq zE4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="K34F7/IG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id m3-20020a17090a7f8300b002790b1320d4si13930113pjl.84.2023.10.10.06.43.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 06:43:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="K34F7/IG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id D53E480743C8; Tue, 10 Oct 2023 06:42:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232592AbjJJNk4 (ORCPT + 99 others); Tue, 10 Oct 2023 09:40:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232728AbjJJNkI (ORCPT ); Tue, 10 Oct 2023 09:40:08 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32C45D53 for ; Tue, 10 Oct 2023 06:39:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696945162; x=1728481162; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=jFQ77hdf5zEKB0qNpCTju/j74KsLB6t/D+R9NA4ih+U=; b=K34F7/IGHen9tHyq8Jd68rPqQB9MiHna3Xk87pp4LWU3xjp2TEADQA+n MqZyED+GhqMj97eMy61MQNBeugTc7RC5aLzvhP0sy+T/zKzA575thdgaD O/9/n2p6l2sVebELd0i2ez1KoNrARivai9WMMtZ8ZhXJYHyk6Hhsb60Y8 CKlOCKPR+n+Tn8DWFtodQaxnRx9/gX+zLblR3Md86ahM6zsn7vHLscE9M mS+LCxiFhd+Wi2iE3Z+8DtKpZk5/4Zjsgq1RDoLmCH1OXpLlnU9prQC+m LmfeiKESi1BnKgGU8ak5ufH9js0NkgmKpAp5CEUa8YRX1siJ9TNpsSOmQ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="384251674" X-IronPort-AV: E=Sophos;i="6.03,212,1694761200"; d="scan'208";a="384251674" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2023 06:39:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="747072743" X-IronPort-AV: E=Sophos;i="6.03,212,1694761200"; d="scan'208";a="747072743" Received: from patinira-mobl.amr.corp.intel.com (HELO [10.212.128.216]) ([10.212.128.216]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2023 06:39:20 -0700 Message-ID: Date: Tue, 10 Oct 2023 06:39:21 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 03/13] cpu/hotplug, x86/acpi: Disable CPU hotplug for ACPI MADT wakeup Content-Language: en-US To: "Kirill A. Shutemov" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org Cc: "Rafael J. Wysocki" , Peter Zijlstra , Adrian Hunter , Elena Reshetova , Jun Nakajima , Rick Edgecombe , Tom Lendacky , kexec@lists.infradead.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org References: <20231005131402.14611-1-kirill.shutemov@linux.intel.com> <20231005131402.14611-4-kirill.shutemov@linux.intel.com> From: Kuppuswamy Sathyanarayanan In-Reply-To: <20231005131402.14611-4-kirill.shutemov@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 10 Oct 2023 06:42:56 -0700 (PDT) X-Spam-Level: ** On 10/5/2023 6:13 AM, Kirill A. Shutemov wrote: > ACPI MADT doesn't allow to offline CPU after it got woke up. > I think you can use the term "CPU hotplug" instead of just offline. > Currently hotplug 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. > > Mark CPU hotplug as "not supported" on ACPI MADT wakeup enumeration. Looks good to me. Reviewed-by: Kuppuswamy Sathyanarayanan > > Signed-off-by: Kirill A. Shutemov > --- > arch/x86/coco/core.c | 1 - > arch/x86/kernel/acpi/madt_wakeup.c | 4 ++++ > include/linux/cc_platform.h | 10 ---------- > kernel/cpu.c | 2 +- > 4 files changed, 5 insertions(+), 12 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 1b9747bfd5b9..15bdf10b1393 100644 > --- a/arch/x86/kernel/acpi/madt_wakeup.c > +++ b/arch/x86/kernel/acpi/madt_wakeup.c > @@ -1,4 +1,5 @@ > #include > +#include > #include > > /* Physical address of the Multiprocessor Wakeup Structure mailbox */ > @@ -74,6 +75,9 @@ int __init acpi_parse_mp_wake(union acpi_subtable_headers *header, > > acpi_mp_wake_mailbox_paddr = mp_wake->base_address; > > + /* Disable CPU onlining/offlining */ > + cpu_hotplug_not_supported(); > + > 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 cf536fe1a88a..9d4279476b40 100644 > --- a/kernel/cpu.c > +++ b/kernel/cpu.c > @@ -1522,7 +1522,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_supported) > + if (!cpu_hotplug_supported) > return -EOPNOTSUPP; > if (cpu_hotplug_disabled) > return -EBUSY; -- Sathyanarayanan Kuppuswamy Linux Kernel Developer