Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4584262rdb; Fri, 15 Sep 2023 06:44:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGPlw7hkeALdnkVP9kzOPTxKig40UoGlAd2fztXExhiHxHlCd8Hg2X6YJ0HYs0Ni5doJyUS X-Received: by 2002:a05:6a00:1f0b:b0:68f:c9f6:f366 with SMTP id be11-20020a056a001f0b00b0068fc9f6f366mr1854766pfb.0.1694785453498; Fri, 15 Sep 2023 06:44:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694785453; cv=none; d=google.com; s=arc-20160816; b=bYdQV+fz5O503YgbneUJFwbgWGiPWuqRxSgU4+7frURFAWcKquRp882L7y2safxLil zPRDjv0+V5DfXwjzA5KRovm7PcYNRRwRFByeyBjDzKC3Q8IoIUex1U4qKrbgPe/gdsnc rMP9GcbBwrt2Q1Eotp5VUZmip7kko7Oxg09AUHh9JQ6Pp7mkj66knP/15uUDus6ZijLZ 8zFhaa+9h/SVEbmNWsY6pya/tf8PoQjdWzWst1vVoweNxzVb0Z+FxHRwncvslFSgpUwZ 7/XdsoSb1Vj0NXpVF3+Qmw0qTCbCrte89aXlK5GGCvDKNAKj9uoQlAzDPNmlR0Jq5g75 eZew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=xb3v2LRovFY8FLVEhAEd5MEIuW2wc/SKd2J8/ZmDXUo=; fh=mNPyHVMf+y40Bpul6Q3v6dagG1thp/sznV7xKFgaW60=; b=zNQtn39vr6W8tmG71kmv3/QF8qE6WdPzDJ2d4v+zkIQTzH+KpfJz/hvgQOddMCR9r8 48X31XsmcfdtmoofmZOCLJzOZWdoPsx4r+SN4uGmGzM2feshvne/eHrBEE+zeQlyjIrC 9fKa/6URrNH0QzeULzfwhyxht/X1rUHAOKnIl2D6RqNY/FGq1AT/KFMggvlKJRdU5mzE WhNbEgxbiLsOxxXaQalCg8m1NlED9rLfuH+Zbw36mD5OFhXsssG/q7K5UpRvt0G0zU8N k/+ni5AbbGZ2LzbpPqI1d3ATYAUjVsM9C2AB9wCQOXMCPDNQssU9Q1DbdfLPmLR7o9He Mu9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="dT7bh/C+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id a25-20020a656419000000b00574046766e0si3225606pgv.40.2023.09.15.06.44.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 06:44:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="dT7bh/C+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id A977481352B4; Fri, 15 Sep 2023 06:28:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235330AbjION2x (ORCPT + 99 others); Fri, 15 Sep 2023 09:28:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235229AbjION2w (ORCPT ); Fri, 15 Sep 2023 09:28:52 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9D9310D; Fri, 15 Sep 2023 06:28:47 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65863C43391; Fri, 15 Sep 2023 13:28:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694784527; bh=eLQxZiO1BkR+sY4fxTC6o/C0cAQMWJdVQ03PQW8hiJ0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=dT7bh/C+vY5bumGsJ9I2oPQ8SwFPLK8948IJ5WxjSjcwf7umhtduJE4+ypADyZUY4 gHk0AWBpdz3RSgJ1lvKANgqy+8GihJnn9xMrFKP2x+4ZqzY0Jnb3uodsG8BL0btm2O 7s8nVsU/xdLzcVExejFUNjDXLQU35deIMjECJvpI5hSmqCOPRn/VvkfX10+cnHehRL 3oy8nQPTA5AvYMSrsRZ2K63T2Rr0x8edVuPJ4uQVsPIvH/fzG7a6e90OGwNHAiHMr3 5Oqiwq2I0Kg4a6/Gsuxlk7GxOLrKbDsvyQs8qYZHo58SZGtYKUytW8m69LB9Vw9gpH r8hWj5LkKdo+A== Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2bb9a063f26so34307261fa.2; Fri, 15 Sep 2023 06:28:47 -0700 (PDT) X-Gm-Message-State: AOJu0YxIhlojuoDwUfHIkQbW7PjHVqJF7lQ+65+AUB+8Tvnzb8JxFfUg VsGs/0gt+2B0WPSMCe3Wfc45m5lkzjVW68e/P7Q= X-Received: by 2002:a2e:9c85:0:b0:2bc:c326:54a2 with SMTP id x5-20020a2e9c85000000b002bcc32654a2mr1416500lji.50.1694784525534; Fri, 15 Sep 2023 06:28:45 -0700 (PDT) MIME-Version: 1.0 References: <20230912090051.4014114-17-ardb@google.com> In-Reply-To: From: Ard Biesheuvel Date: Fri, 15 Sep 2023 15:28:34 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 00/15] x86/boot: Rework PE header generation To: Ard Biesheuvel Cc: Ingo Molnar , 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" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Fri, 15 Sep 2023 06:28:51 -0700 (PDT) On Fri, 15 Sept 2023 at 15:21, Ard Biesheuvel wrote: > > On Fri, Sep 15, 2023 at 1:31=E2=80=AFPM Ingo Molnar wr= ote: > > > > > > * Ingo Molnar wrote: > > > > > > Ard Biesheuvel (15): > > > > x86/efi: Drop EFI stub .bss from .data section > > > > x86/efi: Disregard setup header of loaded image > > > > x86/efi: Drop alignment flags from PE section headers > > > > x86/boot: Remove the 'bugger off' message > > > > x86/boot: Omit compression buffer from PE/COFF image memory footp= rint > > > > x86/boot: Drop redundant code setting the root device > > > > x86/boot: Grab kernel_info offset from zoffset header directly > > > > x86/boot: Drop references to startup_64 > > > > > > I've applied these first 8 patches to tip:x86/boot with minor edits. > > Thanks. > > > > (Please preserve existing comment capitalization conventions ...) > > > > > Ack > > > > > x86/boot: Set EFI handover offset directly in header asm > > > > x86/boot: Define setup size in linker script > > > > x86/boot: Derive file size from _edata symbol > > > > x86/boot: Construct PE/COFF .text section from assembler > > > > x86/boot: Drop PE/COFF .reloc section > > > > x86/boot: Split off PE/COFF .data section > > > > x86/boot: Increase section and file alignment to 4k/512 > > > > > > The rest conflicted with recent upstream changes, and I suppose it's > > > prudent to test these changes bit by bit anyway. > > > > Agreed. So you mean this conflicts with other stuff queued up in -tip > already, right? > > > So, the first 8 patches broke the x86-64-defconfig-ish Qemu bzImage boo= tup, > > 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=3Dy 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?