Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3013264rwa; Mon, 22 Aug 2022 19:13:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR4dEpK8RYuoI+JSF67oRUs7QsnG5dBmGzsOkJK2OOvwN1vNsMN/sljeVh41bIVAikrLSgrd X-Received: by 2002:a05:6402:2744:b0:446:ab07:eb52 with SMTP id z4-20020a056402274400b00446ab07eb52mr1567360edd.83.1661220786803; Mon, 22 Aug 2022 19:13:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661220786; cv=none; d=google.com; s=arc-20160816; b=PmQgBck37dUv2uUqjuSO0x7S1ofjUTkD+s2YgoB5xpr8p97zGBJRkp9xcO8XoljETz BALH8Op8DBABDunipGbiUmRCpI7WXCpheD9aei6tDxaP5nhRSEp2iNwMwPKBcsSYWX6V Ja53AcYk30ZtGw0//fGjT6dyyG6Zw7BpDB661d/Euf2QXFh/fcAPX24nr+PeGtH8BfPk ll7oCu8bstEn914MRNCsigqEbUYVc/EZ6u2on8Dq+fu75U5EWxeE2vr8dPQ7z7chA3Z+ 9h7RNM1gdKeu1FByfzzTAceJ2oTck7ZUL+NU1gU4R/tx6TIQYer/WhiA5urHVBLlPQ33 zXXQ== 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:dkim-signature; bh=g3jkvWJUGf3Fr73puF5aA7xyLqZ7AuXaOV6pbL558IE=; b=rnzfACxuSbKod0fCA+Gwrbl3izFxnMGxGeArUJ4bE8EX2NxO0n9xvsDIplswABHcu5 zW2Gp2ObIiRfGnZ9rePShLa4kLsvk3hZhGCppCD0ZuPu0JXMFOAIVkBTZqisOnqZDo3n UKHYH/56akotaIqTqx3f7o6F++rWidcVN8uU1e9ui+Msi8E9i3fz1K3N+6GtdE0qAheo ObWMvDDT49ehBheOUvLMurbLU20QQn1TTehQCijOLojfiiOJZNF/lZydlO+Lj2cw509t RaN2ER4mfus6n8nkI9Kt5eFHswwoQgbbcd1sqbvOBp+vYwiF188drR3BWE5TsNn7AELn i0wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iXVJDGu8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ho13-20020a1709070e8d00b00730e5c46ed9si12325484ejc.15.2022.08.22.19.12.39; Mon, 22 Aug 2022 19:13:06 -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=@kernel.org header.s=k20201202 header.b=iXVJDGu8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238328AbiHWCEz (ORCPT + 99 others); Mon, 22 Aug 2022 22:04:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239519AbiHWCEp (ORCPT ); Mon, 22 Aug 2022 22:04:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B1165AA1B; Mon, 22 Aug 2022 19:04:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3DFA4B81A7F; Tue, 23 Aug 2022 02:04:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 071FDC433B5; Tue, 23 Aug 2022 02:04:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661220281; bh=g3jkvWJUGf3Fr73puF5aA7xyLqZ7AuXaOV6pbL558IE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=iXVJDGu8tekZUrtUzivDAW7rGl14rRMietxm40QK6v86UEmeeKvIMrKY4lW8hhgTf nFmw5sRfIrsuRPGUOzyeSgAUYNss7zKMoDsqgMk30oFOEH9TbtY30bnPwKRTS9j2/J oePVa73fc/oO0tsnnKZm1t1c3Jjv3QXIXA6HT5P6vDfqhpfiADgDo/FkQvSiW/0ds5 K8gqFsFraqUUKpEph/2GZIuIKNrCe4QC7EPayLY1btgcehmxYn04INpAE8Ne7lNTiZ rmEmBh7ieiGPl6IddKYbMIwF3d07cymY0YRQyjLxvkAHsHOkeVS8D/QcpaELr0h7FH h/xKiTWrCyTVw== Received: by mail-vs1-f54.google.com with SMTP id n125so13101750vsc.5; Mon, 22 Aug 2022 19:04:40 -0700 (PDT) X-Gm-Message-State: ACgBeo3pE5SFNRAC1fMnx9t5frgqjDmMozR0IYlvd2Ju1AYK66Nic/7c kyN5Px1Lb2M35a9mEWuxFIQ40TuKS7fB+88P5yc= X-Received: by 2002:a05:6102:390d:b0:387:78b9:bf9c with SMTP id e13-20020a056102390d00b0038778b9bf9cmr8686004vsu.43.1661220279942; Mon, 22 Aug 2022 19:04:39 -0700 (PDT) MIME-Version: 1.0 References: <20220819102037.2697798-1-chenhuacai@loongson.cn> In-Reply-To: From: Huacai Chen Date: Tue, 23 Aug 2022 10:04:28 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V3] LoongArch: Add efistub booting support To: Ard Biesheuvel Cc: Huacai Chen , Arnd Bergmann , loongarch@lists.linux.dev, linux-arch , Xuefeng Li , Guo Ren , Xuerui Wang , Jiaxun Yang , linux-efi , LKML , Xi Ruoyao Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Hi, Ard, On Mon, Aug 22, 2022 at 6:44 PM Ard Biesheuvel wrote: > > On Fri, 19 Aug 2022 at 12:20, Huacai Chen wrote: > > > > This patch adds efistub booting support, which is the standard UEFI boot > > protocol for us to use. > > > > We use generic efistub, which means we can pass boot information (i.e., > > system table, memory map, kernel command line, initrd) via a light FDT > > and drop a lot of non-standard code. > > > > We use a flat mapping to map the efi runtime in the kernel's address > > space. In efi, VA = PA; in kernel, VA = PA + PAGE_OFFSET. As a result, > > flat mapping is not identity mapping, SetVirtualAddressMap() is still > > needed for the efi runtime. > > > > Tested-by: Xi Ruoyao > > Signed-off-by: Huacai Chen > > --- > > V1 --> V2: > > 1, Call SetVirtualAddressMap() in stub; > > 2, Use core kernel data directly in alloc_screen_info(); > > 3, Remove the magic number in MS-DOS header; > > 4, Disable EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER; > > 5, Some other small changes suggested by Ard Biesheuvel. > > > > V2 --> V3: > > 1, Adjust Makefile to adapt zboot; > > 2, Introduce EFI_RT_VIRTUAL_OFFSET instead of changing flat_va_mapping. > > > > Thanks for the update. > > I am going to queue this up in the efi/next tree. However, due to the > many changes to arch/loongarch in this patch, conflicts are not > unlikely, so I created a signed stable tag for the patch that you can > merge into the loongarch arch tree if you want. > > *However*, you must *not* rebase your tree after merging this tag. > Therefore, it is probably best that the merge of this tag appears as > the very first change on your PR to Linus for v6.1. Everything after > can be rebased at will (assuming there are no other impediments to > doing so) > > You can fetch it and merge it like so: > > git fetch -t git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git > git verify-tag efi-loongarch-for-v6.1 # if you like > git merge efi-loongarch-for-v6.1 > > and all your other v6.1 changes can go on top. > > This way, you can resolve conflicts locally without affecting the EFI > changes going via the other tree. The EFI stub for LoongArch change > will arrive into Linus's tree via whichever tree he pulls first: the > LoongArch one or the EFI one. > > I will rebase my zboot decompressor changes on top of this - I will cc > you again, as the LoongArch builds ok but still does not boot. Thank you very much. There are several bugs that need to be fixed first for the 6.0 cycle, I will merge the efi-loongarch-for-v6.1 tag after that. Huacai > > Thanks, > Ard.