From nobody Thu Nov 14 23:00:32 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+72705+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+72705+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 1615530443141991.4465596916398; Thu, 11 Mar 2021 22:27:23 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id Q9ZBYY1788612xKKrLEQ3yh1; Thu, 11 Mar 2021 22:27:22 -0800 X-Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by mx.groups.io with SMTP id smtpd.web10.4848.1615530434478996917 for ; Thu, 11 Mar 2021 22:27:14 -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 12C6A7Ik178512; Fri, 12 Mar 2021 06:27:11 GMT X-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 37415rgyeg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Mar 2021 06:27:11 +0000 X-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 12C6PAsL055220; Fri, 12 Mar 2021 06:27:11 GMT X-Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam07lp2049.outbound.protection.outlook.com [104.47.56.49]) by userp3020.oracle.com with ESMTP id 374kgw3bq3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Mar 2021 06:27:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eqlN4DxSdLd9OyCAncyaX3WHw6bEHOCpB8L0qRWse4Dii3PbnquF7+lttvhnuMUb7MNp0GvXwVT6U3Nwsq4ZdsNQxUFKXBMYu0WX9xu/V7nvl505P9iwXlgIoDQC8sBB2rEzdU54OV1PgC9BoQWy0ePhGcWCVpBSWzypE/M2u1IQPrYdVi0A+mW2G/XpkZECEo71zzHnDMq23LeoNR/P2pPkr58Vk9nDl0eUBWCjTnS0yTLfDtHmz7VTcG6RiCDrGKAhQcQR3tANfXEUv3bTZ+9RwsUcp8NpxAVk5GNRKRNxK8mjI2V3GRgcilEBQjfNXqD2opLb9VfuV1H0MlrADA== 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=nOhyQYWxPMB/Ll/aIs9h+tZp4+HvVz8O7MSZMdON6VA=; b=czWAV0vd8xfhdK0hYpWo0ZHWXQ18qT2ymh1XSkWMx4pUDbsVgQ9h8drOfBIclx5Pdek4tI/0TxZgrGJLYM7x44tDjd6GOOgebtXJlW0U0FR72dIFfS0J13bSHq5Ty8uLEiSVFrszlvhEssa8GHKrv2kyU5cAibtpcP/B1GjES9QmE+7+TbXW3b8PYc4sCKEV9ivACbmua0bTsyV2sckase6e9yTwz/D9yEzoUx3G+0cyYRnBnBwH2hzQfGbHYD6yHfBgUtxQNSEOf/rDbhG63bH5hGgxoeMp8OQUuSxk4Ay1UlzB9WNfEUkC01uttjQS140kqKS1RjQx4LZWwutP9w== 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 SJ0PR10MB4605.namprd10.prod.outlook.com (2603:10b6:a03:2d9::24) by BYAPR10MB3191.namprd10.prod.outlook.com (2603:10b6:a03:14f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.24; Fri, 12 Mar 2021 06:27:09 +0000 X-Received: from SJ0PR10MB4605.namprd10.prod.outlook.com ([fe80::a021:790:7ce6:6f16]) by SJ0PR10MB4605.namprd10.prod.outlook.com ([fe80::a021:790:7ce6:6f16%6]) with mapi id 15.20.3912.030; Fri, 12 Mar 2021 06:27:09 +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 v9 03/10] OvmfPkg/CpuHotplugSmm: add Qemu Cpu Status helper Date: Thu, 11 Mar 2021 22:26:49 -0800 Message-Id: <20210312062656.2477515-4-ankur.a.arora@oracle.com> In-Reply-To: <20210312062656.2477515-1-ankur.a.arora@oracle.com> References: <20210312062656.2477515-1-ankur.a.arora@oracle.com> X-Originating-IP: [148.87.23.12] X-ClientProxiedBy: MWHPR02CA0018.namprd02.prod.outlook.com (2603:10b6:300:4b::28) To SJ0PR10MB4605.namprd10.prod.outlook.com (2603:10b6:a03:2d9::24) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from prion.us.oracle.com (148.87.23.12) by MWHPR02CA0018.namprd02.prod.outlook.com (2603:10b6:300:4b::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17 via Frontend Transport; Fri, 12 Mar 2021 06:27:08 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f62ad2f4-7e80-4e64-9f8b-08d8e51fdd1f X-MS-TrafficTypeDiagnostic: BYAPR10MB3191: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: 5d5UUtJ8Zp5eOP9shK601A164NG/mIVTltshvOGAegaaVuYZoh+w+bxCM/dsWvDohvyMczZLTKaCSUzGXnM7CjdbRqeDML+hHMWy3yalA3q1j0EGGm34QDPvZOUSyTAQnAuy0TTf+S3lNVseujFIkVAwa20SaIWrpNzeXJUaHyUV63G+nVc3/cESDQUT3S2MLbB58WVmvN45S3VXXirhHsQ7Vl5iTTxa/ELYJpigjZQux5YYGpPK76voX6rBEt7t4URl+ta3NLqbcQo6p9om0amEGokdNYmWm82ffssrqVglte1nKEou8+hnAIBa3L6LjJ5JV/61SVq+068Ldc3qJYmdf5SSBm1zFidQfNFwNiE4npDhnPuth/aa21A9lPHVgm6eXISMtypMZOaJfWqGJEyTavKWiL35fT8f8LKZQURdHLXQJF09lNJejEbv4VoJapQzmVBvfAVqc2cUGbJ0sZWeRL5cVz6EZZ/e0uiAcMyrB4TJGPzj5+fbh3kAF+e+WPuB9WWtve+KGfgk0/DWSiDYydOp82IuBO+AYz4MArJdgtZB37n1lEibPt6GrYtd37UWfpgy3/veutrXMJJmQV1knJDAKXpP7JrQb8O5O2Y= X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?Bp0/vSRqcSCv5ZF/mfrzblgohytIvpPR++9rEyrXZNEOs69fKMqTRpqZtwxl?= =?us-ascii?Q?u5cBRgQ2+wyea5bViAZbmfb5Ylq/mSqFhwIvQJ3HFUHGC77ZdFjdPF7/SEK1?= =?us-ascii?Q?jvb0vmZL7HGfuqwEZPi7u+eAUQ47nachfNV/Se0i+9LyeAy2TtupM1voVX49?= =?us-ascii?Q?7kVIC3QGN9hVgeh90VvYotvw1tsxSFc1OfqFWkSVBz0tlkBTlyH31MCR3+Jm?= =?us-ascii?Q?xy2Edcn5ojNHVnONMrtfiy3S5bglktR3za4Vg2LN29fmP4IMduSAXrEgPb2s?= =?us-ascii?Q?RveiaQ1er64ofscmJe6MqUEMf48htXf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+pgNOPQjtpkieCRMirBAJpPjFuMTXKSNtvLxFL31skAMVzBFaPA0MFSiGQ?= =?us-ascii?Q?63Lm6fWijeNebaZ+054SsxD7E4D/92djpmXcbvXV1YdVSsHIYg70lyetDNom?= =?us-ascii?Q?K7AtAvZoWGJTXsUTLkP0togv?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f62ad2f4-7e80-4e64-9f8b-08d8e51fdd1f X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4605.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2021 06:27:09.1291 (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: dTxl2abGWk5dfwGkspyQMunHejbzbG9pz8fb+l36sOCgjB4ZrI9s4QvsQAiie/P9kJEexUVtq5uV+D4jHe4S4tM2f8k8QPvaiRWT2zUcEl4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3191 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: BaSFXME2lMUowMJdLvtIuDULx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1615530442; bh=uS8abgOVmAU6AFvEzElfFq8GatWN+o71QfQpM1x0a70=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=rgfZPIaURTA9G7+3ezwa9hXFN7Eq2yMho+OrA2gWijR0780s5Rh4CZnrou+CfiJuu2q UfDH5tfjcbh6L1KlauuLEDE7TV6hApyVjSvEMuvjAFI35Vl3fUEVMblOHLfdW00Wml2jx G46BQ9Dzgj3jV9xT3bd9Wqb6HzJq6R5R5N4= 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 Reviewed-by: Laszlo Ersek --- 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 3e2c2192e1c0..8bb3c66e9b44 100644 --- a/OvmfPkg/CpuHotplugSmm/QemuCpuhp.h +++ b/OvmfPkg/CpuHotplugSmm/QemuCpuhp.h @@ -42,6 +42,12 @@ QemuCpuhpWriteCpuSelector ( ); =20 VOID +QemuCpuhpWriteCpuStatus ( + IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo, + IN UINT8 CpuStatus + ); + +VOID QemuCpuhpWriteCommand ( IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo, IN UINT8 Command diff --git a/OvmfPkg/CpuHotplugSmm/QemuCpuhp.c b/OvmfPkg/CpuHotplugSmm/Qemu= Cpuhp.c index 8434dd446b96..dc86ab96777a 100644 --- a/OvmfPkg/CpuHotplugSmm/QemuCpuhp.c +++ b/OvmfPkg/CpuHotplugSmm/QemuCpuhp.c @@ -114,6 +114,28 @@ QemuCpuhpWriteCpuSelector ( } =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 (); + } +} + +VOID QemuCpuhpWriteCommand ( IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo, IN UINT8 Command --=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 (#72705): https://edk2.groups.io/g/devel/message/72705 Mute This Topic: https://groups.io/mt/81273604/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-