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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3D549C0015E for ; Tue, 1 Aug 2023 12:16:29 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9565786B01; Tue, 1 Aug 2023 14:16:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DN14lhK1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E134586B04; Tue, 1 Aug 2023 14:16:25 +0200 (CEST) Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 453E886828 for ; Tue, 1 Aug 2023 14:16:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=oliver.graute@gmail.com Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-99c0cb7285fso343337766b.0 for ; Tue, 01 Aug 2023 05:16:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690892182; x=1691496982; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :resent-to:resent-message-id:resent-date:resent-from:from:to:cc :subject:date:message-id:reply-to; bh=IiEW3PsYCjiBB9dYUgOEbAIsdROfKXcgbvxKbLLWuVM=; b=DN14lhK1kt8k34/M+McwHxISQbSiPY0oUGiqQ7qDyuxm04qaxkbf8LMEWbHGUVs97C Q25qpmLDjYNCA6H1UhyZSPxfQNI2Oeru/d9XYbMs7rDJs427oQwN5a40UWy1Fa48Bt6y SS5PKFhDmwbJwPd8l1ITU2BCum81lmuTvG+44nxvOueQvK5UKD3qU0D1aXduHiKJN2ka pdF27HRpGOp9+DjO1S7O1zWPJm8Z3GTWQX+em13m7c8muVTa2UUpvE/PMCdehR6iG/vG ufb2e26MKU7Q/QFC0VVBAIANOCq/pc1oY5VdY24RSJFEldwkg3+zxwX7x1s9D7nGGxoz pDKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690892182; x=1691496982; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :resent-to:resent-message-id:resent-date:resent-from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IiEW3PsYCjiBB9dYUgOEbAIsdROfKXcgbvxKbLLWuVM=; b=P8Zt4/WwAJA+MjBO6Ei4MHHc4U+ou1gDTvY7gx2AnDKlfNGX5bEQU+QL/AF86rP+IB xTbgJC0icny5mwadJKmN4UsuoCZ6/6MXHjmtm1uxXJ1xAlZoWMxc+2uFNmO9+C8xY80l 43NK2Vy962Tpq4l27oN7aQvXOG7PHrBSRAPq1HA7UfO4zeKJU3RndHVmlRXBGqdwhFnC P7hAXFzjcrvA4xB6CGn5RlY6Myszf8eB9K2HGm44CGCQaWEmVVjcizx0b6rj08vSMj1u /FZF84th5iixP2Xlklee39vfbYdKOPwhgH1ijiUZYHY1fEE6LTwzrgAaJuwzFQGU7EwT Ffgw== X-Gm-Message-State: ABy/qLZenRVxnpjVuAL2857mQYG8T4oVWgxQEr2LUzexgdwXz2/aG3OV sS53MX7nm0D/o7ktuDZGNK9Eew5SFKA15A== X-Google-Smtp-Source: APBJJlGZav4aZ7Ali/1hlvgFz815W2F6ALOr5vb+3pJG8HoUNBKLmG+L2pk7SNlsOFZrx7M95ktXWg== X-Received: by 2002:a17:907:2c48:b0:993:c48f:184c with SMTP id hf8-20020a1709072c4800b00993c48f184cmr2132783ejc.10.1690892182042; Tue, 01 Aug 2023 05:16:22 -0700 (PDT) Received: from localhost (business-90-187-74-145.pool2.vodafone-ip.de. [90.187.74.145]) by smtp.gmail.com with ESMTPSA id t15-20020a1709066bcf00b009893650453fsm7634192ejs.173.2023.08.01.05.16.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Aug 2023 05:16:21 -0700 (PDT) Resent-From: Oliver Graute Resent-Date: Tue, 1 Aug 2023 14:16:12 +0200 Resent-Message-ID: Resent-To: u-boot@lists.denx.de Received: from localhost (business-90-187-74-145.pool2.vodafone-ip.de. [90.187.74.145]) by smtp.gmail.com with ESMTPSA id g12-20020a056402180c00b00522ce914f51sm2191578edy.67.2023.08.01.05.10.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Aug 2023 05:10:16 -0700 (PDT) Date: Tue, 1 Aug 2023 14:09:34 +0200 From: Oliver Graute To: "u-boot@lists.denx.de Marc Zyngier" , "Ying-Chun Liu (PaulLiu)" , jason.hui.liu@nxp.com, peng.fan@nxp.com Cc: =?iso-8859-1?Q?Pierre-Cl=E9ment?= Tosi , Tom Rini , oliver.graute@kococonnector.com Subject: Re: [PATCH 1/2] arm64: Reduce add_map() complexity Message-ID: References: <20230214133814.4173549-1-paul.liu@linaro.org> <20230214133814.4173549-2-paul.liu@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On 01/08/23, Oliver Graute wrote: > On 14/02/23, Ying-Chun Liu (PaulLiu) wrote: > > From: Marc Zyngier > > > > In the add_map() function, for each level it populates, it iterates from > > the root of the PT tree, making it ineficient if a mapping needs to occur > > past level 1. > > > > Instead, replace it with a recursive (and much simpler) algorithm > > that keeps the complexity as low as possible. With this, mapping > > 512GB at level 2 goes from several seconds down to not measurable > > on an A55 machine. > > > > We keep the block mappings at level 1 for now though. > > > > Signed-off-by: Marc Zyngier > > Signed-off-by: Pierre-Clément Tosi > > [ Paul: pick from the Android tree. Fixup Pierre's commit. Rebase to the > > upstream ] > > Signed-off-by: Ying-Chun Liu (PaulLiu) > > Cc: Tom Rini > > Link: https://android.googlesource.com/platform/external/u-boot/+/96ad729cf4cab53bdff8222bb3eb256f38b5c3a6 > > Link: https://android.googlesource.com/platform/external/u-boot/+/6be9330601d81545c7c941e3609f35bf68a09059 > > Hello Marc, > > this patch somehow broke the boot of my imx8qm board. I run into this > issue: > > U-Boot 2023.07-rc6-00004-g5527698481 (Aug 01 2023 - 10:10:52 +0200) > > Model: Advantech iMX8QM DMSSE20 > Board: DMS-SE20A1 8GB > Build: SCFW 549b1e18, SECO-FW c9de51c0, ATF 5782363 > Boot: USB > DRAM: 8 GiB > "Error" handler, esr 0xbf000000 > elr: 0000000080020938 lr : 00000000800209c8 (reloc) > elr: 00000000ffecf938 lr : 00000000ffecf9c8 > x0 : 0000000000000001 x1 : 0000000060000000 > x2 : 0000000010000000 x3 : 0000000000000002 > x4 : 0000000040000000 x5 : 0060000000000401 > x6 : 0000000000000800 x7 : 00000000fff44a60 > x8 : 0068000000000481 x9 : 0000000000000008 > x10: 000000000a200023 x11: 0000000000000002 > x12: 0000000000000002 x13: 0000000080095a00 > x14: 00000000ffffffff x15: 00000000ffecfd2c > x16: 000000008005454c x17: 0000000000000000 > x18: 00000000fd6afd50 x19: 000000000fe00000 > x20: 0000000000000000 x21: 0060000000000401 > x22: 0000000060200000 x23: 0000000000200000 > x24: 0000000040000808 x25: 00000000001fffff > x26: 0000000000000003 x27: 0000000060200000 > x28: 0000000000000002 x29: 00000000fd6ab110 > > Code: a94573fb a8c67bfd d65f03c0 b9418a40 (8a160334) > Resetting CPU ... > > resetting ... > SCI reboot request............................................................................................................................................................................................................................ > > After some bisecting this patch poped up: > > 41e2787f5ec4249cb2e77a3ebd3c49035e3c6535 is the first bad commit > arm64: Reduce add_map() complexity > > After I reverted everything on top of this patch its booting again with v2023.07 > > commit c1da6fdb5c239b432440721772d993e63cfdeb20 > armv8: enable HAFDBS for other ELx when FEAT_HAFDBS is present > > commit 836b8d4b205d2175b57cb9ef271e638b0c116e89 > arm64: Use level-2 for largest block mappings when FEAT_HAFDBS is present > > commit 6cdf6b7a340db4ddd008516181de7e08e3f8c213 > arm64: Use FEAT_HAFDBS to track dirty pages when available > > > Do you have any idea whats going on here? Is this behavior somehow releated to the known Cache coherency issue on A53 Core on NXP imx8qm? https://lore.kernel.org/linux-arm-kernel/ZDflS%2FCnEx8iCspk@FVFF77S0Q05N/T/#mf733406e618244b0b21fd25077febd69b31b686e +Jason Liu +Peng Fan Best Regards, Oliver