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.web09.1623.1608565608361550378 for ; Mon, 21 Dec 2020 07:46:48 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DzE9iO+X; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: imammedo@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608565607; 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=1TARyJYEUVxT+H96KPMA1NMbahWk8p/CM8iNwGbC/qg=; b=DzE9iO+XklszRq52A8y0VUg5HZhxrarHH1fKfi5SrZQwpu+soT+IGbuTdgaNfB4qENxEQB fS6ZR6V7VjW1QuiH8j2zJlzAItMzg8JahKWhiM17fkLzcxQoQj8a3OQyjEQxTZFEAar8Z+ sgD60S/1XdV2BJk+0CeIFC2CHn0tDFg= 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-127-JN_uVVKfOVu8X1_NdtMaDw-1; Mon, 21 Dec 2020 10:46:43 -0500 X-MC-Unique: JN_uVVKfOVu8X1_NdtMaDw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 31787801817; Mon, 21 Dec 2020 15:46:42 +0000 (UTC) Received: from localhost (ovpn-113-127.ams2.redhat.com [10.36.113.127]) by smtp.corp.redhat.com (Postfix) with ESMTP id E957D6064B; Mon, 21 Dec 2020 15:46:40 +0000 (UTC) Date: Mon, 21 Dec 2020 16:46:39 +0100 From: "Igor Mammedov" To: "Laszlo Ersek" Cc: devel@edk2.groups.io, ankur.a.arora@oracle.com, boris.ostrovsky@oracle.com Subject: Re: [edk2-devel] [RFC PATCH 0/5] support CPU hot-unplug Message-ID: <20201221164639.24f83ba4@redhat.com> In-Reply-To: <70e6bf5d-3d59-2e6f-4b5a-2e68cdda8108@redhat.com> References: <20201208053432.2690694-1-ankur.a.arora@oracle.com> <70e6bf5d-3d59-2e6f-4b5a-2e68cdda8108@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=imammedo@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 21 Dec 2020 15:44:35 +0100 "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. > > No need to repost just because of this; I'll review the RFC series later. BTW: meanwhile, QEMU part got merged so one doesn't need to hunt for it anymore. If something is broken there, we will have to fix it on top. > > 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(-) > > > > > > > >