From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753552AbdATUbZ (ORCPT ); Fri, 20 Jan 2017 15:31:25 -0500 Received: from mail.skyhub.de ([78.46.96.112]:33520 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753272AbdATUaB (ORCPT ); Fri, 20 Jan 2017 15:30:01 -0500 From: Borislav Petkov To: X86 ML Cc: LKML Subject: [PATCH 09/16] x86/microcode/AMD: Get rid of global this_equiv_id Date: Fri, 20 Jan 2017 21:29:48 +0100 Message-Id: <20170120202955.4091-10-bp@alien8.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170120202955.4091-1-bp@alien8.de> References: <20170120202955.4091-1-bp@alien8.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Borislav Petkov We have a container which we update/prepare each time before applying a microcode patch instead of using a global. Signed-off-by: Borislav Petkov Reviewed-by: Thomas Gleixner --- arch/x86/kernel/cpu/microcode/amd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c index 9fb398e64b0a..4cbfe70cf458 100644 --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c @@ -56,7 +56,6 @@ static struct cont_desc { static u32 ucode_new_rev; static u8 amd_ucode_patch[PATCH_MAX_SIZE]; -static u16 this_equiv_id; /* * Microcode patch container file is prepended to the initrd in cpio @@ -228,8 +227,6 @@ apply_microcode_early_amd(u32 cpuid_1_eax, void *ucode, size_t size, if (!desc.eq_id) return ret; - this_equiv_id = desc.eq_id; - mc = desc.mc; if (!mc) return ret; @@ -375,7 +372,7 @@ void load_ucode_amd_ap(unsigned int cpuid_1_eax) if (!eq_id) return; - if (eq_id == this_equiv_id) { + if (eq_id == cont.eq_id) { mc = (struct microcode_amd *)amd_ucode_patch; if (mc && rev < mc->hdr.patch_id) { -- 2.11.0