From patchwork Thu Feb 20 13:54:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 866789 Delivered-To: patch@linaro.org Received: by 2002:a5d:47cf:0:b0:38f:210b:807b with SMTP id o15csp60224wrc; Thu, 20 Feb 2025 13:02:06 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWD5Ug0O/0n6I7FeJq4EKFk7Gq9y9JbUw0hjwXyhQ8ZFO3CjS8aWTBSTFTveKu+DNBskyr3jA==@linaro.org X-Google-Smtp-Source: AGHT+IHQB/xG5eEPWYA5lRz265CJ3yDdqrK6/DAbG9eO9pgfgqekH8J7vs4zxvrkx2fgj3+3Ichd X-Received: by 2002:a05:600c:1551:b0:439:9eba:93bb with SMTP id 5b1f17b1804b1-439ae1f19f0mr7419755e9.18.1740085326323; Thu, 20 Feb 2025 13:02:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1740085326; cv=none; d=google.com; s=arc-20240605; b=kWwSJNuOSK94hUGgugoqTzuliKSccokfNAxSTUW3IUnmCnMDD06y34kelVXYQQI1eC lRE+KWTV6K20/l4PdsCb2lVrf2gWrP1d51C5iVabe379adk0PMyULMGgbxkiifJC3sQ/ slsrmPfwmo2Cx5b1bh6F24PGQVjIifu0FhfrJAykAR/coUAMKuyMLLpkRxM7C2uxK1PI 3/+chvDDILOj0xDelmOrWZNjFEZBeXqf0lFakj3uvj29m+QBWdoSevPWqoQuZlfg5tWR Ue3UfW/gpBsWZXhSPckUm6FbkM0WU2XdpZJJWVaTF+/sNRCLkc4jecp5tkn9sCZhlVmN ycuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=B4GSS1ETVKQO5Boy5/n9bcml4EPCbjNmO/frH+vfBuQ=; fh=N+8ezPxhngi9VWsERn4L7pm4Wc0A/EFabDBfRbm8Xdg=; b=TXZh1vjwUcQP8TiUq0HlPwjBnu3U7s2SsOR5HXVBNCrIjUe43yyBmLx4bGz3mWJEzB X++6yIbpWegaQ42hvdQaz3ergKXx1ci28fTOtAXfMdlFkcYelFDzqmDEcT/pMy4aRguJ yPqEmcWbWECE+BCxR708+1aicPau3VXmYzeWyQMDSYtQ4kZnStE/dG7z63AvKNPqOCCD 5tA0xhC7q3YxMINQowTi93Td+k6eghbq2Ni09CE+DJqJsVC/EFlyVpEJLCPx0dUtfCjY hf6U4+0BYBuC0K3qAhYz+vo++TEpxLRBIvf+xKePsIuiUC4up4a+SPWaUuPkTBXa+RPe k7gA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QXVRmvOm; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 5b1f17b1804b1-4395a8cc8besi167175785e9.141.2025.02.20.13.02.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2025 13:02:06 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QXVRmvOm; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 85D3B80F7B; Thu, 20 Feb 2025 22:01:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="QXVRmvOm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4F2BF80F5F; Thu, 20 Feb 2025 14:55:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) (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 DD1A88001F for ; Thu, 20 Feb 2025 14:55:44 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-439a4fc2d65so6929285e9.3 for ; Thu, 20 Feb 2025 05:55:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740059744; x=1740664544; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=B4GSS1ETVKQO5Boy5/n9bcml4EPCbjNmO/frH+vfBuQ=; b=QXVRmvOmXIxJY0NavCQHtSzljlx93O+UmrKjPX76kaBXhIoC3vS1YfB2hbEqabUpb0 2cInTALQO1vke1e6VvKgHGOAlhIbIcMKOaxNwRPCwjA3794nloYPL2H/60kyx9yvHMjZ PDL2XSrazGcot7YTjPiJbIqwQxJCUkKeV5YJPLDTSvBhzrkVusuywjv3x+0Pwt3/3ZC3 QipVLCVtgrlTyM0B9iRvs8LyveX0dTisPZE7LNuQPpWE3c29C2od7u3D8uXADDWdLpXw bmUqeFsN+4CzGcv9uvxNS9Qvg3rM2Ia7zyJd84LDsh4IpLeVBSKwE2y0Ll1m+enz+rFf JOhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740059744; x=1740664544; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B4GSS1ETVKQO5Boy5/n9bcml4EPCbjNmO/frH+vfBuQ=; b=M6bqeFfSLGjSvOPaWX7aLFjvVotxZ0lFKe+cJqAXiFw+nq9qoOXlee//ei5UIXNFyX PFZY6dYeD+ZsWzKw5Cizb6ns+LTRuGZKbJZGimS6xCIJWZWg/cu2gXVohZ6Ix0+IGgZJ MHl5kys0hen5EnYqa32NlHYmS7XtBDKMwCDUs5PdnSc9xWsXvpVQPe78JfN+bO5Vn/hB +TNsZ3FYAEGhpu8swJ5cvWSzC2UwwaGCOru8mapWJRpi7pEaDHkKBcz6cBnlRCpiWSk4 UN0kRlQWCnShKHwKLwaM6ooCMmbWVAFDo5qBSx9LT1p/AjVBSAdUzjxyoyRRfTMslloI IaLw== X-Forwarded-Encrypted: i=1; AJvYcCWDQEF/No+EULa/2f9S5Qc0qKRE75n/6sZwlWBfXhRcjrXIIJJOYi4/06aR+6EVIrRY/SBSZpg=@lists.denx.de X-Gm-Message-State: AOJu0Yw7H3OJbl+GnsWC67wcELPJt/2n/9FZ1FGnBgyIUgmFFZngQbJ4 lG/TSbtlA9MVg3hbiO7BYMCB6vHj67zy/as+MC1ilW1WPhub9kRcxDidYCLlbq0= X-Gm-Gg: ASbGncv+/TFxRFgQUo+4VVPWvEsuHbF+Hb0gzHycBCmvfMsU0ydKYUshPuaxzPnyCxA haI6aJ6m8qb9/UAt+foExgSJlEcRx6fyhn1ejNuyBJHe+n6iIbZs9Dtrrs/W5vXBsV6amtFJfRX ulZ82q3MjCN1pJ9juC2k4I7b/3m7qi1eJGMBcc+QwtxmuUXXcDaMSRwTFLxmKrkDH6V3kKWkbE3 rejFdO0pfGzomjXrVUQ8m6/XM/WzKfOCUTMqc2GDcI1ocBcpZZhFZBAOfp8xTi1vHfswu+bRn4E OaG7pRETgrKJ6/GT2wZiXRKn9Tcd8fKw1kdk6za1ZYlhwxM8+vawt0yOnadfo/Kcek6oOg== X-Received: by 2002:a05:600c:450d:b0:439:9dec:b7a2 with SMTP id 5b1f17b1804b1-4399decb9a6mr63218455e9.2.1740059744214; Thu, 20 Feb 2025 05:55:44 -0800 (PST) Received: from localhost.localdomain (ppp176092191135.access.hol.gr. [176.92.191.135]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43987088ecbsm111659865e9.31.2025.02.20.05.55.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2025 05:55:43 -0800 (PST) From: Ilias Apalodimas To: xypron.glpk@gmx.de, mark.kettenis@xs4all.nl Cc: Ilias Apalodimas , Alexey Brodkin , Eugeniy Paltsev , Tom Rini , Caleb Connolly , Neil Armstrong , Sumit Garg , Huan Wang , Angelo Dureghello , Thomas Chou , Rick Chen , Leo , Marek Vasut , Nobuhiro Iwamatsu , Max Filippov , Simon Glass , Sughosh Ganu , Marc Zyngier , Sam Protsenko , Peng Fan , Richard Henderson , Sam Edwards , Jerome Forissier , Peter Hoyes , Andre Przywara , Patrick Rudolph , Sam Day , Mayuresh Chitale , Mattijs Korpershoek , Stefan Roese , Jiaxun Yang , Joshua Watt , Alex Shumsky , Jagan Teki , Evgeny Bachinin , Christian Marangi , Michal Simek , Rasmus Villemoes , Jonas Jelonek , uboot-snps-arc@synopsys.com, u-boot@lists.denx.de, u-boot-qcom@groups.io Subject: [PATCH v2 2/6] doc: update meminfo with arch specific information Date: Thu, 20 Feb 2025 15:54:39 +0200 Message-ID: <20250220135506.151894-3-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250220135506.151894-1-ilias.apalodimas@linaro.org> References: <20250220135506.151894-1-ilias.apalodimas@linaro.org> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 20 Feb 2025 22:01:46 +0100 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 Since we added support in meminfo to dump live page tables, describe the only working architecture for now (aarch64) and add links to public documentation for further reading. Signed-off-by: Ilias Apalodimas --- doc/usage/cmd/meminfo.rst | 71 +++++++++++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 18 deletions(-) diff --git a/doc/usage/cmd/meminfo.rst b/doc/usage/cmd/meminfo.rst index 6c94493cccc6..e10bdc6832cf 100644 --- a/doc/usage/cmd/meminfo.rst +++ b/doc/usage/cmd/meminfo.rst @@ -18,7 +18,8 @@ Description The meminfo command shows the amount of memory. If ``CONFIG_CMD_MEMINFO_MAP`` is enabled, then it also shows the layout of memory used by U-Boot and the region -which is free for use by images. +which is free for use by images. In architectures that support it, it also prints +the mapped pages and their permissions. The latter is architecture specific. The layout of memory is set up before relocation, within the init sequence in ``board_init_f()``, specifically the various ``reserve_...()`` functions. This @@ -26,8 +27,9 @@ The layout of memory is set up before relocation, within the init sequence in ending with the stack. This results in the maximum possible amount of memory being left free for image-loading. -The meminfo command writes the DRAM size, then the rest of its outputs in 5 -columns: +The meminfo command writes the DRAM size. If the architecture also supports it, +page table entries will be shown next. Finally the rest of the outputs are +printed in 5 columns: Region Name of the region @@ -99,28 +101,61 @@ free Free memory, which is available for loading images. The base address of this is ``gd->ram_base`` which is generally set by ``CFG_SYS_SDRAM_BASE``. +Aarch64 specific flags +---------------------- + +More information on the output can be found +Chapter D8 - The AArch64 Virtual Memory System Architecture at +https://developer.arm.com/documentation/ddi0487/latest/ + +In short, for a stage 1 translation regime the following apply: + +* RWX: Pages mapped with Read, Write and Execute permissions +* RO: Pages mapped with Read-Only permissions +* PXN: PXN (Privileged Execute Never) applies to execution at EL1 and above +* UXN: UXN (Unprivileged Execute Never) applies to EL0 + Example ------- This example shows output with both ``CONFIG_CMD_MEMINFO`` and -``CONFIG_CMD_MEMINFO_MAP`` enabled:: - - => meminfo - DRAM: 256 MiB +``CONFIG_CMD_MEMINFO_MAP`` enabled for aarch64 qemu:: + + DRAM: 8 GiB + Walking pagetable at 000000023ffe0000, va_bits: 40. Using 4 levels + [0x0000023ffe1000] | Table | | | + [0x0000023ffe2000] | Table | | | + [0x00000000000000 - 0x00000008000000] | Block | RWX | Normal | Inner-shareable + [0x00000008000000 - 0x00000040000000] | Block | PXN UXN | Device-nGnRnE | Non-shareable + [0x00000040000000 - 0x00000200000000] | Block | RWX | Normal | Inner-shareable + [0x0000023ffea000] | Table | | | + [0x00000200000000 - 0x0000023f600000] | Block | RWX | Normal | Inner-shareable + [0x0000023ffeb000] | Table | | | + [0x0000023f600000 - 0x0000023f68c000] | Pages | RWX | Normal | Inner-shareable + [0x0000023f68c000 - 0x0000023f74f000] | Pages | RO | Normal | Inner-shareable + [0x0000023f74f000 - 0x0000023f794000] | Pages | PXN UXN RO | Normal | Inner-shareable + [0x0000023f794000 - 0x0000023f79d000] | Pages | PXN UXN | Normal | Inner-shareable + [0x0000023f79d000 - 0x0000023f800000] | Pages | RWX | Normal | Inner-shareable + [0x0000023f800000 - 0x00000240000000] | Block | RWX | Normal | Inner-shareable + [0x00000240000000 - 0x00004000000000] | Block | RWX | Normal | Inner-shareable + [0x0000023ffe3000] | Table | | | + [0x00004010000000 - 0x00004020000000] | Block | PXN UXN | Device-nGnRnE | Non-shareable + [0x0000023ffe4000] | Table | | | + [0x00008000000000 - 0x00010000000000] | Block | PXN UXN | Device-nGnRnE | Non-shareable Region Base Size End Gap ------------------------------------------------ - video f000000 1000000 10000000 - code ec3a000 3c5d28 efffd28 2d8 - malloc 8c38000 6002000 ec3a000 0 - board_info 8c37f90 68 8c37ff8 8 - global_data 8c37d80 208 8c37f88 8 - devicetree 8c33000 4d7d 8c37d7d 3 - bootstage 8c32c20 3c8 8c32fe8 18 - bloblist 8c32000 400 8c32400 820 - stack 7c31ff0 1000000 8c31ff0 10 - free 0 7c31ff0 7c31ff0 0 - + video 23f7e0000 800000 23ffe0000 + code 23f68a000 156000 23f7e0000 0 + malloc 23e64a000 1040000 23f68a000 0 + board_info 23e649f80 78 23e649ff8 8 + global_data 23e649df0 188 23e649f78 8 + devicetree 23e549df0 100000 23e649df0 0 + bloblist 23e547000 2000 23e549000 df0 + stack 23d546ff0 1000000 23e546ff0 10 + lmb 23d546ff0 0 23d546ff0 0 + lmb 23d543000 3ff0 23d546ff0 0 + free 40000000 23d543000 27d543000 ffffffffc0000000 Return value ------------