From nobody Thu Nov 14 17:07:36 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+69972+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+69972+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1610049341; cv=none; d=zohomail.com; s=zohoarc; b=nr39rJ+Mc8x8UmChmwGUyFxBks+LGWUhwhwNzdcSAyJTSgh3FUHyHlf2ImxU2tx+P02cAqksYbZPoYKWi7uyKY4JC1Zcp+D53bWrQ27+cBjsKiViLO7N4Djp2tnM/qARS1bhE3pcHPj9kIJTnS5eJksMnn4ixdG3rFy5/0MIde8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610049341; 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=8/Mp3EaZZqfywebjo8sGkg4/vIsqfAJw+fNCdXvuEns=; b=SJIZ1f9f9cKk0Sa5VDtAH/skpPqTx1teFDmYEIQnTe4wtJQLvHw+I02BW7ossA5szysdAKs3QbYGYP5ycfUIwAA/cl8MCw/5DWFIVtHOy26T5y+whc0FVcg1aNRBDzR2MJS5GkRP36d2N5ldpGgVXO0cl+m8hUqbRve2USJpNeQ= 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+69972+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 161004934189763.393867748610205; Thu, 7 Jan 2021 11:55:41 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id Hg0IYY1788612xRXBfjKdFLm; Thu, 07 Jan 2021 11:55:41 -0800 X-Received: from aserp2130.oracle.com (aserp2130.oracle.com [141.146.126.79]) by mx.groups.io with SMTP id smtpd.web09.2189.1610049330943402912 for ; Thu, 07 Jan 2021 11:55:31 -0800 X-Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 107JtRVS150438; Thu, 7 Jan 2021 19:55:27 GMT X-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2130.oracle.com with ESMTP id 35wcuxxedu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 07 Jan 2021 19:55:27 +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 107Jadrv136087; Thu, 7 Jan 2021 19:55:26 GMT X-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 35w3qu6crh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Jan 2021 19:55:26 +0000 X-Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 107JtPWs021811; Thu, 7 Jan 2021 19:55:26 GMT X-Received: from localhost.localdomain (/70.36.60.91) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 07 Jan 2021 11:55:25 -0800 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 v2 03/10] OvmfPkg/CpuHotplugSmm: add Qemu CpuStatus helper Date: Thu, 7 Jan 2021 11:55:08 -0800 Message-Id: <20210107195515.106158-4-ankur.a.arora@oracle.com> In-Reply-To: <20210107195515.106158-1-ankur.a.arora@oracle.com> References: <20210107195515.106158-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: ND5XBpt2JyuFQ9Bd6xzQB7Hvx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1610049341; bh=3qzfqAxuIU+QAa/ucejdqYZZpQprgIjz3sJfaNjmwc0=; h=Cc:Date:From:Reply-To:Subject:To; b=gC3K6TEA0BT/3vItQ7+Cl4tpwfKf9bJx7mJh4O9Ha4xdDk8nrnKFZMF/Jpd2EZH/MXj jBKg/hc8uqShoGwBEXcwR92IjUs4lDWJVxndcAD1CLupbBKAPkPpDWpRkgcdzCa7tMKYC cvdhCe5XCK+qpvBC3QMcPmif31B+epdkSdQ= 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 similar fashion to the 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.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.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 (#69972): https://edk2.groups.io/g/devel/message/69972 Mute This Topic: https://groups.io/mt/79507539/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-