Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp273716ybi; Wed, 29 May 2019 21:08:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzZ84eAsZhq6B2pa1UcuE+En5qaoonQgMNWpl2VKfwhP4Tmxo/8vShGzmKGQLSYJKporkn X-Received: by 2002:a65:4349:: with SMTP id k9mr1828158pgq.243.1559189326630; Wed, 29 May 2019 21:08:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559189326; cv=none; d=google.com; s=arc-20160816; b=C5BniqIPr4bLUwrFA1XixAOR7VrC+qJAp8Xqg/k9uHREE2cgDAgzrGcMFUkEA40RcF tIFKs/p7tt9+Am2gINllUKNH+TiW4bAYVfnyuCfBx5g+R24PRJ6+KzueKjWuILM+yx0p 7CM1TsOddemcgM/mSjlSTruvfkTwBGfwBH+fUPwkqGYKvY4aTA465fgleBLXrxzt+Ral YFtky7GtCPqLeJ+aGClT+Se7zjMHZ/WjRT7W2wInEyWB0hUylGJacf9CV2e/3sz66OcY g6eDcW54OoS8YaBqRuEoYDd592Q5uPqG+QrEZGyMAW1AF6uS/+kmew8VIN2Rbf/Z1Ca7 TcKQ== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gY+FTvWwJVC2sdgkMfwWr0qYeqJCihev/W0CkZ7FEeY=; b=bRmRB0wP0FWQ/fliQr12AZGuFr+B36JAXDTG4LwLukRblLQWDz0e9fpbuzHUsfb0RO DVBLJGjhGrxxTNCrGkLk5/KQOgLNK9ME3rCfoVyzgQml9D5T6ya9owT8hLLYq/WA6zLu QcLiuxgvN+KpS2kqF1BG8cEyu7G1x7h5L2nPsO/jXVESowfYfuIla8k3NYPSmGjeJ6Yn DFxwyzf0jvQee+HWvix/SURbuWW/grQf2E16Hdt2tl/rMOcLbjo9BQOKM+IY74BXxweE aOjwjftoqck3+nExIezXm+j2uZTOSCYA6dSKitPc4oIBeSk/0GM0Hn8CnMQJ7ksgfkH0 wpAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rx43P8Sq; 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 s2si1914196pgg.225.2019.05.29.21.08.30; Wed, 29 May 2019 21:08:46 -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; dkim=pass header.i=@kernel.org header.s=default header.b=rx43P8Sq; 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 S1727003AbfE3EGW (ORCPT + 99 others); Thu, 30 May 2019 00:06:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:47798 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731173AbfE3DRf (ORCPT ); Wed, 29 May 2019 23:17:35 -0400 Received: from localhost (ip67-88-213-2.z213-88-67.customer.algx.net [67.88.213.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0458D246EE; Thu, 30 May 2019 03:17:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186255; bh=xNydASI18Rj2zLvBaJytxcUwe6gFezTCWCARsuFWbys=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rx43P8SqF9Czn9kYPEX5u0IrTVeMmLWayk1ETrTcFBma+YOQ3wUgPcQo4/PDGLR1c zgJ9gE17jp/XeQbcukueJOnXIirTB2p1Ijkis5r3GthKYYQ7qnd5E0K/vITMKHEIXP MYdkXj1ZEhTCFQ6nbw2AP1E0d2OP0FKrtitdBnBQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Borislav Petkov , Thomas Gleixner , Jann Horn , Sasha Levin Subject: [PATCH 4.19 174/276] x86/microcode: Fix the ancient deprecated microcode loading method Date: Wed, 29 May 2019 20:05:32 -0700 Message-Id: <20190530030536.226687991@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030523.133519668@linuxfoundation.org> References: <20190530030523.133519668@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 24613a04ad1c0588c10f4b5403ca60a73d164051 ] Commit 2613f36ed965 ("x86/microcode: Attempt late loading only when new microcode is present") added the new define UCODE_NEW to denote that an update should happen only when newer microcode (than installed on the system) has been found. But it missed adjusting that for the old /dev/cpu/microcode loading interface. Fix it. Fixes: 2613f36ed965 ("x86/microcode: Attempt late loading only when new microcode is present") Signed-off-by: Borislav Petkov Reviewed-by: Thomas Gleixner Cc: Jann Horn Link: https://lkml.kernel.org/r/20190405133010.24249-3-bp@alien8.de Signed-off-by: Sasha Levin --- arch/x86/kernel/cpu/microcode/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c index b9bc8a1a584e3..b43ddefd77f45 100644 --- a/arch/x86/kernel/cpu/microcode/core.c +++ b/arch/x86/kernel/cpu/microcode/core.c @@ -418,8 +418,9 @@ static int do_microcode_update(const void __user *buf, size_t size) if (ustate == UCODE_ERROR) { error = -1; break; - } else if (ustate == UCODE_OK) + } else if (ustate == UCODE_NEW) { apply_microcode_on_target(cpu); + } } return error; -- 2.20.1