From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.groups.io with SMTP id smtpd.web12.1204.1610056211365252017 for ; Thu, 07 Jan 2021 13:50:11 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FsLU62Do; spf=pass (domain: redhat.com, ip: 63.128.21.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610056210; 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=psv12HLHdrXeg+8sU1CGf1bEGn5sMg89chBXWwNI/PQ=; b=FsLU62Do/FMuEYegW2ZQMD5mrQQSBVtSe/3+LwmkFGaSNI5eFR7So4r+drTkVI3yXJLR5u JNrHaAQtNBUgUfKyB4Mmr9qB934vbtyurbCtheSAyCEQKNN9+2pXvA0ZunhHTSMMloSv8E ASkSRQ5ldbBqbB0fJbw6BDqvgmlhCLg= 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-396-INH819LjPZiwt34sDbx5Tg-1; Thu, 07 Jan 2021 16:50:06 -0500 X-MC-Unique: INH819LjPZiwt34sDbx5Tg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0A936AFA80; Thu, 7 Jan 2021 21:50:05 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-164.ams2.redhat.com [10.36.112.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8232C3A47; Thu, 7 Jan 2021 21:50:02 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v2 05/10] MdePkg: add MmRegisterShutdownInterface() To: Ankur Arora , devel@edk2.groups.io Cc: imammedo@redhat.com, boris.ostrovsky@oracle.com, Jian J Wang , Michael D Kinney , Liming Gao , Zhiguang Liu , Eric Dong , Ray Ni , Rahul Kumar , Aaron Young References: <20210107195515.106158-1-ankur.a.arora@oracle.com> <20210107195515.106158-6-ankur.a.arora@oracle.com> <6893343b-bfb0-2b2b-4954-72a2ad838c48@oracle.com> From: "Laszlo Ersek" Message-ID: <9b0d6ff4-dad9-1ab0-e4dc-e9cc738f62fb@redhat.com> Date: Thu, 7 Jan 2021 22:50:01 +0100 MIME-Version: 1.0 In-Reply-To: <6893343b-bfb0-2b2b-4954-72a2ad838c48@oracle.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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/07/21 22:19, Ankur Arora wrote: > On 2021-01-07 12:48 p.m., Laszlo Ersek wrote: >> We should limit ourselves to modifying only the contents of >> SmmCpuFeaturesRendezvousExit() in OvmfPkg/Library/SmmCpuFeaturesLib. > > That was my initial approach. The problem that ran into was that which > CPUs to eject depends on state held in OvmfPkg/CpuHotPlugSmm (see patch 8) > which, I could not figure out a way to make that available given that the > libraries are linked statically. [...] > Could you take a look at patch 8? That's really the crux of the series Indeed. The proposal I just sent elsewhere in this patch#5 sub-thread addresses exactly that. It's a frequent cross-driver communication pattern in edk2, utilizing dynamic PCDs (platform configuration database entries). The tricky part with this pattern is always proper serialization (make sure the publishing driver always performs the PcdSet before the consuming driver performs the PcdGet). This is often achieved with a DEPEX. Luckily, in this case, such a depex (and indeed an earlier instance of this exact same pattern) is already in place between PiSmmCpuDxeSmm and CpuHotplugSmm, so you can imitate it. In the other email, I laid out the suggested steps. Thanks! Laszlo