From nobody Fri Nov 22 02:31:00 2024 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=1730107173; cv=none; d=zohomail.com; s=zohoarc; b=ebCN6od5MSkeOIqziYgE1oLMJ1vpx8PnxLNLXxLoXpIlGhF72DloL7UQCfn2EzMOPMNhTgANBj9oASZBO3bDFPT9+6Ov8CK8RUbMh9hlBhZd87+lglyDJf+TVwLOTfxXZtRfjtMJR8kDvS/VlgKIdq1eR7y3EQRfROFgmweUCLw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1730107173; 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=oICYqe4yhMzxG8joOnpcuB9tYuO3zHV62gOFfMxJa7M=; b=fs9udR2IC6UoYIvxfWTQPAIWXREt+qojAcnU54EoOortm7entSbeCT5cFoUIroWZnKvOA76IjQucGG5tmGQLQSCS6fhvKZA1D08IAw7g39BEWgfsDz75UOXEYBdSFpFUXCsy24uHQzIBCXjKzBEvrs1cTBxXd1IO9rsKOAw7Smo= 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 1730107173053280.17051829698175; Mon, 28 Oct 2024 02:19:33 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.826298.1240534 (Exim 4.92) (envelope-from ) id 1t5Lu4-0006XR-GK; Mon, 28 Oct 2024 09:19:12 +0000 Received: by outflank-mailman (output) from mailman id 826298.1240534; Mon, 28 Oct 2024 09:19:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t5Lu4-0006Wc-DB; Mon, 28 Oct 2024 09:19:12 +0000 Received: by outflank-mailman (input) for mailman id 826298; Mon, 28 Oct 2024 09:19:11 +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 1t5Lu3-0005yk-94 for xen-devel@lists.xenproject.org; Mon, 28 Oct 2024 09:19:11 +0000 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [2a00:1450:4864:20::62d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id afe37ec1-950d-11ef-99a3-01e77a169b0f; Mon, 28 Oct 2024 10:19:09 +0100 (CET) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a9a850270e2so677426566b.0 for ; Mon, 28 Oct 2024 02:19:09 -0700 (PDT) Received: from andrewcoop.eng.citrite.net ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9b1f05deb6sm355961566b.88.2024.10.28.02.19.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2024 02:19:06 -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: afe37ec1-950d-11ef-99a3-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1730107148; x=1730711948; 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=oICYqe4yhMzxG8joOnpcuB9tYuO3zHV62gOFfMxJa7M=; b=W3KafJDx2IkapzBEPdM/Kv/m6YdPTmMCwrJJrd5jp/65m5rtoyCK5qXgstTZdj+2Es FhGUJCFvzFHC5zPb13U5VfM8x5yn0wXQ5d4xSzhNZeTlGNlc+c0sitTidZ2jEUfqptuZ GTEowN+QGdF0w5nnQITXk7yv12ymuPV6bAabc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730107148; x=1730711948; 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=oICYqe4yhMzxG8joOnpcuB9tYuO3zHV62gOFfMxJa7M=; b=cJnp22mqe0X/ECd6QCx5/caPAkC1npv7PSNMSUULbD9kqI+nmLZBvm7KNFEcehDO7Q NQ7iuJ02H61DD5qq6JiIb0Y0/Eyej3cfGbCPnpKDoRNJhMZZie9g/GVSxe1/Dxcijfdk ElSqoMRHlW5707HT8IxPb7KEFzWIuecIsFq7tUL772asuLKORN3kB9LLe95pF1TMzmEB W0hOz+U5tH0yoGBFoJ3OJeN11yua0ex9jKpX8IH8QMYsBsMzPczL5PEuJ8+lVy1GfEgf dAVIh0K8OmFsrefEBaDZF8IKm8M+L9hUk3ZrCO8yHrLmoxT26VAy8lLZK0OUv8mLkB22 V1DQ== X-Gm-Message-State: AOJu0YyfQG6yZMIoQMtJ4uS0oxxkizbsPqaoM/Kpk6338MH5vSJkU4OA aNCfaml6JFGY95TI8FMkQBua/kUskBF4NSvrIUYlur9AFjozwpXM+itPr4G+8yStpY12OiDfRk6 h X-Google-Smtp-Source: AGHT+IFPmRBctsKkbYZfwJ/wA3cEUyI1GBO58kJ5TMNvnj+8riKv+CKvmi65G6mLHSuZnD3+BsL2RA== X-Received: by 2002:a17:907:a07:b0:a99:4ebc:82d4 with SMTP id a640c23a62f3a-a9de6192c15mr813457466b.55.1730107148172; Mon, 28 Oct 2024 02:19:08 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , "Daniel P . Smith" Subject: [PATCH 05/10] x86/ucode: Fold microcode_grab_module() into its single caller Date: Mon, 28 Oct 2024 09:18:51 +0000 Message-Id: <20241028091856.2151603-6-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241028091856.2151603-1-andrew.cooper3@citrix.com> References: <20241028091856.2151603-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: 1730107175351116600 No functional change. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich Reviewed-by: Daniel P. Smith --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Daniel P. Smith --- xen/arch/x86/cpu/microcode/core.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode= /core.c index 0b00e70f3b07..4c4003bf9687 100644 --- a/xen/arch/x86/cpu/microcode/core.c +++ b/xen/arch/x86/cpu/microcode/core.c @@ -205,19 +205,6 @@ static void __init microcode_scan_module(struct boot_i= nfo *bi) } } =20 -static void __init microcode_grab_module(struct boot_info *bi) -{ - if ( ucode_mod_idx < 0 ) - ucode_mod_idx +=3D bi->nr_modules; - if ( ucode_mod_idx <=3D 0 || ucode_mod_idx >=3D bi->nr_modules || - !__test_and_clear_bit(ucode_mod_idx, bi->module_map) ) - goto scan; - ucode_mod =3D *bi->mods[ucode_mod_idx].mod; -scan: - if ( ucode_scan ) - microcode_scan_module(bi); -} - static struct microcode_ops __ro_after_init ucode_ops; =20 static DEFINE_SPINLOCK(microcode_mutex); @@ -831,7 +818,15 @@ static int __init early_microcode_load(struct boot_inf= o *bi) size_t size; struct microcode_patch *patch; =20 - microcode_grab_module(bi); + if ( ucode_mod_idx < 0 ) + ucode_mod_idx +=3D bi->nr_modules; + if ( ucode_mod_idx <=3D 0 || ucode_mod_idx >=3D bi->nr_modules || + !__test_and_clear_bit(ucode_mod_idx, bi->module_map) ) + goto scan; + ucode_mod =3D *bi->mods[ucode_mod_idx].mod; + scan: + if ( ucode_scan ) + microcode_scan_module(bi); =20 if ( !ucode_mod.mod_end && !ucode_blob.size ) return 0; --=20 2.39.5