Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp8135599ioo; Sat, 4 Jun 2022 00:14:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5n1qhvVrTB9n+xOIJQBb4GWFWsPfvjMgvCDaJpe0yE9y9lE7MPvIiBNeU9Tl1NQyKM/MH X-Received: by 2002:a05:6402:1d48:b0:42d:d1a2:7c6d with SMTP id dz8-20020a0564021d4800b0042dd1a27c6dmr15044117edb.43.1654326882126; Sat, 04 Jun 2022 00:14:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654326882; cv=none; d=google.com; s=arc-20160816; b=xTDcr9GkXO7P45lirBaehVAg3zjy72TxNSAoebpfI5YIl99RP+iCC37x5WQNcwxdpq 8T6rX/Kqh27jNSqJpJA0WelqHLZNtsVyV2skUFimVE+wulRtvyfyLXVKlr1vUOz/4dGz GJpQeU5JmGayttPzqJqsFqS3tkC3szE69/WIvuYuPYbBJtrMGev6xeWIgv+OX48j1+IC jmKekYIiQMFgm3wZglmPiy24cMKElymT0iTUb2h//VMnJjW2xeKvEAPe+zoIcLcpg9fi dCcZQrPx1RziXgqnY1yjZUJctE3pwaBFZabyfXExWOE7Ko3rtoGnA5sdawNpImH8yNXj ZReQ== 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=aLQLKG8fCkYH+SYJbAi6KPB8FnP889R/3x/YXhj0kSc=; b=ZWzan5+ZBHfHQv8g4BOMSyn3iqSPJ9pnKWvhVPsPsKV6SzgYAQNna03blJUV/1xZhL YNRGSla1Z5njcJAxbVNe5NfaKmXrAX9EaBFXiZx+wpbpGy/mNa0ibFp55Qso2/YroKsf S21FVsOt+AWlh6yps78new/weppTVO8x6w3Gmb8no6cnJY36xxvHTqTaZqzzGl/ot3Ki +6LAY7Rrnn0Aqjh1skfONMipQslO4xLMioMldVyCR78uaGp9YHvY/7wjceGJp4xsoVPH WODSv1tdANd+ldtkyxPkWEeNOjmAOls0qGMS1RZUMimh0wKR6/g8pAInuxJ/V1DBhjQz mRGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=oJOqt8+n; 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 ho7-20020a1709070e8700b006fe1209e97esi244707ejc.740.2022.06.04.00.13.52; Sat, 04 Jun 2022 00:14:42 -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; dkim=pass header.i=@xen0n.name header.s=mail header.b=oJOqt8+n; 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 S243767AbiFCKhQ (ORCPT + 99 others); Fri, 3 Jun 2022 06:37:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243745AbiFCKhP (ORCPT ); Fri, 3 Jun 2022 06:37:15 -0400 Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7C0EDF26; Fri, 3 Jun 2022 03:37:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1654252628; bh=mKfMzdoRncVvxs4/8Auvz1NfRkjCux+UfdwXemx3UkI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=oJOqt8+nrUPl4Y87BixC1O6AeT/9iA7k7O8eStChkLTQ8dgSilBYgxoJY+R0ReUJZ M8K2A5GTQmdDP35GAF98jRsnyrlG+7D6nUjVQrduR8DI0j/qF7bs/GN5AXZNqlf7Nq K0Pg0ytMOGgQdK1XuOhDcGS/42ALBJhwRU4sUw3Y= 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) server-digest SHA256) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id 7C72160104; Fri, 3 Jun 2022 18:37:07 +0800 (CST) Message-ID: Date: Fri, 3 Jun 2022 18:37:07 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:103.0) Gecko/20100101 Thunderbird/103.0a1 Subject: Re: [PATCH V15 11/24] LoongArch: Add boot and setup routines Content-Language: en-US To: Arnd Bergmann , WANG Xuerui Cc: Ard Biesheuvel , Huacai Chen , Andy Lutomirski , Thomas Gleixner , Peter Zijlstra , Andrew Morton , David Airlie , Jonathan Corbet , Linus Torvalds , 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 References: <20220603072053.35005-1-chenhuacai@loongson.cn> <20220603072053.35005-12-chenhuacai@loongson.cn> <4213df91-c762-ae56-f08d-8c925759fa63@xen0n.name> 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.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,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 6/3/22 18:02, Arnd Bergmann wrote: > On Fri, Jun 3, 2022 at 11:27 AM WANG Xuerui wrote: >> On 6/3/22 15:20, Huacai Chen wrote: >>> Add basic boot, setup and reset routines for LoongArch. Now, LoongArch >>> machines use UEFI-based firmware. The firmware passes configuration >>> information to the kernel via ACPI and DMI/SMBIOS. >>> >>> Currently an existing interface between the kernel and the bootloader >>> is implemented. Kernel gets 2 values from the bootloader, passed in >>> registers a0 and a1; a0 is an "EFI boot flag" distinguishing UEFI and >>> non-UEFI firmware, while a1 is a pointer to an FDT with systable, >>> memmap, cmdline and initrd information. >>> >>> The standard UEFI boot protocol (EFISTUB) will be added later. >>> >>> Cc: linux-efi@vger.kernel.org >>> Cc: Ard Biesheuvel >>> Reviewed-by: WANG Xuerui >>> Reviewed-by: Jiaxun Yang >>> Co-developed-by: Yun Liu >>> Signed-off-by: Yun Liu >>> Signed-off-by: Huacai Chen >> Would you please look at this patch, which has all the arch-independent >> changes backed out, and Ack if it is fit for mainlining? >> >> I communicated a little with Huacai about the approach for supporting >> alternative boot protocols down the road, and we agreed to carry the >> respective changes downstream. And if needs truly arise for modifying >> common EFI logic, we can do so in a non-rushed manner later. >> >> For the current status of the code, apparently it just accepts the >> standard efistub-shape FDT pointer from (whatever booting the image), >> and everything onwards are fully using the common code without >> modification as you can see from the diffstat. I rebased my BPI support >> patch on top of this (basically translating Loongson BPI data structures >> into the expected FDT form), and can confirm the boot can progress to >> the same point as before -- indeed the SVAM changes etc. are not >> necessary for a working system, and the code remains working. > I'm a bit lost here: Does this mean the v15 version is back to the old > pre-efistub interface and allows booting with existing firmware, or > is it now left out completely? I still see a kernel_entry() function > in head.S, and I see references to loongson_sysconf, but I don't > see if that is what gets passed in from the bootloader. It's not the same interface as in some of the very early revisions; the earlier versions relied on "struct bootparamsinterface" or BPI, while it's the same FDT-based interface to initialize EFI from, as in arch/arm64 and arch/riscv I believe. No Loongson-specific things remain now. > > I really want to make sure that without the EFI stub, there is no > other way to boot the kernel that would have to get maintained > in the long run. Yeah this is the case right now. No LoongArch bootloader that I know of can prepare the EFI stub-shaped FDT that the current code expects, and I don't know of any future Loongson plan to do that either (Loongson's previous in-house efforts all looked something different). So it's pretty safe to say the current code wouldn't get frozen once mainlined. > > Arnd