From nobody Thu Nov 14 16:52:25 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+70870+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+70870+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 1611882014151537.4347496761987; Thu, 28 Jan 2021 17:00:14 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 2vwJYY1788612xmnh43Jc09K; Thu, 28 Jan 2021 17:00:13 -0800 X-Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by mx.groups.io with SMTP id smtpd.web08.3357.1611882008266317122 for ; Thu, 28 Jan 2021 17:00:08 -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 10T0eJ8e041428; Fri, 29 Jan 2021 01:00:04 GMT X-Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 368b7r6uw8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Jan 2021 01:00:04 +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 10T0eGVG081743; Fri, 29 Jan 2021 01:00:03 GMT X-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-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Jan 2021 01:00:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L/1NoALG9E+igW1GsKZ632Jc7jTNnRKYJ6ioLfLYrt//cyripSX6CA65cwFos9bc5ViisjgNbNFt5q/F5JnKA1Ui890zkhO9R1PPisqb9FDNgMQPB3DENS6fMKVsULXXvu8s/28DPNw6yEuO/6PPQrDUejIGDdIAenDjeo60syyYZm8Pgjci3y/BK9nP3HIlqr1G0Q61zUTo6Tr9gKpgUsPeVbiKLReKdulotMwhnQH77EMdOl0l5/CGdTGuRKMT3tkIGWIBSFaMc2AdUPYyrbUGkEc4UYMPaJu1LA8aaHyOnI5C2BTWG7iZsSnjRgKuGEtNyt3XP0xEHd1z6ePOjg== 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=7DyDBLKrhQWru9roBkQCWe9/RsVfjy9XMv9V9+fWzjc=; b=dj/hFTJNJ1pDvrNBzQhUidLn7EAn2YIjs4K2uFOHlG6nc5iWU/wU4UZlemjb2AVyN+NuXacaQcFTh/AS5ayKPlvtyrkC7TaxLiHyLq7IMU17RdQmC612It0GXA0Jq5dj0dCEGCVza3+pTTcVYOES7OzRhYJE+ZfseF/oPBRbI/JwGFp6W6MtVG+MKwktrzCI1jMfX2MHfcRutpPw8y+ZsY4t1f1j1TTDZ3FAN8R0DLK92ZUm96X3UNo/bvAcvD1VHHT8zAWaYTAd+lAEwGvpzdfD/5O/pYTVOxeFs1nbq5m39GktKRF1YTJDtBCn5Jvu+d7JtaBnBeTD+iqsvxvGhw== 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:01 +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:01 +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 3/9] OvmfPkg/CpuHotplugSmm: add Qemu Cpu Status helper Date: Thu, 28 Jan 2021 16:59:44 -0800 Message-Id: <20210129005950.467638-4-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:00 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 35e69161-59b5-4322-c676-08d8c3f134ef X-MS-TrafficTypeDiagnostic: CY4PR1001MB2246: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADC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DiiaKtaNHfFhZs169tlhmZEstgwWIr2?= =?us-ascii?Q?r2U22lZQWX59Vf9eGrwGbRm7YxSdv0CCJ/Fbk1DPcrzRFf2quKJH3V3I8B6E?= =?us-ascii?Q?mCQEo7lVoIDnj4ovYfGf1aJGoHvPW6GypZURh5F1v0ZMf+w4YirGyZiCtR9p?= =?us-ascii?Q?HPY0M9NysFDNc3VQw9EQ3kdmzTeclninIyAN9S0LNLOSQ/P2qWNGRwYv7sTZ?= =?us-ascii?Q?wv0urFeBcbw/IByPAONd/Bpz5bHZJo/XW4KIrJzT5jfu3jMWigSqjD2Vf74k?= =?us-ascii?Q?5wzYF/ujwzILk9fC+bWnvg7t4MpjVoqgTd1kQhMvUtv+oqTw2AH9QhEr/dNV?= =?us-ascii?Q?X+ZpmldYteS3tUejdx9HXAYR73mOlxpncV2jHRy3t4IGPDu2Oenf51tZf6MT?= =?us-ascii?Q?KzbKFu7a5RNCDx5rcyEG5VY4bTMYZ2zIuP1oMsAHLxRYLwGxwMjoelq1jbDa?= =?us-ascii?Q?Cvgi+fVn3+33GVVJgV8ahwtcys0gCmuNRHMSwpRanj06N/ypAfgu/hd5GEYw?= =?us-ascii?Q?XcqNxohC7HCSe3arp5fRPmVJD3Fb+mHVjo2ls8SxH0XLxpl8Zcx4BvlNuwyj?= =?us-ascii?Q?Fih+foTsDj+s+5fKSGeAja5t9OxWcWgxkR7F2NI6lc6iZdVr5RbGa/mUn9mH?= =?us-ascii?Q?JPeED/qgguJJjRA9hq8d211tKZfj1z/rvMQcMR+thRCcZP4aUJZtPDG/ZGAW?= =?us-ascii?Q?63AZnuw4SDdu8XntUsnKN6TFxyaAIc4Q3uCUoMLwO2I59k2hNdRiV0T7lKu4?= =?us-ascii?Q?oUF4cXuA?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 35e69161-59b5-4322-c676-08d8c3f134ef 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:01.7448 (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: BLr9UIwstrlQqPAaKJEgTYqiNL87H8hqkpo/PlMAdynRVkpJ5DIwxDZlA2lTSZ2S60wo0g0fDF/DWuclXFmlUU1WYKj1vkWxo0c/npl1L40= 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: dsV1kebXsQRKXWy2KIREROsAx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1611882013; bh=TFkIoml6MLHv+QdmATNzFWxVepxDBwO0N8xPse/ZgeU=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=YhKjjLI17zFHAe6ddFN5L+kmtwMeTy73cTorjYCQKJqyvr3IVgV3x/jXWWH/NDs+R4C STq02z/gqFHtq0MSa1OXFXgUAZ4mUIhBT05Uj4xpypkVHsZXDkyqcl52EFL4t8ypx/YyY jNtEvwnJhOXfplxolzkyAhlU6IVyoUrfkhI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Add QemuCpuhpWriteCpuStatus() which will be used to update the QEMU CPU status register. On error, it hangs in a similar fashion as other helper functions. 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/CpuHotplugSmm/QemuCpuhp.h | 6 ++++++ OvmfPkg/CpuHotplugSmm/QemuCpuhp.c | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/OvmfPkg/CpuHotplugSmm/QemuCpuhp.h b/OvmfPkg/CpuHotplugSmm/Qemu= Cpuhp.h index 8adaa0ad91f0..804809846890 100644 --- a/OvmfPkg/CpuHotplugSmm/QemuCpuhp.h +++ b/OvmfPkg/CpuHotplugSmm/QemuCpuhp.h @@ -30,6 +30,12 @@ QemuCpuhpReadCpuStatus ( IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo ); =20 +VOID +QemuCpuhpWriteCpuStatus ( + IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo, + IN UINT8 CpuStatus + ); + UINT32 QemuCpuhpReadCommandData ( IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo diff --git a/OvmfPkg/CpuHotplugSmm/QemuCpuhp.c b/OvmfPkg/CpuHotplugSmm/Qemu= Cpuhp.c index f871e50c377b..ed44264de934 100644 --- a/OvmfPkg/CpuHotplugSmm/QemuCpuhp.c +++ b/OvmfPkg/CpuHotplugSmm/QemuCpuhp.c @@ -67,6 +67,28 @@ QemuCpuhpReadCpuStatus ( return CpuStatus; } =20 +VOID +QemuCpuhpWriteCpuStatus ( + IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo, + IN UINT8 CpuStatus + ) +{ + EFI_STATUS Status; + + Status =3D MmCpuIo->Io.Write ( + MmCpuIo, + MM_IO_UINT8, + ICH9_CPU_HOTPLUG_BASE + QEMU_CPUHP_R_CPU_STAT, + 1, + &CpuStatus + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, Status)); + ASSERT (FALSE); + CpuDeadLoop (); + } +} + UINT32 QemuCpuhpReadCommandData ( IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo --=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 (#70870): https://edk2.groups.io/g/devel/message/70870 Mute This Topic: https://groups.io/mt/80199903/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-