From nobody Thu Nov 14 16:51:06 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+70871+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+70871+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oracle.com Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1611882062501152.07724438977607; Thu, 28 Jan 2021 17:01:02 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id hC2iYY1788612xCanhjvJ0JF; Thu, 28 Jan 2021 17:01:02 -0800 X-Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) by mx.groups.io with SMTP id smtpd.web09.3194.1611882056694231295 for ; Thu, 28 Jan 2021 17:00:56 -0800 X-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10T0egxf064300; Fri, 29 Jan 2021 01:00:53 GMT X-Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 368brkxs6d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Jan 2021 01:00:53 +0000 X-Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10T0eFuq081627; Fri, 29 Jan 2021 01:00:52 GMT X-Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2171.outbound.protection.outlook.com [104.47.56.171]) by userp3030.oracle.com with ESMTP id 368wr13fw5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Jan 2021 01:00:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j3fQyxt8ZNoEFFwF0DqZo637Twx0U3dreWXA15DvdQ+Mx8gpXU2nVv9SNfAYGWUYms2bRXuvexBwxeR02h777LjS0rI8TErmUeczMK6yaipRMhXT+VIlzoj5E08k7BEwB3RtZ3UFl9Vh12ygT8oGqC+OkBdRLM+tyW61Hb7ANxtOEyRFbO0SdhLS+mPuJNMt+8/hRBKOK+VlJS5KQSZi9sX+xWN4f0bDXAvUzc9mjsaeqJqE7oZumCCZ6mM3CZkhwFzwBWCUMVMD2wv8xo3a5LCkt/jY5/YsNOVIZVxJE9lHXmUrr5d7ETeMmpk6TYxAaMEv23fFcrUHgUTrsTcsVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GxZXnl/5yHh91kgNlVOCw1FXKO4AEcmuOkvEp2YhLlw=; b=VddyZdHQYQdsr+dv6dDcqBvq0K27es8N+zNV5MoTK/vDZm8Bfua1KSGfV6jHeWrvLzhDU94ADl902wpqVZxq18+CMRz19mUplEIUrqRe7e2mN1oN6aK9Giq3PbGsAKfXqtCHvcOdotIfGnhLOQs+/+06QmUnfkVuPLT3rVDFHQ+cSxvL9Qpm/rDuBoWXlq0kopS2rBEYjtbojnuax5pNalpQxjjOMrl0juPkV4lure6g36xqo6ocdbXr78A1DvLqSefij3JcURqmA4uqnSdEK+h/qI6D6YmUe0K1XNvFO8Wyre2WXQdZGh68tHTZemIVYsC8UwRSGBF3v4Ibx2JzgA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none X-Received: from CY4PR10MB1718.namprd10.prod.outlook.com (2603:10b6:910:9::17) by CY4PR1001MB2246.namprd10.prod.outlook.com (2603:10b6:910:41::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.16; Fri, 29 Jan 2021 01:00:38 +0000 X-Received: from CY4PR10MB1718.namprd10.prod.outlook.com ([fe80::39dc:6ba7:9397:cb6]) by CY4PR10MB1718.namprd10.prod.outlook.com ([fe80::39dc:6ba7:9397:cb6%6]) with mapi id 15.20.3805.019; Fri, 29 Jan 2021 01:00:38 +0000 From: "Ankur Arora" To: devel@edk2.groups.io Cc: lersek@redhat.com, imammedo@redhat.com, boris.ostrovsky@oracle.com, Ankur Arora , Jordan Justen , Ard Biesheuvel , Aaron Young Subject: [edk2-devel] [PATCH v6 5/9] OvmfPkg/CpuHotplugSmm: define CPU_HOT_EJECT_DATA Date: Thu, 28 Jan 2021 16:59:46 -0800 Message-Id: <20210129005950.467638-6-ankur.a.arora@oracle.com> In-Reply-To: <20210129005950.467638-1-ankur.a.arora@oracle.com> References: <20210129005950.467638-1-ankur.a.arora@oracle.com> X-Originating-IP: [148.87.23.8] X-ClientProxiedBy: MWHPR1401CA0022.namprd14.prod.outlook.com (2603:10b6:301:4b::32) To CY4PR10MB1718.namprd10.prod.outlook.com (2603:10b6:910:9::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from prion.us.oracle.com (148.87.23.8) by MWHPR1401CA0022.namprd14.prod.outlook.com (2603:10b6:301:4b::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.17 via Frontend Transport; Fri, 29 Jan 2021 01:00:03 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9b241f9a-0d69-45da-f54b-08d8c3f13671 X-MS-TrafficTypeDiagnostic: CY4PR1001MB2246: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: Q6X/ltX8rSlpKR8qRbsHRO7ipqLf3tbQOrTkpM48RMpuIuqepXC7FeDfNoFrhVVfE1WMxqmXNrzqDWpc7keKyiELGLHXwEp8R1cbxuBrgF1w1Y+kJslTwR8Tmw3mhhIrgN0fd+hMfkr/j5588XLNWDXXe5T32DbwzuLJJJE+RLYscMyXo5zNxFAftqe9YxuoKhlWLGd+FX2/NokUbq/xhMm581B8viSKl9GrbLlWWuXarFCb/7nCBf/Ext5zfWKm6lNSfaB7nnHRe198xn1SwHGvqYz9JxEqki4S0QWOeqviUXbOtPPojEh5FiioPfcJQ0DNX+scg4FHSh+B9MlBBPHxkVDFnLkxBaC/u9V6vfab4bm/yX3VrCoOmLjy+5fTbH+r5KmLlofog+YtRONOGpjsF/+TnA7SVtlwFAmOCMh4ulMMwsU7GjGTT9L4JYg/BSAKiVo2rjpm1bi+spN76BLUnw8oQV90BT/upI1NPSExoBFQBv6FCWKQrh4X6a7y58xq/b0NUUb5iMwIjWBmw9IExIVeam3uvnkGv6t/9wIuu5/ga9r/7z5FgaYx53ph/glzUN3p9yICLT9lCo/VeAh4dPoJu21DnKokZApEniY= X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?UKfqXpd/DqlCp8y0vV0MoNSU+RYLRFFQh2n9YV2ALT4QkCd6xOvdEWbcjJ4p?= =?us-ascii?Q?PdORlf1iA4OCAHU7AypwDN/2TLxX6cwWb4isdY3n7Ch3FGSyyTxYatFu7F4J?= =?us-ascii?Q?5T+l0It2fQGSQtW0vSS6bFCZoU219qhD8fVCI/XEtcWre9f8moccrGoQ7LRT?= =?us-ascii?Q?DW3N4BE5vCECbZcs4EejlD7UPkjzzJZPsxPzLV2nbQuBXe0qAzC3M+TYhStt?= =?us-ascii?Q?gE1z0tdo4mYS0NUmry7aIrO3++eM9cUW2xrBOL/tJSXo2iAE/djRyQwplRyL?= =?us-ascii?Q?357CZpopZZeALJjF3a+5/w1oYIfAF36OE5QqXemPJfNEMiiqDitCXT15tWbq?= =?us-ascii?Q?pzw90PUO/uUyP0LrIBczUB94x7uP/Zb6qBsW92nCVPGkvmX8ZTtSZ6SGTphX?= =?us-ascii?Q?S+/+tyiLRuf+FFdLwI/ccLzjycKSqQ6VokFW/KV9nzdSFRW7L1EMSRAr9zOH?= =?us-ascii?Q?gjmRSFv0VepoGuT8P7lRWO06qhVoePHrFm0Yur0aUa/penK2qZEL7XMw70I7?= =?us-ascii?Q?++ClkLlXWwkaMNuT2zYDTPTir/aG0OQe2ywSNCReaAc1wadwR0a1oQdwEgl+?= =?us-ascii?Q?f8qyBk62gFgteNwySe+mGLk4lGCErh+Vqt5SsTllbhT4W5GkN7ErvhrVd3Pz?= =?us-ascii?Q?G5s8iL2XKhfYRPe6ty/nQlWT7lB5WqiBxGI2QFVNHOVcRfVSMVGhCHOVqvoY?= =?us-ascii?Q?gEXxB+sm9n+6keYifXw45G+C+vhijauGRiq30zTI8lhNM1cWQmY3PwPfiUJR?= =?us-ascii?Q?E3Z8saRMmdz2PvyNI1tRQW0qAyxk/8+FIalqSLwyQra0CPseeK0KpZQEYE8z?= =?us-ascii?Q?SHoEut7M/+ceIES8Y9MBzG2TCj9FAWQPDbIRjr6wnh2CCi1hDy+GjO1AF/fm?= =?us-ascii?Q?/W5HYnGTeI/jYmoHk1LRTj+3KXQIJfE80KNCmHRg4wtTv8L8u+jN8mHcx4+n?= =?us-ascii?Q?VvSeo4KH0+sciGli+G1HvHWVzi6WXdX08L3TEM5G+XiMzWjtSXOFPUT4olLn?= =?us-ascii?Q?yqPgu03gca1olLojsCgqaUonFYwOB1yt0zlHxzOj4hzVT7n0A6Lykp1xe8tu?= =?us-ascii?Q?rvYI9ELf?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9b241f9a-0d69-45da-f54b-08d8c3f13671 X-MS-Exchange-CrossTenant-AuthSource: CY4PR10MB1718.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2021 01:00:04.3066 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: URunm0U9TxvAc67yIbrT15M29NlHaCNO6kJql0/83F2YpdjGm6Lwi4ApstSkg5aBgjNJnLzg68GtP+28Grs1vpy/uK/qv/nEENbv86lkLXM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1001MB2246 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: TDmMOl3oxQz7RfPxUDyFFvsKx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1611882062; bh=2fXIbhxi+IbHYRA9ZlbAmvU6duKz2AJAv6aMhFP3VH8=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=NVjlBomB7inv7OIdCIbqsGFy19Af5Q6YKKROmcmksFX2KZ0GiWrfQIpXKfwgDT5Urj3 iE1hSBmmEvsa/uNID10qzWRfmdO74XBG976yiv1RhnFPU5T3HvPbeZcNNq3/4xjwyvK+2 GsuHMXNBQdHXgtnLB02POjth+NUMFBkbqqk= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Define CPU_HOT_EJECT_DATA and add PCD PcdCpuHotEjectDataAddress, which will be used to share CPU ejection state between OvmfPkg/CpuHotPlugSmm and PiSmmCpuDxeSmm. Cc: Laszlo Ersek Cc: Jordan Justen Cc: Ard Biesheuvel Cc: Igor Mammedov Cc: Boris Ostrovsky Cc: Aaron Young Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3132 Signed-off-by: Ankur Arora --- OvmfPkg/OvmfPkg.dec | 10 +++++++++ OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf | 1 + OvmfPkg/Include/Library/CpuHotEjectData.h | 35 +++++++++++++++++++++++++++= ++++ 3 files changed, 46 insertions(+) create mode 100644 OvmfPkg/Include/Library/CpuHotEjectData.h diff --git a/OvmfPkg/OvmfPkg.dec b/OvmfPkg/OvmfPkg.dec index 4348bb45c64a..1a2debb821d7 100644 --- a/OvmfPkg/OvmfPkg.dec +++ b/OvmfPkg/OvmfPkg.dec @@ -106,6 +106,10 @@ [LibraryClasses] # XenPlatformLib|Include/Library/XenPlatformLib.h =20 + ## @libraryclass Share CPU hot-eject state + # + CpuHotEjectData|Include/Library/CpuHotEjectData.h + [Guids] gUefiOvmfPkgTokenSpaceGuid =3D {0x93bb96af, 0xb9f2, 0x4eb8, {= 0x94, 0x62, 0xe0, 0xba, 0x74, 0x56, 0x42, 0x36}} gEfiXenInfoGuid =3D {0xd3b46f3b, 0xd441, 0x1244, {= 0x9a, 0x12, 0x0, 0x12, 0x27, 0x3f, 0xc1, 0x4d}} @@ -352,6 +356,12 @@ [PcdsDynamic, PcdsDynamicEx] # This PCD is only accessed if PcdSmmSmramRequire is TRUE (see below). gUefiOvmfPkgTokenSpaceGuid.PcdQ35SmramAtDefaultSmbase|FALSE|BOOLEAN|0x34 =20 + ## This PCD adds a communication channel between PiSmmCpuDxeSmm and + # CpuHotplugSmm. + # + # Only accessed if PcdCpuHotPlugSupport is TRUE + gUefiOvmfPkgTokenSpaceGuid.PcdCpuHotEjectDataAddress|0|UINT64|0x46 + [PcdsFeatureFlag] gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderPciTranslation|TRUE|BOOLEAN|0= x1c gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderMmioTranslation|FALSE|BOOLEAN= |0x1d diff --git a/OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf b/OvmfPkg/CpuHotplugSm= m/CpuHotplugSmm.inf index 04322b0d7855..e08b572ef169 100644 --- a/OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf +++ b/OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf @@ -54,6 +54,7 @@ [Protocols] =20 [Pcd] gUefiCpuPkgTokenSpaceGuid.PcdCpuHotPlugDataAddress ## CON= SUMES + gUefiOvmfPkgTokenSpaceGuid.PcdCpuHotEjectDataAddress ## CON= SUMES gUefiOvmfPkgTokenSpaceGuid.PcdQ35SmramAtDefaultSmbase ## CON= SUMES =20 [FeaturePcd] diff --git a/OvmfPkg/Include/Library/CpuHotEjectData.h b/OvmfPkg/Include/Li= brary/CpuHotEjectData.h new file mode 100644 index 000000000000..b6fb629a1283 --- /dev/null +++ b/OvmfPkg/Include/Library/CpuHotEjectData.h @@ -0,0 +1,35 @@ +/** @file + Definition for a CPU hot-eject state sharing structure. + + Copyright (C) 2021, Oracle Corporation. + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef _CPU_HOT_EJECT_DATA_H_ +#define _CPU_HOT_EJECT_DATA_H_ + +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 of + // this structure + UINT32 ArrayLength; // Entries in the ApicIdMap array + + UINT64 *ApicIdMap; // Pointer to CpuIndex->ApicId map f= or + // pending hot-ejects + CPU_HOT_EJECT_FN Handler; // Handler to do the CPU ejection + + UINT64 Reserved; +} CPU_HOT_EJECT_DATA; + +#endif /* _CPU_HOT_EJECT_DATA_H_ */ --=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 (#70871): https://edk2.groups.io/g/devel/message/70871 Mute This Topic: https://groups.io/mt/80199916/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-