From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99AE4C2D0DB for ; Fri, 24 Jan 2020 14:34:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6D8D220661 for ; Fri, 24 Jan 2020 14:34:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579876444; bh=I3YhAYtUA+dx4sZaf7NotbW1nN9/6IuCJ2P8V1dw+P0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=qdndgdlTE5NOukqxCVAjh6OiyozmA0gL6x/ARM1pvLJ8iiJFGgGK6l9ISWbyABiiz paW0M3/BxrvJc75WtqUCUNEN6qHQOxuB0wvpQwZykDXSh8iXeGIcSnCs/EyJ1UCd45 DxaL3Cv6IAW7LtQWvp6r+GhkcKFZpTSH1HeX7Dcw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404642AbgAXOeD (ORCPT ); Fri, 24 Jan 2020 09:34:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:40436 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391785AbgAXOTv (ORCPT ); Fri, 24 Jan 2020 09:19:51 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CE95B22464; Fri, 24 Jan 2020 14:19:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579875590; bh=I3YhAYtUA+dx4sZaf7NotbW1nN9/6IuCJ2P8V1dw+P0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uMElebrLpadIPpyu5TLrZGZexNlg270r1cLsAIZOJVaECLCvW9/51MqPKZvRdIcBv ld5dPfVmLrVcUftL9OV19MPrdWwHKOUu9sbDMUYajAGNxl//C2VtWcntHWufZ5n0b5 pOW2GsmpAoxYTdbLSA3MheuDDWXRi5LPGqwqMAjw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jari Ruusu , Borislav Petkov , Fenghua Yu , Luis Chamberlain , stable@kernel.org, Linus Torvalds , Sasha Levin Subject: [PATCH AUTOSEL 5.4 080/107] Fix built-in early-load Intel microcode alignment Date: Fri, 24 Jan 2020 09:17:50 -0500 Message-Id: <20200124141817.28793-80-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200124141817.28793-1-sashal@kernel.org> References: <20200124141817.28793-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jari Ruusu [ Upstream commit f5ae2ea6347a308cfe91f53b53682ce635497d0d ] Intel Software Developer's Manual, volume 3, chapter 9.11.6 says: "Note that the microcode update must be aligned on a 16-byte boundary and the size of the microcode update must be 1-KByte granular" When early-load Intel microcode is loaded from initramfs, userspace tool 'iucode_tool' has already 16-byte aligned those microcode bits in that initramfs image. Image that was created something like this: iucode_tool --write-earlyfw=FOO.cpio microcode-files... However, when early-load Intel microcode is loaded from built-in firmware BLOB using CONFIG_EXTRA_FIRMWARE= kernel config option, that 16-byte alignment is not guaranteed. Fix this by forcing all built-in firmware BLOBs to 16-byte alignment. [ If we end up having other firmware with much bigger alignment requirements, we might need to introduce some method for the firmware to specify it, this is the minimal "just increase the alignment a bit to account for this one special case" patch - Linus ] Signed-off-by: Jari Ruusu Cc: Borislav Petkov Cc: Fenghua Yu Cc: Luis Chamberlain Cc: stable@kernel.org Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- drivers/base/firmware_loader/builtin/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/firmware_loader/builtin/Makefile b/drivers/base/firmware_loader/builtin/Makefile index 4a66888e7253d..5fa7ce3745a0d 100644 --- a/drivers/base/firmware_loader/builtin/Makefile +++ b/drivers/base/firmware_loader/builtin/Makefile @@ -17,7 +17,7 @@ PROGBITS = $(if $(CONFIG_ARM),%,@)progbits filechk_fwbin = \ echo "/* Generated by $(src)/Makefile */" ;\ echo " .section .rodata" ;\ - echo " .p2align $(ASM_ALIGN)" ;\ + echo " .p2align 4" ;\ echo "_fw_$(FWSTR)_bin:" ;\ echo " .incbin \"$(fwdir)/$(FWNAME)\"" ;\ echo "_fw_end:" ;\ -- 2.20.1