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.web11.3118.1611882007258327765 for ; Thu, 28 Jan 2021 17:00:07 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=elq8H3yT; 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 10T0eiEb064360; Fri, 29 Jan 2021 01:00:03 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=Hufg5L/JF8z4aY4/F926/QJQgWmg4i5ZA1TQCxd4MIg=; b=elq8H3yTp4+LaVvovxGXSDyhfm4nxySLnljWt7/IJe1hem/aauDA0tDSZzE9GrbW58qf ny1/17VVhWadQLIe3pckYAJVHAtJI0LpBZx8HKcB/fONztPLbb6/Q8BX03R/GI9nf0oS 92rZJKfI8O+EOxicAp5eSgz/fcQVDb34RnGfY9gHCrb4SIN1nAOHmXIiuqOi+iWMAXnK aseJpKQRG0VXXUrWodt67+X6g6QJWUfKgI55TNZ8E0w9pX5UJ6pkx73Wbh7TRn250DNN RlkDIF8w9TrgL5mZC47mz6NvhNHMTiOM3tFhTxGyFQf9b8uCF+jljJ8qXIik9wTBIj58 Kw== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 368brkxs2x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Jan 2021 01:00:03 +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 10T0eGVE081743; Fri, 29 Jan 2021 01:00:02 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2172.outbound.protection.outlook.com [104.47.56.172]) by userp3030.oracle.com with ESMTP id 368wr13e5c-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Jan 2021 01:00:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jzZy+CLqVnw8wc2I359COi06FtUXZZ+e3yAbI5IVlNCwNFp/czT+KRO3IuG7il04ehavPtOTWbH5FoKw7535q8QNW+Ir0JBLlpYsfIlxShPwSqpL7VNl7eydgDMZ2yKVaPpRhRrK3SIHZdT4tSBT3SQ42DZjBrhicdSwLYCZm3mJsGFpQadHjDKCNIeAt4AVlS1BHgMqD9C2owyI56bq4R/krXqP7delX7c4EPM6hDlbQg9442P53uo7rCH6zfQAoC1fEwWyQZKU+WVpVH0qgIgCGHWOpeJWwt0CmxuMTSYjcv6bf+sdJjbbN7uMns8WwdWnf7hDBOFSeoYP1ppGoQ== 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=Hufg5L/JF8z4aY4/F926/QJQgWmg4i5ZA1TQCxd4MIg=; b=TkNqpLYFpnTRmVUQ62zSCo2rkIZ8dyCvDN2qzX7pff/CFQEHZ8Urz3Rnqia6CbHkND4M0LoIAo5mZsV6/amOSZga7VUnQR4/hPwrHcXBbyn99BjIu4W34o1ButzBg/iRx65YakGMXPjBL2rlBNyHetLRYOyGztW6GfoQhkqp4zSDbvQksXl6u06e9O5L0ioOe4Vva39i2PDzlu//Adbgc6pU+47oThPkv2wUqOhxAFks/bY+eZPObnfFWozdT6lFrTrQUjZS4njwHnXQsPq73ZuQN9hEMs485KBT/Waqto2Ncz3wdG5PXorpFRIE5zRmT1POf+rmKVVGTalwMQwJPw== 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=Hufg5L/JF8z4aY4/F926/QJQgWmg4i5ZA1TQCxd4MIg=; b=XhV+W0tLyRx/nvpY62kRaYqd4Bo49dXOESyKTB52Xd7+Y3hEg88rUJYhnFmceuzlOfr8fhJfrVN2x5fbJylhCklEkBSevnabT0ycRhHJRQgVQzCpE4fo6kJvXvkdUP4kYdAZzkLKO97gmQiLB2f07GWZrCW9KPIT0I72CvTUJ/U= 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 00:59:59 +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 00:59:59 +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 1/9] OvmfPkg/CpuHotplugSmm: refactor hotplug logic Date: Thu, 28 Jan 2021 16:59:42 -0800 Message-Id: <20210129005950.467638-2-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 00:59:57 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c5a112c4-8594-4afe-b320-08d8c3f13346 X-MS-TrafficTypeDiagnostic: CY4PR1001MB2246: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3EqZRgG3dTTcUGiZ2SvPXMW4H3o2g9vzDV4cfwmbOnAVf+TB6CBIb0yipmHlOXfo6k/66Luu+pfcAxTRSw16A9f0YDfgPDugWrGNr7sQX+kljE47LjB+qLduZ7ACWZSNGjL51vGCfKFgY8J3HVylsKhxSMoGADfIBtQWesHXOlG3iFI/RkTfiIcQB8Psl/Nj7NG4QQhneYIgkmfQvdCSXa0fjKbXsYbkdolGu9B/DoLdm2jTGDJCKHv3aE4VxWTAmKrzak0GgtrVL0hOTjLtVRmWelQUtqze1nDgdA+LZilffxK5kq2DcQDzPPfhSQZYv1Xtns7EgtRA5jOdYY/5vaVUQZEuGFWBSuYGxtFczEWzVoVH03LLw4tU2w36v4ilFdyDlTwhfYmxGkWvqTxouniDQLa+aoDAJj0MkJ6aVXAoDOgTJgeIoBu0ZPhkgaorfRpF5hy9pEtvC31lNJTqeOPDbOiMaOMcVeM5f6dpbGvbF/ccFTeJUkFpoOR68SK78xWwmHLh8QyyAhBf4aD7lYt0G+djwRFP5ybY+K6vxgGS5AKNyBQDIgHuLuxDeVfwT+1Vdqqh11+Kr8xlFdhVBBVtQSa1JYeIGNHa1DgjtQA= 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?h1TAsnOGSiM42u1pyzpzccfPW7WrrJHldyUOAGDSB+t0+ydJz8BqqHtbqTw2?= =?us-ascii?Q?fQR9ylj0P953s21AsuW5G/zLNxudfgrQd9v2s3gz8jVwdMc0bPprGaLb0LZ8?= =?us-ascii?Q?uml5sS1boUgmbEoteTMZzCd1EGlCxq3XNBTDpeMIZiyXr55AZOcXiJasAr6e?= =?us-ascii?Q?Cb5uYXbVvCJnwEvp+Xd13Grd0Ud5jzJLbNcwd1m0Di1Qh6/XJXtxm3Ym6ACb?= =?us-ascii?Q?B3/vBnr7vTvLiEKeC/ec/1UgaL5qKtvPTSaCFvm5KsNYFROD4wn2a1y/E8gp?= =?us-ascii?Q?6twnA5y4zd/aMw/xT0eO8h6DatKDXtEaiFx/eV4QSzFSdxoodJqepy9kRZpw?= =?us-ascii?Q?s6plgMcnSK722khyIuXsIDpBiy9GWfWOLPFAAI9NhXY6WIW/qNX+atNvylRN?= =?us-ascii?Q?0f1grPms9WR7PldQx/DIbkeNUYqERSC89+0fnCdQ7QEAz6w794bolRvH3sHc?= =?us-ascii?Q?nRvxrIM8GDLa2s4cfymUidAx3ZBMI30wiiA/QKwvmW6YJw5pkNPEnOz/TVu9?= =?us-ascii?Q?EcbzMH5tcf0EG75degdtS1y1Vsd3XdtUZGMRYZ8O6odwqrLVyrTjEB45a08B?= =?us-ascii?Q?QQhE5zJdVrSXLK8QM85TFLX04TT93ACKWekRdilyY2UsejcYnA6ExXvwRJ0E?= =?us-ascii?Q?Kxj/5Jc2sy7+HHuHrIEjmAXnP/CDQaGyBG7TVgDnaHdBGAQY0e1wGnTtp/dn?= =?us-ascii?Q?ShBMOrZgL7pefmml4zAhO1aP7QoF8kwv78+DCsdN4IBqBFVtAaprcduyW+RW?= =?us-ascii?Q?YMPIB+gH8QwehuSTbT/iGdu/lm27co8evwAGJzdHdDy/r1jJ11vvk3QFs9rN?= =?us-ascii?Q?wf8V8kB4Umm4gh3LXxYttqmfQeLotj8NOvKy0NNJCR06uG+y8DmXBDL5AfDL?= =?us-ascii?Q?5hvIXLpiZEvER26k6u6GIokOQa5JMQZ+wTeJMKerjsS3lZWM0HTB7D7fIjkV?= =?us-ascii?Q?05FyuX9cqq65S6HJweU67GpVSps8nffvrDAwTLZbv6wLq5vX7ztOvdW0n4eb?= =?us-ascii?Q?K61pEkCTTQQ94jdx6Y6ZJT749yv39YpnoUq+TpVOTKwTl4fda7MShbmAA9iG?= =?us-ascii?Q?CvlCqXJ6?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c5a112c4-8594-4afe-b320-08d8c3f13346 X-MS-Exchange-CrossTenant-AuthSource: CY4PR10MB1718.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2021 00:59:59.0090 (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: QnWupg6F2dW/u36jvwcc6cwKQmt2mIn4K+qX8NzYQEG8CJghwfsPqeG0yJQpWVPNBn8h3p66QLYvwppbOyALHcHrFvD2Ns6Oe+eoDJ0Txl0= 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 Refactor CpuHotplugMmi() to pull out the CPU hotplug logic into ProcessHotAddedCpus(). This is in preparation for supporting CPU hot-unplug. 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 --- Notes: > + if (EFI_ERROR(Status)) { > + goto Fatal; > } (13) Without having seen the rest of the patches, I think this error check should be nested under the same (PluggedCount > 0) condition; in other words, I think it only makes sense to check Status after we actually call ProcessHotAddedCpus(). Addresses all comments from v5, except for this one, since the (lack) of nesting makes more sense after patch 4, "OvmfPkg/CpuHotplugSmm: introduce UnplugCpus()". OvmfPkg/CpuHotplugSmm/CpuHotplug.c | 214 ++++++++++++++++++++++--------------- 1 file changed, 129 insertions(+), 85 deletions(-) diff --git a/OvmfPkg/CpuHotplugSmm/CpuHotplug.c b/OvmfPkg/CpuHotplugSmm/CpuHotplug.c index cfe698ed2b5e..05b1f8cb63a6 100644 --- a/OvmfPkg/CpuHotplugSmm/CpuHotplug.c +++ b/OvmfPkg/CpuHotplugSmm/CpuHotplug.c @@ -62,6 +62,130 @@ STATIC UINT32 mPostSmmPenAddress; // STATIC EFI_HANDLE mDispatchHandle; +/** + Process CPUs that have been hot-added, per QemuCpuhpCollectApicIds(). + + For each such CPU, relocate the SMBASE, and report the CPU to PiSmmCpuDxeSmm + via EFI_SMM_CPU_SERVICE_PROTOCOL. If the supposedly hot-added CPU is already + known, skip it silently. + + @param[in] PluggedApicIds The APIC IDs of the CPUs that have been + hot-plugged. + + @param[in] PluggedCount The number of filled-in APIC IDs in + PluggedApicIds. + + @retval EFI_SUCCESS CPUs corresponding to all the APIC IDs are + populated. + + @retval EFI_OUT_OF_RESOURCES Out of APIC ID space in "mCpuHotPlugData". + + @return Error codes propagated from SmbaseRelocate() + and mMmCpuService->AddProcessor(). + +**/ +STATIC +EFI_STATUS +ProcessHotAddedCpus ( + IN APIC_ID *PluggedApicIds, + IN UINT32 PluggedCount + ) +{ + EFI_STATUS Status; + UINT32 PluggedIdx; + UINT32 NewSlot; + + // + // The Post-SMM Pen need not be reinstalled multiple times within a single + // root MMI handling. Even reinstalling once per root MMI is only prudence; + // in theory installing the pen in the driver's entry point function should + // suffice. + // + SmbaseReinstallPostSmmPen (mPostSmmPenAddress); + + PluggedIdx = 0; + NewSlot = 0; + while (PluggedIdx < PluggedCount) { + APIC_ID NewApicId; + UINT32 CheckSlot; + UINTN NewProcessorNumberByProtocol; + + NewApicId = PluggedApicIds[PluggedIdx]; + + // + // Check if the supposedly hot-added CPU is already known to us. + // + for (CheckSlot = 0; + CheckSlot < mCpuHotPlugData->ArrayLength; + CheckSlot++) { + if (mCpuHotPlugData->ApicId[CheckSlot] == NewApicId) { + break; + } + } + if (CheckSlot < mCpuHotPlugData->ArrayLength) { + DEBUG ((DEBUG_VERBOSE, "%a: APIC ID " FMT_APIC_ID " was hot-plugged " + "before; ignoring it\n", __FUNCTION__, NewApicId)); + PluggedIdx++; + continue; + } + + // + // Find the first empty slot in CPU_HOT_PLUG_DATA. + // + while (NewSlot < mCpuHotPlugData->ArrayLength && + mCpuHotPlugData->ApicId[NewSlot] != MAX_UINT64) { + NewSlot++; + } + if (NewSlot == mCpuHotPlugData->ArrayLength) { + DEBUG ((DEBUG_ERROR, "%a: no room for APIC ID " FMT_APIC_ID "\n", + __FUNCTION__, NewApicId)); + return EFI_OUT_OF_RESOURCES; + } + + // + // Store the APIC ID of the new processor to the slot. + // + mCpuHotPlugData->ApicId[NewSlot] = NewApicId; + + // + // Relocate the SMBASE of the new CPU. + // + Status = SmbaseRelocate (NewApicId, mCpuHotPlugData->SmBase[NewSlot], + mPostSmmPenAddress); + if (EFI_ERROR (Status)) { + goto RevokeNewSlot; + } + + // + // Add the new CPU with EFI_SMM_CPU_SERVICE_PROTOCOL. + // + Status = mMmCpuService->AddProcessor (mMmCpuService, NewApicId, + &NewProcessorNumberByProtocol); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: AddProcessor(" FMT_APIC_ID "): %r\n", + __FUNCTION__, NewApicId, Status)); + goto RevokeNewSlot; + } + + DEBUG ((DEBUG_INFO, "%a: hot-added APIC ID " FMT_APIC_ID ", SMBASE 0x%Lx, " + "EFI_SMM_CPU_SERVICE_PROTOCOL assigned number %Lu\n", __FUNCTION__, + NewApicId, (UINT64)mCpuHotPlugData->SmBase[NewSlot], + (UINT64)NewProcessorNumberByProtocol)); + + NewSlot++; + PluggedIdx++; + } + + // + // We've processed this batch of hot-added CPUs. + // + return EFI_SUCCESS; + +RevokeNewSlot: + mCpuHotPlugData->ApicId[NewSlot] = MAX_UINT64; + + return Status; +} /** CPU Hotplug MMI handler function. @@ -122,8 +246,6 @@ CpuHotplugMmi ( UINT8 ApmControl; UINT32 PluggedCount; UINT32 ToUnplugCount; - UINT32 PluggedIdx; - UINT32 NewSlot; // // Assert that we are entering this function due to our root MMI handler @@ -179,87 +301,12 @@ CpuHotplugMmi ( goto Fatal; } - // - // Process hot-added CPUs. - // - // The Post-SMM Pen need not be reinstalled multiple times within a single - // root MMI handling. Even reinstalling once per root MMI is only prudence; - // in theory installing the pen in the driver's entry point function should - // suffice. - // - SmbaseReinstallPostSmmPen (mPostSmmPenAddress); + if (PluggedCount > 0) { + Status = ProcessHotAddedCpus (mPluggedApicIds, PluggedCount); + } - PluggedIdx = 0; - NewSlot = 0; - while (PluggedIdx < PluggedCount) { - APIC_ID NewApicId; - UINT32 CheckSlot; - UINTN NewProcessorNumberByProtocol; - - NewApicId = mPluggedApicIds[PluggedIdx]; - - // - // Check if the supposedly hot-added CPU is already known to us. - // - for (CheckSlot = 0; - CheckSlot < mCpuHotPlugData->ArrayLength; - CheckSlot++) { - if (mCpuHotPlugData->ApicId[CheckSlot] == NewApicId) { - break; - } - } - if (CheckSlot < mCpuHotPlugData->ArrayLength) { - DEBUG ((DEBUG_VERBOSE, "%a: APIC ID " FMT_APIC_ID " was hot-plugged " - "before; ignoring it\n", __FUNCTION__, NewApicId)); - PluggedIdx++; - continue; - } - - // - // Find the first empty slot in CPU_HOT_PLUG_DATA. - // - while (NewSlot < mCpuHotPlugData->ArrayLength && - mCpuHotPlugData->ApicId[NewSlot] != MAX_UINT64) { - NewSlot++; - } - if (NewSlot == mCpuHotPlugData->ArrayLength) { - DEBUG ((DEBUG_ERROR, "%a: no room for APIC ID " FMT_APIC_ID "\n", - __FUNCTION__, NewApicId)); - goto Fatal; - } - - // - // Store the APIC ID of the new processor to the slot. - // - mCpuHotPlugData->ApicId[NewSlot] = NewApicId; - - // - // Relocate the SMBASE of the new CPU. - // - Status = SmbaseRelocate (NewApicId, mCpuHotPlugData->SmBase[NewSlot], - mPostSmmPenAddress); - if (EFI_ERROR (Status)) { - goto RevokeNewSlot; - } - - // - // Add the new CPU with EFI_SMM_CPU_SERVICE_PROTOCOL. - // - Status = mMmCpuService->AddProcessor (mMmCpuService, NewApicId, - &NewProcessorNumberByProtocol); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a: AddProcessor(" FMT_APIC_ID "): %r\n", - __FUNCTION__, NewApicId, Status)); - goto RevokeNewSlot; - } - - DEBUG ((DEBUG_INFO, "%a: hot-added APIC ID " FMT_APIC_ID ", SMBASE 0x%Lx, " - "EFI_SMM_CPU_SERVICE_PROTOCOL assigned number %Lu\n", __FUNCTION__, - NewApicId, (UINT64)mCpuHotPlugData->SmBase[NewSlot], - (UINT64)NewProcessorNumberByProtocol)); - - NewSlot++; - PluggedIdx++; + if (EFI_ERROR(Status)) { + goto Fatal; } // @@ -267,9 +314,6 @@ CpuHotplugMmi ( // return EFI_SUCCESS; -RevokeNewSlot: - mCpuHotPlugData->ApicId[NewSlot] = MAX_UINT64; - Fatal: ASSERT (FALSE); CpuDeadLoop (); -- 2.9.3