From nobody Mon Nov 3 12:18:52 2025 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=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1731446392; cv=none; d=zohomail.com; s=zohoarc; b=K79QFvYVezx9d0cgrmZ6b7uDanIwd66LyDq6wRHn94TbLW1406JQ33TxajxzYdDhB6weURzfdb3M4Ywh16w4wVisdyoKAkqmPGTnLTDeN2jMChxTCU2AU8aLSLAqd5X1zJ6PPU1LCY9YHDFZrcsBJybzb6IpYTZK7lwV4MlYNlo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1731446392; 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=jsa12gmbMNZ4JYTlfQsRQq4C/O5aUYd1O0nPblfp3iE=; b=c2qzQVEi65HoXzk8m9GH1GBzyguEXMKKX0my44Ht97IJ7Y9osDHfPER6DahwoVlmB+6qoVeScUjoeNUaDxoelhG6usCwRrk4kmxwn4JHrnW0nk5jQZjGUa/B6SjW/uhJt+PWrRBru8Bn9h2RQPdB4eO90dC5kgElrajyGEMVLX8= 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 1731446392025391.4015284956025; Tue, 12 Nov 2024 13:19:52 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.834936.1250736 (Exim 4.92) (envelope-from ) id 1tAyIK-0002Gk-7l; Tue, 12 Nov 2024 21:19:28 +0000 Received: by outflank-mailman (output) from mailman id 834936.1250736; Tue, 12 Nov 2024 21:19:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tAyIK-0002Gd-4T; Tue, 12 Nov 2024 21:19:28 +0000 Received: by outflank-mailman (input) for mailman id 834936; Tue, 12 Nov 2024 21:19:26 +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 1tAyII-0002GE-Jy for xen-devel@lists.xenproject.org; Tue, 12 Nov 2024 21:19:26 +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 c8326aed-a13b-11ef-99a3-01e77a169b0f; Tue, 12 Nov 2024 22:19:20 +0100 (CET) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-aa1e51ce601so174359166b.3 for ; Tue, 12 Nov 2024 13:19:20 -0800 (PST) Received: from andrewcoop.eng.citrite.net ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9ee0defaefsm762049066b.164.2024.11.12.13.19.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2024 13:19:19 -0800 (PST) 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: c8326aed-a13b-11ef-99a3-01e77a169b0f X-Custom-Connection: eyJyZW1vdGVpcCI6IjJhMDA6MTQ1MDo0ODY0OjIwOjo2MzAiLCJoZWxvIjoibWFpbC1lajEteDYzMC5nb29nbGUuY29tIn0= X-Custom-Transaction: eyJpZCI6ImM4MzI2YWVkLWExM2ItMTFlZi05OWEzLTAxZTc3YTE2OWIwZiIsInRzIjoxNzMxNDQ2MzYwLjcyMTg0LCJzZW5kZXIiOiJhbmRyZXcuY29vcGVyQGNsb3VkLmNvbSIsInJlY2lwaWVudCI6Inhlbi1kZXZlbEBsaXN0cy54ZW5wcm9qZWN0Lm9yZyJ9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1731446360; x=1732051160; darn=lists.xenproject.org; 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=jsa12gmbMNZ4JYTlfQsRQq4C/O5aUYd1O0nPblfp3iE=; b=Im5nBlCwWip2eFlaCHX4aY+OqjPY8wk+qhyyrWvQXO+6TmNsw2gi9fu1HVUqF3Xjq6 Q6hs/eVpxVv+2H5CWv/vhCq3hxyOejrlWypwa3s9+nXJXlHdrlf7A5UcdBhIE9GGohIY xr4mY112BRi5Tko4fII7SrbQlS244r4meTUHU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731446360; x=1732051160; 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=jsa12gmbMNZ4JYTlfQsRQq4C/O5aUYd1O0nPblfp3iE=; b=BhYYcSDcTzj6y36KLV5MH/lVUDOTSPrSs0302jYi4/17e+qMCmKD7g3jCB8UBnDmDn 5ispBdSP8vf2Q/CjNFi8L6brluJtt4tXlnxPo+fT2a8PIgNMGT74F2FjRlYu2Y03yPY5 7cnWUb7T2dgOSxviQryccr0G6/eKzqguUekq/jPTqBsPNxhpAu0XebZ4XQXnRa4KI3i5 K9jQqMo8wpq/QUnnQ2BfFPmwevxCbyx+Xsl1VcSFBcavFfCx8GVJwtsV3oapI5aWpraw mvJnduRy4kJ2NVMFiW/tSMVT6LqJdOVX13STehJx90wRabBeCU73Lq9HKH+j+p5Fg7ZJ lf5A== X-Gm-Message-State: AOJu0YyjTFQBabnQxdmPPg8QM2srJRiZ4F9F+Gm7YOjJTdnZOFCNTlYL GUygjCl+Vm8r41zAOGbQDFxlKxFZJDTdl0VrrsXPvtkyUMpYbIrt2cOHM1B7QahVxeu5ygZMycb T X-Google-Smtp-Source: AGHT+IEI+uILRhB7vfT10ROk8wzxcMHa3aAYpcdopfiCXVqktNFi+WzYOeKEVsFBdreGQMhTBDC9fA== X-Received: by 2002:a17:907:9486:b0:a99:4f40:3e82 with SMTP id a640c23a62f3a-a9eefeb2bacmr1612502366b.7.1731446359564; Tue, 12 Nov 2024 13:19:19 -0800 (PST) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v2 1/3] x86/ucode: Remove the collect_cpu_info() call from parse_blob() Date: Tue, 12 Nov 2024 21:19:13 +0000 Message-Id: <20241112211915.1473121-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241112211915.1473121-1-andrew.cooper3@citrix.com> References: <20241112211915.1473121-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1731446392988116600 With the tangle of logic starting to come under control, it is now plain to see that parse_blob()'s side effect of re-gathering the signature/revision = is pointless. The cpu_request_microcode() hooks need the signature only. The BSP gathers this in early_microcode_init(), the APs and S3 in microcode_update_cpu(). = For good measure, the apply_microcode() hooks also keep the revision correct as load attempts are made. This finally gets us down to a single call per CPU on boot / S3 resume, and= no calls during late-load hypercalls. No functional change. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 --- xen/arch/x86/cpu/microcode/core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode= /core.c index fd4b08b45388..5897ec54032a 100644 --- a/xen/arch/x86/cpu/microcode/core.c +++ b/xen/arch/x86/cpu/microcode/core.c @@ -189,8 +189,6 @@ static struct patch_with_flags nmi_patch =3D */ static struct microcode_patch *parse_blob(const char *buf, size_t len) { - alternative_vcall(ucode_ops.collect_cpu_info); - return alternative_call(ucode_ops.cpu_request_microcode, buf, len, tru= e); } =20 --=20 2.39.5