Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp85285iof; Sun, 5 Jun 2022 21:54:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuUtSKsx7RwdOkiKuazdX/YUfTGwhSoz75O6tPsw/9tZW5ZaU0qBPWa6qtqpMyg3cPIr0Q X-Received: by 2002:a17:902:f789:b0:163:935d:aa69 with SMTP id q9-20020a170902f78900b00163935daa69mr22194326pln.165.1654491290295; Sun, 05 Jun 2022 21:54:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654491290; cv=none; d=google.com; s=arc-20160816; b=IFuNxiKiqL5OPW4H3XEHEJWyc7uvmPEL9YBwtfHzAzjOQFZJlLqXFZajej2SbAad2I LnnQVq6tiJHI8gYIKUvYbNAhi6Uvquv+2uLKNLS/68G0ysZS6MYPa3+Y6zIDvrndZpGB DoMCVV8IZWKYsY0Tx4kNq3YJUX+Y0UxbscCiqR+FWZaJuJbRzUpJ7SzZUifmR9IC27oj bOxUoHetqF3ZzCKK/ubSzvzF06yFAM6d7lDCxdGXO3OK20IAi+0WdIQvIjKG0MOEjOag FKqU4iC+BIDngCCXKihCJra3QHN1/xWOmJHLMGW75Hc0Loyec38pZRkeLePALdYCl7cY qmAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=wTQrThgYmboRYB2F7AFhWWnVMyoQEEBPYQo4znRVsf4=; b=s7HBLlxsitvMlhO7wUuSzqQbgwpV0BEyw2rKmPhfRRR3khWkJH+fnW46fcMceJJf4e thIHSbx8Q6PqkR3trhmw069xfvgKQSqEovFIwZJTZuVnVfTn2mk5K4Kfn0kvLFMjFAIX p4Wp+6MeiI/oKkkTNB6OwxznrvaujunQhFTAG6tiT6SGebRyZO64NYUZhHFbigVo1fQL bctsYRGvzWphwNyTaAs2RrZgaTGTL+CyAXTsz+ZoO5ql440arWSaV4DLW6N76Xcgxp47 ruIpR2txQhhSioFVs/3rY/NYqfYlA+W9Xmu6uHZJSkGRoS0lKIeQPEKPVNI7P1grxHlT 9vUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=jRWyTZmC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e2-20020a636902000000b003c6af783a2fsi19215931pgc.797.2022.06.05.21.54.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 21:54:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=jRWyTZmC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 92CC3C9EDB; Sun, 5 Jun 2022 21:08:48 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243203AbiFCJsN (ORCPT + 99 others); Fri, 3 Jun 2022 05:48:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243182AbiFCJsM (ORCPT ); Fri, 3 Jun 2022 05:48:12 -0400 Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B191613D1F; Fri, 3 Jun 2022 02:48:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1654249686; bh=yrg9on8zb+NApRYtS5qBL8mX8F/7jBwdIdZxHyDYbOg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=jRWyTZmCNV/pqzL9Eg+ZxwLUSRI9QggIjDRMCfMrbky0lqSLxFkJtfEZUGVyyUYRg 89X1nwC1YAmllYkpH0RvCQ201k1hKMjSdHc0Op5LLuhNnls78FnzObQU7HsVRJeXBr tQ2czc6m7bTnTxGA7okwYgtWi3dI1Urc/giRlB1M= Received: from [192.168.9.172] (unknown [101.88.28.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id EB0F560104; Fri, 3 Jun 2022 17:48:05 +0800 (CST) Message-ID: Date: Fri, 3 Jun 2022 17:48:05 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Thunderbird/103.0a1 Subject: Re: Steps forward for the LoongArch UEFI bringup patch? (was: Re: [PATCH V14 11/24] LoongArch: Add boot and setup routines) Content-Language: en-US To: Xi Ruoyao , WANG Xuerui , Ard Biesheuvel , Huacai Chen Cc: linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Xuefeng Li , Yanteng Si , Huacai Chen , Guo Ren , Jiaxun Yang , Stephen Rothwell , linux-efi@vger.kernel.org, WANG Xuerui , Yun Liu , Jonathan Corbet , Arnd Bergmann , Andy Lutomirski , Thomas Gleixner , Peter Zijlstra , Andrew Morton , David Airlie , Linus Torvalds References: <20220602115141.3962749-1-chenhuacai@loongson.cn> <20220602115141.3962749-12-chenhuacai@loongson.cn> From: WANG Xuerui In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 6/3/22 17:32, Xi Ruoyao wrote: > On Thu, 2022-06-02 at 22:09 +0800, WANG Xuerui wrote: > >> For this, I don't know if Huacai should really just leave those >> modification in the downstream fork to keep the upstream Linux clean of >> such hacks, because to some degree dealing with such notoriety is life, >> it seems to me. I think at this point Huacai would cooperate and tweak >> the patch to get rid of the SVAM and other nonstandard bits as much as >> possible, and I'll help him where necessary too. > To me any new firmware for PC-like platforms should implement UEFI. For > embedded platforms device tree support will be added later. > > For those guys impossible or unwilling to upgrade the firmware, it may > be possible to implement a compatibility layer and the booting procedure > will be like: > > 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. 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. > > Just my 2 cents. I know almost nothing about booting. That's fine, we all know nothing in the beginning ;-)