From nobody Thu Nov 14 16:47:57 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+70762+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+70762+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 1611643499211691.4594177836809; Mon, 25 Jan 2021 22:44:59 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id qEJlYY1788612xpdM4HrJwUz; Mon, 25 Jan 2021 22:44:58 -0800 X-Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by mx.groups.io with SMTP id smtpd.web12.8812.1611643498248855445 for ; Mon, 25 Jan 2021 22:44:58 -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 10Q6Z79B054283; Tue, 26 Jan 2021 06:44:54 GMT X-Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 368b7qrnuf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Jan 2021 06:44:54 +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 10Q6a5jQ097050; Tue, 26 Jan 2021 06:44:54 GMT X-Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam08lp2046.outbound.protection.outlook.com [104.47.74.46]) by userp3030.oracle.com with ESMTP id 368wqw1qb8-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Jan 2021 06:44:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nkd0xoHw6qSrNxY2LurZsoK4xAlUJ9PKYkZqZctj6e/QUR2XykyrYJvJ9k0K0vNO2qGOkBqJhhv24vKvjg9E/lv/GWJetr61Ypq+bhuo7JzDfQLQg1PESSgV17rmz1s+C6+Qhct3nRFyAZym2zeeHI0T0CG274ruxz0c++AejBP8JN9uYvyPULsAzs0KfIbbiGsKLF1Lo353PVEKjkMQZSU1JN2rKv5ol0gouJgMANO2l8D3ddIQDUNi0nTcU/1KANX1HREXebNPKjiCNKQ0VnUCSYwAXfNErnmV0V9tX+oiA9q+9y8rPlYEIr820gmssB9dYNAV9bUkSQiU+zj0+A== 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=5EaL+ZxMNT/nlKN0K1jN7X0CrnwOY2RVEUXcZfsweZY=; b=oRMODvJglnVWaDwI19AIzIyqwMTw3YibCMZL9yaSaZAv6ffeD9tn4NNPBij8IsN3mTYFPM1u+ehH0rbemwm7vApxX3cNkHc5Nq+nywqpZLin2877yJttwK3eQdnZ4X0v8JR98y6J6KYF5dsY0/MPCLEU1UtRVZD7VGf/nKg93Mi940LIch9aX/kcUEp4SgxXaoidili4nsRkoGdPL7sG13/4XjSLNspew+osJbPgOHmxTMnpeSKcEdkPprBgKgDZCYJWNAraN7QS8916c1DivheKAfJBVyNaXLmpF4GcOqhLKHvg5WVsEpAc8WkqTN48qz2B6hWkzlmgqsfvcmml8w== 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 CY4PR1001MB2184.namprd10.prod.outlook.com (2603:10b6:910:45::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.14; Tue, 26 Jan 2021 06:44:52 +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.3784.019; Tue, 26 Jan 2021 06:44:51 +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 v5 3/9] OvmfPkg/CpuHotplugSmm: add Qemu Cpu Status helper Date: Mon, 25 Jan 2021 22:44:34 -0800 Message-Id: <20210126064440.299596-4-ankur.a.arora@oracle.com> In-Reply-To: <20210126064440.299596-1-ankur.a.arora@oracle.com> References: <20210126064440.299596-1-ankur.a.arora@oracle.com> X-Originating-IP: [70.36.60.91] X-ClientProxiedBy: MWHPR18CA0061.namprd18.prod.outlook.com (2603:10b6:300:39::23) To CY4PR10MB1718.namprd10.prod.outlook.com (2603:10b6:910:9::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from localhost.localdomain (70.36.60.91) by MWHPR18CA0061.namprd18.prod.outlook.com (2603:10b6:300:39::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.12 via Frontend Transport; Tue, 26 Jan 2021 06:44:51 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 41aa5cab-edef-4736-dd2a-08d8c1c5e1e3 X-MS-TrafficTypeDiagnostic: CY4PR1001MB2184: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-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2jSM?= =?us-ascii?Q?3F4HwU6XiPKv7q28I5u8HMF2t7ATeewRRRbmJIKtobyzYb2lkFBc6SPKuMrh?= =?us-ascii?Q?6XvFTiLUO33qiAhJhMuJ9z8toJVOmbgaLkRbZniVgKzXexTQtFy6y45y7CNS?= =?us-ascii?Q?onHwI1K1ef9GLaZDgg8cqifzM2Yv+OvYZFZa5L41tOr/FfeNedh+h/qVYTzQ?= =?us-ascii?Q?vT0Da5i8yxSOT9Njb6aOiJJMfzCgKPn8RRMmaatPgKLhoewinRuv3DIEJF78?= =?us-ascii?Q?57/h2okcQH9LJS9FemOHOA7t5dKxwCwteEMXyNJdFRe7xQkLJFYB3Z5oSinp?= =?us-ascii?Q?v3xTl+ElsrqCm2erL8xNe+IHlwrD1IXFLu1BlC4XCOwZe9O2MFs/JKMiu6s7?= =?us-ascii?Q?55KnYSMAOnOTdQCnc4eqfVCLjWQjwiU4g54vas55WPLsUBqv9GiJdGOg+6lo?= =?us-ascii?Q?bcCXBOZSLc1KwLm/YfRh9arpx16cXXTvOG3sOHs6gIU8Fv9qWq6oO+RaY6y4?= =?us-ascii?Q?YCYDMNUFSylCDEZVmFHa2AOWIwQ5opICoKQI/+T5RDPTZq+ViP11M6XLk1n4?= =?us-ascii?Q?7+buo/UceCme4nUcqeh2WlGsUHqnia3ISKBNO5wYZcHCBAMARrseBK+gc+EZ?= =?us-ascii?Q?I5YCYMQtDsBWtW11H+0XAEYkE2l4qSNVV30ejlccmePG+RdHYvImfacT+Oda?= =?us-ascii?Q?oXgt+G4b?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 41aa5cab-edef-4736-dd2a-08d8c1c5e1e3 X-MS-Exchange-CrossTenant-AuthSource: CY4PR10MB1718.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2021 06:44:51.9248 (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: ysAuM/fONkPtY+5tULDSF0br5h1qD7KKbBUtiO90mEh9T0D5ny3tY1RG/NBGW+TZd56ZKw06zN8r+DG/7zpymQXUFEAO80xBf8vxmT5APB0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1001MB2184 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: VENxP2sOTM82AuwPeZJlqeU8x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1611643498; bh=agVdRaX7Rt6Fucp5s2mqTp/nzvOiVmJF9CLEpRy1km4=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=p5vaNSb4WD3CeY03tErl8dA1jeh58Epv4oxu0VSXX0yiIE0mHpM8efvxNh8gpklaWdh lUUI/fUpJM7Lt0NVArJgD3PM1AA5u8Qf4RVhmRvkK5hDuotl2wS+vQXGGbrbvjMMw3gLt kOIlJ9ewAZvUH84N22pWN2+OBrHqEksnFmI= 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 2dd783ebf42e..c35ae31d2db0 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 (#70762): https://edk2.groups.io/g/devel/message/70762 Mute This Topic: https://groups.io/mt/80125310/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-