Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2890392ybl; Sun, 12 Jan 2020 05:04:34 -0800 (PST) X-Google-Smtp-Source: APXvYqz73pIlOTaljXjuunypEL32ZL/RuqVXtfx0C0zfh8Gl1bmuT23G/bEGOV4A40yucMcFGUmh X-Received: by 2002:a05:6830:145:: with SMTP id j5mr9358360otp.242.1578834274736; Sun, 12 Jan 2020 05:04:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578834274; cv=none; d=google.com; s=arc-20160816; b=useqhGMqON9BZllYjslB3+VeRCYp7GzmRvrnaSDaUNHcPZyVOAfO/0I0ZJ2LlNgDhe UEc6ktdKHVObtBSeKIszwsVoqqAYSIOL7OXV0qhSdsKEdfnmiIeaCZlmyU/Ne6deaigC 4Jm2SQhekJxTX8lTgCx84U7UT69nEQ2ONznr2+knjodFJyMbRmwglCsJDzlGIQAhJ0En o65jKeGXGusMAAzDaTMrbl3cl3hLSFxx3lnGVr6DHdA07O/s0GY9BjSFJyySQGAEd/VL 6H34h4lQnH/F6/AmxLFS5verSSBaZKXhXgnjGQ/jgnVFAFlC9NIyILPkNH4OR8Q7PJyo NNpQ== 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 :mime-version:dkim-signature; bh=Si82Ae7kSJL+W4RyecalMW+utXj0IbUfyQpBmFzvOtA=; b=hwEJjcix2kjm3lym6w+3lWEszqN5HnfiGv3IhDJf5MwZ10OI1IcA9vYuwe9cA136Fo CkVXKLP/UNnOY1u6wX73z4xuZjVZeMZ9nU2VM/K/9pRqXovq3LkNYblcqeykCoN15mTL /uyJkCb+/sa26vK/BXNhcwSEXFcGbXcArWtni2qHNQklBKE6A9n3JTTqiOjoMuSPsIMA Ydvs0/4o5TYHUb8OnKZIy+UqDxvm9F2BxAJ3FcZIW+ZYLR+cJnq/zclOhZHZSNfHNgAb x1/BHlBIzN4JWF1AXv94FTfMAFTdy4v9K3mJROCuh/8wPrq1FYYpBWQy9PZn+wDdGsDr ox3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="D9Dc/7CF"; 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 o66si4186507oig.193.2020.01.12.05.03.56; Sun, 12 Jan 2020 05:04:34 -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="D9Dc/7CF"; 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 S1732842AbgALNA4 (ORCPT + 99 others); Sun, 12 Jan 2020 08:00:56 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:45885 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732833AbgALNA4 (ORCPT ); Sun, 12 Jan 2020 08:00:56 -0500 Received: by mail-ed1-f65.google.com with SMTP id v28so5997454edw.12; Sun, 12 Jan 2020 05:00:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=Si82Ae7kSJL+W4RyecalMW+utXj0IbUfyQpBmFzvOtA=; b=D9Dc/7CFHPXJQVdy/5TZscGlGRW1iaIhizUvNxcihtUpSXSlOuL+keCEabVYJnlc6t WvTCUaYYCxGMk54GmHljuD0Lba4EZHmmrD5Lj9u1nugcIXptlqadw20VM7+l/BFNskwd n9MhGAHfqMKMFm7KM3/fGrJemBnn95/mXgxbimqWcsTjvdBUYjO9ujnKvP8rdI0J942F kOGZ9iXSMZFzYKg9ax6T4Esc/tagbjUi+6LZLFZJIB7djY9lBUKQHGyxARxF5K57ZHNT GMuPNbYPQJ4K2WkZ6UVvM51R9s+0muwISWP5Lw7Z8Cz+igSQiPgYQRLGwIvoyhkdJnT7 Z/jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=Si82Ae7kSJL+W4RyecalMW+utXj0IbUfyQpBmFzvOtA=; b=XDJ9+ITkv1+foBF6oBOamYGHm7IATt/ugJLMKM8+cq/dF1gpNwbIn6+6YausNZ2Gc6 /rqSFMM4a5wcJ+y6xJl+jNCAWHpcoakqRGUiEacVFy4nUjobur0gWEJjHHcOIacbLGr0 AsubnaqyQt4jXwMZnYcpkyH6n7gFw9RZkd6ie8SM98b4w78MAvBnAuca2GcddnypVgka 7FhKGRQHbA770DaCxS3o8gB5BtgVgspCIHoaK5NVLtVmT4ADIU7ksJvoiMshER61kkhD ymgxLfzUw0ChxLZVlknWMz27Mxory553jjlbdjaVb00GPI+26x+uxWw4zzFvgwA0fJoy 3ZFg== X-Gm-Message-State: APjAAAUNfnnuR3s2ePMIEwQMMLhs12Nzbg+XSnrLiWUAmCrrLfC6wSpz I5jnInlAUajAntOqfxLp2JcDxxFCC+YIcifFbwQ= X-Received: by 2002:aa7:cf86:: with SMTP id z6mr12549252edx.85.1578834054234; Sun, 12 Jan 2020 05:00:54 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a05:6402:1c11:0:0:0:0 with HTTP; Sun, 12 Jan 2020 05:00:53 -0800 (PST) From: Jari Ruusu Date: Sun, 12 Jan 2020 15:00:53 +0200 Message-ID: Subject: 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 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. Signed-off-by: Jari Ruusu --- a/drivers/base/firmware_loader/builtin/Makefile +++ b/drivers/base/firmware_loader/builtin/Makefile @@ -17,7 +17,7 @@ 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:" ;\ -- Jari Ruusu 4096R/8132F189 12D6 4C3A DCDA 0AA4 27BD ACDF F073 3C80 8132 F189