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 X-Spam-Level: X-Spam-Status: No, score=-4.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E8F0C433E0 for ; Tue, 9 Feb 2021 22:38:38 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C932964E31 for ; Tue, 9 Feb 2021 22:38:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C932964E31 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TGMj9wuSKCN7D4S7RrpcehXqAuJuP7+QS677FJbmZ74=; b=RE2PZI5V3Gdi6h+Aimk46wJGr l3mIcZY3RJqjIx2mOfEw9Ip5PC+zZRK+A+qHHJbD/5emHpi4MqhvNWqtDmFOBrIsldhf30ddG9Oqo XtvXl6nRyLeEr+JRUepMMeAY9UvN8AM4WL/45CXY8xKdqR5W9qslX9W5OfbOlviCVSkzd83AfSxhU J37DS3MEA9C4KBFeftha9936ukij9hKayc4xCIu+ablU1M7m/HCXT5TBHTRW6DzcptbYtWJohMZes q8bxOFcBrbFY+bBV4KZDpX9TN8BSJi7HShOheTzhBf205O9C8X95xJcjnIELXXlkzKCl2r+kCRSCA YJmu2E8eA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9bdN-0001yO-Fe; Tue, 09 Feb 2021 22:37:25 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9bdL-0001xz-Of for linux-arm-kernel@lists.infradead.org; Tue, 09 Feb 2021 22:37:24 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5E32A64E3B for ; Tue, 9 Feb 2021 22:37:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612910242; bh=RcRyaXzri0k2AnSfRmU+DhP9upsGrcL/YmqfgsuKiOE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ZKjR3yAU9mB3qaE5GDFtATdPv8TbPmG8BpTJDJ6z6F5UTf+JcU+1TJ3Z2sI/rydCd tn/WlPfNJXFbTU96+65MjD5Uc2Wkv8CHOz1VkeWenGQOA9x2bjVdjpK6WgVEWeDs2g 0RhLWIbvqo2Q2FVOwbe4VHenpwlikx0T8iPpo70lwTbE/o58m0NLSoTfZi3wF2pQKX aCxkM0msg1G++IESPm5FTlyxJFW173ugKNQXbuP+BbyMvkziH6a07OAtGCkxP/WEjQ Hazq0Wmn71bAz8qmuKtyPmijvnpfUapjbBUtTDrQMbOlNdvtIXu/djXtJhUGqfnGLR XSrT2+Ci708CA== Received: by mail-oi1-f172.google.com with SMTP id d20so21200218oiw.10 for ; Tue, 09 Feb 2021 14:37:22 -0800 (PST) X-Gm-Message-State: AOAM531KkEXrIt5FrCygQk5AgRY2rwIROEX2AINQk1kgnlVE+yFBoc7a zlK7evcjqf12sVxF9+nPXBNSzutWbj78YKIVffc= X-Google-Smtp-Source: ABdhPJzgeYwjbCt/8QZ8RNC2hXtRwtf/ZdJT0d1sKIrlxNgi4E3IBuzRttJRsGL/qli/s3Kp6MXIhTDnoJbff3eoIJk= X-Received: by 2002:aca:307:: with SMTP id 7mr9498oid.174.1612910241665; Tue, 09 Feb 2021 14:37:21 -0800 (PST) MIME-Version: 1.0 References: <20210208224959.13683-1-ardb@kernel.org> <10r5qp6n-pqr4-285n-646o-73o236124024@syhkavp.arg> In-Reply-To: <10r5qp6n-pqr4-285n-646o-73o236124024@syhkavp.arg> From: Ard Biesheuvel Date: Tue, 9 Feb 2021 23:37:10 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/3] ARM: v7: get rid of boot time mini stack To: Nicolas Pitre X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210209_173723_898692_03F24C8A X-CRM114-Status: GOOD ( 20.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , Linus Walleij , Android Kernel Team , Russell King , Linux ARM 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 On Tue, 9 Feb 2021 at 00:12, Nicolas Pitre wrote: > > On Mon, 8 Feb 2021, Ard Biesheuvel wrote: > > > The v7 boot code uses a small chunk of BSS to preserve some register > > contents across a call to v7_invalidate_l1 that occurs with the MMU and > > caches disabled. Memory accesses in such cases are tricky on v7+, given > > that the architecture permits some unintuitive behaviors (it is > > implementation defined whether accesses done with the MMU and caches off > > may hit in the caches, and on SoCs that incorporate off-core system > > caches, this behavior appears to be different even between cache > > levels). Also, cache invalidation is not safe under virtualization if > > the intent is to retain stores issued directly to DRAM, given that the > > hypervisor may upgrade invalidate operations to clean+invalidate, > > resulting in DRAM contents to be overwritte by the dirty cachelines that > > we were trying to evict in the first place. > > > > So let's address this issue, by removing the need for this stack to > > exist in the first place: v7_invalidate_l1 can be rewritten to use fewer > > registers, which means fewer registers need to be preserved, and we have > > enough spare registers available. > > That is excellent. > > I wonder why r1-r3 were preserved though. > r1 and r2 are documented in head.S as * The processor init function will be called with: * r1 - machine type * r2 - boot data (atags/dt) pointer but preserving the value of r3 does not seem necessary. Perhaps this is a leftover from old code? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel