Received: by 10.213.65.68 with SMTP id h4csp590328imn; Tue, 13 Mar 2018 14:09:11 -0700 (PDT) X-Google-Smtp-Source: AG47ELs/O7lXR91mvyfXIpjQ6Cux3mvGEQ/DcgculKt2uk83N5vgkyumrGLBtosI5UJsUUZEmKM4 X-Received: by 2002:a17:902:8f89:: with SMTP id z9-v6mr1742583plo.370.1520975351129; Tue, 13 Mar 2018 14:09:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520975351; cv=none; d=google.com; s=arc-20160816; b=wgwhvdamWPKpnCY1WglaBL1M9s1ulp1JoWf1dsQ2fVraSuDv16GY/cIFnVMFezHpYR UP3XszwS4KApnBgQ2EIav++I3qhgbphICgqNK739kaK/ZLcaGVt2Wn65UrdZWCUScXBM lPaSsyywAL+U3GeJAhwYkA9yvO52XMv9XlvAi8KO70FkOmzMieVCs8CxhSYX/xPDeRAz YwXg9ZM8BPXc8ChYOdp2gmOv9e7Tuuv1UmBlLTtTqapu4YZLfUzwwbjUJi8q6NzADQ3F GoB6xt4Jkr1EOgBGJdq+CgWQWQeZS9rMP+ysN4fuJ8dhwT/qD1FOfO+kEDARm/6yjm5t fGZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from:arc-authentication-results; bh=lGy79eyxsQ9q7w2gh/XluX5XlNLetN84E92L3tHCyS0=; b=pGYoIsTKmRFN1SiwIM4eo1SAFyI+blTcMbZ1uucflw+BGy3qYdcQsd10iKcq6hgrtF L15Ud8wOYQLjPMdcPoTQeKjhhosmmaKCQhTYwiFL3XlM/Mq6kUtVou2uykCcBoJ+j/gF WdyDliCb3fMNtBBKBCCFFRC+OLIA9ZHoCQVf/9te1XDl60dYuD12sMIZCnIIsv0X4r/F g93krIpZd88Qx+9DNDzuDBhfrJrRDoWZmCLnBPIgG0EEd1lxzcshYIGPSGKajfz/UMhP 2qQiMgEzwi5H0+WMfnU5rHbRbq9nyxJEzlWJANb1cl6WfxS7bhqRvxNgRxT/cegVuMGU Jg9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w23-v6si723565plk.682.2018.03.13.14.08.56; Tue, 13 Mar 2018 14:09:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753253AbeCMVH3 (ORCPT + 99 others); Tue, 13 Mar 2018 17:07:29 -0400 Received: from vps-vb.mhejs.net ([37.28.154.113]:48886 "EHLO vps-vb.mhejs.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753238AbeCMVH2 (ORCPT ); Tue, 13 Mar 2018 17:07:28 -0400 Received: by vps-vb.mhejs.net with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1evr8o-0004TE-O6; Tue, 13 Mar 2018 22:07:26 +0100 From: "Maciej S. Szmigiero" Subject: [PATCH v3 9/9] x86/microcode/AMD: be more tolerant of late parse failures in late loader To: Borislav Petkov Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org References: Message-ID: Date: Tue, 13 Mar 2018 22:07:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=iso-8859-2 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The early loader just ends its microcode container file processing when it is unable to parse some patch section, but keeps the already read patches from this file for their eventual application. We can do the same in the late loader - we'll just return an error if we are unable to parse any patches. Note that we already do silently skip patches in the late loader for smaller issues like lack of an equivalence table entry, family-size mismatch or an unsupported chipset match type. Signed-off-by: Maciej S. Szmigiero --- arch/x86/kernel/cpu/microcode/amd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c index 78e698fcd3ce..a098780b0847 100644 --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c @@ -729,13 +729,15 @@ static enum ucode_state __load_microcode_amd(u8 family, const u8 *data, while (leftover) { crnt_size = verify_and_add_patch(family, fw, leftover); if (crnt_size < 0) - return ret; + break; fw += crnt_size; leftover -= crnt_size; + + ret = UCODE_OK; } - return UCODE_OK; + return ret; } static enum ucode_state