From nobody Thu Nov 14 17:04:09 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+68463+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+68463+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1607433829; cv=none; d=zohomail.com; s=zohoarc; b=aXlHky5BJmr+CeqygWxB2v5TPzHVIBeZ6K/YyT+LYApSSPNl3X4D+kTTXKtXhkHTYL5o+JJwpyMdpX8Bm9gf9KA38yHeRzzYwDQNUcMBOh+hNlnDTuD++l00Vk1SNlmairyXrxusQXDUt7MxncrXb1iEtB/gYefYxdwFr+nuBR4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607433829; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=V/sioP0xalJygR5Ds5AmXce56A4cZ4+QpWIRROIRolc=; b=eAjZSndjWr3TGAfM8cCdtmSHnFMvD+6y3ae9BABFmhkRqXgzI5l3Vr7Lv/o5tqsxU1BUhnDXv7lbc6m2wEg1S8Ek7A2XW7ghAWwc2XmhLosJvM1XaCZA3YhezwFu5NgPyzsl7CFqY63CIbKwhPdXvNRBRCD9iY6laVjiP5YcmgA= ARC-Authentication-Results: i=1; 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+68463+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1607433829878856.0636897626172; Tue, 8 Dec 2020 05:23:49 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id qAxeYY1788612xJKkj3VkUKM; Tue, 08 Dec 2020 05:23:49 -0800 X-Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by mx.groups.io with SMTP id smtpd.web09.4506.1607405699695896174 for ; Mon, 07 Dec 2020 21:34:59 -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 0B85XrWV025044; Tue, 8 Dec 2020 05:34:59 GMT X-Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 3581mqrun7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 08 Dec 2020 05:34:59 +0000 X-Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0B85YkWF116126; Tue, 8 Dec 2020 05:34:58 GMT X-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 358ksn3e4w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 08 Dec 2020 05:34:58 +0000 X-Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 0B85YvUn006142; Tue, 8 Dec 2020 05:34:57 GMT X-Received: from localhost.localdomain (/70.36.60.91) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 07 Dec 2020 21:34:57 -0800 From: "Ankur Arora" To: devel@edk2.groups.io Cc: imammedo@redhat.com, lersek@redhat.com, boris.ostrovsky@oracle.com, Ankur Arora Subject: [edk2-devel] [RFC PATCH 3/5] OvmfPkg/CpuHotplugSmm: add CpuStatus helper function Date: Mon, 7 Dec 2020 21:34:30 -0800 Message-Id: <20201208053432.2690694-4-ankur.a.arora@oracle.com> In-Reply-To: <20201208053432.2690694-1-ankur.a.arora@oracle.com> References: <20201208053432.2690694-1-ankur.a.arora@oracle.com> MIME-Version: 1.0 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: FWo9NXpXteAP8UkYnGmj54JHx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1607433829; bh=rV6YPeVLtHZRLNfjbwWcxEYY+T6nis3VYm5EYsNg8FA=; h=Cc:Date:From:Reply-To:Subject:To; b=pB6iHQNA8mTy4pmWDdjOCT/7sW2irhfdQgXZ/ZjtaO/SY7yPlGjJgFfC6qYoHGr6itU BzLHWIX/eF79IDn7G0snvv4Esr2FXehTU0XfltxeCsqxYkcGs8aOp48O6/9+LLskm00iy riRaDg3EIsYwW233RDVoAbt7iSk9obsmxKw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Add QemuCpuhpWriteCpuStatus() which writes to the QEMU CPU status register. On error, it hangs in similar fashion to the other helper functions. Signed-off-by: Ankur Arora --- OvmfPkg/CpuHotplugSmm/QemuCpuhp.c | 23 +++++++++++++++++++++++ OvmfPkg/CpuHotplugSmm/QemuCpuhp.h | 6 ++++++ 2 files changed, 29 insertions(+) diff --git a/OvmfPkg/CpuHotplugSmm/QemuCpuhp.c b/OvmfPkg/CpuHotplugSmm/Qemu= Cpuhp.c index 2dd783ebf42e..14145696aa50 100644 --- a/OvmfPkg/CpuHotplugSmm/QemuCpuhp.c +++ b/OvmfPkg/CpuHotplugSmm/QemuCpuhp.c @@ -67,6 +67,29 @@ QemuCpuhpReadCpuStatus ( return CpuStatus; } =20 +UINT8 +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 (); + } + return Status; +} + UINT32 QemuCpuhpReadCommandData ( IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo diff --git a/OvmfPkg/CpuHotplugSmm/QemuCpuhp.h b/OvmfPkg/CpuHotplugSmm/Qemu= Cpuhp.h index 8adaa0ad91f0..9f084d199fd4 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 +UINT8 +QemuCpuhpWriteCpuStatus ( + IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo, + IN UINT8 CpuStatus + ); + UINT32 QemuCpuhpReadCommandData ( IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo --=20 2.25.4 -=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 (#68463): https://edk2.groups.io/g/devel/message/68463 Mute This Topic: https://groups.io/mt/78802724/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-