Received: by 10.213.65.68 with SMTP id h4csp45454imn; Thu, 15 Mar 2018 16:12:26 -0700 (PDT) X-Google-Smtp-Source: AG47ELs4M+GNjnaAMX+2+iTytMN57DiC+VhPtdhdXhx1gTsm1ejC2ukyZdapzQT1vid/2i4W/YYI X-Received: by 10.99.125.78 with SMTP id m14mr8057594pgn.190.1521155546113; Thu, 15 Mar 2018 16:12:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521155546; cv=none; d=google.com; s=arc-20160816; b=wt6vBuCOAjAUenio55pBzXQ8TeHqN9Mi1jqr4j52StRV0ArBAJ36raxsFwsNXzzYN6 HLMHpN7ffo+fB9HYEFYP4griU6Y2mfy27Hygs0WQwVPy3SaKsynkEV64QDqu8ObycW0m h0JF2TG9OcAjJNzpdD5EQEZ7Dn3PNPfy7rJHMDPmM0voDcdJIzgsha4CTYD9bI81er2/ qc86SccXXQSL64SfuYbItHWuIJzGhJhlASfO8bbr4pqaw28ZTpTkzbGJND+G3iZrBuEG w9ssfkggf32923HrrVXqJvblchabbsWEIJTiK754Jc9hkmd3eRqA2LeZMlGm0PaMfIs2 0vBQ== 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=sBQFznc4uISJYsPD4Ev8qL1/nYG50vfbHsMTMcgl7KE=; b=I+dK97oW4hs/UkFXnUSXYNI4uQbGb+ZBLzOmtFbxifKeeNkLPv1F0IdREI8vnYGoqu 5B204zkPfnAKMbgRUu3E9HHt+hbFi4Gc9ZdTJgdEdCKdy0WQmzKALsajIEBEnV16Uf9r Tjfha7dzuuOlZ9sB7qWOl2Ke/+MAN7wo7yjhRAhkZkVWTEMzE/fASPvk1sMkT4QLdGTv 17c6XyAXgfeNCTwxkBBUdyjDgJ30rN5zZ1Sgo94AM56JQNteFAR+bOV+7WK/973r0IqE YK966ZLxk3DDOroNlxwR0NPE3iZX9rH2zfY14JL5Oi+5CseJnHzFI0Zw+O+nyuLSqTsZ At0w== 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 h32-v6si4874823pld.217.2018.03.15.16.11.42; Thu, 15 Mar 2018 16:12:26 -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 S933141AbeCOXIf (ORCPT + 99 others); Thu, 15 Mar 2018 19:08:35 -0400 Received: from vps-vb.mhejs.net ([37.28.154.113]:48098 "EHLO vps-vb.mhejs.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933122AbeCOXIc (ORCPT ); Thu, 15 Mar 2018 19:08:32 -0400 Received: by vps-vb.mhejs.net with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ewbz5-0008TB-52; Fri, 16 Mar 2018 00:08:31 +0100 From: "Maciej S. Szmigiero" Subject: [PATCH v4 10/10] 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: Fri, 16 Mar 2018 00:08:30 +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 6e25a63a0a3d..f9278d9a2f9b 100644 --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c @@ -738,13 +738,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