From nobody Mon Feb 9 08:15:50 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1768230228; cv=pass; d=zohomail.com; s=zohoarc; b=kYyY0AWD5T/VqM7kVxXw26aLejJRlM3VkRnedYTREuaEo+PR2f8Jiu19Cn0d5mlF3a2q0iiElEbUnSR9l19RTwYG/9siYvVK7HM8MgaAn6oGZsYD4mc38XgqdAFIfUYl6rUjCnpAto18stElciPmciRNd9krZBUnYRJyF/RUitA= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768230228; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=phk+SV0NvzOuegtvacWtWxrgPC5vdBqZsS7cba8pcHo=; b=aZvOsDTZEP/uKeEWLNGw/qqJyPvWmd95jtDPrH9heGI8eeUlIpuYiG2+P6VAXq6BCmHWtRvsb7oBgj1A0VdrpvYOfbAGGeIc0KrOAdGo2s59o8Fpdy4+aPqVNsKOWDAn4lhpNLQzBfNdlwN+txdBeYsWLHrN9b4JjPWM2ms3CTc= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1768230228306782.3953045085414; Mon, 12 Jan 2026 07:03:48 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1200491.1516403 (Exim 4.92) (envelope-from ) id 1vfJS6-0002IN-U1; Mon, 12 Jan 2026 15:03:30 +0000 Received: by outflank-mailman (output) from mailman id 1200491.1516403; Mon, 12 Jan 2026 15:03:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vfJS6-0002IG-R4; Mon, 12 Jan 2026 15:03:30 +0000 Received: by outflank-mailman (input) for mailman id 1200491; Mon, 12 Jan 2026 15:03:29 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vfJS5-0002Gh-J1 for xen-devel@lists.xenproject.org; Mon, 12 Jan 2026 15:03:29 +0000 Received: from BYAPR05CU005.outbound.protection.outlook.com (mail-westusazlp170100001.outbound.protection.outlook.com [2a01:111:f403:c000::1]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d4e9da5b-efc7-11f0-b15e-2bf370ae4941; Mon, 12 Jan 2026 16:03:21 +0100 (CET) Received: from MN0P220CA0018.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:52e::16) by MN0PR12MB6319.namprd12.prod.outlook.com (2603:10b6:208:3c0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9499.7; Mon, 12 Jan 2026 15:03:14 +0000 Received: from BL02EPF0001A104.namprd05.prod.outlook.com (2603:10b6:208:52e:cafe::c4) by MN0P220CA0018.outlook.office365.com (2603:10b6:208:52e::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9499.7 via Frontend Transport; Mon, 12 Jan 2026 15:03:05 +0000 Received: from satlexmb08.amd.com (165.204.84.17) by BL02EPF0001A104.mail.protection.outlook.com (10.167.241.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9520.1 via Frontend Transport; Mon, 12 Jan 2026 15:03:14 +0000 Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Mon, 12 Jan 2026 09:03:14 -0600 Received: from xcbagarciav01.xilinx.com (10.180.168.240) by satlexmb09.amd.com (10.181.42.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Mon, 12 Jan 2026 07:03:12 -0800 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d4e9da5b-efc7-11f0-b15e-2bf370ae4941 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qq7DU7JBv3op++sJHlFa2HdjdwXg26BcJj++veM1BCH7inmVtzAQsek+wUFbs77z5duD65TwOtGJf/eBXzaw/FGD2EJW0lzp/+X0AqsxtNu7hQIQZXQMcHARf7LPZ3xCVV86hECiN9f2/utIx8r0wxnkWvjbqb31HKgxJupC9wS+4xkOwUHN4wxwqQG910LKXensV2PKr4cvKbh5rbf40A31fsoSaYn0XThE1SylXIBhNUnEAAPZAmI5YVwHlH8PHK1mqHDutRuM358eNpxyUXHnwIY6XhEzBfc45jK5WNFjDTNulnDLQTjkXWQ0Y7CHvhDAuNwl+rmusSSOBs82tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=phk+SV0NvzOuegtvacWtWxrgPC5vdBqZsS7cba8pcHo=; b=grmxCvAkJquPa1YQaYNOQXkhmq5bxqlrjUIqJtjiogfrSCFHwnwZ9QiHTRIm8PJbTnKHHMe8Ufdkg9JchM22y1SFGRNIDPDLQFFDmVWil56gGfn+HdDdNGMjptMmD+sizdbVqWlcFLGXePN1B6bbs/Hoqkz95RFy4wD6k9h++pwVd+tWGeG3FAie6P5QkQhLabGpnRAMGN4MfK0/xl/tfeoR8RbJIWhlIBHPry4yVDp9lEDEvJpx00LT+jo9epnlgDoOKaZWEo9NEFOWPUB/wbjsg0dU8NX9vRvUYCNe2rkdI0v8/RaGgWDBMQ+Iwxge+eaRGd8ThP+DvpPEvA4Gmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=phk+SV0NvzOuegtvacWtWxrgPC5vdBqZsS7cba8pcHo=; b=2/Ble8uQA6IzkoW+a6+1sNEnTgScG7YfsV6OZhPKDblbc+Ux+JtaSf6sWio5tYmTwwxA+VciEogWm7zfelk9rxc8au6qOGAX8PUkAgZ3LmO76d/OuWr5unFvesPf73fxCOJvWHBe/10e2t8gCixqAz8sZTOJsatU0gXbvl5CKOk= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb08.amd.com; pr=C From: Alejandro Vallejo To: CC: Alejandro Vallejo , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v2 1/2] x86/ucode: Fix typo s/mitigiated/mitigated/ Date: Mon, 12 Jan 2026 16:02:55 +0100 Message-ID: <20260112150259.74535-2-alejandro.garciavallejo@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260112150259.74535-1-alejandro.garciavallejo@amd.com> References: <20260112150259.74535-1-alejandro.garciavallejo@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb09.amd.com (10.181.42.218) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A104:EE_|MN0PR12MB6319:EE_ X-MS-Office365-Filtering-Correlation-Id: 6032fdb2-e864-408b-a766-08de51ebb5e2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|36860700013|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?O8BmwpvLsr+zr/wyyZbQxl1f10kolt2Yx4kxGH5+njOQzlPFtzevo/bNU8C3?= =?us-ascii?Q?ApBVPPwxMdycxISGL+lQnzdKjhranQIdmXDSDDZptXjKp+EE9PiHF7784lOo?= =?us-ascii?Q?fo5gtgeWRCWCAm0KXdKhD/+HdwGiSfA7nKDysQSAyf7loVj0U9UV2m3WX74z?= =?us-ascii?Q?XPXFBaUIdkdp+G5cOSyaoNL+/wVutouSaJM5fq6FLxNCAF94/9UxRoFI1wf6?= =?us-ascii?Q?4rr6BPQsgakutZaBjEUMHuA4va77yI76UdCOYf1p+L6lGakWp4sIaVHMKYBL?= =?us-ascii?Q?8eWjPlhBhje5A50Kmkm3ovaTD04nhchAEnlIUQnwgwSlX2AzU1yFYgebrSDf?= =?us-ascii?Q?XGMwP1wn5aPHJCxBIdMX4sAXBcZqqlpxGKyRd42hHEoGsOuJvxuG+B53P3c3?= =?us-ascii?Q?IO6zTPRviwQ3wKOurIYlJY7NN3SPI77qz+zDhtX3KA2A1aTcln0+3NHQyyPF?= =?us-ascii?Q?pWQQ3chWXJwbE04JZQjMPTDIrrv0FTVVtruT2d4wdgEcwHoqG0zyoLwG+bK4?= =?us-ascii?Q?p0RckKVczyTwnqfZt7lHuuEU+46OUW3aiPQasExVFDkIcUOT5MHTRW9TM+D2?= =?us-ascii?Q?D5Fm7xqCXQcebxUwkJu5N3oiVf/HpSxFuuxuM/o+6Is5e5av0MGN1zLKTNHH?= =?us-ascii?Q?YT+ly0k6AlSifwUaSjBWRWxrj/bnKgcZOAGDx/KUfI3Ycdsyft3haY///mai?= =?us-ascii?Q?gIC9yxf4KlZvV+YfHcTYf1XOQrm26sXeOme+tZyGh8NJi8zVI4SkgdqW8v9C?= =?us-ascii?Q?y0s6wH7n53vaQB205v0X+t+9QInuRw9m4h4eN4kQhGRBxZ/Mj0r4D6N8H3SJ?= =?us-ascii?Q?Z7mQ/d8zdR0hRKNhgI/UUxo6IDNpkohjFyq8IVqSt1vGS/SN0AwrhrxgapDa?= =?us-ascii?Q?/CqxaM8JP8nbq2VoQZGH6kKnOrQ6C6ozIQKQKmz2wYiV3/IEdEH7e0Vb1K8T?= =?us-ascii?Q?WvaxrGRl056y+9y4elTQ8sg3rqenXxDTIttfzD4f9ZcC7J5l/xVV7Slgsfub?= =?us-ascii?Q?i7c50lU4UpG+wM65AqsoG0FmbeWgsgi63seZIGz4kIbm149IcZD0q2/MI7T4?= =?us-ascii?Q?WYxcdaYY7+kgIg+Sol7WXRaECltj4VhSsqY//IGcO5GU6cBvZjUH3w8ehRe1?= =?us-ascii?Q?p9D3R9gRGgLuw2rH+Fe0rDdRQ+loVH5wZ31IcsSRsf/Wr1uR6eYtlnzTmh+9?= =?us-ascii?Q?YdD72VlD/PoomPeUJ27mSxZAVRgAQt6r2HxUKRI9dqM03/FXrHt1k8GkmQGy?= =?us-ascii?Q?iJN0JFZ9V+k/npSuekpK8MWb3w7Cpi+/dA80R02xW4k+x+0u9RwSV4dGd8vp?= =?us-ascii?Q?TZ/dfXLwXGNA4VnSulSIYNL/leb2BC8vmblNcXJR5ue8RxVieSVbSKQTT4zG?= =?us-ascii?Q?NBdCxZ+Hd6ZKAlHTC87Sz7ow7aGCNsnRSw4iHUWK8W0ShyB8EcbR+fosVAmR?= =?us-ascii?Q?/3Bb3A0NSgMkgKtsmdogb0tCWN9genFWgMtvCM7XPvlYzlalnQOMU3UqqQVU?= =?us-ascii?Q?IeixhD/z2Un3QyKBZIV8g7d5aVOBVDtHjtnINTo24gJEPc0+6kgsc8hkR2OQ?= =?us-ascii?Q?hjdDraLqTgUL2GqaR4Y=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(36860700013)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2026 15:03:14.3451 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6032fdb2-e864-408b-a766-08de51ebb5e2 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb08.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0001A104.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6319 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1768230230040158500 Content-Type: text/plain; charset="utf-8" Not a functional change. Signed-off-by: Alejandro Vallejo Reviewed-by: Andrew Cooper --- xen/arch/x86/cpu/microcode/amd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/= amd.c index 2760ace921..71b041c84b 100644 --- a/xen/arch/x86/cpu/microcode/amd.c +++ b/xen/arch/x86/cpu/microcode/amd.c @@ -101,7 +101,7 @@ static const struct patch_digest { } patch_digests[] =3D { #include "amd-patch-digests.c" }; -static bool __ro_after_init entrysign_mitigiated_in_firmware; +static bool __ro_after_init entrysign_mitigated_in_firmware; =20 static int cf_check cmp_patch_id(const void *key, const void *elem) { @@ -127,7 +127,7 @@ static bool check_digest(const struct container_microco= de *mc) * the digest of the patch against a list of known provenance. */ if ( boot_cpu_data.family < 0x17 || boot_cpu_data.family > 0x1a || - entrysign_mitigiated_in_firmware || !opt_digest_check ) + entrysign_mitigated_in_firmware || !opt_digest_check ) return true; =20 pd =3D bsearch(&patch->patch_id, patch_digests, ARRAY_SIZE(patch_diges= ts), @@ -676,7 +676,7 @@ void __init amd_check_entrysign(void) */ if ( (uint8_t)curr_rev >=3D fixed_rev ) { - entrysign_mitigiated_in_firmware =3D true; + entrysign_mitigated_in_firmware =3D true; return; } =20 --=20 2.43.0 From nobody Mon Feb 9 08:15:50 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1768230223; cv=pass; d=zohomail.com; s=zohoarc; b=joy7SL01/t+HlTNOVsv9G4GhUHSdCWbQ2ps79IIdFRdQKDGVZSHDv6djWAvFqKQRYgviUZ95TJ1N85jcJRXk9WY+pjPgiB71JvBs0JjxcHqvoGZaVCjjl8/3ESKQnorewbNNXsmE7NytRo34TC4f1uw/YXPctrgGBhzOye/ZZZ8= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768230223; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ybbTcCzVlltRMz1WEtFiCbnEPeRN28eyOOsctOIRu60=; b=euzTxESUxKmzMh5nzbhrxsp8CvdxqS2/ul9Zciswx/SXKDLWtNjssj24tHTCB6qwqqOeXtNRHnaPUUFut1EiOV/nXaxAhG7zmH+mWkU2sxHFMPTpX9HklF7sGweWjUy0E7IeKXi7/1ll3Bf5CY0xS3v9voZCN4ICnt2iyDFHkyw= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1768230222978568.6217536979411; Mon, 12 Jan 2026 07:03:42 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1200489.1516393 (Exim 4.92) (envelope-from ) id 1vfJS0-000207-M4; Mon, 12 Jan 2026 15:03:24 +0000 Received: by outflank-mailman (output) from mailman id 1200489.1516393; Mon, 12 Jan 2026 15:03:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vfJS0-000200-JM; Mon, 12 Jan 2026 15:03:24 +0000 Received: by outflank-mailman (input) for mailman id 1200489; Mon, 12 Jan 2026 15:03:23 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vfJRz-0001lb-32 for xen-devel@lists.xenproject.org; Mon, 12 Jan 2026 15:03:23 +0000 Received: from CH1PR05CU001.outbound.protection.outlook.com (mail-northcentralusazlp170100001.outbound.protection.outlook.com [2a01:111:f403:c105::1]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d4d9e88a-efc7-11f0-9ccf-f158ae23cfc8; Mon, 12 Jan 2026 16:03:20 +0100 (CET) Received: from BL1PR13CA0341.namprd13.prod.outlook.com (2603:10b6:208:2c6::16) by BL1PR12MB5922.namprd12.prod.outlook.com (2603:10b6:208:399::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9499.7; Mon, 12 Jan 2026 15:03:16 +0000 Received: from BL02EPF0001A106.namprd05.prod.outlook.com (2603:10b6:208:2c6:cafe::c5) by BL1PR13CA0341.outlook.office365.com (2603:10b6:208:2c6::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9520.4 via Frontend Transport; Mon, 12 Jan 2026 15:02:58 +0000 Received: from satlexmb08.amd.com (165.204.84.17) by BL02EPF0001A106.mail.protection.outlook.com (10.167.241.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9520.1 via Frontend Transport; Mon, 12 Jan 2026 15:03:16 +0000 Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Mon, 12 Jan 2026 09:03:16 -0600 Received: from xcbagarciav01.xilinx.com (10.180.168.240) by satlexmb09.amd.com (10.181.42.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Mon, 12 Jan 2026 07:03:14 -0800 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d4d9e88a-efc7-11f0-9ccf-f158ae23cfc8 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VIOWvf9llHrf7CgvOdcvbewC39l5qyE+5XP3vn/8qku5mGjLxXrSxkOpwtJ7siop2of9eWACBoecvuUhU18rPLPZnkvwaKLn3mjyxPAGDStaTVG0uOVihkEKS4se6a0Bh76WtO/JWCWS4bwCLiNrV9Ygy9vCzcmv/bniObvKRsgdr7WdtnzVaB31paa5LK20kBKBGYKN9zfNi88Sr2oBZLh+HFvX30R+FWcaLhnqohNlotOEjE7iJy/yVaxglC1fdYLBnvtiS31/gK/avNSu7+iqW4kQYAdFSoHXair3EvDTCGG5jOzsx5rBGCoZ6ErjAq3+Z+1EXqgOnClv0yQyfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ybbTcCzVlltRMz1WEtFiCbnEPeRN28eyOOsctOIRu60=; b=c7Y8IaeQ79cABvJpdyycDKPxNk3r4WlJChd6YfWdaHiRZy2FT9Q/AQveRbhWvqGaOXDhv3ribkvtuQThVuF7Pti7YSeG78+9Dpp+vT42BZoiFCNtfXmGOgP1JjyhrPSHqY47O+QX5lv6CAEKFEZwSgxlSF+wwxsXmNXcptTq9Jl9RRNW6RrTW4ocKcN8FypVnS3a9d10Yppf4FLFYRLYZQH1GZBhVsQ39xDN3FGolX3b/md7n5yhJ4VOFStz1cbd+Au2yFPruupC28u6h/7ppTqQ/nykaMfC5LVJo66yCQrE5O34/cQjw7qta5whSBQ1axFL5Kwva/cO9K1b0NENoA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ybbTcCzVlltRMz1WEtFiCbnEPeRN28eyOOsctOIRu60=; b=HGz4s91IENQWxhiKD4G6grahQzeFvaDo28X5/pvkqVKIPuxUP9dh5R/e0ovQkUihSUwRzBYOhyRq30AM837enIVEG8j4iqRYQUc8L3IJfD63EsDErKJyqxGQICpy1rkcocGdRDqD72AZSgy4nVHxIpn1Du6mMjPNkwdCdD0W7hI= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb08.amd.com; pr=C From: Alejandro Vallejo To: CC: Alejandro Vallejo , Doug Goldstein , Stefano Stabellini , "Andrew Cooper" , Anthony PERARD , Michal Orzel , Jan Beulich , Julien Grall , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , "Daniel P. Smith" , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Subject: [PATCH v2 2/2] x86/ucode: Add Kconfig option to remove microcode loading Date: Mon, 12 Jan 2026 16:02:56 +0100 Message-ID: <20260112150259.74535-3-alejandro.garciavallejo@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260112150259.74535-1-alejandro.garciavallejo@amd.com> References: <20260112150259.74535-1-alejandro.garciavallejo@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb09.amd.com (10.181.42.218) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A106:EE_|BL1PR12MB5922:EE_ X-MS-Office365-Filtering-Correlation-Id: c843b0ac-36d2-4fa6-eee0-08de51ebb71e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|7416014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?lqEZFPsI9oVRxXBZfIaTS2B/OhXC/POf1rpauSXktFwHPOJRqweYOaFV09D5?= =?us-ascii?Q?iq+MkEgEoSq3I6P/1fezj0Y+o3rCHn22HMZxzWFkLQR2gdYayl3OnXeW3b8s?= =?us-ascii?Q?MZwYTNopKWo04UyAgN6rzsUnO001x1Zgawl5cbKR6kic2HuTgvUrQK69Ma+o?= =?us-ascii?Q?QB5gIu6c3/F3NLvKJ6P425AxTG3MGY4x3Ji6V6SiR0mmHGJe0RX3tPfClvCc?= =?us-ascii?Q?mp7Z8oa8ki5FLXWBnIKpty2XNQxL9rAM/lEUsDJDw9QdA1d8rX0jhWcqaAfc?= =?us-ascii?Q?kuN/9rk+VIt4KdD5FM8ni+eX3/dLxKG/9kOSiXQzBwbKocipeH7bqA9V+aqX?= =?us-ascii?Q?0RcxeOPCrH2uSUpvkIjt4d2nSt7qRoLmypUVElg570SXhWf2onJ0Exwfc/4o?= =?us-ascii?Q?naUO4Dz8c0ROZvTf6dqR5Uo7uFgqSOzA4JcSzt9h8qKEUZ3o++EaB5VAr2pP?= =?us-ascii?Q?tN1vl+tJzfmPPL8bW1YdP2BzxgNSzTB9dR7u0LgxQ88xxrGFSGvmqvFK9pNg?= =?us-ascii?Q?H7VwIwGcuBzdGZI+Kxup/TIxPyL3p+kHJ0rrz6izh0UitsHvcKTt76y+l31I?= =?us-ascii?Q?D9tw14HhYLu4Gm1vuOY1pmI0G2G5Lylj3mpUabrAQ6SWqg6kYeRihXaEaoe7?= =?us-ascii?Q?z65TcP6KCluWqnhVefgMKlN3W79S4R0qGg/8IyO1K37FyiaGw9N/Wm99mvHY?= =?us-ascii?Q?SqNcZGJlzeP4HAI18c3GVI6g7G6rpjUAt69Xv91VLCn8W4eTe69dthP6TtGZ?= =?us-ascii?Q?Ugdj+Kx4xKC4WqHE53hn1u5L3yI58HmGwrFssyEiPgLhQvI9srxcVUgUm0bs?= =?us-ascii?Q?VxHqYELqzvSBpofxcU9Rvr8e1b0YOnw/BwvzXxhu/rivlGuxi70ldakTYM9t?= =?us-ascii?Q?P24OXpYM9EEpwHyW/gBOp1TeGW920Fhu8ndxgEa6u1X00CJvLcL4U3ID1oyy?= =?us-ascii?Q?2nEVZD2sO6YyuecddqOaMDnxabXaa3NT6MJZc6g2QUk5MKhEONSnS958SD7N?= =?us-ascii?Q?PC2IUoCZhCOAnyv0v8Vvy35EeY8Gmjlf1GPZnLFioQZzlR5GITEChfhCP/xx?= =?us-ascii?Q?qnZGEr0mCCapy0R410hoALA1zQT6AHzS6GphWtLmIlpE5exCEnqjnEb/0T2b?= =?us-ascii?Q?2qD4APAPpnWYkfayGncRCRvxSy2FNpf9sitIIvcs004r9M+iOM+rFCKUuKUo?= =?us-ascii?Q?OHkLqK9U6p/0NELyl6RzrjYmhzTRmxgIV+YBE1JvpDhgrQD6SGhBOHtKLj8W?= =?us-ascii?Q?3DBLvVY//MDaUgvnlIUzVB83OfZ6DqFRK5611WwAIXgtCVc2Ic3uJN+SXecN?= =?us-ascii?Q?G9XA/bAl+wZl/CzcQmyIDgn2w48uRkNhK5g+TcsN6RSW3LZrDnIYmaJKxgX/?= =?us-ascii?Q?Dtf0ypnfRHu8TNYlccmAWx8OA+hDOaLWGf+1A6DgWSvszoDtYqIlDT3AwcSQ?= =?us-ascii?Q?DB01wE8l/25axpPvE9i5Kz5ZdBtB4tEFeFoKOGh+8dlgsd/n21B9NSPvG/DQ?= =?us-ascii?Q?uVt/1fhPC/HB5M5LAUvfUJyU32UaRC9hOLfHToX61uZqy+BUI4T0DA8MqhxT?= =?us-ascii?Q?DMVNvYTNZAYKWhyt2yE=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(376014)(7416014)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2026 15:03:16.4164 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c843b0ac-36d2-4fa6-eee0-08de51ebb71e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb08.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0001A106.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5922 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1768230224170158500 Content-Type: text/plain; charset="utf-8" Amend docs to reflect ucode=3D commands depend on MICROCODE_LOADING being set. While at it, rename UCODE_SCAN_DEFAULT to MICROCODE_SCAN_DEFAULT for consistency. Signed-off-by: Alejandro Vallejo --- v2: * Rely aggressively on DCE and ifdef/IS_ENABLED rather than file refactoring * Add a note about CONFIG_MICROCODE_LOADING to xen-command-line.pandoc * Rename UCODE to MICROCODE_LOADING * Rename UCODE_SCAN_DEFAULT to MICROCODE_SCAN_DEFAULT in order to avoid having some options with UCODE and some with MICROCODE. * Remove earlycpio.init.o from the build when !CONFIG_MICROCODE_LOADING --- automation/gitlab-ci/build.yaml | 2 +- docs/misc/efi.pandoc | 2 ++ docs/misc/xen-command-line.pandoc | 4 ++-- xen/arch/x86/Kconfig | 14 +++++++++++++- xen/arch/x86/cpu/microcode/amd.c | 22 +++++++++++++--------- xen/arch/x86/cpu/microcode/core.c | 25 ++++++++++++++++++------- xen/arch/x86/cpu/microcode/intel.c | 16 +++++++++------- xen/arch/x86/efi/efi-boot.h | 3 ++- xen/arch/x86/platform_hypercall.c | 2 ++ xen/common/Makefile | 3 ++- 10 files changed, 64 insertions(+), 29 deletions(-) diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.y= aml index a6fc55c2d5..b69bad9202 100644 --- a/automation/gitlab-ci/build.yaml +++ b/automation/gitlab-ci/build.yaml @@ -310,7 +310,7 @@ alpine-3.18-gcc-debug: CONFIG_ARGO=3Dy CONFIG_UBSAN=3Dy CONFIG_UBSAN_FATAL=3Dy - CONFIG_UCODE_SCAN_DEFAULT=3Dy + CONFIG_MICROCODE_SCAN_DEFAULT=3Dy CONFIG_XHCI=3Dy =20 debian-13-x86_64-gcc-debug: diff --git a/docs/misc/efi.pandoc b/docs/misc/efi.pandoc index 11c1ac3346..c3fb1f3a30 100644 --- a/docs/misc/efi.pandoc +++ b/docs/misc/efi.pandoc @@ -104,6 +104,8 @@ Specifies an XSM module to load. =20 Specifies a CPU microcode blob to load. (x86 only) =20 +Only available when Xen is compiled with CONFIG_MICROCODE_LOADING. + ###`dtb=3D` =20 Specifies a device tree file to load. The platform firmware may provide a diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line= .pandoc index 50d7edb248..866fa2f951 100644 --- a/docs/misc/xen-command-line.pandoc +++ b/docs/misc/xen-command-line.pandoc @@ -2748,7 +2748,7 @@ performance. ### ucode > `=3D List of [ | scan=3D, nmi=3D, digest-check=3D<= bool> ]` =20 - Applicability: x86 + Applicability: x86 with CONFIG_MICROCODE_LOADING active Default: `scan` is selectable via Kconfig, `nmi,digest-check` =20 Controls for CPU microcode loading. For early loading, this parameter can @@ -2773,7 +2773,7 @@ microcode in the cpio name space must be: - on AMD : kernel/x86/microcode/AuthenticAMD.bin When using xen.efi, the `ucode=3D` config file setting takes precedence over `scan`. The default value for `scan` is set with -`CONFIG_UCODE_SCAN_DEFAULT`. +`CONFIG_MICROCODE_SCAN_DEFAULT`. =20 'nmi' determines late loading is performed in NMI handler or just in stop_machine context. In NMI handler, even NMIs are blocked, which is diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig index c808c989fc..1353ec9a3f 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -331,8 +331,20 @@ config REQUIRE_NX was unavailable. However, if enabled, Xen will no longer boot on any CPU which is lacking NX support. =20 -config UCODE_SCAN_DEFAULT +config MICROCODE_LOADING + bool "Microcode loading" + default y + help + Support updating the microcode revision of available CPUs with a newer + vendor-provided microcode blob. Microcode updates address some classes = of + silicon defects. It's a very common delivery mechanism for fixes or + workarounds for speculative execution vulnerabilities. + + If unsure, say Y. + +config MICROCODE_SCAN_DEFAULT bool "Scan for microcode by default" + depends on MICROCODE_LOADING help During boot, Xen can scan the multiboot images for a CPIO archive containing CPU microcode to be loaded, which is Linux's mechanism for diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/= amd.c index 71b041c84b..6abdc7813b 100644 --- a/xen/arch/x86/cpu/microcode/amd.c +++ b/xen/arch/x86/cpu/microcode/amd.c @@ -264,7 +264,7 @@ static bool microcode_fits_cpu(const struct microcode_p= atch *patch) return equiv.id =3D=3D patch->processor_rev_id; } =20 -static int cf_check amd_compare( +static int cf_check __maybe_unused amd_compare( const struct microcode_patch *old, const struct microcode_patch *new) { /* Both patches to compare are supposed to be applicable to local CPU.= */ @@ -310,8 +310,8 @@ static bool check_min_rev(const struct microcode_patch = *patch) return this_cpu(cpu_sig).rev >=3D patch->min_rev; } =20 -static int cf_check apply_microcode(const struct microcode_patch *patch, - unsigned int flags) +static int cf_check __maybe_unused apply_microcode( + const struct microcode_patch *patch, unsigned int flags) { int hw_err, result; unsigned int cpu =3D smp_processor_id(); @@ -422,7 +422,7 @@ static int scan_equiv_cpu_table(const struct container_= equiv_table *et) return -ESRCH; } =20 -static struct microcode_patch *cf_check cpu_request_microcode( +static __maybe_unused struct microcode_patch *cf_check cpu_request_microco= de( const void *buf, size_t size, bool make_copy) { const struct microcode_patch *saved =3D NULL; @@ -557,15 +557,17 @@ static struct microcode_patch *cf_check cpu_request_m= icrocode( return patch; } =20 -static const char __initconst amd_cpio_path[] =3D +static const char __initconst __maybe_unused amd_cpio_path[] =3D "kernel/x86/microcode/AuthenticAMD.bin"; =20 static const struct microcode_ops __initconst_cf_clobber amd_ucode_ops =3D= { - .cpu_request_microcode =3D cpu_request_microcode, .collect_cpu_info =3D collect_cpu_info, +#ifdef CONFIG_MICROCODE_LOADING + .cpu_request_microcode =3D cpu_request_microcode, .apply_microcode =3D apply_microcode, .compare =3D amd_compare, .cpio_path =3D amd_cpio_path, +#endif /* CONFIG_MICROCODE_LOADING */ }; =20 void __init ucode_probe_amd(struct microcode_ops *ops) @@ -574,7 +576,8 @@ void __init ucode_probe_amd(struct microcode_ops *ops) * The Entrysign vulnerability (SB-7033, CVE-2024-36347) affects Zen1-5 * CPUs. Taint Xen if digest checking is turned off. */ - if ( boot_cpu_data.family >=3D 0x17 && boot_cpu_data.family <=3D 0x1a = && + if ( IS_ENABLED(CONFIG_MICROCODE_LOADING) && + boot_cpu_data.family >=3D 0x17 && boot_cpu_data.family <=3D 0x1a = && !opt_digest_check ) { printk(XENLOG_WARNING @@ -614,8 +617,9 @@ void __init amd_check_entrysign(void) unsigned int curr_rev; uint8_t fixed_rev; =20 - if ( boot_cpu_data.vendor !=3D X86_VENDOR_AMD || - boot_cpu_data.family < 0x17 || + if ( !IS_ENABLED(CONFIG_MICROCODE_LOADING) || + boot_cpu_data.vendor !=3D X86_VENDOR_AMD || + boot_cpu_data.family < 0x17 || boot_cpu_data.family > 0x1a ) return; =20 diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode= /core.c index fe47c3a6c1..aec99834fd 100644 --- a/xen/arch/x86/cpu/microcode/core.c +++ b/xen/arch/x86/cpu/microcode/core.c @@ -44,6 +44,9 @@ =20 #include "private.h" =20 +#define can_apply_microcode(ops) (IS_ENABLED(CONFIG_MICROCODE_LOADING) && \ + (ops).apply_microcode) + /* * Before performing a late microcode update on any thread, we * rendezvous all cpus in stop_machine context. The timeout for @@ -58,7 +61,7 @@ */ #define MICROCODE_UPDATE_TIMEOUT_US 1000000 =20 -static bool __initdata ucode_mod_forced; +static bool __initdata __maybe_unused ucode_mod_forced; static unsigned int nr_cores; =20 /* @@ -101,9 +104,10 @@ static struct microcode_patch *microcode_cache; * location we require that they are not both active together. */ static int __initdata opt_mod_idx; -static bool __initdata opt_scan =3D IS_ENABLED(CONFIG_UCODE_SCAN_DEFAULT); +static bool __initdata opt_scan =3D IS_ENABLED(CONFIG_MICROCODE_SCAN_DEFAU= LT); bool __ro_after_init opt_digest_check =3D true; =20 +#ifdef CONFIG_MICROCODE_LOADING /* * Used by the EFI path only, when xen.cfg identifies an explicit microcode * file. Overrides ucode=3D|scan on the regular command line. @@ -162,6 +166,7 @@ static int __init cf_check parse_ucode(const char *s) return rc; } custom_param("ucode", parse_ucode); +#endif /* CONFIG_MICROCODE_LOADING */ =20 static struct microcode_ops __ro_after_init ucode_ops; =20 @@ -469,7 +474,7 @@ struct ucode_buf { char buffer[]; }; =20 -static long cf_check ucode_update_hcall_cont(void *data) +static long cf_check __maybe_unused ucode_update_hcall_cont(void *data) { struct microcode_patch *patch =3D NULL; int ret, result; @@ -613,6 +618,7 @@ static long cf_check ucode_update_hcall_cont(void *data) return ret; } =20 +#ifdef CONFIG_MICROCODE_LOADING int ucode_update_hcall(XEN_GUEST_HANDLE(const_void) buf, unsigned long len, unsigned int flags) { @@ -622,7 +628,7 @@ int ucode_update_hcall(XEN_GUEST_HANDLE(const_void) buf, if ( flags & ~XENPF_UCODE_FORCE ) return -EINVAL; =20 - if ( !ucode_ops.apply_microcode ) + if ( !can_apply_microcode(ucode_ops) ) return -EINVAL; =20 buffer =3D xmalloc_flex_struct(struct ucode_buf, buffer, len); @@ -645,6 +651,7 @@ int ucode_update_hcall(XEN_GUEST_HANDLE(const_void) buf, */ return continue_hypercall_on_cpu(0, ucode_update_hcall_cont, buffer); } +#endif /* CONFIG_MICROCODE_LOADING */ =20 /* Load a cached update to current cpu */ int microcode_update_one(void) @@ -658,7 +665,7 @@ int microcode_update_one(void) if ( ucode_ops.collect_cpu_info ) alternative_vcall(ucode_ops.collect_cpu_info); =20 - if ( !ucode_ops.apply_microcode ) + if ( !can_apply_microcode(ucode_ops) ) return -EOPNOTSUPP; =20 spin_lock(µcode_mutex); @@ -678,6 +685,7 @@ int microcode_update_one(void) */ static int __initdata early_mod_idx =3D -1; =20 +#ifdef CONFIG_MICROCODE_LOADING static int __init cf_check microcode_init_cache(void) { struct boot_info *bi =3D &xen_boot_info; @@ -734,6 +742,7 @@ static int __init cf_check microcode_init_cache(void) return rc; } presmp_initcall(microcode_init_cache); +#endif /* CONFIG_MICROCODE_LOADING */ =20 /* * There are several tasks: @@ -907,10 +916,12 @@ int __init early_microcode_init(struct boot_info *bi) * * Take the hint in either case and ignore the microcode interface. */ - if ( !ucode_ops.apply_microcode || this_cpu(cpu_sig).rev =3D=3D ~0 ) + if ( !can_apply_microcode(ucode_ops) || this_cpu(cpu_sig).rev =3D=3D ~= 0 ) { printk(XENLOG_INFO "Microcode loading disabled due to: %s\n", - ucode_ops.apply_microcode ? "rev =3D ~0" : "HW toggle"); + !IS_ENABLED(CONFIG_MICROCODE_LOADING) ? "not compiled in" : + ucode_ops.apply_microcode ? "rev =3D ~0" = : + "HW toggle"); ucode_ops.apply_microcode =3D NULL; return -ENODEV; } diff --git a/xen/arch/x86/cpu/microcode/intel.c b/xen/arch/x86/cpu/microcod= e/intel.c index 281993e725..d9895018b4 100644 --- a/xen/arch/x86/cpu/microcode/intel.c +++ b/xen/arch/x86/cpu/microcode/intel.c @@ -273,7 +273,7 @@ static bool microcode_fits_cpu(const struct microcode_p= atch *mc) return false; } =20 -static int cf_check intel_compare( +static int __maybe_unused cf_check intel_compare( const struct microcode_patch *old, const struct microcode_patch *new) { /* @@ -286,8 +286,8 @@ static int cf_check intel_compare( return compare_revisions(old->rev, new->rev); } =20 -static int cf_check apply_microcode(const struct microcode_patch *patch, - unsigned int flags) +static int cf_check __maybe_unused apply_microcode( + const struct microcode_patch *patch, unsigned int flags) { uint64_t msr_content; unsigned int cpu =3D smp_processor_id(); @@ -333,7 +333,7 @@ static int cf_check apply_microcode(const struct microc= ode_patch *patch, return 0; } =20 -static struct microcode_patch *cf_check cpu_request_microcode( +static __maybe_unused struct microcode_patch *cf_check cpu_request_microco= de( const void *buf, size_t size, bool make_copy) { int error =3D 0; @@ -404,21 +404,23 @@ static bool __init can_load_microcode(void) return !(mcu_ctrl & MCU_CONTROL_DIS_MCU_LOAD); } =20 -static const char __initconst intel_cpio_path[] =3D +static const char __initconst __maybe_unused intel_cpio_path[] =3D "kernel/x86/microcode/GenuineIntel.bin"; =20 static const struct microcode_ops __initconst_cf_clobber intel_ucode_ops = =3D { - .cpu_request_microcode =3D cpu_request_microcode, .collect_cpu_info =3D collect_cpu_info, +#ifdef CONFIG_MICROCODE_LOADING + .cpu_request_microcode =3D cpu_request_microcode, .apply_microcode =3D apply_microcode, .compare =3D intel_compare, .cpio_path =3D intel_cpio_path, +#endif /* CONFIG_MICROCODE_LOADING */ }; =20 void __init ucode_probe_intel(struct microcode_ops *ops) { *ops =3D intel_ucode_ops; =20 - if ( !can_load_microcode() ) + if ( IS_ENABLED(CONFIG_MICROCODE_LOADING) && !can_load_microcode() ) ops->apply_microcode =3D NULL; } diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h index 0194720003..42a2c46b5e 100644 --- a/xen/arch/x86/efi/efi-boot.h +++ b/xen/arch/x86/efi/efi-boot.h @@ -295,7 +295,8 @@ static void __init efi_arch_cfg_file_late(const EFI_LOA= DED_IMAGE *image, { union string name; =20 - if ( read_section(image, L"ucode", &ucode, NULL) ) + if ( !IS_ENABLED(CONFIG_MICROCODE_LOADING) || + read_section(image, L"ucode", &ucode, NULL) ) return; =20 name.s =3D get_value(&cfg, section, "ucode"); diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hype= rcall.c index 79bb99e0b6..5e83965d21 100644 --- a/xen/arch/x86/platform_hypercall.c +++ b/xen/arch/x86/platform_hypercall.c @@ -307,6 +307,7 @@ ret_t do_platform_op( break; } =20 +#ifdef CONFIG_MICROCODE_LOADING case XENPF_microcode_update: { XEN_GUEST_HANDLE(const_void) data; @@ -327,6 +328,7 @@ ret_t do_platform_op( op->u.microcode2.flags); break; } +#endif /* CONFIG_MICROCODE_LOADING */ =20 case XENPF_platform_quirk: { diff --git a/xen/common/Makefile b/xen/common/Makefile index 92c97d641e..1e6c92e554 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -65,7 +65,8 @@ obj-y +=3D wait.o obj-bin-y +=3D warning.init.o obj-y +=3D xmalloc_tlsf.o =20 -obj-bin-$(CONFIG_X86) +=3D $(foreach n,decompress bunzip2 unxz unlzma lzo = unlzo unlz4 unzstd earlycpio,$(n).init.o) +obj-bin-$(CONFIG_MICROCODE_LOADING) +=3D earlycpio.init.o +obj-bin-$(CONFIG_X86) +=3D $(foreach n,decompress bunzip2 unxz unlzma lzo = unlzo unlz4 unzstd,$(n).init.o) =20 obj-$(CONFIG_COMPAT) +=3D $(addprefix compat/,domain.o memory.o multicall.= o xlat.o) =20 --=20 2.43.0