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=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 5D692C352A3 for ; Thu, 13 Feb 2020 22:36:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2DBC621734 for ; Thu, 13 Feb 2020 22:36:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581633388; bh=JU3goHu7gsc+wO1ffpTCrRoCNDgmBOMfYIX03xTJlXk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=K7DaA9pNGLnR8/3/0b8ILvba2UHoDrfIIRryjz67d4cM4T22giSCg5kowY4nsWvDu 5VnIfq2ppV0ReAECi55eIFh1cL9rJwU50BYSoznmpTZc4oT2u0VJxfBcLJu/N44bQ6 Tq+s5AgoQMf/TGilugSdzBuip9yv+7FdL50mqgbs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727347AbgBMWg1 (ORCPT ); Thu, 13 Feb 2020 17:36:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:36980 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726780AbgBMWg1 (ORCPT ); Thu, 13 Feb 2020 17:36:27 -0500 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 BD050222C2 for ; Thu, 13 Feb 2020 22:36:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581633387; bh=JU3goHu7gsc+wO1ffpTCrRoCNDgmBOMfYIX03xTJlXk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=KuZavOgvBzqv+Qxh1BFMchPE7rZHU/sde4FMKB0n1cRkHuF8yB2nSpwg6p41mkK5I A52ju/TzH5VcdbBNLQwxyEmQw9uqML5Zj/LUu/+bvFfCJOFuPrRtpJ12zGykuHomH0 zDNcpUMCRBFKFURaoXhBegKJjltrEob12YNDMmAo= Received: by mail-wm1-f54.google.com with SMTP id a5so8024570wmb.0 for ; Thu, 13 Feb 2020 14:36:26 -0800 (PST) X-Gm-Message-State: APjAAAWcbkpPN4NYrrQCEifl1OI0MEe38b2AEOZEnANfVwsRckjaKgmb 7aVzyF6aEyvPYkLog0PUgM0eyHyo3goQ69DPVtirVA== X-Google-Smtp-Source: APXvYqwbn5MVNy/geSnY+QWWK0EmTyse/GP6qimB1vsXCBiqPWCuxVIvXO0w48vYKkBBBZ/xAF8BVoT6KTDIxw7M9kk= X-Received: by 2002:a1c:b603:: with SMTP id g3mr263116wmf.133.1581633385212; Thu, 13 Feb 2020 14:36:25 -0800 (PST) MIME-Version: 1.0 References: <20200213145928.7047-1-ardb@kernel.org> <20200213175317.GC1400002@rani.riverdale.lan> <20200213184752.GA1424509@rani.riverdale.lan> In-Reply-To: <20200213184752.GA1424509@rani.riverdale.lan> From: Ard Biesheuvel Date: Thu, 13 Feb 2020 22:36:14 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 0/3] efi/x86: add support for generic EFI mixed mode boot To: Arvind Sankar Cc: linux-efi , linux-arm-kernel , Laszlo Ersek , Leif Lindholm , Peter Jones , Matthew Garrett , Alexander Graf , Daniel Kiper , Hans de Goede , Michael Brown , Ingo Molnar Content-Type: text/plain; charset="UTF-8" Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org On Thu, 13 Feb 2020 at 19:47, Arvind Sankar wrote: > > On Thu, Feb 13, 2020 at 05:55:44PM +0000, Ard Biesheuvel wrote: > > On Thu, 13 Feb 2020 at 18:53, Arvind Sankar wrote: > > > As an alternative to the new section, how about having a CONFIG option > > > to emit the 64-bit kernel with a 32-bit PE header instead, which would > > > point to efi32_pe_entry? In that case it could be directly loaded by > > > existing firmware already. You could even have a tool that can mangle an > > > existing bzImage's header from 64-bit to 32-bit, say using the newly > > > added kernel_info structure to record the existence and location of > > > efi32_pe_entry. > > > > > > > That wouldn't work with, say, signed distro kernels. > > No, the idea would be that the distro would distribute two signed > images, one 32-bit and one 64-bit, which are identical except for the > header. At install time, the installer chooses based on the system's > firmware bit-ness. > I guess it would be possible, but then we'd need two different images while today, we can run the same image on both kinds of firmwares. The only thing I am trying to do is remove all the quirky bootparams stuff from the loader so that we can switch to LoadImage > > > > > Also, the PE header can live anywhere inside the image, right? Is there > > > any reason to struggle to shoehorn it into the "boot sector"? > > > > It cannot. It must live outside a region described by the section headers. > > It could still be inserted after .setup, or at the very end of the file, no? The PE/COFF spec mentions that the COFF header needs to follow the signature. Also, the SizeOfHeaders field would become somewhat ambiguous if the header is split up like that. 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=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 33A3EC352A3 for ; Thu, 13 Feb 2020 22:36:44 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 05AFB20873 for ; Thu, 13 Feb 2020 22:36:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="n4KMbmaN"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="KuZavOgv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 05AFB20873 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eLkXcEE0JtNZbdbwBg/tY1WKYF0mJOCw3PvAWqzVeKM=; b=n4KMbmaN6dQ/TC vpFb9kKDLuwTBhaHFDCrWFDEOtMyavqq6hAvSI9UKD7EVpA6bygxuSG/rLvLMGSMOLjO4SZiXTNMI LLxaT2uHYHPX4pOgvHIhkN8Z6y1ysH6qBGTrafpIDxoqR4AVPpSJgbbUI59sXP3GOjsUVhS9m1g2o ljHQmL+uFkyNwQTwbJstrZ3Cg8/TXNj8sr8idEQE4p0f/S1x0TJJXbwCCVWr3NP3g5nHZhePVIcux hlmP98PMW5owPQKJ9y73Nsun6NmDanY5KCTl9osQsBbHWXhonjqmvDVgFBq2HdyUYUhMEiwxtYV51 7qHePzkS18HrxCTkj7PA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j2N60-0003qz-GW; Thu, 13 Feb 2020 22:36:32 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j2N5w-0003qb-Qp for linux-arm-kernel@lists.infradead.org; Thu, 13 Feb 2020 22:36:30 +0000 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 C2F8122314 for ; Thu, 13 Feb 2020 22:36:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581633387; bh=JU3goHu7gsc+wO1ffpTCrRoCNDgmBOMfYIX03xTJlXk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=KuZavOgvBzqv+Qxh1BFMchPE7rZHU/sde4FMKB0n1cRkHuF8yB2nSpwg6p41mkK5I A52ju/TzH5VcdbBNLQwxyEmQw9uqML5Zj/LUu/+bvFfCJOFuPrRtpJ12zGykuHomH0 zDNcpUMCRBFKFURaoXhBegKJjltrEob12YNDMmAo= Received: by mail-wm1-f51.google.com with SMTP id t14so8567000wmi.5 for ; Thu, 13 Feb 2020 14:36:26 -0800 (PST) X-Gm-Message-State: APjAAAW+3ipwzmvYZL5/nlKSyP4Wgrwfgojq5jWMzmrotn9U7JyEyb7i OzMJuWnqI9Xh2N5L/oOS63hKkr7G82lqn0G10MvLoA== X-Google-Smtp-Source: APXvYqwbn5MVNy/geSnY+QWWK0EmTyse/GP6qimB1vsXCBiqPWCuxVIvXO0w48vYKkBBBZ/xAF8BVoT6KTDIxw7M9kk= X-Received: by 2002:a1c:b603:: with SMTP id g3mr263116wmf.133.1581633385212; Thu, 13 Feb 2020 14:36:25 -0800 (PST) MIME-Version: 1.0 References: <20200213145928.7047-1-ardb@kernel.org> <20200213175317.GC1400002@rani.riverdale.lan> <20200213184752.GA1424509@rani.riverdale.lan> In-Reply-To: <20200213184752.GA1424509@rani.riverdale.lan> From: Ard Biesheuvel Date: Thu, 13 Feb 2020 22:36:14 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 0/3] efi/x86: add support for generic EFI mixed mode boot To: Arvind Sankar X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200213_143628_914060_E8F5B584 X-CRM114-Status: GOOD ( 19.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-efi , Alexander Graf , Daniel Kiper , Matthew Garrett , Michael Brown , Hans de Goede , Peter Jones , Leif Lindholm , Laszlo Ersek , Ingo Molnar , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 13 Feb 2020 at 19:47, Arvind Sankar wrote: > > On Thu, Feb 13, 2020 at 05:55:44PM +0000, Ard Biesheuvel wrote: > > On Thu, 13 Feb 2020 at 18:53, Arvind Sankar wrote: > > > As an alternative to the new section, how about having a CONFIG option > > > to emit the 64-bit kernel with a 32-bit PE header instead, which would > > > point to efi32_pe_entry? In that case it could be directly loaded by > > > existing firmware already. You could even have a tool that can mangle an > > > existing bzImage's header from 64-bit to 32-bit, say using the newly > > > added kernel_info structure to record the existence and location of > > > efi32_pe_entry. > > > > > > > That wouldn't work with, say, signed distro kernels. > > No, the idea would be that the distro would distribute two signed > images, one 32-bit and one 64-bit, which are identical except for the > header. At install time, the installer chooses based on the system's > firmware bit-ness. > I guess it would be possible, but then we'd need two different images while today, we can run the same image on both kinds of firmwares. The only thing I am trying to do is remove all the quirky bootparams stuff from the loader so that we can switch to LoadImage > > > > > Also, the PE header can live anywhere inside the image, right? Is there > > > any reason to struggle to shoehorn it into the "boot sector"? > > > > It cannot. It must live outside a region described by the section headers. > > It could still be inserted after .setup, or at the very end of the file, no? The PE/COFF spec mentions that the COFF header needs to follow the signature. Also, the SizeOfHeaders field would become somewhat ambiguous if the header is split up like that. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel