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 59178EB64DD for ; Tue, 1 Aug 2023 08:55:25 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5271086B5A; Tue, 1 Aug 2023 10:55: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=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="isRqbFrN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4076486B5E; Tue, 1 Aug 2023 10:55:21 +0200 (CEST) Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) (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 9EF7786B53 for ; Tue, 1 Aug 2023 10:55:18 +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-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-522ab301692so5278408a12.2 for ; Tue, 01 Aug 2023 01:55:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690880118; x=1691484918; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:from:to:cc:subject:date:message-id:reply-to; bh=pf2PoJt668TMoxjO3qWeTp/C8JjVyH021XryYax1nvs=; b=isRqbFrNNRt7PrQPk9rrfSJMJFxOKFv7ozMJiUqaAanHGAkNxrvOoJ9Y0URv3McTr6 PnPStkw8M4CBu4yKJtXUQ7OYOpEYunsiEZiVQ/pwrGnY1Ea0UIkezEqGzqKh5tOaOeTD 88+/Uy0VEH2azURonVFwKpU7Af32FfD7F33zeG9uqIqEj8chqZwD0zNrGEOOiPhwH5jr b24ql4bYGM0Uq3cn4SyIHUW048l6K0UzGJxDZfAuqPc15YuLvkl9DqOWDYyCUD6OSt7Z wY0zUAiBjQwCtmK2yih0fepkFazC8HLVZSLvP6VAMLhtXf+FkaB+QGQRPWeqD+BJzzXo UmVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690880118; x=1691484918; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pf2PoJt668TMoxjO3qWeTp/C8JjVyH021XryYax1nvs=; b=FUr3ILs9wXUdtKFB4VMKZjKhykX6mx33YMHCZvlLVKmYmncQPYiAp9bi1u8HejF0z/ Az+Mqu2k+3P+CBdFoyQNL1GovB/ta9Iz//u8ni0YQERVjGyfFNkRlDOh23tQz4rM5r/g wwRTHsNZSaegQKjs/WDWMVgf1AsiSECnCNBHCrRxHgtPnlrEeQ9MjYkGBXFVjGohiDZI ZrDWVxpP1tcihWgeSq6dKcb3M+oxaadF8h4RblJb12aThzFNbgYaCgb/Ey5DNiAwjgpt 6UdFvQi4yiwb0ZojX21uLFWkUWU7RaIeEkf0HVqLoDgvavg4K2iLOIk6ircfxsJtZ80t BAbA== X-Gm-Message-State: ABy/qLax6346j98mmHVqRQMPlRhNE/zMlqrO3vI6d8QQV+StS9gylr/Y VGngx/a1fPdOARsGZJN0edO9w9EuZn0UWA== X-Google-Smtp-Source: APBJJlHHNntGGge5LYvGsJgSAP/8hw2dTXS+aEvDP+Eax3QAa2oZv+NBeLltA9Lk1QV+7c7eC/LqeQ== X-Received: by 2002:a50:ed14:0:b0:522:586b:7db6 with SMTP id j20-20020a50ed14000000b00522586b7db6mr2074128eds.34.1690880117850; Tue, 01 Aug 2023 01:55:17 -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 l1-20020a056402028100b005224d15d3dfsm6646461edv.87.2023.08.01.01.55.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Aug 2023 01:55:17 -0700 (PDT) Date: Tue, 1 Aug 2023 10:53:52 +0200 From: Oliver Graute To: "Ying-Chun Liu (PaulLiu)" , Marc Zyngier Cc: u-boot@lists.denx.de, Marc Zyngier , =?iso-8859-1?Q?Pierre-Cl=E9ment?= Tosi , Tom Rini Subject: Re: [PATCH 1/2] arm64: Reduce add_map() complexity Message-ID: Mail-Followup-To: "Ying-Chun Liu (PaulLiu)" , Marc Zyngier , u-boot@lists.denx.de, =?iso-8859-1?Q?Pierre-Cl=E9ment?= Tosi , Tom Rini 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: <20230214133814.4173549-2-paul.liu@linaro.org> 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 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? Best Regards, Oliver