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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98150C433EF for ; Wed, 20 Apr 2022 21:09:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382328AbiDTVMY (ORCPT ); Wed, 20 Apr 2022 17:12:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379079AbiDTVMX (ORCPT ); Wed, 20 Apr 2022 17:12:23 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2564E47AE6 for ; Wed, 20 Apr 2022 14:09:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1650488976; x=1682024976; h=from:to:cc:subject:date:message-id:mime-version; bh=CVpGC15qTB4Dx3RmzQhS+gi/i1dRRHj+8ZZU5naui3I=; b=C4lk6QTtuGPe/LlxT1yyGqv4RgbH7rpdXVTIW95jmWAUym31Sr4EkxAO zWsXxHy5nXbc4UQ4p+6gnzwzPfnE5eSpusnwAo4crt4CRzecX1hsBTGSF qHtsjbrIdaPaVCmOLEXXwWRHmVgthH2VESaiLNwiMw0ZptZ0ZcfebXVht 8=; Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-02.qualcomm.com with ESMTP; 20 Apr 2022 14:09:35 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg01-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2022 14:09:35 -0700 Received: from nalasex01b.na.qualcomm.com (10.47.209.197) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 20 Apr 2022 14:09:35 -0700 Received: from hu-pdaly-lv.qualcomm.com (10.49.16.6) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 20 Apr 2022 14:09:34 -0700 From: Patrick Daly To: , , , CC: Patrick Daly Subject: [PATCH] of: of_reserved_mem: Increase limit for reserved_mem regions Date: Wed, 20 Apr 2022 14:09:14 -0700 Message-ID: <1650488954-26662-1-git-send-email-quic_pdaly@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) To nalasex01b.na.qualcomm.com (10.47.209.197) Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The reserved_mem array must be statically allocated because it is used prior to memblock being aware of all "no-map" or otherwise reserved regions which have fixed physical addresses. Due to this limitation, if one architecture/board has a large number of reserved_mem regions, this limit must be raised for all. In particular, certain new qcom boards currently have 63 reserved memory regions, which when new features are added, pushes them over the existing limit of 64. A generalized breakdown by region type: 13 for linux-loaded device firmware 9 for guest-vms or inter-vm communication 15 cma heaps/dma-buf heaps 24 for bootloaders/hypervisor/secure-world devices or software 2 misc Although this number could be reduced by a minor amount by combining physically adjacent regions, this comes at the cost of losing documention on what/who the regions are used by. In addition, combining adjacent regions is not possible if there are phandles in devicetree referring to the regions in question, such as "memory-region". Vmlinux before: text data bss dec hex filename 31030829 15807732 588524 47427085 2d3ae0d dist/vmlinux Vmlinux after: text data bss dec hex filename 31030877 15807668 592108 47430653 2d3bbfd dist/vmlinux Signed-off-by: Patrick Daly --- drivers/of/of_reserved_mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 75caa6f..de0cdda 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -26,7 +26,7 @@ #include "of_private.h" -#define MAX_RESERVED_REGIONS 64 +#define MAX_RESERVED_REGIONS 128 static struct reserved_mem reserved_mem[MAX_RESERVED_REGIONS]; static int reserved_mem_count; -- 2.7.4 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 65CA8C433F5 for ; Wed, 20 Apr 2022 21:10:57 +0000 (UTC) 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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=lTE6+bCTSZ8brPxLJP8abfk7Bu/SQt3W3h88a29gW/0=; b=3GyQkk5dSLvIfo Myg/ZPvwBCSfq0gNnOUrPYC9tLTY36AhghdWuqakNJe6EDPTPRhDx275ze6rOJPvYHAck0H4PTxi5 KhaN/vZXrrniRjIHvtwTFF8gfTnzmlOX2DSZ9RWmCbX4/vYwqSO11LuQvA2/iTLXd3eMMDtu/+d1a gwpVhBShonxndhjKFLa6iSxVXGDXg8F9vAGZLMPdOZZJP3O9Ms+5Oi3u8f48mxdDZ3PQULIw4Xo75 6zwShfoCYcApNh7Je1wF/gswBu+bp+dj1IAKYdSKRSLVhXGTLJ67JfYnJDSFDWgfa37OOg4OsDSsQ pUuUQbtJqYW+1M/wP5Xw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhHa3-00AOcS-Sj; Wed, 20 Apr 2022 21:09:43 +0000 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nhHa0-00AObt-Kh for linux-arm-kernel@lists.infradead.org; Wed, 20 Apr 2022 21:09:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1650488980; x=1682024980; h=from:to:cc:subject:date:message-id:mime-version; bh=CVpGC15qTB4Dx3RmzQhS+gi/i1dRRHj+8ZZU5naui3I=; b=D2/dh6l5ztHUiRaPYtZZyugbtx2Kt2+1Qh2NbY2RlHqWWG38uzO8dafc zJGBd5ctTOZUPh4bwe7emKtkec6WGtb6VqaMxoszk+kD20KenhMQIToc7 D5hQ95EgkH7dZwO9qpT/qkWpvsoPbxSJT24hUk2jPIdtkwF+Rh2FmarZn o=; Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-02.qualcomm.com with ESMTP; 20 Apr 2022 14:09:35 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg01-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2022 14:09:35 -0700 Received: from nalasex01b.na.qualcomm.com (10.47.209.197) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 20 Apr 2022 14:09:35 -0700 Received: from hu-pdaly-lv.qualcomm.com (10.49.16.6) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 20 Apr 2022 14:09:34 -0700 From: Patrick Daly To: , , , CC: Patrick Daly Subject: [PATCH] of: of_reserved_mem: Increase limit for reserved_mem regions Date: Wed, 20 Apr 2022 14:09:14 -0700 Message-ID: <1650488954-26662-1-git-send-email-quic_pdaly@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) To nalasex01b.na.qualcomm.com (10.47.209.197) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220420_140940_740378_DA20C1ED X-CRM114-Status: GOOD ( 13.12 ) 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: , 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 The reserved_mem array must be statically allocated because it is used prior to memblock being aware of all "no-map" or otherwise reserved regions which have fixed physical addresses. Due to this limitation, if one architecture/board has a large number of reserved_mem regions, this limit must be raised for all. In particular, certain new qcom boards currently have 63 reserved memory regions, which when new features are added, pushes them over the existing limit of 64. A generalized breakdown by region type: 13 for linux-loaded device firmware 9 for guest-vms or inter-vm communication 15 cma heaps/dma-buf heaps 24 for bootloaders/hypervisor/secure-world devices or software 2 misc Although this number could be reduced by a minor amount by combining physically adjacent regions, this comes at the cost of losing documention on what/who the regions are used by. In addition, combining adjacent regions is not possible if there are phandles in devicetree referring to the regions in question, such as "memory-region". Vmlinux before: text data bss dec hex filename 31030829 15807732 588524 47427085 2d3ae0d dist/vmlinux Vmlinux after: text data bss dec hex filename 31030877 15807668 592108 47430653 2d3bbfd dist/vmlinux Signed-off-by: Patrick Daly --- drivers/of/of_reserved_mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 75caa6f..de0cdda 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -26,7 +26,7 @@ #include "of_private.h" -#define MAX_RESERVED_REGIONS 64 +#define MAX_RESERVED_REGIONS 128 static struct reserved_mem reserved_mem[MAX_RESERVED_REGIONS]; static int reserved_mem_count; -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel