From nobody Thu Nov 14 16:58:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+70878+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+70878+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one); dmarc=fail(p=none dis=none) header.from=oracle.com Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1611882200161737.5762230152853; Thu, 28 Jan 2021 17:03:20 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id DW5vYY1788612xdhClAFoRI9; Thu, 28 Jan 2021 17:03:19 -0800 X-Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by mx.groups.io with SMTP id smtpd.web11.3165.1611882194308091904 for ; Thu, 28 Jan 2021 17:03:14 -0800 X-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 10T0dvT0041186; Fri, 29 Jan 2021 01:03:10 GMT X-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 368b7r6v8r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Jan 2021 01:03:09 +0000 X-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10T0duse084583; Fri, 29 Jan 2021 01:01:09 GMT X-Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2170.outbound.protection.outlook.com [104.47.56.170]) by userp3020.oracle.com with ESMTP id 368wjutpx7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Jan 2021 01:01:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Cvn+FtmixTjPMFGiLq2KiSHKnzqxYl1tzQCJhJxPbjbtg7S4PYGj9PBcyl0Tsa0aP25jUVWVbsV1yHcTr13EHBwoUVFsAx2Kl4YBi06FgI33hNGhIgUUtKktLHGJX39/XZieeRzjhB3I2+wCYq4RSl7+Hvl4MmqpJ8dquySSBtBhc6Qg8AS3W0P6yUgLc83CNgSZeIs7CX9UULnzGWFXOGSl90ZporXvxjscDx1dMybUL616aohQ5lhYDgs3YgA3yD3Mx91nFqwEW80Bv9895mla7kUCAY/V9519KH6MD1X2fuZ6PiJA47woX0GvVTWn8/5oZKggCvwd5UAHJo8S6w== 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=36qBbBe5dOPYeRoLF8Xd0QOYo8RDNVjRX3kTgxR0JyU=; b=WVQb2bG/jeFeut5abVjwdquWSQsEqEPZjskrQPMPbb1/XgcK9IJB8bnMOL0VFCzcfY/q/SBEBRC1fO4dQQg+JnO2WH2KSFSo8YbAnP1lfUXWyGi4j2vv9UlAAF8GHrpuhsQw98+kjcR79/GNWpCYe3Y6lfV4yRHGtWi+O22rFJzV9kO74WTBFKDDWBMCY2uThkgCLJcXli3eHO6NqU7kqOPsJA5urlo1l0vFQACLBw+nP/YR+ZDW5RolKOQSFMkHCiEPesCb6cTfuJHg7Z0yM9Xnj4UM1trcKQ1452q00HFlrXZi4miIF9l3VO3Vam4my6RkqEEHJKfE023F96P+Tg== 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 X-Received: from CY4PR10MB1718.namprd10.prod.outlook.com (2603:10b6:910:9::17) by CY4PR1001MB2246.namprd10.prod.outlook.com (2603:10b6:910:41::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.16; Fri, 29 Jan 2021 01:01:06 +0000 X-Received: from CY4PR10MB1718.namprd10.prod.outlook.com ([fe80::39dc:6ba7:9397:cb6]) by CY4PR10MB1718.namprd10.prod.outlook.com ([fe80::39dc:6ba7:9397:cb6%6]) with mapi id 15.20.3805.019; Fri, 29 Jan 2021 01:01:06 +0000 From: "Ankur Arora" To: devel@edk2.groups.io Cc: lersek@redhat.com, imammedo@redhat.com, boris.ostrovsky@oracle.com, Ankur Arora , Jordan Justen , Ard Biesheuvel , Aaron Young Subject: [edk2-devel] [PATCH v6 9/9] OvmfPkg/SmmControl2Dxe: negotiate CPU hot-unplug Date: Thu, 28 Jan 2021 16:59:50 -0800 Message-Id: <20210129005950.467638-10-ankur.a.arora@oracle.com> In-Reply-To: <20210129005950.467638-1-ankur.a.arora@oracle.com> References: <20210129005950.467638-1-ankur.a.arora@oracle.com> X-Originating-IP: [148.87.23.8] X-ClientProxiedBy: MWHPR1401CA0022.namprd14.prod.outlook.com (2603:10b6:301:4b::32) To CY4PR10MB1718.namprd10.prod.outlook.com (2603:10b6:910:9::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Received: from prion.us.oracle.com (148.87.23.8) by MWHPR1401CA0022.namprd14.prod.outlook.com (2603:10b6:301:4b::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.17 via Frontend Transport; Fri, 29 Jan 2021 01:00:08 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ec8659c4-0b50-4212-4fe5-08d8c3f139c7 X-MS-TrafficTypeDiagnostic: CY4PR1001MB2246: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: PSfKCr4ixzWzgbpxdu4H+SdG+gI1nZmF4GAbLPVQIcd+vUB25sGyPccNlRwFFgKIZFgeI9Sqyis8VSZp0Fgc6tYVKixl43vXjPa5UD1SEdebI2TwxGje1hbMzZ0nOhagmMr6g4zxLGtlU0dhNZwUIPvVuo8sLhJwv4xs9BCN78agNl81d534H7Oli/ReZZkV737HGk9Ol16swXeIFevhfZughL2D+f3YrwPQx1yr8bbjzH6n1/MKdi3qLEEIyBbn7YRbsKnreZz4XaXf2MkRisxi8dJSF68Evi2kIbNtm/DwX0qOQHmRNstZpHJPncEGuco0Ady/1uWI4drE79+qCUucbZaBbZdebMu1YL2b/5EoOtVRSmizqAdB8P/dxKlW1lMXuYaqaqBZcHAdCZdZq2aaVwdXigmjwWsz7m9ZO9De+jv4H7dxgP3zStrLp7oIH6p0J4xry8EH1nv/GPOUgOnFbBZPCuUL/0VHmZySSc3mACeR8IWORwTHI5Ag3BTkw25j5GPQeQ4UPRvpmTAD/+U4AWF518yizssKLAyQhbX+QcZWY3BMzpoDER15l/nYkYdNPp+yu50mGPGQ+WLkV0JlSu70fqPBCB/asKEYcmI= X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?4kIu5JAIE6IUBErz/c3xJyesRoz3XvSdb4in7Jh+N1Wak4P3PMESlpRqekxG?= =?us-ascii?Q?dHX0gsW9o/quxeuQhbRLsd9p0+XvMDHlEpMblhsccV0fDimH5oP5AUKRrbJU?= =?us-ascii?Q?6PTT3VlHXVxZxOxOTGmoeO4lZzrRbJCkSixk031IvpqBwF+1dCK6fgXT/D2b?= =?us-ascii?Q?Grtao4A7GSBKcSRQKzUIcWLgJ1wMweDtxcUrxFtHiaVsF9GNwxyTmdfMu0gd?= =?us-ascii?Q?6ib6xRcxSyyU3G61VUpYzbJylPZYMCTn/u7SlIbqddnwZ5Nai/NUJkE0zUuW?= =?us-ascii?Q?MP9O4tc9eVmh9ICI+utcZF3GBszZSHDErwWu2V8/kBdEEKSa3jzu7sebzVQB?= =?us-ascii?Q?X3dzrwGhZa7qAxok5/+rPT07EQUjyuST0Y+uhf+iDxl7/PoFMA0ruzFslLjF?= =?us-ascii?Q?NhmNholNKrHGeXq7oatZkMzIwjE7VCpgVhfkjlurVe5Mi0OAuvEhmPSOz1al?= =?us-ascii?Q?dLpAHF/ndN0wDJ0WL4vCRnROeEZxzGoXbVmx3yDp90uQD9vBggUcM6oLQ1Ak?= =?us-ascii?Q?wwHVKGQdAUZQ5TY6etRr/l2/4eJbFk8G7EgcHB+yLXolQGQVST3OVOCozCR+?= =?us-ascii?Q?tFIvL722ou8dyN2j4J5jUrQFNeKx0/yVScgfsTZGihIz7e8MwEIfgDs12oEB?= =?us-ascii?Q?6nfBuQKfuzPILQZIzVo2LfCTJrkFYdpWsI6WYqUbQy0h1qbxUDZ0o23MBk9z?= =?us-ascii?Q?Jk1NEN54Qatf6Ynp1F6R9JQUohuWG/95CPDhLVwnnrWQ0bUsjI604T1zQeO3?= =?us-ascii?Q?wVjQi5jnge1uPwBI9Cud+tbu/dNptaG2XCfI+IMVInt3uAppWiD4n/TwvRPk?= =?us-ascii?Q?SIc4V27ck1HjFmS3wehqE04D7wJDS/Z36Gi7fYy+6UBB2hA/YHyPh08+ytnu?= =?us-ascii?Q?rrHCnsfUqnmPcHN7aUsmGijZsVbCSTfBLbkyPFb3JUoCw4+ukqA36MwZFVOG?= =?us-ascii?Q?2uE9E4DmUbJXJwM35dwrsfbDW8A9H1hgU4lQ5o5Tm+zy/3xQCBEyAFjKIi8B?= =?us-ascii?Q?QN708PzmNQSlJUxKxzWiVyMI6HtETe1jXw6X0qgUj4T71zoK4KfXUpjaqWqH?= =?us-ascii?Q?gUNIOz9j?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ec8659c4-0b50-4212-4fe5-08d8c3f139c7 X-MS-Exchange-CrossTenant-AuthSource: CY4PR10MB1718.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2021 01:00:09.8952 (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: 4lONGSThHdZBDeHgCxovl2n4+VWnbrbHsPOGSxupWtzNCO9ZKIqprzT1+mvzqUThudl+ZBTVnY1MrWWqnoGp9f11fRfCgNISvcAwvNGoX4U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1001MB2246 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ankur.a.arora@oracle.com X-Gm-Message-State: HletZVujWwpJiqoMkkWWFuP4x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1611882199; bh=ITOpNsdfDpYa2b2FpD3n6KQstIUI2WBtseFrMjv5WXA=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=IkMgalLQUEs0TrWoa3J5OhH6xqPyT1sar98xtqLzI7tUvJltS/SRYp0y96NGEZESKwK QrQSLbTqsqgkan4HH50xgE5JVZ+C5d77OY2lKo3AYvZet2Vcdd+MCArJxkAbrDrq0N13D O3lgUR0XWcaw4Z+WAQwZ9hj5qvw/RMbP5/k= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" As part of the negotiation treat ICH9_LPC_SMI_F_CPU_HOT_UNPLUG as a subfeature of feature flag ICH9_LPC_SMI_F_CPU_HOTPLUG, so enable it only if the other is also being negotiated. Cc: Laszlo Ersek Cc: Jordan Justen Cc: Ard Biesheuvel Cc: Igor Mammedov Cc: Boris Ostrovsky Cc: Aaron Young Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3132 Signed-off-by: Ankur Arora --- OvmfPkg/SmmControl2Dxe/SmiFeatures.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c b/OvmfPkg/SmmControl2Dxe/= SmiFeatures.c index c9d875543205..e70f3f8b58cb 100644 --- a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c +++ b/OvmfPkg/SmmControl2Dxe/SmiFeatures.c @@ -29,6 +29,13 @@ // #define ICH9_LPC_SMI_F_CPU_HOTPLUG BIT1 =20 +// The following bit value stands for "enable CPU hot unplug, and inject a= n SMI +// with control value ICH9_APM_CNT_CPU_HOT_UNPLUG upon hot unplug", in the +// "etc/smi/supported-features" and "etc/smi/requested-features" fw_cfg fi= les. +// Is only negotiated alongside ICH9_LPC_SMI_F_CPU_HOTPLUG. +// +#define ICH9_LPC_SMI_F_CPU_HOT_UNPLUG BIT2 + // // Provides a scratch buffer (allocated in EfiReservedMemoryType type memo= ry) // for the S3 boot script fragment to write to and read from. @@ -112,7 +119,8 @@ NegotiateSmiFeatures ( QemuFwCfgReadBytes (sizeof mSmiFeatures, &mSmiFeatures); =20 // - // We want broadcast SMI, SMI on CPU hotplug, and nothing else. + // We want broadcast SMI, SMI on CPU hotplug, on CPU hot-unplug + // and nothing else. // RequestedFeaturesMask =3D ICH9_LPC_SMI_F_BROADCAST; if (!MemEncryptSevIsEnabled ()) { @@ -120,8 +128,18 @@ NegotiateSmiFeatures ( // For now, we only support hotplug with SEV disabled. // RequestedFeaturesMask |=3D ICH9_LPC_SMI_F_CPU_HOTPLUG; + RequestedFeaturesMask |=3D ICH9_LPC_SMI_F_CPU_HOT_UNPLUG; } mSmiFeatures &=3D RequestedFeaturesMask; + + if (!(mSmiFeatures & ICH9_LPC_SMI_F_CPU_HOTPLUG) && + (mSmiFeatures & ICH9_LPC_SMI_F_CPU_HOT_UNPLUG)) { + DEBUG ((DEBUG_WARN, "%a CPU host-features %Lx, requested mask %Lx\n", + __FUNCTION__, mSmiFeatures, RequestedFeaturesMask)); + + mSmiFeatures &=3D ~ICH9_LPC_SMI_F_CPU_HOT_UNPLUG; + } + QemuFwCfgSelectItem (mRequestedFeaturesItem); QemuFwCfgWriteBytes (sizeof mSmiFeatures, &mSmiFeatures); =20 @@ -162,8 +180,9 @@ NegotiateSmiFeatures ( if ((mSmiFeatures & ICH9_LPC_SMI_F_CPU_HOTPLUG) =3D=3D 0) { DEBUG ((DEBUG_INFO, "%a: CPU hotplug not negotiated\n", __FUNCTION__)); } else { - DEBUG ((DEBUG_INFO, "%a: CPU hotplug with SMI negotiated\n", - __FUNCTION__)); + DEBUG ((DEBUG_INFO, "%a: CPU hotplug%s with SMI negotiated\n", + __FUNCTION__, + (mSmiFeatures & ICH9_LPC_SMI_F_CPU_HOT_UNPLUG) ? ", unplug" : "")); } =20 // --=20 2.9.3 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#70878): https://edk2.groups.io/g/devel/message/70878 Mute This Topic: https://groups.io/mt/80199973/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-