Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2891069ybl; Sun, 12 Jan 2020 05:05:16 -0800 (PST) X-Google-Smtp-Source: APXvYqwVrAEXg2KPX93/l2hPm1Xx2eF7JQdQzAW9swhnQZsyMAVy3J6ZcgsWmOwK8PnwtazeKx5+ X-Received: by 2002:a9d:470a:: with SMTP id a10mr10039969otf.370.1578834316577; Sun, 12 Jan 2020 05:05:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578834316; cv=none; d=google.com; s=arc-20160816; b=y7ZwKvqKyjXuGBPasAPQ2xnxZGWsYAl2DLzwX4Fcn/B2e0Tj8iAl96K/mtFWmWQYrh K6mftH0OwBh9eicsobmI6Befv6Qc8MvBu0I3k5q+NpdkESJZVIrw92Us+TIpnK2Er9G0 JPmR+6BNfv6NS+dy2kHidqYbGf5UdiS7YfmUjdobTDdauUqJe5x8opSg3XspS9SuE65b xrTwz28WqbfG9BqxWNaAqaNWiMoT/R9JY9lJz1lPt7wn51b+I0c3qB6CW2699Apnd5gL 6GnEWJQ6gMzPDTwrIMMmR2oloG2v7WLL7dVtnXcD5tb/ngT3uOX9qVKgEnMHlzkudnH3 98xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=LPfprFmHx12pshQR3Bs7ESSVF/5so2k7WxJXYYduZPg=; b=kkIOXNbroxvN80p2nYEz/JHBAYinl0TJhKm9FZ41T2EpcPG7SVRIdqwheeD8QFG2ZI wXkDNsUlw90uRxuZPNiOpHw8x9VWzk9g/5E7goGyyhJkyxb0HVss+wwH8gsCrXq9xzr/ CORdl7PhpuTW+9qCGxGskmozuF6zdvgHkU1T2ljNVXp1XK5Uc94vjwLsi/DkEhWrV01J tKq5g0iTwsW6wJiTzEivyj4jeoBGRqqzfK/zkBJbCqfRmN+YqYBvXg0YaQ9AgEqz2B3t pIFIa4P/d/Xk2C3+6CV11piTcK3IquiI12uyMjg7cxcYZRecWtX8nKME+WLUr7AHy9oE xX6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vPTZxsUI; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l189si4470137oih.166.2020.01.12.05.05.04; Sun, 12 Jan 2020 05:05:16 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=vPTZxsUI; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732868AbgALNDr (ORCPT + 99 others); Sun, 12 Jan 2020 08:03:47 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:38778 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732859AbgALNDq (ORCPT ); Sun, 12 Jan 2020 08:03:46 -0500 Received: by mail-ed1-f65.google.com with SMTP id i16so6018711edr.5; Sun, 12 Jan 2020 05:03:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=LPfprFmHx12pshQR3Bs7ESSVF/5so2k7WxJXYYduZPg=; b=vPTZxsUIA5eLyW3Lcq4lKc8uJM113sfAzCegClUwRRstF49nXwf9i+pUZe9xI15OUq 0VsfeOKayn4jTTysh3cV2xUs9/petOgBBrblaBVCBkFgl5VdJJKmEVIKJ54bRFCJelbF if4aJU8gyTPRJDv7eYCHL5SVfY2NCpnOnxacO5d0r7zyGTxgYaYWJiq9UWNOKfXyMzpw ZGf20qJXPJ1qSSNVP+prepth9hocWLgIK8LAZNsIhbZRQecnvhXQwE4niViUBkQpwxYr 6u9PRL2oT25mUAhuYI2ok4iPzJPxo5K8YAyOKK2vdgLCLLeHWlHuUa1IYHy/pKrJLZy2 F5FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=LPfprFmHx12pshQR3Bs7ESSVF/5so2k7WxJXYYduZPg=; b=LUaEVQnuF4QuzrVxRkcYrcG7xWCCco+WHQ1b/k5JE9gUCdowlMYeWgnwty1TTxdGFL FY7xMtO1YPBzQ0BdozqqacUIlnZJLUXoX0htzXuLuhPU4wOOcDYQMZG8BfxfnvEVx1XO P2PyziEduDFeGdA1/BXWCMixFpRL1uk8cFAtqKRqHdpQFrWPi80uTjAmEgPKmeNc4rkA 6U1u8w/LFh6emoDpDRH2/OU0eOHeqKuU+KuCcpJU7spkWKZUyLrOJcZglLWsnCNClLzv rbckirMG+Vj2l9nGOJbD67i8ZNWPdLGmZpEQ/3KoQ1jhAnKVTL/QuMk2A2t6kVjJj5EA Abyw== X-Gm-Message-State: APjAAAXXTckdPUB3gxCWfTPayrqXz5T/wke17UPMM0oGVepkdtlpcTt0 9xSgV/HO3wLxRK+amtU+oB+e/M/op7CwU0qCUCQ= X-Received: by 2002:a05:6402:31b5:: with SMTP id dj21mr9677434edb.308.1578834225028; Sun, 12 Jan 2020 05:03:45 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a05:6402:1c11:0:0:0:0 with HTTP; Sun, 12 Jan 2020 05:03:44 -0800 (PST) In-Reply-To: References: From: Jari Ruusu Date: Sun, 12 Jan 2020 15:03:44 +0200 Message-ID: Subject: Re: Fix built-in early-load Intel microcode alignment To: Borislav Petkov , Fenghua Yu , Luis Chamberlain , Linus Torvalds Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/12/20, Jari Ruusu wrote: > 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. Backport of "Fix built-in early-load Intel microcode alignment" for linux-4.19 and older stable kernels. Signed-off-by: Jari Ruusu --- a/firmware/Makefile +++ b/firmware/Makefile @@ -19,7 +19,7 @@ PROGBITS=$(if $(CONFIG_ARM),%,@)progbits; \ echo "/* Generated by firmware/Makefile */" > $@;\ echo " .section .rodata" >>$@;\ - echo " .p2align $${ASM_ALIGN}" >>$@;\ + echo " .p2align 4" >>$@;\ echo "_fw_$${FWSTR}_bin:" >>$@;\ echo " .incbin \"$(2)\"" >>$@;\ echo "_fw_end:" >>$@;\ -- Jari Ruusu 4096R/8132F189 12D6 4C3A DCDA 0AA4 27BD ACDF F073 3C80 8132 F189