Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp9117102ioo; Sun, 5 Jun 2022 05:39:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcpGEgwokct9fJgyl5+tO/p81CoAtz9jMjwEL6eT3E0ewU+mp93BqvLTZMvP4PqwIvM7Sh X-Received: by 2002:a17:90b:4c85:b0:1e5:42ef:a921 with SMTP id my5-20020a17090b4c8500b001e542efa921mr24367712pjb.75.1654432770201; Sun, 05 Jun 2022 05:39:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654432770; cv=none; d=google.com; s=arc-20160816; b=ZHk6e+rOlH4gyPADDyHM/+K06MQIMVi6xji1TTVLLKnFOH0ceIf53Ism9DLkNOS4J6 eQfnkJ1hkUS2AFn9VGcVsmGINlxG/2+rII03KLPg2lCBBJ4jaQHNOS33Fqv+JbePXzFd Y7KAGEBrss/kHqhGEkzhiGggJvan6zEQJKiuXPIxsymKAFM59JnhkdWegl1gaFMpmREi JBtVcqKoqez7j2TdoNtkvI4a6Haf5yPQ8nlhzumIXdQ23zNEKp8/Iox5PKCU5+VkvHoU vSzX5d5r6yrV/nwt12tga365/UBtcpGE8JHjvF3wF+U7aSzO1zAL0cusY2OjzvI9VX/i AwnA== 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; bh=PgFd/932O+IRtzHWu31mhgITqdNyQYI7AV0g8ogABVA=; b=Gw4vOpkeuW2TdcXO1X5m5Hhy9okQKrURKG2Wov9fGj+a2w2nbM7GO8iQR3Bs7iVc3i IyhciltvKbsc1BaEEZcnuDwmi4qC0HXh1RT1r935zIVcO1N2MlPMbT6P4JP+CDwLz0zw 9XkoUAX+titnCsSK5pkmfYWKv4HDX1Xh6kfdlIaaBCaRSSx6rHOhvLwGaGA+IH7uEh8O nCTYDq/RAquIZoWFPJOt1RhmWQz2LKJqQCcQeau5YSKCdbLFYNKgpesQkqnExvttfxeL +A2T7SrgtK/W7a1CFFcknSfKnPi/qzdKlCt0iyX9t4UjwqkJGyRZY84oy36A0lG0M4+k 6A6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d6-20020a17090a2a4600b001c1171b611fsi20024048pjg.22.2022.06.05.05.39.16; Sun, 05 Jun 2022 05:39:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243371AbiFCKI7 (ORCPT + 99 others); Fri, 3 Jun 2022 06:08:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240691AbiFCKI4 (ORCPT ); Fri, 3 Jun 2022 06:08:56 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B007B3B02C; Fri, 3 Jun 2022 03:08:55 -0700 (PDT) Received: from mail-yw1-f181.google.com ([209.85.128.181]) by mrelayeu.kundenserver.de (mreue011 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MhULz-1nJagI3kax-00eeye; Fri, 03 Jun 2022 12:08:54 +0200 Received: by mail-yw1-f181.google.com with SMTP id 00721157ae682-30ce6492a60so77133517b3.8; Fri, 03 Jun 2022 03:08:53 -0700 (PDT) X-Gm-Message-State: AOAM531qmQ1fneuOwtxJ7t6powi+Yhf1xlaunKW0311lBi9hDbMvWB+W HC1ODCoffdwMbl3plNRZz3RglfJyntH1ATkp0Sk= X-Received: by 2002:a0d:efc2:0:b0:2fe:d2b7:da8 with SMTP id y185-20020a0defc2000000b002fed2b70da8mr10241968ywe.42.1654250932363; Fri, 03 Jun 2022 03:08:52 -0700 (PDT) MIME-Version: 1.0 References: <20220602115141.3962749-1-chenhuacai@loongson.cn> <20220602115141.3962749-12-chenhuacai@loongson.cn> In-Reply-To: From: Arnd Bergmann Date: Fri, 3 Jun 2022 12:08:35 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Steps forward for the LoongArch UEFI bringup patch? (was: Re: [PATCH V14 11/24] LoongArch: Add boot and setup routines) To: WANG Xuerui Cc: Xi Ruoyao , Ard Biesheuvel , Huacai Chen , linux-arch , "open list:DOCUMENTATION" , Linux Kernel Mailing List , Xuefeng Li , Yanteng Si , Huacai Chen , Guo Ren , Jiaxun Yang , Stephen Rothwell , linux-efi , WANG Xuerui , Yun Liu , Jonathan Corbet , Arnd Bergmann , Andy Lutomirski , Thomas Gleixner , Peter Zijlstra , Andrew Morton , David Airlie , Linus Torvalds Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:OB5x7qgklN1NkyMxirtVh/vMvPr9nVsm9XsrIOgTJ2X89GtQRKH QRp0Md5FetpQ8nV8Qsk7R9+/pbSbN+wudoQSHfmOy0LrH+BhwtuOPVFiflz6Z+s85XDrDWG 0DKApkZEfdcE9amNyo9uVFortdvCGNS9jm6fQp/GUuRhdgoc58xMXcfslhTvnNuxO9PiV/X unXn5PsyowvwM6/CU5y8Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:HLzlSqTG/oE=:2o9WIAFOtP7ToyY4QsnqAc k/+bOSvo6cIpNpNLhN+ZIjYTmhbnk0EYCCnr3q/ujw9Hcrs/qoweMVohpqCy2L/4aHryAZzdo nF8qz5O7clnjH3cXg27TATVVahQehECoeRYa/15/1HZVG+LlZdt0Q8ycf2qLdsIv13KGCDgNk npHaHlNhJ3TCdESXci2y4XrMn1g4xq1JiMVYigsb6OySUA7nu5jkZvJ8PlE1AkLBFBYQmgVy/ tfNROxj8Kzf7vViYbatxCS9E5K0hGlGgaf1kxyoH3V4xsmPbktsdq1SMQ+Pm5r+JfMH0P+boO nooUA+7LP8foaD+d3SINBB0NaZOIzr7YtIrKYFHP+gLgn0jN8lK0F+hn+3apc8fQh08x0bHCy oehu/wm13fugxrN0YAeZiKaMimz5lmTSXodeWS9rLQHFDxDGin7ZyquyPW4kOy/0uzPxY+tgB vexWW0zEFI56gP1BiagWulMwb8biJrISdFge/yjtTvSMPhZueKPWN5MezUbV88KUvywQi7NVR HN8F4aS3neb/CbXpJJcw0HNtkB2JBZBiIAN5/uT8bdyR+0uPHV3RfFFfffCFWMcYPOO9k9pv5 Pw5Yh50H1s3Ej21m8PaCw7mL6+2kMVahdTDw5adcipnz2B32VNMAoNfwQTu2sQmMunWBBAnXS dQ5l0RXwylqA6MZLLBX9P8C3FEZHvVE3EVNKBlBJbt5lMS892niTiR4HHLoA2SNDcJHy6gjB8 IN8m/vgt2W5eEk0KgW4hnkOtse1+mG7svEdq26NZaj5NXvFlUUDFYVsnxAP7b8btyKR8Fm8/F H3a0BCwDkWeHxCZjocZLh7Kdwfkn9ALpCyF2Htah3DimBrmJY3kw6XzPyl37lfaOHttIJOuzu fwT4YjxWyYCD7LuZI/Zw== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 On Fri, Jun 3, 2022 at 11:48 AM WANG Xuerui wrote: > On 6/3/22 17:32, Xi Ruoyao wrote: > > On Thu, 2022-06-02 at 22:09 +0800, WANG Xuerui wrote: > > > > old firmware -> bootloongarch.efi -> customized u-boot -> bootloongarch64.efi (grub) -> efi stub (kernel) > > --------- compatibility layer -------- ^^^^^^^^ normal UEFI compatible stuff ^^^^^^^^^ > > > > new firmware -> bootloongarch64.efi (grub) -> efi stub (kernel) > > > > The old firmware route would be similar to the booting procedure of > > Asahi Linux. I think this can be implemented because it's already > > implemented on M1 even while Apple is almost completely uncooperative. It should be a little easier here, as the firmware can already boot a version of grub from disk. I would hope that there could simply be two different file names for the grub executable, with the existing firmware booting an old image, and new firmware looking for a different file name first, which would contain a regular EFI executable (grub, kernel or anything else). If either of the two versions of grub gets loaded by the firmware, that should then be able to boot a modern kernel through efistub. > This is a bit off-topic (we're basically hurrying up to get the port > into v5.19-rc1 and discussing ways to achieve that), but yeah > definitely. I've had the same idea right after knowing the LoongArch > firmware would also have "new-world" variant, then I contacted some > firmware engineers working on LoongArch boards, I think they agreed on > the approach overall. > > However, making the kernel itself capable of booting on both BPI and > new-world UEFI firmware flavors may have its merits after all; one > scenario I could come up with is that user reboots and upgrades their > firmware, *before* updating their old-world kernel, and bang! system > soft-bricked. All such cases involve old-world distros that already > deviate a little bit from vanilla upstream code, so such BPI support > needn't be mainlined for avoiding this scenario. The problem here is that this is very hard to ever get rid of. If having the compatibility layer in grub works, I think that is better for the long run. Arnd