From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by mx.groups.io with SMTP id smtpd.web11.4545.1607405694682729190 for ; Mon, 07 Dec 2020 21:34:54 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=U8+dSvRP; spf=pass (domain: oracle.com, ip: 156.151.31.86, mailfrom: ankur.a.arora@oracle.com) 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 0B85XtU7025078; Tue, 8 Dec 2020 05:34:54 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=M0jWjGGLIxDZrAwMqAJRWCRtmLrs8eas34pD93EwrlE=; b=U8+dSvRPpuD/CSXinht0XfaeGUQqewqWvG231qqdCsgI1FEqTi8TDs0QfMZLQ8/6akmq Vz/FGoIr5SLVi+60RN63iVSNEXbD9M8P9wg1liSFLPhBLbfZJwRc7ahTajta1AabN943 XSMOpcWjMzs90lebeMOLM0kfWn7FzoK2tAz1Qh719l0MPKt++Vw4MvbNBghYXZATpIry yQxiK0iBPj9DqKBmy8/cPUmUUCuutmlt1R9X9smG+Dt6ti8GxGKF0pbZWujRaWya1ZOa oXVbvZD+ds503ezdiZL57k0bsUeW9tIzgeiqT0IITKcjQseCGRBFZ2brmdtUlGUmBMtg 4g== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 3581mqrumt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 08 Dec 2020 05:34:54 +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 0B85YcHE074879; Tue, 8 Dec 2020 05:34:53 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 358kysb96x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 08 Dec 2020 05:34:53 +0000 Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 0B85Yph6012585; Tue, 8 Dec 2020 05:34:53 GMT Received: from localhost.localdomain (/70.36.60.91) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 07 Dec 2020 21:34:51 -0800 From: ankur.a.arora@oracle.com To: devel@edk2.groups.io Cc: imammedo@redhat.com, lersek@redhat.com, boris.ostrovsky@oracle.com, Ankur Arora Subject: [RFC PATCH 0/5] support CPU hot-unplug Date: Mon, 7 Dec 2020 21:34:27 -0800 Message-Id: <20201208053432.2690694-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=9828 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012080033 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9828 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 clxscore=1011 malwarescore=0 priorityscore=1501 adultscore=0 lowpriorityscore=0 phishscore=0 spamscore=0 impostorscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012080033 Content-Transfer-Encoding: 8bit [ Resending to the correct edk2 alias this time. ] Hi, This series adds support for CPU hot-unplug with OVMF. Please see this in conjunction with the QEMU v2 series posted here: https://lore.kernel.org/qemu-devel/20201207140739.3829993-1-imammedo@redhat.com/ In particular, would be glad for comments on Patch 4, specifically where we should be ejecting the CPU. Right now the ejection happens in UnplugCpus() (called from CpuHotplugMmi()): + QemuCpuhpWriteCpuSelector (mMmCpuIo, RemoveApicId); + QemuCpuhpWriteCpuStatus (mMmCpuIo, QEMU_CPUHP_STAT_EJECTED); That is way too early -- given that the actual unplug will happen in SmmCpuUpdate() and given that the BSPHandler() would have waited for the APs multiple times before then. Another possibility is that the actual ejection be deferred to the _EJ0 method after the return from the SMI. But, that seems like a hack. Additionally, Igor points out here that this approach has problems: https://lore.kernel.org/qemu-devel/20201204170939.1815522-1-imammedo@redhat.com/ Please review. Thanks Ankur Ankur Arora (5): OvmfPkg/CpuHotplugSmm: move CPU Hotplug into PlugCpus() OvmfPkg/CpuHotplugSmm: handle fw_remove OvmfPkg/CpuHotplugSmm: add CpuStatus helper function OvmfPkg/CpuHotplugSmm: handle CPU hot-unplug OvmfPkg/SmmControl2Dxe: negotiate ICH9_LPC_SMI_F_CPU_HOT_UNPLUG OvmfPkg/CpuHotplugSmm/CpuHotplug.c | 293 ++++++++++++------ OvmfPkg/CpuHotplugSmm/QemuCpuhp.c | 58 +++- OvmfPkg/CpuHotplugSmm/QemuCpuhp.h | 6 + .../Include/IndustryStandard/QemuCpuHotplug.h | 2 + OvmfPkg/SmmControl2Dxe/SmiFeatures.c | 21 +- 5 files changed, 280 insertions(+), 100 deletions(-) -- 2.25.4