From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.8997.1615903661132953204 for ; Tue, 16 Mar 2021 07:07:41 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=L7/vJFA/; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615903660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7MjgaEuR8cTxiEvYzShaXIka0bViujt4/Vn4KpsM74c=; b=L7/vJFA/kzFkOCdg9V7ijBTBMbj2+hIXEnnqzQi5ABjmeMgnJK1REi1LndO0E+1rv//CON tyH3Ctx0bf1Axx0KA5q9YRKC0J012Vu+VolGvZ0INxPRK3HytE5SXDnXhPgbj53fWkHx4k 4EZDKAyfXojC/bgy24sTTf0vukBDzd4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-22-suuDZx4sMKqIY64SBPbjKg-1; Tue, 16 Mar 2021 10:07:36 -0400 X-MC-Unique: suuDZx4sMKqIY64SBPbjKg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8B2001B2C989; Tue, 16 Mar 2021 14:07:35 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-138.ams2.redhat.com [10.36.114.138]) by smtp.corp.redhat.com (Postfix) with ESMTP id 62B596091A; Tue, 16 Mar 2021 14:07:34 +0000 (UTC) Subject: Re: [PATCH v9 00/10] support CPU hot-unplug To: Ankur Arora , devel@edk2.groups.io Cc: imammedo@redhat.com, boris.ostrovsky@oracle.com References: <20210312062656.2477515-1-ankur.a.arora@oracle.com> From: "Laszlo Ersek" Message-ID: Date: Tue, 16 Mar 2021 15:07:33 +0100 MIME-Version: 1.0 In-Reply-To: <20210312062656.2477515-1-ankur.a.arora@oracle.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 03/12/21 07:26, Ankur Arora wrote: > Hi, > > This series adds OVMF support for CPU hot-unplug. > > QEMU secureboot hot-unplug logic corresponding to this is in upstream. > Also posted here: > https://lore.kernel.org/qemu-devel/20201207140739.3829993-1-imammedo@redhat.com/ > > Testing (with QEMU 5.2.50): > - Stable with randomized CPU plug/unplug (guest maxcpus=33,128) > - Synthetic tests with simultaneous multi CPU hot-unplug > > Also at: > github.com/terminus/edk2/ hot-unplug-v9 > > Changelog: > > v9: > - Rebased on top of edd46cd407ea > - Clarify comments around memory-barriers in patches 7, 8, 9 > - Address other review comments from v8 Merged as commit range 4751a48aeb2a..f3bdfc41866e, via , with the following R-b's / comments / light tweaks added: > 1: 4b4466ed7c44 = 1: 0cb242e33693 OvmfPkg/CpuHotplugSmm: refactor hotplug logic > 2: 719828efdebe ! 2: a752dd07466c OvmfPkg/CpuHotplugSmm: collect hot-unplug events > @@ -20,6 +20,7 @@ > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3132 > Signed-off-by: Ankur Arora > Message-Id: <20210312062656.2477515-3-ankur.a.arora@oracle.com> > + Reviewed-by: Laszlo Ersek > > diff --git a/OvmfPkg/Include/IndustryStandard/QemuCpuHotplug.h b/OvmfPkg/Include/IndustryStandard/QemuCpuHotplug.h > --- a/OvmfPkg/Include/IndustryStandard/QemuCpuHotplug.h > 3: 7d732efcb7af = 3: 2d92e052c3af OvmfPkg/CpuHotplugSmm: add Qemu Cpu Status helper > 4: 64649eeeee42 = 4: 15e6ae8ea400 OvmfPkg/CpuHotplugSmm: introduce UnplugCpus() > 5: 7190a5d134a7 ! 5: 8ade9d425a6e OvmfPkg: define CPU_HOT_EJECT_DATA > @@ -15,6 +15,7 @@ > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3132 > Signed-off-by: Ankur Arora > Message-Id: <20210312062656.2477515-6-ankur.a.arora@oracle.com> > + Reviewed-by: Laszlo Ersek > > diff --git a/OvmfPkg/OvmfPkg.dec b/OvmfPkg/OvmfPkg.dec > --- a/OvmfPkg/OvmfPkg.dec > 6: 1fd019dac476 ! 6: b6d5996706dd OvmfPkg/SmmCpuFeaturesLib: init CPU ejection state > @@ -22,6 +22,7 @@ > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3132 > Signed-off-by: Ankur Arora > Message-Id: <20210312062656.2477515-7-ankur.a.arora@oracle.com> > + Reviewed-by: Laszlo Ersek > > diff --git a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf b/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf > --- a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf > 7: c8758d9b9764 ! 7: af9c77e151fa OvmfPkg/SmmCpuFeaturesLib: call CPU hot-eject handler > @@ -19,6 +19,7 @@ > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3132 > Signed-off-by: Ankur Arora > Message-Id: <20210312062656.2477515-8-ankur.a.arora@oracle.com> > + Reviewed-by: Laszlo Ersek > > diff --git a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c b/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c > --- a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c > 8: 5ff8e8700678 ! 8: 30c69d2cfa63 OvmfPkg/CpuHotplugSmm: add EjectCpu() > @@ -19,6 +19,7 @@ > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3132 > Signed-off-by: Ankur Arora > Message-Id: <20210312062656.2477515-9-ankur.a.arora@oracle.com> > + Reviewed-by: Laszlo Ersek > > diff --git a/OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf b/OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf > --- a/OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf > 9: d6660f8f2f14 ! 9: f05328886302 OvmfPkg/CpuHotplugSmm: do actual CPU hot-eject > @@ -27,6 +27,9 @@ > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3132 > Signed-off-by: Ankur Arora > Message-Id: <20210312062656.2477515-10-ankur.a.arora@oracle.com> > + Reviewed-by: Laszlo Ersek > + [lersek@redhat.com: unneeded inner QemuSelector declaration in EjectCpu() > + triggers VS warning #4456 (local variable shadowed); remove it] > > diff --git a/OvmfPkg/Include/IndustryStandard/QemuCpuHotplug.h b/OvmfPkg/Include/IndustryStandard/QemuCpuHotplug.h > --- a/OvmfPkg/Include/IndustryStandard/QemuCpuHotplug.h > @@ -102,8 +105,6 @@ > + UINT32 Idx; > + > + for (Idx = 0; Idx < mCpuHotEjectData->ArrayLength; Idx++) { > -+ UINT64 QemuSelector; > -+ > + QemuSelector = mCpuHotEjectData->QemuSelectorMap[Idx]; > + > + if (QemuSelector != CPU_EJECT_QEMU_SELECTOR_INVALID) { > 10: 0a9a1cd40b98 ! 10: f3bdfc41866e OvmfPkg/SmmControl2Dxe: negotiate CPU hot-unplug > @@ -14,6 +14,9 @@ > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3132 > Signed-off-by: Ankur Arora > Message-Id: <20210312062656.2477515-11-ankur.a.arora@oracle.com> > + [lersek@redhat.com: preserve the empty line between the ICH9_LPC_SMI_F_* > + group of macro definitions and the SCRATCH_BUFFER type definition] > + Reviewed-by: Laszlo Ersek > > diff --git a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c b/OvmfPkg/SmmControl2Dxe/SmiFeatures.c > --- a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c > @@ -22,16 +25,15 @@ > // "etc/smi/supported-features" and "etc/smi/requested-features" fw_cfg files. > // > #define ICH9_LPC_SMI_F_CPU_HOTPLUG BIT1 > -- > +// > +// The following bit value stands for "enable CPU hot-unplug, and inject an SMI > +// with control value ICH9_APM_CNT_CPU_HOTPLUG upon hot-unplug", in the > +// "etc/smi/supported-features" and "etc/smi/requested-features" fw_cfg files. > +// > +#define ICH9_LPC_SMI_F_CPU_HOT_UNPLUG BIT2 > + > // > // Provides a scratch buffer (allocated in EfiReservedMemoryType type memory) > - // for the S3 boot script fragment to write to and read from. > @@ > QemuFwCfgReadBytes (sizeof mSmiFeatures, &mSmiFeatures); > Thanks for the contribution, Laszlo