From nobody Fri Dec 19 04:49:11 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83396CA0ECE for ; Tue, 12 Sep 2023 07:58:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232055AbjILH6z (ORCPT ); Tue, 12 Sep 2023 03:58:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232127AbjILH6i (ORCPT ); Tue, 12 Sep 2023 03:58:38 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8598219A1 for ; Tue, 12 Sep 2023 00:58:07 -0700 (PDT) Message-ID: <20230912065501.656264495@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1694505486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=kkIW+v+zNIk9lQpoyroVUgRr0ogOwnyVqvNr/VLjf7s=; b=MmUz0z9xeJcrJnxPWAhM0Sg9irL5LYgARz0uyeEaDH49TpRkPWpFfdIeun756Hw9CzJCgr HcE0+36CM8yqUrZTC3+N4XKggFfmqs2nEeTMUnbrtSA4jYJdoX0SnTEhdUuxl9wTCoqcmF cJfWnR6QFOJNGFZQ2Yn826PEDE0YPyW+1TSBpaa4E6a+8xcf5iVKMGxq9iL/v0X5u1pvTh QfHnC59V/7lkdTO8uDeUTXJ73kaVBLIjBrYgUSSg1rrWw05XdnPI2kFESehEwXhV+bS8LL i8ECiTGFkpP2+uqiFvEGf7ArEgcC/uEfmOCVnq1HmHpawVwzWGAVvFa7CU4qzA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1694505486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=kkIW+v+zNIk9lQpoyroVUgRr0ogOwnyVqvNr/VLjf7s=; b=k8+2iG5JfnEGJAuQRw8Z7ZzyuRb880eqYgK9XpNXEhGaZUVQv5PAFFf05u5VWP+04t5PSY jE+MezHcy/Fb0gAg== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Borislav Petkov , "Chang S. Bae" , Arjan van de Ven , Nikolay Borisov Subject: [patch V3 14/30] x86/microcode/amd: Read revision from hardware in collect_cpu_info_amd() References: <20230912065249.695681286@linutronix.de> MIME-Version: 1.0 Date: Tue, 12 Sep 2023 09:58:05 +0200 (CEST) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Prepare to decrapify the core initialization logic which invokes microcode_ops::apply_microcode() several times just to set cpu_data::microcode. Signed-off-by: Thomas Gleixner --- V2: New patch --- arch/x86/kernel/cpu/microcode/amd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c @@ -673,12 +673,12 @@ void reload_ucode_amd(unsigned int cpu) =20 static int collect_cpu_info_amd(int cpu, struct cpu_signature *csig) { - struct cpuinfo_x86 *c =3D &cpu_data(cpu); struct ucode_cpu_info *uci =3D ucode_cpu_info + cpu; + u32 dummy __always_unused; struct ucode_patch *p; =20 csig->sig =3D cpuid_eax(0x00000001); - csig->rev =3D c->microcode; + rdmsr(MSR_AMD64_PATCH_LEVEL, csig->rev, dummy); =20 /* * a patch could have been loaded early, set uci->mc so that