From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web12.16606.1611685088408062060 for ; Tue, 26 Jan 2021 10:18:08 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hd5qSPC8; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611685087; 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=vY1hLX1Sqq4Xvc6d/DxZ5GjLJGwDlYNNsEf5CAZr/D8=; b=hd5qSPC80C41NvrQnr06JBfDpSCnZ82OBQVgItvrJ1eNEbOnc426f9YNmsVFlomDY/s/L4 JeGd98v/N0wagICU/DUbn3u7HBAJkFtLJGj+tW1aaz8nJ6dOhjC4L8SvsZPHCTX8wpFCiJ Ok6sBa7rsz0Njk4UEAbJd9hUg8U/DOA= 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-385-16sJdiFVNISPmJyuIO43FA-1; Tue, 26 Jan 2021 13:18:05 -0500 X-MC-Unique: 16sJdiFVNISPmJyuIO43FA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1EA0210054FF; Tue, 26 Jan 2021 18:18:04 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-219.ams2.redhat.com [10.36.112.219]) by smtp.corp.redhat.com (Postfix) with ESMTP id E244919C46; Tue, 26 Jan 2021 18:18:02 +0000 (UTC) Subject: Re: [PATCH v5 0/9] support CPU hot-unplug To: Ankur Arora , devel@edk2.groups.io Cc: imammedo@redhat.com, boris.ostrovsky@oracle.com References: <20210126064440.299596-1-ankur.a.arora@oracle.com> From: "Laszlo Ersek" Message-ID: Date: Tue, 26 Jan 2021 19:18:01 +0100 MIME-Version: 1.0 In-Reply-To: <20210126064440.299596-1-ankur.a.arora@oracle.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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 01/26/21 07:44, Ankur Arora wrote: > 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. > > OvmfPkg/CpuHotplugSmm: introduce UnplugCpus() > OvmfPkg/CpuHotplugSmm: add CpuEject() > OvmfPkg/CpuHotplugSmm: add worker to do CPU ejection > > Patch 2 and 9, > ("OvmfPkg/CpuHotplugSmm: collect hot-unplug events") > ("OvmfPkg/SmmControl2Dxe: negotiate CPU hot-unplug") > handle the QEMU protocol logic for collection of CPU hot-unplug events > or the protocol negotiation. > > Patch 4, > ("OvmfPkg/CpuHotplugSmm: introduce UnplugCpus()") > adds the MMI logic for CPU hot-unplug handling and informing > the PiSmmCpuDxeSmm of CPU removal. > > Patches 5 and 6, > ("OvmfPkg/CpuHotplugSmm: define CPU_HOT_EJECT_DATA") > ("OvmfPkg/SmmCpuFeaturesLib: init CPU ejection state") > sets up state for doing the CPU ejection as part of hot-unplug. > > Patches 7, and 8, > ("OvmfPkg/CpuHotplugSmm: introduce UnplugCpus()") > ("OvmfPkg/CpuHotplugSmm: add worker to do CPU ejection") > add the CPU ejection logic. > > 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-v5 > > Changelog: > v5: > - fixes ECC errors (all but one in "OvmfPkg/CpuHotplugSmm: add > add Qemu Cpu Status helper"). > > v4: > - Gets rid of unnecessary UefiCpuPkg changes > URL: https://patchew.org/EDK2/20210118063457.358581-1-ankur.a.arora@oracle.com/ > > v3: > - Use a saner PCD based interface to share state between PiSmmCpuDxeSmm > and OvmfPkg/CpuHotplugSmm > - Cleaner split of the hot-unplug code > URL: https://patchew.org/EDK2/20210115074533.277448-1-ankur.a.arora@oracle.com/ > > 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 (9): > OvmfPkg/CpuHotplugSmm: refactor hotplug logic > OvmfPkg/CpuHotplugSmm: collect hot-unplug events > OvmfPkg/CpuHotplugSmm: add Qemu Cpu Status helper > OvmfPkg/CpuHotplugSmm: introduce UnplugCpus() > OvmfPkg/CpuHotplugSmm: define CPU_HOT_EJECT_DATA > OvmfPkg/SmmCpuFeaturesLib: init CPU ejection state > OvmfPkg/CpuHotplugSmm: add CpuEject() > OvmfPkg/CpuHotplugSmm: add worker to do CPU ejection > OvmfPkg/SmmControl2Dxe: negotiate CPU hot-unplug > > OvmfPkg/OvmfPkg.dec | 10 + > OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf | 1 + > .../SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf | 3 + > OvmfPkg/CpuHotplugSmm/QemuCpuhp.h | 6 + > OvmfPkg/Include/IndustryStandard/QemuCpuHotplug.h | 2 + > OvmfPkg/Include/Library/CpuHotEjectData.h | 32 ++ > OvmfPkg/CpuHotplugSmm/CpuHotplug.c | 450 ++++++++++++++++----- > OvmfPkg/CpuHotplugSmm/QemuCpuhp.c | 57 ++- > .../Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c | 68 ++++ > OvmfPkg/SmmControl2Dxe/SmiFeatures.c | 25 +- > 10 files changed, 552 insertions(+), 102 deletions(-) > create mode 100644 OvmfPkg/Include/Library/CpuHotEjectData.h > Comparing the maximum line lengths for each file modified, before and after the series: - before: 73 OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf 78 OvmfPkg/CpuHotplugSmm/QemuCpuhp.h 79 OvmfPkg/CpuHotplugSmm/CpuHotplug.c 79 OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf 79 OvmfPkg/CpuHotplugSmm/QemuCpuhp.c 79 OvmfPkg/Include/IndustryStandard/QemuCpuHotplug.h 79 OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c 79 OvmfPkg/SmmControl2Dxe/SmiFeatures.c 120 OvmfPkg/OvmfPkg.dec 120 total - after: 73 OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf 78 OvmfPkg/CpuHotplugSmm/QemuCpuhp.h 79 OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf 79 OvmfPkg/Include/IndustryStandard/QemuCpuHotplug.h 79 OvmfPkg/SmmControl2Dxe/SmiFeatures.c 85 OvmfPkg/CpuHotplugSmm/QemuCpuhp.c 90 OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c 91 OvmfPkg/Include/Library/CpuHotEjectData.h 97 OvmfPkg/CpuHotplugSmm/CpuHotplug.c 120 OvmfPkg/OvmfPkg.dec 120 total Please rework the patches that modify: 85 OvmfPkg/CpuHotplugSmm/QemuCpuhp.c 90 OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c 91 OvmfPkg/Include/Library/CpuHotEjectData.h 97 OvmfPkg/CpuHotplugSmm/CpuHotplug.c so that their line lengths remain under 80 characters. Thanks Laszlo