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=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham 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 41912C4338F for ; Tue, 3 Aug 2021 10:52:17 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0ADB760FC2 for ; Tue, 3 Aug 2021 10:52:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0ADB760FC2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject: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=ytYRMEUSiGWnJ1iXc+LuBzrUo9XKw5QXQcdoT+8eDUY=; b=BIrY2KUTmgCwbJ OdSRQSyhtZaVOX2fFQ8/QJ0hXJlVMjyrPcn65XgE1Yios1JAeQZx7lUXrdeLkvml6eT3qKFyIIkCB FcbswK4vgyFIiCsNriSuzRAz+q3h/5mkbELlg5UzIsZ+mvOSf0nTaZXyEn2XEodiNhfWEZqY60Emg eVuTe1SNI56CuOUSKw210lxHKOVvJKFP2rgZq6mH3qjO/2t2/thmcO0q5RHSccu/3z7YyRk3TKGaT iB6Z4P9AcguDhBBZAO0WFZLTUVwPJQnNJ5iJrRhdXrQuwH+yF+pRlh90fbe5OnmUb8F3Wb8JRaMhz mUcVG0zRmRDYhMRkeJHg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mArzl-002ACf-Mw; Tue, 03 Aug 2021 10:50:04 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mArzW-002A8s-FR for linux-arm-kernel@lists.infradead.org; Tue, 03 Aug 2021 10:49:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=t8EdQk1MYr0tUEaFt1pnsejrP9FNmS0O17YnTqvjq5A=; b=VCKaGabghOjhPPckZI1bNEw/j Rsu66WfPuC8PjmLN8jcXkZtH1DhqTCwlTbado6McoYuHAdFCrWB8M2ytsj8KlTLGWE2YRpobWnRsY UFNz3/Qtf75EBfPXBelVyYG1U8suVCzbKBrirYMHPqVafBcfMFDoBFRZaoXQZhVvgbiQtheCqD3ZP mL0DRo71/W3dbShGuNWGheMwgMU31B4D4rnEoORWglf2yq6fQaFAoqpS6HhtmoBjeGHO98oUpCCl7 NI+GLnC0fdhe95/1A0le4FHBsr9YbvYuPy7zJh8S0idObWfdADEmOA7hcdbwGCc6EH31tPMIocyNu EQnAgoM3w==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:46898) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mArzL-00073Q-D6; Tue, 03 Aug 2021 11:49:35 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1mArzJ-0003nM-8s; Tue, 03 Aug 2021 11:49:33 +0100 Date: Tue, 3 Aug 2021 11:49:33 +0100 From: "Russell King (Oracle)" To: Grygorii Strashko Subject: Re: [PATCH 3/3] ARM: Map the lowmem and kernel separately Message-ID: <20210803104932.GM22278@shell.armlinux.org.uk> References: <20210517145719.110966-1-linus.walleij@linaro.org> <20210517145719.110966-4-linus.walleij@linaro.org> <20210730202259.dbifugsvry5vjdr7@earthen> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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-20210803_034946_582411_6E161395 X-CRM114-Status: GOOD ( 33.42 ) 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: , Cc: Nishanth Menon , Florian Fainelli , Geert Uytterhoeven , Arnd Bergmann , Linus Walleij , santosh.shilimkar@oracle.com, Tero Kristo , Santosh Shilimkar , Ard Biesheuvel , 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, Aug 03, 2021 at 01:27:18PM +0300, Grygorii Strashko wrote: > > > On 31/07/2021 01:40, Linus Walleij wrote: > > On Fri, Jul 30, 2021 at 10:23 PM Nishanth Menon wrote: > > > On 16:57-20210517, Linus Walleij wrote: > > > > Using our knowledge of where the physical kernel sections start > > > > and end we can split mapping of lowmem and kernel apart. > > > > > > > [...] > > > > > > > > Signed-off-by: Linus Walleij > > > > > > > > > We noticed a regression in k2g platforms with this patch. > > > commit 6e121df14ccd ("ARM: 9090/1: Map the lowmem and kernel > > > separately") > > > > > > Boot log: https://pastebin.ubuntu.com/p/Sf3r28D8MR/ > > > Bisect log: https://pastebin.ubuntu.com/p/6PTYpNVFDy/ > > > > Given how invasive the patch is I'm surprised that k2g is the > > only thing so far complaining about it. Let's fix this! > > > > I've had similar reports and in those cases it has been that the boot > > loader did not turn off the caches before jumping to execute the > > Linux kernel. > > > > So first can you check that cache is off? > > > > Next can you turn on DEBUG_LL and enable the debug messages > > in arch/arm/mmu.c in map_lowmem() in some way that works for > > you, for example I just add a patch like this: > > https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git/patch/?id=d10c46631a6eaef1339e376b878de985143b27ff > > (Beware of ugly debug habits!) > > > > Next is this using the keystone 2 pv fixup thing mdesc->pv_fixup > > mdesc->pv_fixup in early_paging_init()? > > > > I added a special print > > there to see if that gets called. This code is really scary but I > > suppose Santosh can explain what is supposed to happen here > > and what I may have stepped on. (I see Santosh work at Oracle > > now? Interesting.) > > It should be called on all keystone 2 platforms by default (LAPE is default mode for K2). > > Huh. Below as I remember it: > - K2 starts using memory window (aliased memory) at 00 8000 0000 (No IO coherency is supported) > - K2, early at boot, is switching to LPAE memory window 08 0000 0000 (IO coherency is supported) > so all, already mapped memory, has to be fixed - phys addresses. If I remember correctly, the code that fixes that up assumes that (a) the kernel is mapped using section mappings in the lowmem mapping at PAGE_OFFSET.._end-1 (b) that no other RAM is mapped (iow, it's called before the kernel starts building the real page mappings in paging_init()). It looks to me like Linus missed the code in arch/arm/mm/pv-fixup-asm.S and as the kernel is no longer mapped in the lowmem mapping, this likely writes a load of entries in the page tables that are random... -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel