From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=XhT/0aqh; spf=pass (domain: oracle.com, ip: 141.146.126.78, mailfrom: ankur.a.arora@oracle.com) 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=GxZXnl/5yHh91kgNlVOCw1FXKO4AEcmuOkvEp2YhLlw=; b=XhT/0aqh/zEWdLU0HebVhF5SrPLMfF/OSxU6rlcPup+bMojHoWTLRxWFW+Ukik9xGyns acPQLejeBFAJfxNSuollIVG9azMlO8YhJMIlv/7KjlHUhKMmwlHkg1YGONM/Rt6RCHyc BYK2txU+37K3OylAJ81XOjjHwb7/NFQR2dQVJsO7DvxOSS7ZweJTXFbtxiV2GePo5ok1 m6u8LMSSPAYvjbcJz6bKtDMbOcc2rrc193uOHYW3ZCTzaUSkUA2Kng2N9xy1fA/HWn17 ekHwzsu7hmvtDpi5ux34HAhkEqb4mNOkmPXiEWdUYddR3t0bM1IokRnc5XySUimqhTpL 6w== 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 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 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GxZXnl/5yHh91kgNlVOCw1FXKO4AEcmuOkvEp2YhLlw=; b=jOknbed8m2dCvH+qYg2jrtXEfu/w/ZPJVneVN02JHDqpx8vZbXr8hCTcmfRN+LgvmsR30KNs8QiFIsAIHGdW45PdwzFS4TE5sQwVebyvlIOLaEJtFfwBj0UE/T5WGtZjanyxj5diRBuxGhesdhibDHh1NPz8v3tmaNzXfuqlXi0= Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=oracle.com; 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 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: [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> X-Mailer: git-send-email 2.29.2 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 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: BCL:0; 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-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR10MB1718.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(39860400002)(346002)(376002)(396003)(136003)(8936002)(107886003)(2906002)(66946007)(66476007)(66556008)(36756003)(1076003)(103116003)(16526019)(956004)(966005)(7696005)(478600001)(52116002)(54906003)(6486002)(86362001)(83380400001)(6666004)(8676002)(186003)(5660300002)(4326008)(6916009)(26005)(316002)(2616005);DIR:OUT;SFP:1101; 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 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9878 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 spamscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 suspectscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101290001 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9878 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 impostorscore=0 phishscore=0 bulkscore=0 priorityscore=1501 mlxlogscore=999 lowpriorityscore=0 spamscore=0 mlxscore=0 suspectscore=0 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101290001 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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=3132 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 + ## @libraryclass Share CPU hot-eject state + # + CpuHotEjectData|Include/Library/CpuHotEjectData.h + [Guids] gUefiOvmfPkgTokenSpaceGuid = {0x93bb96af, 0xb9f2, 0x4eb8, {0x94, 0x62, 0xe0, 0xba, 0x74, 0x56, 0x42, 0x36}} gEfiXenInfoGuid = {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 + ## 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|0x1c gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderMmioTranslation|FALSE|BOOLEAN|0x1d diff --git a/OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf b/OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf index 04322b0d7855..e08b572ef169 100644 --- a/OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf +++ b/OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf @@ -54,6 +54,7 @@ [Protocols] [Pcd] gUefiCpuPkgTokenSpaceGuid.PcdCpuHotPlugDataAddress ## CONSUMES + gUefiOvmfPkgTokenSpaceGuid.PcdCpuHotEjectDataAddress ## CONSUMES gUefiOvmfPkgTokenSpaceGuid.PcdQ35SmramAtDefaultSmbase ## CONSUMES [FeaturePcd] diff --git a/OvmfPkg/Include/Library/CpuHotEjectData.h b/OvmfPkg/Include/Library/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 for + // 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_ */ -- 2.9.3