From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by mx.groups.io with SMTP id smtpd.web11.2274.1612407511759118125 for ; Wed, 03 Feb 2021 18:58:31 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@oracle.com header.s=corp-2020-01-29 header.b=QhJVd9Rl; spf=pass (domain: oracle.com, ip: 156.151.31.86, mailfrom: ankur.a.arora@oracle.com) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1142sp42112989; Thu, 4 Feb 2021 02:58:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=ZcgwpHfkzd9EdEQrqIz0D4vqliuf72VbsE9XmKtm5bw=; b=QhJVd9Rlwqb8B5shw9UglkxjZ6R5q2RpCLnCfEVuqRWTPnJCRFwdlX1mL6TTXBGQ4u4Z FzdvBKN85UOomJsKe0JwzDCU8aYqHGT5GHHIrRHPc7lRadSRiM+1s2aE0BjtsRlH7MBk Bk4wPI7xe/FdiWon5IASQtofDAsE5hKyiqPLSHkRnsS1+Tt1Y+DzY3PZ8MlubCCQGV0D cOz/fryYFwHEQEWRoMwYiFzS9LyNp6Cw+TIEd9arLNW8SoXZUw5aflFJN5QIH5zzkFhj VRMB7+KUWX1FzM7vD2mSvbN1PJilo6jExqNSUHUeSEHTLGGsCyh61PtuyZdIvKwk210X Yw== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 36cxvr5wp0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Feb 2021 02:58:28 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1142tfHv143676; Thu, 4 Feb 2021 02:58:27 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2177.outbound.protection.outlook.com [104.47.56.177]) by aserp3030.oracle.com with ESMTP id 36dh1ru7ue-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Feb 2021 02:58:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K70zxAarT6FATPSGmtYXc48yXsvqA90sLbdGyEP4VLndhE23tWd25yBJEnnvndg+OFOWCQeL9QfTZE+Cy9L4VH2Iap+drlERGt2JRB7hivyNI5cAca+91RL+CaWG4p3HYxF6CEVPbNVQAbdF+vAumvcc1595QbX3upSHkKpCb13Y+TPYJN/8WbTTXpuFw2P+eMSHqi9hOvnNhWa0Ba8YQ51KrPXVoDZh5Agl954Fuj0m6UebJP0sRe0XbxXgYtAWoqI+l1cKgu2iU6uvr1QFzAkRYNP/3nrTE1YY1+KLRWguW3aiVOt46TN3pw+sRylK0DjX5ABKMl0f85vMEdEeUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZcgwpHfkzd9EdEQrqIz0D4vqliuf72VbsE9XmKtm5bw=; b=Fwy8zHYFMZalDu0SclxPVIWIz/EcsieDbT4406GTGSONw6V8GNtIHbx6fD4BTBL4KEpPi3yrnu1REM6Jho62iDjLU8/eeNPqQvwpNcc/CGbh4HNeBNRaVyGWVnw5x3q6dOZq4u5xvR2eV6hKqMspb/hZZSprFzRKkZa3yVihR2MLen35Wd2+trDbo+lU8IYZtDNIgeAspPsl+XdZscS3E2sttEvKIo8booQMCuQy1dInvOrCJIY6ZASFHun13upYneGWFNmnOJRIpvjLwNBwbCp0cS/F1jf3j2Z8Fy1UYiAXV4cONE/GdQaYxIf+5kkSFkHg8tq8Yw5CPF6uHR/aUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZcgwpHfkzd9EdEQrqIz0D4vqliuf72VbsE9XmKtm5bw=; b=Qg2GF+XH8+4lHY8bfbTtvESrKnShbcpPfQ6XlxqjCuB93QYLPMr+4NH76ZFT5M6Dapo1uaZXDvWb23FfSJNOJ4Y78dUK/vle0tZS9nJV7CZhF/sMMHRMGesJxvNF98O5g1Eu6eg2l/QGSjls6y6e3xFD2yRDM1Sbljvf8FAlJGs= Received: from SJ0PR10MB4605.namprd10.prod.outlook.com (2603:10b6:a03:2d9::24) by BYAPR10MB3607.namprd10.prod.outlook.com (2603:10b6:a03:121::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.24; Thu, 4 Feb 2021 02:58:25 +0000 Received: from SJ0PR10MB4605.namprd10.prod.outlook.com ([fe80::b1e9:811d:aa8e:f62a]) by SJ0PR10MB4605.namprd10.prod.outlook.com ([fe80::b1e9:811d:aa8e:f62a%6]) with mapi id 15.20.3805.028; Thu, 4 Feb 2021 02:58:25 +0000 Subject: Re: [PATCH v6 6/9] OvmfPkg/SmmCpuFeaturesLib: init CPU ejection state To: Laszlo Ersek , 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> <94129935-fee5-f09c-5913-fdee5c8e52d1@redhat.com> From: "Ankur Arora" Message-ID: Date: Wed, 3 Feb 2021 18:58:22 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 In-Reply-To: <94129935-fee5-f09c-5913-fdee5c8e52d1@redhat.com> X-Originating-IP: [148.87.23.5] X-ClientProxiedBy: MW4PR04CA0435.namprd04.prod.outlook.com (2603:10b6:303:8b::20) To SJ0PR10MB4605.namprd10.prod.outlook.com (2603:10b6:a03:2d9::24) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.0.108] (148.87.23.5) by MW4PR04CA0435.namprd04.prod.outlook.com (2603:10b6:303:8b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.21 via Frontend Transport; Thu, 4 Feb 2021 02:58:24 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3efea968-fbf7-4777-3e78-08d8c8b8bd6d X-MS-TrafficTypeDiagnostic: BYAPR10MB3607: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Gla5X1m+aAmTp5/D4D1U2Xmw1VG8wG/Qdxf5xEp7uX7xaUIb/y8nZ6GbWsA1KjrsG1eFENg9dyaZSL9onqHMsWI/llHS9RIEXQM1omYkTJxpMIflNovPOljVBlfbV7oH0L2d+a0bJ1pV61eAA9V294XDUtUbXjnO8wwqaCFQtpam7117rOTGQ82VGrAFPMaEFMxugGM/8MUi22UEJzfZ9gR1kz6c5Y8kc30pwS5FUF0tRxMoodENkZIAoAUFQvznpNeWiX9BUaegDzmGO2viaVyTQ5N7jYP2cB23nqw4uuuRlHVhyv4klTTeAR/OfTQc/51sAJlkF3ChZpoSwRps9TRqAusgpstmK6/29FMcRg1CvW8kx5Y7idRrzZG18mrwXX3GoWh1MveZnq744i0yYk2LV+jBdpCVQTf0UI86ycjWZlGBZ3E3UlF74vWRIVyeoawLusZP3s2nh9kcXbQnDbo+jEuhG1LFTvVI+WS6eA8gsIuaaOnmzUf5dD9Pwmc9my8RW+1dnlOXugckelKvTbzMN+Bk9OC5wIx3Vy+MTPZE3jFKtZ4DRGGpbSRMtKhYeSUaV51jCLIX7FSae/zmyzAXHn4iCia53g8OAxB2BxY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4605.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(39860400002)(136003)(346002)(376002)(396003)(5660300002)(86362001)(53546011)(8676002)(26005)(186003)(16526019)(478600001)(36756003)(4326008)(956004)(31696002)(6486002)(2616005)(19627235002)(107886003)(316002)(8936002)(66946007)(66556008)(66476007)(54906003)(2906002)(31686004)(16576012)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?Um80cDdGeUJOTG9DZlhXdUw4SlpsRFZXN1FZeUkxWktKLzFFQmdhNURlOGli?= =?utf-8?B?ZDFBRjg3TDJLRU5pRVlvU3JpdktCTVFwd0l5YmZ1MlBVTG1VQnovb2Y4OW5a?= =?utf-8?B?blE4d1gyUksrWmRUak1NbmpEZysxOG1Qd3k3VjdjSW9iUFpHQ3Y4WmhsT3Ir?= =?utf-8?B?NTJINStQMTlCNGQzc1BQaDBwaUNsTXp5QWQ4cTFCZUdjeHZmd3pYRXZvNU40?= =?utf-8?B?ZWJPbEdkZCtmbkFDeFlmUTdCMjZyNTQwUVhaaU5jREZVZU16MzF1T0NCQktm?= =?utf-8?B?eFZmVGRpNVVRcTA5TjdDejhDdW1kWUJLWmhPczZuNEVTNWtvRzhSZmlHQWcw?= =?utf-8?B?TVdKblpPcDkwWjhlTnMzVEgzNWxpSVUxMzBkQ3RWOVNkW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LL0t1dDZVQy8wOXhkTG5DU3JM?= =?utf-8?B?SkFnZ3JtUXk4UHJlc1ZETDFLQUZrdlZ4ajFzVzI2TW90UjRoL3phK1pQcWFs?= =?utf-8?B?dlRYMkdXQ2QxcTlLVCt4MzV5VWZlSGdkNk5jWCtpN2l6MEp0Z2Q5N09LeUdX?= =?utf-8?Q?OUYgcCEi?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3efea968-fbf7-4777-3e78-08d8c8b8bd6d X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4605.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Feb 2021 02:58:25.2029 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tMBYgshKU2mjh0JLxtmXt4G9myrDRBX7btxBVW5JIIRZD2jWXu/avcK7fiSrA4W9AkR9paOHneYZpRMGAEmY3BpyBhkeBS547lXChbOcslA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3607 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9884 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102040018 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9884 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 mlxscore=0 priorityscore=1501 spamscore=0 impostorscore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102040018 X-MIME-Autoconverted: from 8bit to quoted-printable by userp2130.oracle.com id 1142sp42112989 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2021-02-03 12:36 p.m., Laszlo Ersek wrote: > On 02/03/21 06:20, Ankur Arora wrote: >=20 >> 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=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0x8 >> /tmp/PiSmmCpuDxeSmm.dll.0k4hl8.ltrans1.ltrans.o >> >> .bss.mCpuHotEjectData >> 0x0000000000005110=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0x8 >> /tmp/CpuHotplugSmm.dll.ixiN9a.ltrans0.ltrans.o >> >> I imagine they do get unified in the build process later, but that's t= he >> point my understanding stops. >=20 > The PiSmmCpuDxeSmm binary has a (static global) variable called > "mCpuHotEjectData" via OVMF's SmmCpuFeaturesLib instance, from this > patch (patch#6). >=20 > 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.) >=20 > In other words, there's nothing common between the two variables, beyon= d > the name. If you rename the first to mCpuHotEjectData1, and the second > to mCpuHotEjectData2, just for the experiment's sake, nothing will brea= k. Yeah you are right. I completely forgot that I had defined mCpuHotEjectDa= ta in CpuHotplug.c and then assumed that it was because we link with SmmCpuFeaturesLib.a Sorry for the confusion. Ankur >=20 > PiSmmCpuDxeSmm and CpuHotplugSmm never get unified in the build process= ; > they are independent binaries. >=20 > Thanks > Laszlo >=20