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.2508.1612384617661557907 for ; Wed, 03 Feb 2021 12:36:58 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JAEJ0Bw3; 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=1612384616; 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=nXA2qnf6JYGOdlwtoF4Fcov0RSQQUxxDzR5PGN3BMPI=; b=JAEJ0Bw3+3xvOSSqqKQ8VRPjYb647XCseJqSPYeWyfXGjKWFfkR6G5/X3Bm5sIDoQPly3G 82NcubWseJX7FawB2eXk50wZXNN/XASugiA7FC7C2PHTyVXyzi616ho1Qe0InU1vHdXWHT iKQmp2m5M7+YZw/nfa/lKnKHuFlBxiI= 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-268-b3DdWKlOOtKWY3DRTklbCw-1; Wed, 03 Feb 2021 15:36:55 -0500 X-MC-Unique: b3DdWKlOOtKWY3DRTklbCw-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 CE887801962; Wed, 3 Feb 2021 20:36:53 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-32.ams2.redhat.com [10.36.113.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37F225D762; Wed, 3 Feb 2021 20:36:52 +0000 (UTC) Subject: Re: [PATCH v6 6/9] OvmfPkg/SmmCpuFeaturesLib: init CPU ejection state To: Ankur Arora , devel@edk2.groups.io Cc: imammedo@redhat.com, boris.ostrovsky@oracle.com, Jordan Justen , Ard Biesheuvel , Aaron Young References: <20210129005950.467638-1-ankur.a.arora@oracle.com> <20210129005950.467638-7-ankur.a.arora@oracle.com> <60b9b4ce-b4cc-1399-1ac9-77279762f331@redhat.com> From: "Laszlo Ersek" Message-ID: <94129935-fee5-f09c-5913-fdee5c8e52d1@redhat.com> Date: Wed, 3 Feb 2021 21:36:51 +0100 MIME-Version: 1.0 In-Reply-To: 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: 8bit On 02/03/21 06:20, Ankur Arora wrote: > Just as a sidenote, I do see two copies of the mCpuHotEjectData in > the PiSmmCpuSmm and CpuHotplugSmm maps (which makes sense, given > that both include SmmCpuFeaturesLib): > > .bss.mCpuHotEjectData > 0x0000000000017d60        0x8 > /tmp/PiSmmCpuDxeSmm.dll.0k4hl8.ltrans1.ltrans.o > > .bss.mCpuHotEjectData > 0x0000000000005110        0x8 > /tmp/CpuHotplugSmm.dll.ixiN9a.ltrans0.ltrans.o > > I imagine they do get unified in the build process later, but that's the > point my understanding stops. The PiSmmCpuDxeSmm binary has a (static global) variable called "mCpuHotEjectData" via OVMF's SmmCpuFeaturesLib instance, from this patch (patch#6). The CpuHotplugSmm binary has a (static global) variable called "mCpuHotEjectData" because the "CpuHotplug.c" source file defines that variable, from patch#7. (CpuHotplugSmm does not consume the SmmCpuFeaturesLib class -- it has no reason to.) In other words, there's nothing common between the two variables, beyond the name. If you rename the first to mCpuHotEjectData1, and the second to mCpuHotEjectData2, just for the experiment's sake, nothing will break. PiSmmCpuDxeSmm and CpuHotplugSmm never get unified in the build process; they are independent binaries. Thanks Laszlo