From nobody Mon Feb 9 02:51:05 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=1685984938; cv=none; d=zohomail.com; s=zohoarc; b=givnlfjhg+gQ5zw6ITAwoAY53u2KfmU1vCbnYr4ns8j6CckAyKMvBTcscextYRiTxI6YffD1+PD3+NtuNN3T9j4J2e4cERDcVoCKOfcKrTfqGobA96LDTaW1gxy6qEoLg8ySiwDvNOrWe1c5BxKt+agd5RqlbHfTRwstDBnQty4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685984938; 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=AQ0i8Te1opYVMDeoQr+YKauj4QQYILajO6V4WWhluDI=; b=eEkDUK8GdaP1OjSfUYirLXw/Gj6IDYq+ZUPZmmIRZvm2McPfN87Rn/XHFXYbQr2m7qfBA4puWZY2XlIj75AQVCcHz3HVaZZ00NF+47zNhGdEbfBrOuHmn39ERsf3pGSDzAxye4V9Wugn+S05+8zTY8WnsO50FSoWTApbVcm+o5c= 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 1685984938974533.4923919489265; Mon, 5 Jun 2023 10:08:58 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.543818.849108 (Exim 4.92) (envelope-from ) id 1q6Dgw-0001yS-U0; Mon, 05 Jun 2023 17:08:26 +0000 Received: by outflank-mailman (output) from mailman id 543818.849108; Mon, 05 Jun 2023 17:08:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1q6Dgw-0001vQ-Ob; Mon, 05 Jun 2023 17:08:26 +0000 Received: by outflank-mailman (input) for mailman id 543818; Mon, 05 Jun 2023 17:08:25 +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 1q6Dgv-0001hK-Jj for xen-devel@lists.xenproject.org; Mon, 05 Jun 2023 17:08:25 +0000 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [2a00:1450:4864:20::331]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 945e8a35-03c3-11ee-8611-37d641c3527e; Mon, 05 Jun 2023 19:08:23 +0200 (CEST) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3f70fc4682aso44516565e9.1 for ; Mon, 05 Jun 2023 10:08:23 -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 b3-20020a5d4d83000000b0030c4d8930b1sm10247405wru.91.2023.06.05.10.08.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jun 2023 10:08:22 -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: 945e8a35-03c3-11ee-8611-37d641c3527e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1685984903; x=1688576903; 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=AQ0i8Te1opYVMDeoQr+YKauj4QQYILajO6V4WWhluDI=; b=AijknLkAw44KoXyWtWTqPOsvWTUeCgC7yDC7DbCsgHQz9BlJiEr2hVaVzvBy+qe9lT ek7JourSTY0vpLo85i752gOXghl8nqswKcR/qGpevLS0eZQTBa/74cnskV6I7fedT9AV cQE4lWvvgxUeUiccmC+gwbp9pU6KZmj+sWCW8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685984903; x=1688576903; 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=AQ0i8Te1opYVMDeoQr+YKauj4QQYILajO6V4WWhluDI=; b=Y0rtgHgRvtjQHOH67jETDM75LZzirLygIWmhNNzc6qqSSreOP1H8/vfRhL8EKtk2e2 vNZP7V2Uf6jRAUxgp9JEu0vfBCN/7rbDvIyUdj3vxvlLshSpwYKuRACEn7w3W72v4a/v 4CzJp3k4PEJFucUy2AVtpyTm82AMVcE4r7TVS3Nx0bRSfgZmZncyGmuSL3M2vsMh05l8 NHARJTi2Xn1dKvnj+qmAPZ0YcqHJi0/lZv4PCwuOAgFAGRtHA8O9tRl3/Vr9fhqwy6TO Y9qCelwJ5KACCv0H0F8XOa5j1umkGJI1OAICMZUTTEmrtLa93fkvinfN4TVTRQ3YLFPh guUg== X-Gm-Message-State: AC+VfDwk1z1sA/PFKNaUUtZ+ucghM5QhFubY5r3gtjIxeFOwOELszTcJ ujC1P0DZ4fYFs5kkCCTRonDwl8engt+jXzLhPQ0= X-Google-Smtp-Source: ACHHUZ7u1sk2+R+asIIG0fkfef+a11cKVB0k6wJX3/SpkDo/ZSUS+7nRmWIapgoPCzcCH2bOcbZjgA== X-Received: by 2002:a05:600c:282:b0:3f7:3526:d96f with SMTP id 2-20020a05600c028200b003f73526d96fmr4020879wmk.27.1685984903394; Mon, 05 Jun 2023 10:08:23 -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 v2 3/4] x86/microcode: Ignore microcode loading interface for revision = -1 Date: Mon, 5 Jun 2023 18:08:16 +0100 Message-Id: <20230605170817.9913-4-alejandro.vallejo@cloud.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230605170817.9913-1-alejandro.vallejo@cloud.com> References: <20230605170817.9913-1-alejandro.vallejo@cloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @cloud.com) X-ZM-MESSAGEID: 1685984940823100004 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 --- v2: * New addition --- xen/arch/x86/cpu/microcode/core.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode= /core.c index 892bcec901..4f60d96d98 100644 --- a/xen/arch/x86/cpu/microcode/core.c +++ b/xen/arch/x86/cpu/microcode/core.c @@ -874,6 +874,21 @@ int __init early_microcode_init(unsigned long *module_= map, break; } =20 + if ( ucode_ops.collect_cpu_info ) + ucode_ops.collect_cpu_info(); + + /* + * This is a special case for virtualized Xen. 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 ) + { + this_cpu(cpu_sig) =3D (struct cpu_signature){ 0 }; + ucode_ops =3D (struct microcode_ops){ 0 }; + } + if ( !ucode_ops.apply_microcode ) { printk(XENLOG_WARNING "Microcode loading not available\n"); @@ -882,8 +897,6 @@ int __init early_microcode_init(unsigned long *module_m= ap, =20 microcode_grab_module(module_map, mbi); =20 - ucode_ops.collect_cpu_info(); - if ( ucode_mod.mod_end || ucode_blob.size ) rc =3D early_microcode_update_cpu(); =20 --=20 2.34.1