From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=P7goszki; spf=pass (domain: oracle.com, ip: 141.146.126.79, mailfrom: ankur.a.arora@oracle.com) 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=hsCinjjaxj36/gwm8Aa9FIu1GnGojX10cMEIemk0S9E=; b=P7goszki4zo3iZIKqIxiV5n475Wa2CsudCXrGFUaDxtqeXGDVrnehJeDGxD8PeO1oPgv p/YkTeoBKhP1BUPVs6+8KBXlRh2nLpoGF8JarN9v+LYpBLsJfacgHq3m7QH94PmvSWKp jkqiLkaqLFdTSTg9L96AYG2jO8s9Zsnjyxl4Q7JetEMjSOWjQCMGMEsYYmiK4+gke4kM Zef3PFBbl0hEAP9sv7J26VBmZ+t/Xryn8NDN8L0PKEzx8nltuUkBrAFnoo0Z0SxUmb7I hNijrjJe60zZooUdNZ/R/TsxiTb7X0mJ1tfOVDkaxyS1FBXtC19MPsbuL/ni4ETyvG7O ug== 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 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 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 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 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: [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> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20210107195515.106158-1-ankur.a.arora@oracle.com> References: <20210107195515.106158-1-ankur.a.arora@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9857 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 mlxscore=0 spamscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101070114 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9857 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 bulkscore=0 clxscore=1015 spamscore=0 impostorscore=0 priorityscore=1501 mlxscore=0 adultscore=0 mlxlogscore=999 lowpriorityscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101070115 Content-Transfer-Encoding: quoted-printable 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;=0D }=0D =0D +UINT8=0D +QemuCpuhpWriteCpuStatus (=0D + IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo,=0D + IN UINT8 CpuStatus=0D + )=0D +{=0D + EFI_STATUS Status;=0D +=0D + Status =3D MmCpuIo->Io.Write(=0D + MmCpuIo,=0D + MM_IO_UINT8,=0D + ICH9_CPU_HOTPLUG_BASE + QEMU_CPUHP_R_CPU_STAT,=0D + 1,=0D + &CpuStatus=0D + );=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "%a: %r\n", __FUNCTION__, Status));=0D + ASSERT (FALSE);=0D + CpuDeadLoop ();=0D + }=0D + return Status;=0D +}=0D +=0D UINT32=0D QemuCpuhpReadCommandData (=0D IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo=0D 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=0D );=0D =0D +UINT8=0D +QemuCpuhpWriteCpuStatus (=0D + IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo,=0D + IN UINT8 CpuStatus=0D + );=0D +=0D UINT32=0D QemuCpuhpReadCommandData (=0D IN CONST EFI_MM_CPU_IO_PROTOCOL *MmCpuIo=0D --=20 2.9.3