From nobody Thu Nov 14 16:58:02 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+71913+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+71913+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 1613978387545692.6087789058715; Sun, 21 Feb 2021 23:19:47 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id cyuzYY1788612xE7VrVKrMx0; Sun, 21 Feb 2021 23:19:47 -0800 X-Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by mx.groups.io with SMTP id smtpd.web10.31718.1613978386341564918 for ; Sun, 21 Feb 2021 23:19:46 -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 11M7FDtv133395; Mon, 22 Feb 2021 07:19:43 GMT X-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 36tsuqtkts-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Feb 2021 07:19:43 +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 11M7GCDu126471; Mon, 22 Feb 2021 07:19:42 GMT X-Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2175.outbound.protection.outlook.com [104.47.59.175]) by userp3020.oracle.com with ESMTP id 36uc6pynae-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Feb 2021 07:19:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lOJIBUbUqOrpnuExeQzQ5zQM5N0bS35YCCsizsxiRslZcgA8pqgB745hulEI/wjBO/5qSzFP4UKsxTrF3QZAkM/Grd9sYZE6DLfegOyzN2zyBoYrLpQCmmj6u3dgyICv/DA9+2ZZE5BykEfjKI1y2K6EGWAn8fRB7QJ24P7KX9lQDeCEbBp7xAIYqBhFf8R8AoRPAO3G2CZBqfFALvYSAK144RjmkHBgEHAOEKJ3xB63sOgsVkGzxh7yQfE7kUC6KWPsM+Sq79IqanyhW+QD/rCiumM/z+jV9Fok6BJAkISuHmNCbcQS2BZwQeQjhgRQLdjIXx32/ZSaOCXDhc9Eaw== 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=bR5TQsUsLtgVrWbHYA6czpMiWJHrguYqDjpqH9qkXb5TG3hk9wQ8ls85h9cewQuXLgWAtnmRw8emPKIQMcynfJVDeuZKp63L6wTeeJRmyMb4dcdh0brOMq2jnohyY5mYrmHCeCGkvTayvVlzeo3OT0YzvYUi9tlqsEzQNMM0Fi/Ua0lyLqbAD+GvbjYDHOuO+8nrM2njZe0LaJsExKm3exuwtTmlHXPuRWNzt3Zqr3ElzJkpxWQ6HCqcXb7vPbsMpx/g0LiTep/x6KbEKTT1H9rnnmScxTRHBAsGfpHbviXQ4hQKnvRi5hHf15mS1YHLuU4p33eaB+TWqhDxuyV33A== 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.3868.29; Mon, 22 Feb 2021 07:19:41 +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.033; Mon, 22 Feb 2021 07:19:41 +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 v8 03/10] OvmfPkg/CpuHotplugSmm: add Qemu Cpu Status helper Date: Sun, 21 Feb 2021 23:19:21 -0800 Message-Id: <20210222071928.1401820-4-ankur.a.arora@oracle.com> In-Reply-To: <20210222071928.1401820-1-ankur.a.arora@oracle.com> References: <20210222071928.1401820-1-ankur.a.arora@oracle.com> X-Originating-IP: [148.87.23.11] X-ClientProxiedBy: MWHPR17CA0065.namprd17.prod.outlook.com (2603:10b6:300:93::27) 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.11) by MWHPR17CA0065.namprd17.prod.outlook.com (2603:10b6:300:93::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.27 via Frontend Transport; Mon, 22 Feb 2021 07:19:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0c380061-ebbe-45cd-bdc3-08d8d702388b X-MS-TrafficTypeDiagnostic: BYAPR10MB3191: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS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Q84T7+KyADaSQRIu1OSs/IMdnA0MzO?= =?us-ascii?Q?MWXSo44+0UtOAeSrqJGAdSAwRyi5a4k7N7+ajvi2ZsQEHNK5Rzp9cyR5z5wn?= =?us-ascii?Q?kwULiR/OPIUDVnxGkTKR4KY6wNrnqXBXq49F5MLLzUbu1iK1wLc/TBY1REBW?= =?us-ascii?Q?9t3PFHDWPj2wPisuMCOL0eTF?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c380061-ebbe-45cd-bdc3-08d8d702388b X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4605.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2021 07:19:41.2668 (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: MmSk/yxS4kFMt7kssIIQW+iHduTqY8w1DC9DW1CKUugT3QdUn1K/e5VjDFYAt3GEmYaGUZUn9Pan6fsxbBTWzx1d4OPse0ugPG8SepfG5dQ= 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: Z5b1RaigEhT61OAUwQBF3GHLx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1613978387; bh=Z5Ir4FEoBvoZheeBxXFADR1TZZAi6LqOGgtLhA9PRZA=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=loO/tfGcvY2WiBtup/FePm0hsomf/HyIJq4BfjyBpy+/fEE/B1i6TmABsdTIzLVFKyK RLuuTQG31HDU5hQvqxzD4Ej3v3SwOdz6rP8ux2EVGaQ7VVbMqdoevMpueu9adN4LtLQbM Y7YAy1WRr+jWZunTPMw4MnrGaltwNT4b7rc= 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 --- 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 (#71913): https://edk2.groups.io/g/devel/message/71913 Mute This Topic: https://groups.io/mt/80819857/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-