From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 92AE2C433FE for ; Mon, 7 Nov 2022 16:14:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=knQR8MSSs7EmL9GTKM4ACbM9tpRZe6LxOcbFA5JNU38=; b=l2F5AmhxVOQ2vf pTQ6mR35o9JUbaLSN0jjGUAre82pXBxSrTJMVuwkYiWnNFoWxmst72IbkuszdAKc1e5xaeX/YGypl wQkrFgUX9DGtye0cYhJ+pER0Jsi8JitiHYOFaPMM5sQmcweX7j/TraFxwbN1FEQr7Kjeg38FES78r JxcRw5SdZhXPX//ce3rS8NIatC0InzxHhHUrkvxoDDc6FuvQEeFqeu3fkkecW/G2RwFy4qS3Y2mjx V6myjWdu/Zd1m5toxjBg1eWQ6dma4/lax3C7559gyBydGVXAaH2/vwdhxr3cF7cbob1eUNie2XJWX cGwxA8JDWuqrJbjYaduA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1os4k4-00G47F-Dr; Mon, 07 Nov 2022 16:12:56 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1os4je-00G3uj-1W for linux-arm-kernel@lists.infradead.org; Mon, 07 Nov 2022 16:12:31 +0000 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 dfw.source.kernel.org (Postfix) with ESMTPS id 4B10B61189; Mon, 7 Nov 2022 16:12:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44BB9C433D6; Mon, 7 Nov 2022 16:12:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667837548; bh=QC6jwXB7pZSFZiayacrdUHtw3C127MJmlDzPPTXyZfc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Hs0b4M5EJhQXLHD6rRSaZuBr73/R8D+9qglQnkcIFK69fzcqEnCJ+v1Zw/4YthjjW A9m4oHQM55njxMimKwLaDUe/b0rP+P8NfOv1i0Kn4U2X/ez3K4UJ/EXj/rqi2d5D/H j3CXiHY3QJdcEI08xDeiLbPxlBgvDTJpvvW5wnxbP9r8vSY2yOg+Tdl0AXLB8COFYE i+pAke+Z3nypZ1yY/D5DgQmGoVdSs+zFd1KLhDqJ3IDri5Jkm/eUSlL23v8UKIueub Y07au9qSgX3Bwv7vCpz1+LiprbDmb6tjCSIzJeE3i8XZUP/eLoUJsUYK0xWh8E9KWp 07Fjhl94sV1qA== Date: Mon, 7 Nov 2022 16:12:23 +0000 From: Will Deacon To: Ard Biesheuvel Cc: linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, keescook@chromium.org, Catalin Marinas , Marc Zyngier , Mark Rutland Subject: Re: [PATCH v4 0/6] arm64: efi: leave MMU and caches on at boot Message-ID: <20221107161222.GE21157@willie-the-truck> References: <20221018110441.3855148-1-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221018110441.3855148-1-ardb@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221107_081230_158617_71271A00 X-CRM114-Status: GOOD ( 22.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Ard, On Tue, Oct 18, 2022 at 01:04:35PM +0200, Ard Biesheuvel wrote: > The purpose of this series is to remove any explicit cache maintenance > for coherency during early boot that becomes unnecessary if we simply > retain the cacheable 1:1 mapping of all of system RAM provided by EFI, > and use it to populate the ID map page tables. After setting up this > preliminary ID map, we disable the MMU, drop to EL1, reprogram the MAIR, > TCR and SCTLR registers as before, and proceed as usual, avoiding the > need for any manipulations of memory while the MMU and caches are off. > > The only properties of the firmware provided 1:1 map we rely on is that > it does not require any explicit cache maintenance for coherency, and > that it covers the entire memory footprint of the image, including the > BSS and padding at the end - all else is under control of the kernel > itself, as before. > > Changes since v3: > - drop EFI_LOADER_CODE memory type patch that has been queued in the > mean time > - rebased onto [partial] series that moves efi-entry.S into the libstub/ > source directory [0] > - fixed a correctness issue in patch #2 I really like this series, but I'm also very nervous about supporting booting the kernel with the MMU enabled outside of EFI. The booting documentation prohibits this, but we don't appear to take any steps to prevent this case with your series. Perhaps we shouldn't, but I do think it would be worth trying to warn+taint if we detect it so that we don't spend too much time debugging strange memory issues on platforms that try to use such a configuration. What do you think? Cheers, Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel