From nobody Thu Nov 14 17:07:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+70383+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+70383+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1610696868; cv=none; d=zohomail.com; s=zohoarc; b=N6Tlc8o5n9V/2agS20UeeAHN81bIHKEAJIjeBFtpPb1jIpDhYPWlG5GokaBeMFl/Ga0F5gfAXW+TTfER2WVKtOFEKZOScK6Vj/ASn/pHGGN4kSxKEedGSoSgAvNQArGDpuqdBkrCquNr+REPUyrMMPMxABmX7W3RmcieTo0Q42U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610696868; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=noMQpzJLjJD+UKOJu1cmiSAccpAOdJOwkJ2KSwGeCKI=; b=CjIuPm6u74hFa9VuZA1Dt1WOqLH+vn1J6NjCB3i6JI3tT5qc2zfRyNqlAtlLCyqr3WsX4jsnIRrkmeQZdUoAKqd0qytTv+/TmN5m0VzrUOtwBR8voAEfDID5T9cwsV+86xjzeDWztz1mRqsGZ2JblrkLej974r+HgJ2rDKI9gIA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+70383+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1610696867998854.0237753414937; Thu, 14 Jan 2021 23:47:47 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id ZhJoYY1788612xhmeY5N3FrE; Thu, 14 Jan 2021 23:47:47 -0800 X-Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by mx.groups.io with SMTP id smtpd.web09.1080.1610696867114815838 for ; Thu, 14 Jan 2021 23:47:47 -0800 X-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10F7jMv1124591; Fri, 15 Jan 2021 07:47:46 GMT X-Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 360kvkbnnr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Jan 2021 07:47:46 +0000 X-Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10F7eJE6043453; Fri, 15 Jan 2021 07:45:45 GMT X-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3030.oracle.com with ESMTP id 360kf33v0q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Jan 2021 07:45:45 +0000 X-Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 10F7jhgT013343; Fri, 15 Jan 2021 07:45:43 GMT X-Received: from localhost.localdomain (/70.36.60.91) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 14 Jan 2021 23:45:43 -0800 From: "Ankur Arora" To: devel@edk2.groups.io Cc: imammedo@redhat.com, lersek@redhat.com, Ankur Arora , Eric Dong , Ray Ni , Rahul Kumar , Boris Ostrovsky , Aaron Young Subject: [edk2-devel] [PATCH v3 04/10] UefiCpuPkg: add CPU ejection support Date: Thu, 14 Jan 2021 23:45:27 -0800 Message-Id: <20210115074533.277448-5-ankur.a.arora@oracle.com> In-Reply-To: <20210115074533.277448-1-ankur.a.arora@oracle.com> References: <20210115074533.277448-1-ankur.a.arora@oracle.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ankur.a.arora@oracle.com X-Gm-Message-State: I7SS8tPHsJP7P4dAFBYHIBNxx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1610696867; bh=6TE+to3l/lCUJjTD7BBWLEtPQq3AjuObik3bZoeestQ=; h=Cc:Date:From:Reply-To:Subject:To; b=p1X24WMM8PJDPA7QCkXSmOX6XfNna6bx1Nr9InHVHw2lQNybo8xwgPQe0pcryJccRDW zpumN8KtaZNAOo4S3Mn22shEMxuJk4NNcrNf4AgqfBtsf4Mih593LC3MoE2CjrBeMGXMQ HZWwJcLiV2cArvfs/citf8TQeA5hKU5wgCU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Define CPU_HOT_EJECT_DATA and add PCD PcdCpuHotEjectDataAddress, =20 which would be used to share CPU ejection state between PiSmmCpuDxeSmm and OvmfPkg/CpuHotPlugSmm. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Cc: Rahul Kumar Cc: Boris Ostrovsky Cc: Aaron Young Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3132 Signed-off-by: Ankur Arora --- UefiCpuPkg/Include/CpuHotPlugData.h | 21 +++++++++++++++++++++ UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf | 1 + UefiCpuPkg/UefiCpuPkg.dec | 5 +++++ UefiCpuPkg/UefiCpuPkg.uni | 4 ++++ 4 files changed, 31 insertions(+) diff --git a/UefiCpuPkg/Include/CpuHotPlugData.h b/UefiCpuPkg/Include/CpuHo= tPlugData.h index 6321a149fa52..86f964550655 100644 --- a/UefiCpuPkg/Include/CpuHotPlugData.h +++ b/UefiCpuPkg/Include/CpuHotPlugData.h @@ -2,6 +2,7 @@ Definition for a structure sharing information for CPU hot plug. =20 Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2021, Oracle Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -24,4 +25,24 @@ typedef struct { UINT32 SmrrSize; } CPU_HOT_PLUG_DATA; =20 +typedef +VOID +(EFIAPI *CPU_HOT_EJECT_FN)( + IN UINTN ProcessorNum + ); + +#define CPU_EJECT_INVALID (MAX_UINT64) +#define CPU_EJECT_WORKER (MAX_UINT64-1) + +#define CPU_HOT_EJECT_DATA_REVISION_1 0x00000001 + +typedef struct { + UINT32 Revision; // Used for version identification f= or this structure + UINT32 ArrayLength; // The entries number of the followi= ng ApicId array and SmBase array + + UINT64 *ApicIdMap; // Pointer to CpuIndex->ApicId map. = Holds APIC IDs for pending ejects + CPU_HOT_EJECT_FN Handler; // Handler for CPU ejection + UINT64 Reserved; +} CPU_HOT_EJECT_DATA; + #endif diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf b/UefiCpuPkg/PiSm= mCpuDxeSmm/PiSmmCpuDxeSmm.inf index 76b146299679..f79c874d74f1 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf @@ -131,6 +131,7 @@ gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmApSyncTimeout ## CONS= UMES gUefiCpuPkgTokenSpaceGuid.PcdCpuS3DataAddress ## SOME= TIMES_CONSUMES gUefiCpuPkgTokenSpaceGuid.PcdCpuHotPlugDataAddress ## SOME= TIMES_PRODUCES + gUefiCpuPkgTokenSpaceGuid.PcdCpuHotEjectDataAddress ## SOME= TIMES_PRODUCES gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmCodeAccessCheckEnable ## CONS= UMES gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmSyncMode ## CONS= UMES gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmShadowStackSize ## SOME= TIMES_CONSUMES diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec index d83c084467b3..704ccc05f662 100644 --- a/UefiCpuPkg/UefiCpuPkg.dec +++ b/UefiCpuPkg/UefiCpuPkg.dec @@ -339,6 +339,11 @@ # @ValidList 0x80000001 | 0 gUefiCpuPkgTokenSpaceGuid.PcdCpuHotPlugDataAddress|0x0|UINT64|0x60000011 =20 + ## Contains the pointer to a CPU Hot Eject Data structure if CPU hot-plu= g is supported. + # @Prompt The pointer to CPU Hot Eject Data. + # @ValidList 0x80000001 | 0 + gUefiCpuPkgTokenSpaceGuid.PcdCpuHotEjectDataAddress|0x0|UINT64|0x60000017 + ## Indicates processor feature capabilities, each bit corresponding to a= specific feature. # @Prompt Processor feature capabilities. # @ValidList 0x80000001 | 0 diff --git a/UefiCpuPkg/UefiCpuPkg.uni b/UefiCpuPkg/UefiCpuPkg.uni index 219c1963bf08..b1721f256632 100644 --- a/UefiCpuPkg/UefiCpuPkg.uni +++ b/UefiCpuPkg/UefiCpuPkg.uni @@ -140,6 +140,10 @@ =20 #string STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuHotPlugDataAddress_HELP #lang= uage en-US "Contains the pointer to a CPU Hot Plug Data structure if CPU ho= t-plug is supported." =20 +#string STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuHotEjectDataAddress_PROMPT #l= anguage en-US "The pointer to CPU Hot Eject Data" + +#string STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuHotEjectDataAddress_HELP #lan= guage en-US "Contains the pointer to a CPU Hot Eject Data structure if CPU = hot-plug is supported." + #string STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuNumberOfReservedVariableMtrrs_= PROMPT #language en-US "Number of reserved variable MTRRs" =20 #string STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuNumberOfReservedVariableMtrrs_= HELP #language en-US "Specifies the number of variable MTRRs reserved for = OS use." --=20 2.9.3 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#70383): https://edk2.groups.io/g/devel/message/70383 Mute This Topic: https://groups.io/mt/79697164/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-