From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750985AbdAWJMX (ORCPT ); Mon, 23 Jan 2017 04:12:23 -0500 Received: from terminus.zytor.com ([65.50.211.136]:34630 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750808AbdAWJMW (ORCPT ); Mon, 23 Jan 2017 04:12:22 -0500 Date: Mon, 23 Jan 2017 01:11:51 -0800 From: tip-bot for Borislav Petkov Message-ID: Cc: bp@suse.de, linux-kernel@vger.kernel.org, mingo@kernel.org, tglx@linutronix.de, hpa@zytor.com Reply-To: bp@suse.de, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@kernel.org, hpa@zytor.com In-Reply-To: <20170120202955.4091-11-bp@alien8.de> References: <20170120202955.4091-11-bp@alien8.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/mce] x86/microcode/AMD: Use find_microcode_in_initrd() Git-Commit-ID: 8cc26e0b4c49246564f773edbbefa3d5dc91d56e X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 8cc26e0b4c49246564f773edbbefa3d5dc91d56e Gitweb: http://git.kernel.org/tip/8cc26e0b4c49246564f773edbbefa3d5dc91d56e Author: Borislav Petkov AuthorDate: Fri, 20 Jan 2017 21:29:49 +0100 Committer: Thomas Gleixner CommitDate: Mon, 23 Jan 2017 10:02:48 +0100 x86/microcode/AMD: Use find_microcode_in_initrd() Use the generic helper instead of semi-open-coding the procedure. Signed-off-by: Borislav Petkov Reviewed-by: Thomas Gleixner Link: http://lkml.kernel.org/r/20170120202955.4091-11-bp@alien8.de Signed-off-by: Thomas Gleixner --- arch/x86/kernel/cpu/microcode/amd.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c index 4cbfe70..7727f27 100644 --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c @@ -337,17 +337,15 @@ void load_ucode_amd_ap(unsigned int cpuid_1_eax) /* First AP hasn't cached it yet, go through the blob. */ if (!cont.data) { - struct cpio_data cp = { NULL, 0, "" }; + struct cpio_data cp; if (cont.size == -1) return; reget: if (!get_builtin_microcode(&cp, x86_family(cpuid_1_eax))) { -#ifdef CONFIG_BLK_DEV_INITRD - cp = find_cpio_data(ucode_path, (void *)initrd_start, - initrd_end - initrd_start, NULL); -#endif + cp = find_microcode_in_initrd(ucode_path, false); + if (!(cp.data && cp.size)) { /* * Mark it so that other APs do not scan again @@ -401,13 +399,9 @@ int __init save_microcode_in_initrd_amd(unsigned int cpuid_1_eax) if (!cont.data) { if (IS_ENABLED(CONFIG_X86_32) && (cont.size != -1)) { - struct cpio_data cp = { NULL, 0, "" }; - -#ifdef CONFIG_BLK_DEV_INITRD - cp = find_cpio_data(ucode_path, (void *)initrd_start, - initrd_end - initrd_start, NULL); -#endif + struct cpio_data cp; + cp = find_microcode_in_initrd(ucode_path, false); if (!(cp.data && cp.size)) { cont.size = -1; return -EINVAL;