From nobody Thu Nov 14 16:56:47 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+71831+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+71831+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 161372550457498.06004033167767; Fri, 19 Feb 2021 01:05:04 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id Xmz6YY1788612xLsx8q8M69m; Fri, 19 Feb 2021 01:05:04 -0800 X-Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) by mx.groups.io with SMTP id smtpd.web11.6107.1613725501901957568 for ; Fri, 19 Feb 2021 01:05:02 -0800 X-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 11J93veU178541; Fri, 19 Feb 2021 09:04:59 GMT X-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 36pd9ag89k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 19 Feb 2021 09:04:59 +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 11J8tl0t182210; Fri, 19 Feb 2021 09:04:58 GMT X-Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2177.outbound.protection.outlook.com [104.47.55.177]) by userp3020.oracle.com with ESMTP id 36prhve0ju-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 19 Feb 2021 09:04:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fTY2AzcCWNwd60zbVbc6o+JyCY4572eeJw/piuVm/Ezq80nojpiCJz+/7yLAa5UP+sKHnafyVCyVRJS4Zw93IVB38Lny8nRTXtKK+qGB3g+SxUb4EvocemF1RFMJ4iYKS3SjzCXDRQonTi/byTfH603CJOG612oidxMLcwpdVTJu9PIbrUB+cgeY5c6h3MZsVq1QXNXIFtA2MgzMsQe6brtSbup+6NngfqnK5BMOcGGGYv4kR3mPSmqc0ahD4+3JbqpB6OgF0gy7sPjT9ukp3PymMqdbqcl1G3Vdz6QjQuaI1i1DycEliMDAnruUAIAkxJTI4OfjjoL0GoUbFPs6aA== 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=8fO67yOsbQGfKTZwTbqUZ414s/0CVrpbiuLZpLVLgDQ=; b=JaioWhgexAZxVDXgD6HWTeO3zddXjUFk6eHljt6uX/r2p9I9kFEfw2EnG19Qz/s71//OwBZS4JvYaavvvB0vwOoF1BgBEnbm/if1vLk/3J4rHWzLuj+2xVfzRhgiNaq8BmeNljmuVCJJMb/8zKzz77g49lnHaUune5ON+HOXCSmnLHIj3m4/5DIiKLAax+YOYztN1aW6yr0qLAFO7ctjwB+4ldpxcSK4GTSS2oIs6Rzlwa10WwmXLXJU4Mz2iYqTUHD0e+wIxpUwiaS/hE9Zzs/H4LsPXIOhg4vVBMzYhP6kRRzdDAKvAYnMJjJjGyxiBUIBRDYU99zUwXFZqeM8pA== 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 BYAPR10MB3605.namprd10.prod.outlook.com (2603:10b6:a03:129::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Fri, 19 Feb 2021 09:04:57 +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.3868.029; Fri, 19 Feb 2021 09:04:57 +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 v7 03/10] OvmfPkg/CpuHotplugSmm: add Qemu Cpu Status helper Date: Fri, 19 Feb 2021 01:04:37 -0800 Message-Id: <20210219090444.1332380-4-ankur.a.arora@oracle.com> In-Reply-To: <20210219090444.1332380-1-ankur.a.arora@oracle.com> References: <20210219090444.1332380-1-ankur.a.arora@oracle.com> X-Originating-IP: [148.87.23.5] X-ClientProxiedBy: MWHPR13CA0004.namprd13.prod.outlook.com (2603:10b6:300:16::14) 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.5) by MWHPR13CA0004.namprd13.prod.outlook.com (2603:10b6:300:16::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.8 via Frontend Transport; Fri, 19 Feb 2021 09:04:56 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b2235f95-f7a8-427b-e3d1-08d8d4b56dfa X-MS-TrafficTypeDiagnostic: BYAPR10MB3605: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-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ii?Q?rDV/eB65w7oHx6Gm1/htJ7zBKysXIfeuLEuoSSGVjOK+c3a8+Cta0DGKg0bI?= =?us-ascii?Q?uQ/3G7HBySVUL7dH1SPQPS1ML01z8ixA6oAt4c+pcvAweMwcxZzWSBkFcBal?= =?us-ascii?Q?JYKwCHutHr1qKg98/F5bJ2XW?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b2235f95-f7a8-427b-e3d1-08d8d4b56dfa X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4605.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2021 09:04:57.4005 (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: vJZeNlKc8egjKX5kPxDYFSioE9Y7EOK678hX5J6tccPpCGPTeFhmVkQjDFG6tDM4NqeijHP7Im23MI8wiUgx2db+hVwj98YHYKOTh5CuRA4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3605 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: 7bM8nZofAF0dTDk8m6ikJDS3x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1613725504; bh=3qYCIkOY5AX22n6/+hlD4guZThLhZtacG2I1QMw422c=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=TfON5GKBkM1U2Z3m71vk/MWzPHzhwP+U7jtHGCcAPA7eC73witt6dqOafP9BplNYhEi l8ocbAnMpRgVfsN/oDIWYzmI2jI5o5NRsgTItlId/grrq59B0mE2uqxVNrblCedkXWoGu wxj4QXf/5KGqO4rLau14kOF/wgCjUW30HHM= 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 --- Notes: Address this review comment: () Move QemuCpuhpWriteCpuStatus() (declaration and definition) between QemuCpuhpWriteCpuSelector() and QemuCpuhpWriteCommand() to match the order of the register descriptions in QEMU. 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 1e23b150910e..859412c1a173 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 36372a5e6193..9434bb14dd4e 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 (#71831): https://edk2.groups.io/g/devel/message/71831 Mute This Topic: https://groups.io/mt/80751394/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-