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.634.1608577749453783423 for ; Mon, 21 Dec 2020 11:09:09 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=vkmPpY3d; 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 0BLJ42Ia083875; Mon, 21 Dec 2020 19:09:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=M1svFbSBp5aozyVd7xM0RmYwP24qRjvIIokwnD1I/xg=; b=vkmPpY3dQA8o8dl49JO3lewlYntgdZ/mIMI/g+LJ3X1ESbS1EvXyOOjdWDVECd7LatB5 XUQWa45UTktUkI+6lNaALs1tYLsivpu01wNy/q2LX1HSd45OGcQ2WRdaNqZu9afyfX0H y6Yo+Rb9WR1hNBendMey2ji7iS5dWq8fSkbR70lLOobJXmzmG+UklBgas7xuRReWeMK7 NwgOznZouHKj5u0sottnXvBMxurvzgXQq8VvhozsUimLTMA8frx0aGe7LU4qv3zUYyVZ lzstcLV3JgL+t/ygWqGPQ78YoPnklI9+gpbRRiDs0DNjdELr3TsbFtzicSCQJA3Xwrrs vg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 35k0cw0b0a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 21 Dec 2020 19:09:05 +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 0BLIxVe1097701; Mon, 21 Dec 2020 19:09:04 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 35k0e03270-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 21 Dec 2020 19:09:04 +0000 Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 0BLJ924D010957; Mon, 21 Dec 2020 19:09:03 GMT Received: from [192.168.0.108] (/70.36.60.91) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 21 Dec 2020 11:09:02 -0800 Subject: Re: [edk2-devel] [RFC PATCH 0/5] support CPU hot-unplug To: Laszlo Ersek , devel@edk2.groups.io Cc: imammedo@redhat.com, boris.ostrovsky@oracle.com References: <20201208053432.2690694-1-ankur.a.arora@oracle.com> <70e6bf5d-3d59-2e6f-4b5a-2e68cdda8108@redhat.com> From: "Ankur Arora" Message-ID: <98d3701d-f51f-0909-fd79-9ed4338eb1d8@oracle.com> Date: Mon, 21 Dec 2020 11:09:01 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <70e6bf5d-3d59-2e6f-4b5a-2e68cdda8108@redhat.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9842 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 malwarescore=0 phishscore=0 mlxscore=0 adultscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012210130 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9842 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 mlxlogscore=999 mlxscore=0 priorityscore=1501 impostorscore=0 suspectscore=0 phishscore=0 spamscore=0 clxscore=1015 malwarescore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012210130 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 2020-12-21 6:44 a.m., Laszlo Ersek wrote: > Hi Ankur, > > On 12/08/20 06:34, Ankur Arora wrote: >> [ 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/ > > I've filed: > > https://bugzilla.tianocore.org/show_bug.cgi?id=3132 > > Can you please register an account in the TianoCore Bugzilla at > , and assign the above ticket to yourself? > > And then, the URL of the new BZ ticket should be included in every > commit message, like this: > > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3132 > > just above your S-o-b. Sure. Will do. > No need to repost just because of this; I'll review the RFC series later. Actually could you hold off before reviewing the RFC series. I'll be sending a v2 series shortly. That does the actual unplug via SmmCpuFeaturesRendezvousExit() (I had described the approach elsewhere in this thread.) Thanks Ankur > Thanks, > Laszlo > >> >> 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(-) >> >