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.web09.32253.1613978396461566180 for ; Sun, 21 Feb 2021 23:19:56 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=LtaWRum9; 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 11M7FAU5133303; Mon, 22 Feb 2021 07:19:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=9bkWGfoq1y7L5hpHb9XwV6nCkXOVbulHM1KyVz0wRtg=; b=LtaWRum9rR3NuNmEFNi1pYC+r3BZOnQYxhhRFPO3wHwjo9jewRmWQMixC/QMR39unnC0 nCQoNGD7H7AIdx9Z80113yq3k+V67Apk9r/K4DuTbeUK9X93BvrsjUCepsS582veZ6gb jnpbT44EGL7UWl/CX/0czXsrF/GGTcHE+FZOkAT0c7pw5/p5T0M+cpsKnd1d059HLKDM bQSClEEFGnhF1zteKUwsfzfY40DHycImCgvTE6n2widASzpoYIii0CPPQwiqGQ+fERI0 NZpDvdNY5nHZMhTg7oECKmpmcj4tybHX+OGxP6VU5PD8m5tSr6wvSbhlyErBJodx5ogT 0w== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 36tsuqtku4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Feb 2021 07:19:52 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11M7GSLC067574; Mon, 22 Feb 2021 07:19:51 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by aserp3020.oracle.com with ESMTP id 36ucawnxq0-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Feb 2021 07:19:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B+/0Vw3bOBgGx5tQ35WhfYzIYuayAhIW7PtjIJkTvCJ3x9IVe+ptatJhJCS1jdVeVXyia6XsGgWdXOdGQ4G2BwLbtDowGd3kkpRHg7ihOQ/ZpD7bCUgdVajll7EKIpqXg64jJ2J9iida9MEBL1dcDvHARQXw/MZdszlMVg/8q61ajjdcNEByGyKSi+/Wi38V4OOSVb+NbbVvGdIVkSVT+HAisawt+MIgH7tHuvFzVxYshdi2V/aiX0RrilRCUoeYu091coYhR5jD7oM+Pakx1U8zI1LgLB4N3tP03WwbMyoag1E4lglCg0OKVxry9oj7SHX31Md6giL9Bf7gWbFfpA== 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=9bkWGfoq1y7L5hpHb9XwV6nCkXOVbulHM1KyVz0wRtg=; b=dv+wo3u7+FaeU0aKV3YsWlgqP3SiQa/GShEqUfK9EZrCsh/gS3mt6PJx3Nw0H02n6DUe+8nQPuDkmAcinYDmApoJS90AR15bN3aefuSS++YcveYAyV+YrVDSNfd+HdhU3XpdY5mHNu7mtjtYNfwVuNEbb4VjUI3+P90oWSyAnYjv+hwmGjcEi0Ab5JZlWmIf6/IKAPCIMMLCuhr2VLcIHJcxi8x+HUNOMH/wO0eRUIxZu8BdMkupyT/9NiS3q11+cE56sn4SFl/7g7sMzfVhjK7c1+BuXxaA7xvhbM3vnsGiKY4OC9o7Oq0A9q62O6M84Uz/yXJ7BLZ3eW4rKCzcEw== 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=9bkWGfoq1y7L5hpHb9XwV6nCkXOVbulHM1KyVz0wRtg=; b=FuKK7nWkbdRiwI1AR25GjRNWrtDjuL4nobgais8+8X7oUR8XygoKla4ifHqjosxKSwA4IYgTD8JZx0yMoFUHyeefjJNaENayuRcI0NV3wTOU85rynYEIuA5YXPs2Ap2pdjm7s4WqN9uN+pL44+l9V6CzIqtxS/aF9NNXwrkV1uw= Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=oracle.com; Received: from SJ0PR10MB4605.namprd10.prod.outlook.com (2603:10b6:a03:2d9::24) by BY5PR10MB3922.namprd10.prod.outlook.com (2603:10b6:a03:1fd::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.32; Mon, 22 Feb 2021 07:19:50 +0000 Received: from SJ0PR10MB4605.namprd10.prod.outlook.com ([fe80::a021:790:7ce6:6f16]) by SJ0PR10MB4605.namprd10.prod.outlook.com ([fe80::a021:790:7ce6:6f16%6]) with mapi id 15.20.3868.033; Mon, 22 Feb 2021 07:19:49 +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: [PATCH v8 10/10] OvmfPkg/SmmControl2Dxe: negotiate CPU hot-unplug Date: Sun, 21 Feb 2021 23:19:28 -0800 Message-Id: <20210222071928.1401820-11-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210222071928.1401820-1-ankur.a.arora@oracle.com> References: <20210222071928.1401820-1-ankur.a.arora@oracle.com> X-Originating-IP: [148.87.23.11] X-ClientProxiedBy: MWHPR17CA0065.namprd17.prod.outlook.com (2603:10b6:300:93::27) To SJ0PR10MB4605.namprd10.prod.outlook.com (2603:10b6:a03:2d9::24) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prion.us.oracle.com (148.87.23.11) by MWHPR17CA0065.namprd17.prod.outlook.com (2603:10b6:300:93::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.27 via Frontend Transport; Mon, 22 Feb 2021 07:19:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 93931eab-db88-4230-30f9-08d8d7023d8d X-MS-TrafficTypeDiagnostic: BY5PR10MB3922: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F3SEbQiu1n7jqQUf3fnlHEeiaf5OHSZNZ+Y4TsPULq16IKF0kg1K24QIaUfldBUwzU7ZXg/+OUGGHhertCMFfAXIuKRI8k/1cWSpsSW2d/KWrEys79NnON/zbDlshJVM31OaqRHcvFPETd/jeSSZ4Clssh7285dN/86LndAjyLefoYlOZBAfpgcFmPSlVxbjVPVj9d1w0359+EDkT/iwAdQVlQamoB0zRS55CR3IVq1UNJCh5SLQQY1j6OTsLqlNHQAfBCHlgLdR9TkkmRM+1eBu4FQVtXlXQpqQ3CgTptV9UElRBZg2nDJCvQhMMtjxBHsKrbeHX7v41EEUoxCjBaCYmwgxv746IVxo6MRgKMK8xUCk4L9shz/8bvDlVW98tu99CV8un2uJMkWQp90j0uEhNgL06IPU1rQnuzmOVbwPBNLfYnIhmWz2htwdS2FH/dvo2/d443/Cf1CrUi2vzz7DvHxLMWLo0wegHIpXj2FZrs92SSUJoxBdnFhr9qINir/kpuGFGfTYr3ooT9i92ZsCM8R65tOvod3r9LWfy5ofUZAQlykkHoPSyPYTt5JilhSQ4X6rpheGk5afsLF/tOaR+RQ0BZF1RouSCL3MhZg= 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:(396003)(376002)(39860400002)(346002)(136003)(366004)(6666004)(6486002)(6916009)(2906002)(86362001)(52116002)(1076003)(7696005)(316002)(36756003)(107886003)(4326008)(26005)(478600001)(2616005)(8676002)(8936002)(966005)(16526019)(5660300002)(186003)(54906003)(103116003)(66476007)(66556008)(66946007)(83380400001)(956004)(19627235002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?F3qei1Sb2soyURQDN4q4/Vz/LrOcEUL2Nb0S5UpNr6cyW5pI5Md0PfIeELXL?= =?us-ascii?Q?YDpzgdwZTtvW3HqqvtKdFWoipmX01q11Vf41B3BLX2lPVksl3vCndwmuuxN8?= =?us-ascii?Q?IkzY0AxjUQ6bk4VqVledsKXSvzIAOBh+lhsn64/v3E9ZRcs5SZPi9FTSjYzo?= =?us-ascii?Q?O9uxyqYHmnihyoVxYriBYRIs/c+/FfHieJ8ZKFU6AT3uNzWNGP+gOevNLX+x?= =?us-ascii?Q?MBo4vu+dSOUulZy8amoKPfyQc3yx/TEglv4+EF13Uyny3iQB67RyPd8k0amo?= =?us-ascii?Q?jNlYRREON2MtYx5yV8sj+fgNMLURk2+5ZB752Z7bFDWJ4WVy4G8EElkDt17G?= =?us-ascii?Q?uhmPhGAB1TpMoAdybnkpEWtaef/EKdbIJnOPmi2zeQ74ZRLirtQeZyfsGZTJ?= =?us-ascii?Q?2YZoqiX8ik08XEYcG8gKretGz5rticxtX1Vc7nxbeEe96RRY7TedsPSoIkcB?= =?us-ascii?Q?3SgxGNsv70pdxzFYMe4pYKc2JeqeVC1Emb2/U0oAZ83s16hfURdnwHOqRvNW?= =?us-ascii?Q?O2QExOIU6dYgxNkO/XiM4R6PlRklf//yuhpW2sZOxOJfb5KS6vd/JEx+imZW?= =?us-ascii?Q?JaL16dU88tyDUpQjw2GbEpmOlTEzerIVmwxmJjPgPIuaswb3/L5onhpe+KN/?= =?us-ascii?Q?TwxNXWI83ChE6ALuhqm9UcwRepRRkW+Cd0vyC5T28CvaJCyqUKpuHN5H3p9y?= =?us-ascii?Q?lTTBBOZHAjyKT8s7QSbasf5WOyGi7343qCs+4VCKheqdcekgHA4TEjBVOe2Y?= =?us-ascii?Q?NHPN2v7kNdQXmuey2/X1NH5z/Jx6Gqxoxcgl8fc/bG/RQTO+vkxvmmzSWpta?= =?us-ascii?Q?pBkY6J50zDq7mW8cXi54/n9+JqunvMUjf7rRKFLK31/ioL/KTMI9MvZrP+H7?= =?us-ascii?Q?Jp3CWm1djxFlA1gfDqZtwFeKInED39ClCgIb6pKymq5q/EhKQY2YJActpSkQ?= =?us-ascii?Q?myiDunO5BV9dSLurKaxelKa7pG4Q4jdSZNmQxl2Vo5oPjmaKpF8BVr6sgnw6?= =?us-ascii?Q?yTaCX5HOsPmPvamJS+ivcJBTetOumi843ASbpRbWY39as/yJn3491SggEim+?= =?us-ascii?Q?wTaZVY8Ohu1muHH58Zmf6SYs4dr0TxWCBcrjr929AUhmT1o6tONru4Ldp+iA?= =?us-ascii?Q?NIONISruWlZhKlRund7/uZN8g1ZQbQWV7Kn00EMqP+cl2LxzfyL+vc5uMNFj?= =?us-ascii?Q?crcjMuklVHFFlgSEeqqnmdEsFdiSg1GT/81w4yR/+gXoOJf+PjYcTnv4VoSX?= =?us-ascii?Q?et1l9JLgU4rV70APewb+1l3DgbdgufZWKu0LhNqwiN3y0b43OrjVcVBH49Pq?= =?us-ascii?Q?yAnwby3+h/DhHugH3Qvp3pVn?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 93931eab-db88-4230-30f9-08d8d7023d8d X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4605.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2021 07:19:49.6958 (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: vnVfv3rKh5PgFx0oksq9CZLlD4rCH7ZI7S2rmBSwrn+GtQJZ/1BuEiJI0B6cAAHmnp3cFzKxZ859FP12JebtbHMhPly3Cafd2VBk6FUGMxQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB3922 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9902 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102220064 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9902 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 mlxscore=0 malwarescore=0 clxscore=1015 phishscore=0 mlxlogscore=999 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102220064 Content-Transfer-Encoding: 8bit Content-Type: text/plain Advertise OVMF support for CPU hot-unplug and negotiate it if QEMU requests the feature. 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=3132 Signed-off-by: Ankur Arora --- Notes: Addresses the following review comments: (1,3) s/hot unplug/hot-unplug/ (2) Get rid of the reference to the made up ICH9_APM_CNT_CPU_HOT_UNPLUG (4,6) Remove the artificial tie in between ICH9_LPC_SMI_F_CPU_HOTPLUG, ICH9_LPC_SMI_F_CPU_HOT_UNPLUG. (5) Fully spell out "SMI on CPU hot-unplug". (7) Emit separate messages on negotiation (or not) of ICH9_LPC_SMI_F_CPU_HOT_UNPLUG. OvmfPkg/SmmControl2Dxe/SmiFeatures.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c b/OvmfPkg/SmmControl2Dxe/SmiFeatures.c index c9d875543205..b1d59a559dae 100644 --- a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c +++ b/OvmfPkg/SmmControl2Dxe/SmiFeatures.c @@ -29,6 +29,12 @@ // #define ICH9_LPC_SMI_F_CPU_HOTPLUG BIT1 +// The following bit value stands for "enable CPU hot-unplug, and inject an SMI +// with control value ICH9_APM_CNT_CPU_HOTPLUG upon hot-unplug", in the +// "etc/smi/supported-features" and "etc/smi/requested-features" fw_cfg files. +// +#define ICH9_LPC_SMI_F_CPU_HOT_UNPLUG BIT2 + // // Provides a scratch buffer (allocated in EfiReservedMemoryType type memory) // for the S3 boot script fragment to write to and read from. @@ -112,7 +118,8 @@ NegotiateSmiFeatures ( QemuFwCfgReadBytes (sizeof mSmiFeatures, &mSmiFeatures); // - // We want broadcast SMI, SMI on CPU hotplug, and nothing else. + // We want broadcast SMI, SMI on CPU hotplug, SMI on CPU hot-unplug + // and nothing else. // RequestedFeaturesMask = ICH9_LPC_SMI_F_BROADCAST; if (!MemEncryptSevIsEnabled ()) { @@ -120,8 +127,10 @@ NegotiateSmiFeatures ( // For now, we only support hotplug with SEV disabled. // RequestedFeaturesMask |= ICH9_LPC_SMI_F_CPU_HOTPLUG; + RequestedFeaturesMask |= ICH9_LPC_SMI_F_CPU_HOT_UNPLUG; } mSmiFeatures &= RequestedFeaturesMask; + QemuFwCfgSelectItem (mRequestedFeaturesItem); QemuFwCfgWriteBytes (sizeof mSmiFeatures, &mSmiFeatures); @@ -166,6 +175,13 @@ NegotiateSmiFeatures ( __FUNCTION__)); } + if ((mSmiFeatures & ICH9_LPC_SMI_F_CPU_HOT_UNPLUG) == 0) { + DEBUG ((DEBUG_INFO, "%a: CPU hot-unplug not negotiated\n", __FUNCTION__)); + } else { + DEBUG ((DEBUG_INFO, "%a: CPU hot-unplug with SMI negotiated\n", + __FUNCTION__)); + } + // // Negotiation successful (although we may not have gotten the optimal // feature set). -- 2.9.3