From nobody Wed Jan 7 03:46:02 2026 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 3E066E7849A for ; Mon, 2 Oct 2023 12:00:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236962AbjJBMAa (ORCPT ); Mon, 2 Oct 2023 08:00:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236921AbjJBMAA (ORCPT ); Mon, 2 Oct 2023 08:00:00 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 403D71B6 for ; Mon, 2 Oct 2023 04:59:53 -0700 (PDT) Message-ID: <20231002115902.854919221@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1696247991; 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=wSIKumgnxSQh4jImaEIP58qXBdiBffu/K6t5/ntvIzQ=; b=tSDpcr5rWCDpa5okkQctpU3oe2fk8ZQztVdUP8lJ+eg0iqaXsaT8RZcr9YMh3l+dJdnfOL vha25su6LdaNwPHe6Z4hc+g7DBiKcXHokZ9ID3LtOWYJjJ/dBXnE2gwySfxhERfwD7+bsu GE4adkXnzmhS15Jl5Rx/96uLkoCSKsOxCnBdVokVccSUBJEDnC92kJt0A13vd7RaCodcAj CLMr0pxWkNBjn8KU5geQc4CUrozwM+sDlX5fa7qFdal8eHIrmjOYSk4GO61KsC5ifRzQNB 3wwCiS+nSwyFDlVYsQnv3anxR+p+dlJpNNySE4M+/1eh9M5sJmDDqZbmrz1Mmw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696247991; 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=wSIKumgnxSQh4jImaEIP58qXBdiBffu/K6t5/ntvIzQ=; b=TBKKTtA1j5HNxDEtmf3rFeMukhPCQNSKVB+EtkrfabEqMwQCo24qURJXZz2bMSmEpjxagS u2s0llm9RrQTIwBw== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Borislav Petkov , "Chang S. Bae" , Arjan van de Ven , Nikolay Borisov Subject: [patch V4 14/30] x86/microcode/amd: Read revision from hardware in collect_cpu_info_amd() References: <20231002115506.217091296@linutronix.de> MIME-Version: 1.0 Date: Mon, 2 Oct 2023 13:59:51 +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 @@ -634,12 +634,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