Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp2200289rwa; Mon, 22 Aug 2022 04:06:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR7fmfHjTs9UbxYw6zP70F/HYakGsrXTjcC9vE07ZgB4TolgoOXTowYxJzaaU6FiDU+ZGW+2 X-Received: by 2002:a05:6a00:24d2:b0:52f:1ead:2c55 with SMTP id d18-20020a056a0024d200b0052f1ead2c55mr20253767pfv.78.1661166365289; Mon, 22 Aug 2022 04:06:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661166365; cv=none; d=google.com; s=arc-20160816; b=hvJisxDFZiJuBV7SzgKXpvT839M4yceHisqlhG3PGe4TMI5+H4ThAvSNDr62dhfRr3 8//YxwXJD7O2Hp9prQvM9O/N+KhHG9hUAqYU2Qlj9QYxk2WPyTDQ3R8uJgmoZx5eTp8B JoY+TpWNdJYBLgSR5m9m1iISe3WKZ3C1FdLPCppBB2aGMVImYX5fDJlXaNB29y59dUqh wyFjZTPv6sA8mvE4A6Qe8yQ9f1lLkb6INEV6IOMqsVa8Xjo7oVYiTYhe+8l5jwbYuDst FTrGBOloSuAxhZ7LDelXIRecwhnZJrTqm7Q/7+zqjV4WB6Y8ISkDbVlROZ3mNGF8xp19 9hMA== 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=4YMvU65qQ04IqowCEYwWIpKFExLC5MhJHQddN3xHoAM=; b=dCGzhooZAHwJzBzk+MSP9dz21mFY0byFAn3HeFyL32mb+mDONiFzHa4n/7Yat86xv5 fpiDUzrIW/1ytChQh2NJ7UyaBEsbREmJcUJ4FnVOyU3oduE3ZI05uz9I/7MFWZfjn02Q qcXWg/N5R0R5/RN541G7ehU27FRm+58m/beQoan7BwuDFhcx+UxHJZVYoJYuX9L18y/L /Dq2Wpj985C+UDlChRXiAJQx//INPSJ8irgC8o41HQJkflvoKi4/0fDQ6iIOvTsgR+cY sfzbzb9/EtlyM4UHd3xbxVDVi3zsW52qxoFcH5WZOC2dIMLAnhRrpbqkBmw8MHtVl+aE e2xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=j9x05gbK; 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 j5-20020a170903024500b001727fd59497si12642025plh.358.2022.08.22.04.05.54; Mon, 22 Aug 2022 04:06:05 -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=j9x05gbK; 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 S232620AbiHVKoc (ORCPT + 99 others); Mon, 22 Aug 2022 06:44:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229586AbiHVKoa (ORCPT ); Mon, 22 Aug 2022 06:44:30 -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 2B87F2B24F; Mon, 22 Aug 2022 03:44:29 -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 D4C9FB81032; Mon, 22 Aug 2022 10:44:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84508C43140; Mon, 22 Aug 2022 10:44:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661165066; bh=4YMvU65qQ04IqowCEYwWIpKFExLC5MhJHQddN3xHoAM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=j9x05gbKjQGZwc9HIR8I6+4rCHw6QZjD13AXAE14TUDj9/3wNRRZQsk5D/WFWX93d xxK4I6f35LPIo2MIYhnxX7HcUznCJwfWbm5tOu7hER5qGXRGpES7Qdgn8Qr20qn3hE hyplEFM2Mrlk10qnr9jujsskZTPDUTHPIBvyCSOm3oIwkWPGc/mU6nKinbheVsVJwZ 7pP4kzrtNx3ObiIs9tcLsDlW00ILojgOPutyWxEZP61GhPB2VGfJE6BFUdOAMHZ8IM ILsV+8MyxElWQICm9lUakq9UBUjO7OC2iRc0E22Zdb8bqTqdv8dGBgZkuhekQNAv9E iVE58sR4PusRw== Received: by mail-wr1-f42.google.com with SMTP id a4so12685563wrq.1; Mon, 22 Aug 2022 03:44:26 -0700 (PDT) X-Gm-Message-State: ACgBeo2gtOf3Ykh7XM8eL36656CRoRsq3iENn9Hi7M6uJRjEdMhOD1UX hCjMf1j1HnLdvakhM/zv/OeE8s7llL+6ykT5BB0= X-Received: by 2002:adf:ebd2:0:b0:222:cd3f:cf9 with SMTP id v18-20020adfebd2000000b00222cd3f0cf9mr10524954wrn.598.1661165064692; Mon, 22 Aug 2022 03:44:24 -0700 (PDT) MIME-Version: 1.0 References: <20220819102037.2697798-1-chenhuacai@loongson.cn> In-Reply-To: <20220819102037.2697798-1-chenhuacai@loongson.cn> From: Ard Biesheuvel Date: Mon, 22 Aug 2022 12:44:13 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V3] LoongArch: Add efistub booting support To: Huacai Chen Cc: Arnd Bergmann , Huacai Chen , loongarch@lists.linux.dev, linux-arch@vger.kernel.org, Xuefeng Li , Guo Ren , Xuerui Wang , Jiaxun Yang , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, 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 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. Thanks, Ard.