Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp5335915rdb; Sat, 16 Sep 2023 12:15:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF+nGA0n/OST1i6NutT5qVBoN6PJel4rMKhW7O1jrh0V1cZc+NsehfmHiAcbLBomaGAJb8A X-Received: by 2002:a05:6a00:1a4f:b0:68b:a137:3739 with SMTP id h15-20020a056a001a4f00b0068ba1373739mr5202962pfv.4.1694891729098; Sat, 16 Sep 2023 12:15:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694891729; cv=none; d=google.com; s=arc-20160816; b=qXCm+ep9VvJBm8EgIwDORlmxJYuTSAb9Y3WkQeIkjJjzGpW60mst/l51HEDipC1BWy heu9NZjWbdPVp8+1ORI4qK+GySU9TOE1dfM7hjLpdZ8riOA9C/S/SuC9HQ3sX+jRfGJv ld024Z/JH8YTm6tDyv2V9rUsGXGwR9PPxVv/OqlGgxbTkbubQQt5WjuXHl0wbKfQ6C+Z jFwrmwQRKP+/Ce8p84jU+VpSv9tVij7ML0srLiSxnRcp1CcQ7hYJmGB58U5LUCt8O2f4 6CJ056b19Tq24GcHaJk8CmS5WQqMdh8PL8rNjO+dyOUteeUGh2ON93o32QFFt1ob+LYe VUuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=hxcrWTkOWm51WboMphVyXsbZBA4sSxIba+urscqIJ5I=; fh=mi6oB1QU3eEZL0kZvrBUIZCRad5ObShpP4kPH/vn5JY=; b=Zp+uB0nrtatLW3nwsBXupXk/C2DxrWw5PlRiBUGmkxpe6+OFv56V+qUvS+vwcwujYI FgxiciY4A5ac2Hdd1iQEnxzE/ybo62Y//CFZM9IgEudtVNHonJZkNKu+JJ/Z/5cDv0L4 Bzpj+miK6wwwjRFqFVP77Tn1NAZEsi0v7LLsGVw6AToxWg/TkpCGhZIwkjtHRHK9r9RS 6IBJnB/OxkCQDH2OJk7Dsrdewueo5Dw35OFV5N0rZR54BG5lStFfbuKNtmVG+Hdz9fIC o1FHVwZa0kFRxl7KOj6IwaP9cDKoo0BybZ+uH3X0RaT4HMGX37ZAkpJWN3yxg2kTIIJ1 1LVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B6EpN3T7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id a29-20020a63705d000000b00563a0c1bf06si5148124pgn.428.2023.09.16.12.15.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 12:15:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B6EpN3T7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 361F283B312C; Sat, 16 Sep 2023 12:15:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231315AbjIPTO4 (ORCPT + 99 others); Sat, 16 Sep 2023 15:14:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233268AbjIPTOy (ORCPT ); Sat, 16 Sep 2023 15:14:54 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D2D3CE8; Sat, 16 Sep 2023 12:14:49 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C9F4C433CD; Sat, 16 Sep 2023 19:14:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694891688; bh=GhEPs001caUtxwRsE4CgbQic7rBW6RkecWPBoHLDshg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=B6EpN3T7NeJLqmpijC2ABe3zkhN7Mky/SKq3Wy46erS33iNYDHo7ePdb5NvptwhFH ZNfNeWEo+sda6PO1R1CRfd0MP7I/mQpofgcocUqbtTA67QvdCiouPO6SLpdwHR1NBh jiu+Qvj8LtBdpdg72StJjUpp7l7Mv0IaM6co40P+VNwlC4q/Voj9opKgn7iavZOv8e HzATNC1jVbdXapmA9prWf3+2NI8LUO/XpZtg3s1NZHsQhDOVtAmBzBa2ui376mBqMn jV4DLhWB7iSfG54I5vJOL33l/0wB6x2WEcRefcGRFsQUptvp19JvE/D37xpBfDjMuf 6T+naGWoHW3bA== Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2b962c226ceso51990651fa.3; Sat, 16 Sep 2023 12:14:48 -0700 (PDT) X-Gm-Message-State: AOJu0YzwtsSuuk7ntRLQuFwz5nc1ivw4B7EPwH3hQ/0WfJ0BdeUGdx9V 64iuqp2fHZH82bwBnluNgIcaxlOGB3pAC2MCwxM= X-Received: by 2002:a2e:680c:0:b0:2bd:133c:58ff with SMTP id c12-20020a2e680c000000b002bd133c58ffmr3852284lja.48.1694891686814; Sat, 16 Sep 2023 12:14:46 -0700 (PDT) MIME-Version: 1.0 References: <20230912090051.4014114-17-ardb@google.com> In-Reply-To: From: Ard Biesheuvel Date: Sat, 16 Sep 2023 21:14:35 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 00/15] x86/boot: Rework PE header generation To: Ingo Molnar Cc: Ard Biesheuvel , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Evgeniy Baskov , Borislav Petkov , Dave Hansen , Ingo Molnar , Thomas Gleixner , Peter Jones , Matthew Garrett , Gerd Hoffmann , Kees Cook , "H. Peter Anvin" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sat, 16 Sep 2023 12:15:25 -0700 (PDT) On Sat, 16 Sept 2023 at 11:11, Ingo Molnar wrote: > > > * Ard Biesheuvel wrote: > > > > > So, the first 8 patches broke the x86-64-defconfig-ish Qemu bzImage bootup, > > > > due to the 8th patch: > > > > > > > > 988b52b207a9fe74c3699bda8c2256714926b94b is the first bad commit > > > > commit 988b52b207a9fe74c3699bda8c2256714926b94b > > > > Author: Ard Biesheuvel > > > > Date: Tue Sep 12 09:01:01 2023 +0000 > > > > > > > > x86/boot: Define setup size in linker script > > > > > > > > I've removed it for now - but this side effect was not expected. > > > > > > > > > > No, definitely not expected. I tested various combinations of i386 / > > > x86_64 built with GCC / Clang doing EFI or BIOS boot. > > > > > > I'll rebase the remaining stuff onto -tip and see if I can reproduce this. > > > > This is actually quite bizarre. x86_64_defconfig has > > CONFIG_EFI_MIXED=y and i tested that this change produces the exact > > same bzImage binary in that case. > > > > Could you send me the .config and the QEMU command line perhaps? > > So the patch below is the delta between v2 and v3 - that is expected > to fix the bzImage boot crash, right? > Yes. ld.bfd does something unexpected [to me] here, and the resulting value turns out not to be a multiple of 512 at all. With this tweak, my claim that this patch does not affect the binary bzImage at all actually holds for ld.bfd as well (provided that CONFIG_EFI_MIXED=y and CONFIG_LOCAL_VERSION_AUTO is disabled) So if this still does not work in your test, could you please disable CONFIG_LOCAL_VERSION_AUTO and compare the md5sums of the two builds? Thanks, > --- tip.orig/arch/x86/boot/setup.ld > +++ tip/arch/x86/boot/setup.ld > @@ -41,7 +41,7 @@ SECTIONS > LONG(0x5a5aaa55) > > /* Reserve some extra space for the reloc and compat sections */ > - setup_size = ABSOLUTE(ALIGN(. + 64, 512)); > + setup_size = ALIGN(ABSOLUTE(.) + 64, 512); > setup_sects = ABSOLUTE(setup_size / 512); > } > >