From patchwork Fri Dec 3 20:25:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C5=81ukasz_Stelmach?= X-Patchwork-Id: 1563368 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=samsung.com header.i=@samsung.com header.a=rsa-sha256 header.s=mail20170921 header.b=uNZNmsEr; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4J5PVP151Qz9s0r for ; Sat, 4 Dec 2021 07:26:19 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 7604180F1E; Fri, 3 Dec 2021 20:26:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Hzaym8-DrbCt; Fri, 3 Dec 2021 20:26:15 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id B9B6383123; Fri, 3 Dec 2021 20:26:14 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 10BB01BF378 for ; Fri, 3 Dec 2021 20:26:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id F3B3460B9D for ; Fri, 3 Dec 2021 20:26:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=samsung.com Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fqOmWvqJw-Wa for ; Fri, 3 Dec 2021 20:26:11 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by smtp3.osuosl.org (Postfix) with ESMTPS id C8B0A60AB0 for ; Fri, 3 Dec 2021 20:26:10 +0000 (UTC) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20211203202607euoutp012e206ad6caccd62a40bc26e63b8f4178~9WIUNtfI90770207702euoutp01j for ; Fri, 3 Dec 2021 20:26:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20211203202607euoutp012e206ad6caccd62a40bc26e63b8f4178~9WIUNtfI90770207702euoutp01j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1638563167; bh=iV1cADU8J3uxNgRr1dBvLo5PtZKk6SRZDfSyLICI2Ow=; h=From:To:Cc:Subject:Date:References:From; b=uNZNmsErmsWMvmaG+VrrwGQuGh1rg0uWx9T2+yIZgKvMMSc7uYaQklXGTF20jyAUw EK1UTaRw7zYFXAUWMVm7GgBRCq0zUyjWy3Q2ybCCGIZDRmjs9r6szqFQSIzfDAH9J1 Gk1PD/7Bx9rURiEp0et4jg1GCxQtQLvVG2VjwEco= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20211203202606eucas1p2157a38c42f85c450b042c29deef073cb~9WITMeO9-1234112341eucas1p2M; Fri, 3 Dec 2021 20:26:06 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 30.66.10260.E5D7AA16; Fri, 3 Dec 2021 20:26:06 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20211203202606eucas1p1c5fd10ed5661e22dfea6199a69b7414b~9WIS2ypsq0641406414eucas1p1Q; Fri, 3 Dec 2021 20:26:06 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20211203202606eusmtrp24f0de318cd940750c13104540290ce3e~9WIS2L1Z91627916279eusmtrp2z; Fri, 3 Dec 2021 20:26:06 +0000 (GMT) X-AuditID: cbfec7f5-bddff70000002814-3e-61aa7d5e8b96 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id B3.A1.09404.E5D7AA16; Fri, 3 Dec 2021 20:26:06 +0000 (GMT) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20211203202606eusmtip28913d9fbb849bbdcf5b897f793e0b712~9WISp_xzR0790307903eusmtip2-; Fri, 3 Dec 2021 20:26:06 +0000 (GMT) From: =?utf-8?q?=C5=81ukasz_Stelmach?= To: buildroot@buildroot.org Date: Fri, 3 Dec 2021 21:25:59 +0100 Message-Id: <20211203202559.253726-1-l.stelmach@samsung.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Organization: Samsung R&D Institute Poland X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrGIsWRmVeSWpSXmKPExsWy7djPc7pxtasSDXa/NbZ43rCV1eLmoRWM FmuP3GW36Hzzjt2BxWPemmqPy+/nsnv0bV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/nsnv0bVnFGMAcpWdTlF9akqqQkV9cYqsUbWhhpGdoaaFn ZGKpZ2hsHmtlZKqkb2eTkpqTWZZapG+XoJdx4rBSwVaBivaJE9kbGO/ydjFyckgImEjMmf6T vYuRi0NIYCmjxNn+btYuRg6ghJTEyrnpEDXCEn+udbFB1DxllHjauYINJMEm4CjRv/QEK4gt IiAt8f3eWVaQImaBhYwSm/afBysSFrCWeLuoiR3EZhFQlfiw/yBYnFfARmJv8xcmiA3yEm3X pzNCxAUlTs58wgJyBLOAusT6eUIgYX4BLYk1TddZQGxmoPLmrbOZJzAKzELSMQuhYxaSqgWM zKsYRVJLi3PTc4uN9IoTc4tL89L1kvNzNzECg37bsZ9bdjCufPVR7xAjEwfjIUYJDmYlEV6T ylWJQrwpiZVVqUX58UWlOanFhxhNgT6YyCwlmpwPjLu8knhDMwNTQxMzSwNTSzNjJXFez4KO RCGB9MSS1OzU1ILUIpg+Jg5OqQamPZ7n1nn8dN7xXneP3GQVOc7fN/ed6nQIzVl879QvT5vW NYlz5Bzyu83ZEwP61NrVEnYGrUxY3Don5tiBfVFBuzqPaWp8skn7/CT/uu47/4mH/Gffei9y jP3nJ5XP93qCV/MedpBQW8nDxvj2rLN1pVW7x4apCpPqo93qFRuiOSNea73snK+38c5a03TW B+qOZpXBOtmN/2vz/RR2WyndiU46GtvIFs6vNjdQYtOciEUVMeuesJ47eZpRdtmceUHr5Ys9 L99dWd/roieoMm2+f/7uxkNcf66Khz8MbWLR87oT8rA2YEvcipf7JQ9yePYefeuqddjw1uZq bhv7XWeSn9bLTt/8a03rhtCNFQ+VWIozEg21mIuKEwGnfiwXAwMAAA== X-CMS-MailID: 20211203202606eucas1p1c5fd10ed5661e22dfea6199a69b7414b X-Msg-Generator: CA X-RootMTR: 20211203202606eucas1p1c5fd10ed5661e22dfea6199a69b7414b X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20211203202606eucas1p1c5fd10ed5661e22dfea6199a69b7414b References: Subject: [Buildroot] [PATCH 1/1] arch/arm: Choose page size for AArch64 X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?=C5=81ukasz_Stelmach?= , Thomas Petazzoni , Marek Szyprowski Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" MMUs on AArch64 support three different page sizes: 4 kB, 16 kB, and 64 kB. It is OS kernel's task to choose the configuration during boot. Linux kernel can be compiled to support different page size. To run on a system with pages larger than 4 kB userland binaries need to be properly aligned during the linking process. However, binaries prepared for systems with larger pages can run on systems with smaller pages. Signed-off-by: Ɓukasz Stelmach --- arch/Config.in.arm | 24 ++++++++++++++++++++++++ arch/arch.mk.arm | 12 ++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 arch/arch.mk.arm diff --git a/arch/Config.in.arm b/arch/Config.in.arm index 4c0910e4f8..bc6452878d 100644 --- a/arch/Config.in.arm +++ b/arch/Config.in.arm @@ -930,5 +930,29 @@ config BR2_READELF_ARCH_NAME default "ARM" if BR2_arm || BR2_armeb default "AArch64" if BR2_aarch64 || BR2_aarch64_be +choice + prompt "Aarch64 MMU Page Size" + default BR2_ARM_PAGE_SIZE_4K + depends on BR2_aarch64 || BR2_aarch64_be + help + Choose MMU page size + +config BR2_ARM_PAGE_SIZE_4K + bool "4KB" + +config BR2_ARM_PAGE_SIZE_16K + bool "16KB" + +config BR2_ARM_PAGE_SIZE_64K + bool "64KB" + +endchoice + +config BR2_ARM_PAGE_SIZE + string + default "4K" if BR2_ARM_PAGE_SIZE_4K + default "16K" if BR2_ARM_PAGE_SIZE_16K + default "64K" if BR2_ARM_PAGE_SIZE_64K + # vim: ft=kconfig # -*- mode:kconfig; -*- diff --git a/arch/arch.mk.arm b/arch/arch.mk.arm new file mode 100644 index 0000000000..ef65c60f6c --- /dev/null +++ b/arch/arch.mk.arm @@ -0,0 +1,12 @@ +ifeq ($(filter y, $(BR2_aarch64) $(BR2_aarch64_be)), y) + +# Explicitly set LD's "max-page-size" instead of relying on some defaults +ifeq ($(BR2_ARM_PAGE_SIZE_4K),y) +ARCH_TOOLCHAIN_WRAPPER_OPTS += -Wl,-z,max-page-size=4096 +else ifeq ($(BR2_ARM_PAGE_SIZE_16K),y) +ARCH_TOOLCHAIN_WRAPPER_OPTS += -Wl,-z,max-page-size=32768 +else ifeq ($(BR2_ARM_PAGE_SIZE_64K),y) +ARCH_TOOLCHAIN_WRAPPER_OPTS += -Wl,-z,max-page-size=65536 +endif + +endif