From nobody Mon Feb 9 12:09:25 2026 Delivered-To: importer@patchew.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; 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; dmarc=pass(p=reject dis=none) header.from=cloud.com ARC-Seal: i=1; a=rsa-sha256; t=1688052456; cv=none; d=zohomail.com; s=zohoarc; b=a97GHgU6aq/NY+Q1fLoaZVWY+vWbqrwYKlLOqKEbKsWnGS8qaLKxb50Ob5zglgVwEFBlUz2YZ/PyuxMK/dlqOhDFbjmFzXoKQMODtwAYLI5ByxiQK6ck9/KKlZTVjR+K8yT8QOmOPn8N6p/SrxdfEBT68HVpry1ki+ti8ZK6Jv0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1688052456; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hW8flEGuUVEa8vCzcK1Csawi7P2txv/CQdLOaV7tNFk=; b=E6VAMAzay7HVY4h9XycRmI9JzGvntRCXEW/Y1/OXa9HJERxnMI2b1p5CAiFvAV542dNgwB5RDypwRkLN9BSTlUKbDZ1mvIzn2AiJUQDS6baNVG4CuAXzr/41VP3IWh9+LQ2aU+GCkZ0tzaUGcueXHiOlIlWkrws+0WLm4JjZ+lY= ARC-Authentication-Results: i=1; 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; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1688052456810491.136020823071; Thu, 29 Jun 2023 08:27:36 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.556911.869807 (Exim 4.92) (envelope-from ) id 1qEtY2-0001Mt-Mp; Thu, 29 Jun 2023 15:27:06 +0000 Received: by outflank-mailman (output) from mailman id 556911.869807; Thu, 29 Jun 2023 15:27:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qEtY2-0001MY-H2; Thu, 29 Jun 2023 15:27:06 +0000 Received: by outflank-mailman (input) for mailman id 556911; Thu, 29 Jun 2023 15:27:04 +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 1qEtY0-0000oy-EN for xen-devel@lists.xenproject.org; Thu, 29 Jun 2023 15:27:04 +0000 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [2a00:1450:4864:20::630]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 642da17a-1691-11ee-8611-37d641c3527e; Thu, 29 Jun 2023 17:27:00 +0200 (CEST) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-9920a6a6cb0so97175566b.3 for ; Thu, 29 Jun 2023 08:27:00 -0700 (PDT) Received: from localhost.localdomain (default-46-102-197-194.interdsl.co.uk. [46.102.197.194]) by smtp.gmail.com with ESMTPSA id v11-20020a170906564b00b00992c4103cb5sm307727ejr.129.2023.06.29.08.26.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jun 2023 08:26:59 -0700 (PDT) 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: 642da17a-1691-11ee-8611-37d641c3527e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1688052419; x=1690644419; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hW8flEGuUVEa8vCzcK1Csawi7P2txv/CQdLOaV7tNFk=; b=LsP4Q1/sJcGPff1nn5mAs1YGEsVCeeCyjCUXx5n6bjWd+Eh0bR2LM5JnGUcqytdUGi KrKd5hBm0rUMToba1+Sfjhxbm6rXSyW9LbXLetjOVy5q8dmYh/jNJDTKo6Pv8NNi8Z2E dp3Zw6t5KjFhRoWgWTROFn/UJSiPbK2w4N8ro= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688052419; x=1690644419; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hW8flEGuUVEa8vCzcK1Csawi7P2txv/CQdLOaV7tNFk=; b=I5ZIEF7ZyPNxOwYW017kcMf2FACPX/CkZ97nbggPQH6Df827hWyYtE/xzmBYfikAAl KNvzLvXzFxTnHGnfbmcOENpBfxJ6cT6ayPdC3nPJpL1nVqoop45S6VrVYIIcLkj7+gI+ feRRkko37T12kCd1y182vafW1KEVPWgyVkn4jRLTo4BMEN+7cNK/PZu3KJIXWQYoWfJg IQqqKpgEXIERo4Ze7Xo/HIHrw9pPIhvASetmM42iWvuOuZl5Kvtvkw3RcI2TtugNbdMc XGuJ1JVBb+1/AK2bznIOTX7B/c33rq7Kne7cEKYPgnTSi/XqTPRFS9fHz8Towom80qku DYcA== X-Gm-Message-State: AC+VfDzgu67rfrExAWKZjdXN68BThp/jDKD4QaqCwF+c+xc6LIfzJTa5 T3xP4Bhp+ORCgDyf8+crkhOIizirS55psSwZ5JU= X-Google-Smtp-Source: ACHHUZ6dPxjTgEK4ZylFXht3+Dygl3PdD/weoWIMQ8Q8+aOEnfqCLEZ/bEQC801no7kdb25MXeNfkA== X-Received: by 2002:a17:907:d0f:b0:975:942e:81e7 with SMTP id gn15-20020a1709070d0f00b00975942e81e7mr37765200ejc.37.1688052419824; Thu, 29 Jun 2023 08:26:59 -0700 (PDT) From: Alejandro Vallejo To: Xen-devel Cc: Alejandro Vallejo , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu Subject: [PATCH v5 2/4] x86/microcode: Ignore microcode loading interface for revision = -1 Date: Thu, 29 Jun 2023 16:26:54 +0100 Message-Id: <20230629152656.12655-3-alejandro.vallejo@cloud.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230629152656.12655-1-alejandro.vallejo@cloud.com> References: <20230629152656.12655-1-alejandro.vallejo@cloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @cloud.com) X-ZM-MESSAGEID: 1688052458073100001 Content-Type: text/plain; charset="utf-8" Some hypervisors report ~0 as the microcode revision to mean "don't issue microcode updates". Ignore the microcode loading interface in that case. Signed-off-by: Alejandro Vallejo Reviewed-by: Jan Beulich --- v5: * Style fix. Brace position. --- xen/arch/x86/cpu/microcode/core.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode= /core.c index bec8b55db2..b620e3bfa6 100644 --- a/xen/arch/x86/cpu/microcode/core.c +++ b/xen/arch/x86/cpu/microcode/core.c @@ -867,10 +867,22 @@ int __init early_microcode_init(unsigned long *module= _map, return -ENODEV; } =20 - microcode_grab_module(module_map, mbi); - ucode_ops.collect_cpu_info(); =20 + /* + * Some hypervisors deliberately report a microcode revision of -1 to + * mean that they will not accept microcode updates. We take the hint + * and ignore the microcode interface in that case. + */ + if ( this_cpu(cpu_sig).rev =3D=3D ~0 ) + { + printk(XENLOG_WARNING "Microcode loading disabled\n"); + ucode_ops.apply_microcode =3D NULL; + return -ENODEV; + } + + microcode_grab_module(module_map, mbi); + if ( ucode_mod.mod_end || ucode_blob.size ) rc =3D early_microcode_update_cpu(); =20 --=20 2.34.1