From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) by mx.groups.io with SMTP id smtpd.web08.1037.1610696863077919249 for ; Thu, 14 Jan 2021 23:47:43 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=oMxSCJ6A; spf=pass (domain: oracle.com, ip: 141.146.126.78, mailfrom: ankur.a.arora@oracle.com) 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 10F7iFfm032655; Fri, 15 Jan 2021 07:47:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=7XB3hR8O2m8SIj3apDta7hnI7Gslc0mcuL0pg9lMqSw=; b=oMxSCJ6ARd+VIOKJSHWVNFYcKjDCYNEwfQHk8/XTA39IylVDzszMGiU9fMkRnxpbGWgs i0KSaw4XH92pinQcFtIPCCgISn1YPQaYuBfYFD3t+mrcFEOxvKG5oAUUcBDiIt9OPCXB Ah8sGZyCgvveZLLUwKtVFPtspta+oVXb9dX1bvEfe7zpTyCmx5z5jEbADhUNfooNAxJ3 ekSgxHclJCc1x46MDtV/JvlHnilNjBdMIZf8OcIrkNNqEyXd8TsP/aUXzr4Jlc6u0dJz 1wyRLKS3tIA/ur8gWfPkCLv+d5wUqrU/qSArWyEPV/LfqDeVl/wDin5Yxjrq88JsYZVy qg== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 360kd03q0b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Jan 2021 07:47:42 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10F7exER109945; Fri, 15 Jan 2021 07:45:41 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3030.oracle.com with ESMTP id 360keph9as-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Jan 2021 07:45:41 +0000 Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 10F7je7D008858; Fri, 15 Jan 2021 07:45:40 GMT Received: from localhost.localdomain (/70.36.60.91) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 14 Jan 2021 23:45:40 -0800 From: "Ankur Arora" To: devel@edk2.groups.io Cc: imammedo@redhat.com, lersek@redhat.com, Ankur Arora Subject: [PATCH v3 00/10] support CPU hot-unplug Date: Thu, 14 Jan 2021 23:45:23 -0800 Message-Id: <20210115074533.277448-1-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9864 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 spamscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101150044 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9864 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 impostorscore=0 bulkscore=0 adultscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 mlxlogscore=999 mlxscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101150044 Content-Transfer-Encoding: 8bit [ Resending, again to the correct list. Apologies to everybody who got this twice. ] Hi, This series adds support for CPU hot-unplug with OVMF. Please see this in conjunction with the QEMU secureboot hot-unplug v2 series posted here (now upstreamed): https://lore.kernel.org/qemu-devel/20201207140739.3829993-1-imammedo@redhat.com/ Patches 1 and 3, ("OvmfPkg/CpuHotplugSmm: refactor hotplug logic") ("OvmfPkg/CpuHotplugSmm: add Qemu Cpu Status helper") are either refactors or add support functions. Patch 2 and 9, ("OvmfPkg/CpuHotplugSmm: collect hot-unplug events") ("OvmfPkg/SmmControl2Dxe: negotiate hot-unplug") handle the QEMU protocol logic for collection of hot-unplug events or to handle the protocol negotiation. Patches 4 and 5, ("UefiCpuPkg: add CPU ejection support") ("OvmfPkg/SmmCpuFeaturesLib: init CPU ejection state") setup and init the PiSmmCpuDxeSmm CPU ejection state. Patches 6, 7, and 8, ("OvmfPkg/CpuHotplugSmm: support CPU eject") ("OvmfPkg/CpuHotplugSmm: introduce UnplugCpus()") ("OvmfPkg/CpuHotplugSmm: add worker to do CPU ejection") contain the core of the changes. The first one adds a NOP CPU ejection handler, the second processing CPU ejection events and removing the CPUs to be unplugged in a pen, and the third doing the actual eject. Patch 10 ("MdePkg: use CpuPause() in CpuDeadLoop()") is unrelated to the series and just adds a CpuPause() in the CpuDeadLoop((). Testing (with QEMU 5.2.50): - Stable with randomized CPU plug/unplug (guest maxcpus=1,8,128) - Synthetic tests with simultaneous multi CPU hot-unplug - Negotiation with/without CPU hotplug enabled Also at: github.com/terminus/edk2/ hot-unplug-v3 Changelog: v3: - Use a saner PCD based interface to share state between PiSmmCpuDxeSmm and OvmfPkg/CpuHotplugSmm - Cleaner split of the hot-unplug code v2: - Do the ejection via SmmCpuFeaturesRendezvousExit() URL: https://patchew.org/EDK2/20210107195515.106158-1-ankur.a.arora@oracle.com/ RFC: URL: https://patchew.org/EDK2/20201208053432.2690694-1-ankur.a.arora@oracle.com/ Please review. Thanks Ankur Ankur Arora (10): OvmfPkg/CpuHotplugSmm: refactor hotplug logic OvmfPkg/CpuHotplugSmm: collect hot-unplug events OvmfPkg/CpuHotplugSmm: add Qemu Cpu Status helper UefiCpuPkg: add CPU ejection support OvmfPkg/SmmCpuFeaturesLib: init CPU ejection state OvmfPkg/CpuHotplugSmm: support CPU eject OvmfPkg/CpuHotplugSmm: introduce UnplugCpus() OvmfPkg/CpuHotplugSmm: add worker to do CPU ejection OvmfPkg/SmmControl2Dxe: negotiate hot-unplug MdePkg: use CpuPause() in CpuDeadLoop() MdePkg/Library/BaseLib/CpuDeadLoop.c | 4 +- OvmfPkg/CpuHotplugSmm/CpuHotplug.c | 424 ++++++++++++++++----- OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf | 1 + OvmfPkg/CpuHotplugSmm/QemuCpuhp.c | 58 ++- OvmfPkg/CpuHotplugSmm/QemuCpuhp.h | 6 + OvmfPkg/Include/IndustryStandard/QemuCpuHotplug.h | 2 + .../Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c | 68 ++++ .../SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf | 3 + OvmfPkg/SmmControl2Dxe/SmiFeatures.c | 21 +- UefiCpuPkg/Include/CpuHotPlugData.h | 21 + UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf | 1 + UefiCpuPkg/UefiCpuPkg.dec | 5 + UefiCpuPkg/UefiCpuPkg.uni | 4 + 13 files changed, 515 insertions(+), 103 deletions(-) -- 2.9.3