From patchwork Tue Jul 1 19:12:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Loeliger X-Patchwork-Id: 4461731 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A179E9F39B for ; Tue, 1 Jul 2014 19:15:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D12EE203DC for ; Tue, 1 Jul 2014 19:15:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 00ACB20328 for ; Tue, 1 Jul 2014 19:15:03 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X23Tx-0001L3-RE; Tue, 01 Jul 2014 19:12:45 +0000 Received: from mail-ob0-x22f.google.com ([2607:f8b0:4003:c01::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X23Tu-0001Ig-Nc for linux-arm-kernel@lists.infradead.org; Tue, 01 Jul 2014 19:12:43 +0000 Received: by mail-ob0-f175.google.com with SMTP id wm4so10978197obc.20 for ; Tue, 01 Jul 2014 12:12:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=yZwHI7UbeFnwaRfZ4TtjTcNnuQVX3Q8pmMZBGCsnHKg=; b=fP2kOMWDP8Wln/r72wnsyAi7v/TlcBiq0my613eNtiXSnWCj9vRTas3keCv+Yktxcq a56zYQzmZoVkctYdveD8S6PUx5PxmdtRg2SDU6fqrI4053PnYedS2ZMJCIVa1pFWzULw gLTrvu9QtMQ6Jhfbak1tYYdYQVmFXK4VDgoRKlyO0Y5KQZ7vtVSqjVqbCErJz7wkc69j FPcJMMkCacJjn7D2DeeaweOcF0T+oltCeyFQacmWX6svS3lnWtYkmPL/EYubc0dTBpOK n8LQYty2cuBr1+YPX+pvT38SF3tqcIqKOdZeA8dIa3LbQtKGqMdgqnJApVsSgZICULbn fNdg== MIME-Version: 1.0 X-Received: by 10.60.98.148 with SMTP id ei20mr51691437oeb.37.1404241941194; Tue, 01 Jul 2014 12:12:21 -0700 (PDT) Received: by 10.182.245.202 with HTTP; Tue, 1 Jul 2014 12:12:21 -0700 (PDT) In-Reply-To: <14859259.LsA3SotVTm@wuerfel> References: <14859259.LsA3SotVTm@wuerfel> Date: Tue, 1 Jul 2014 14:12:21 -0500 Message-ID: Subject: Re: Some Large Address Space Ponders on A9 From: Jon Loeliger To: Arnd Bergmann X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140701_121242_846183_889590E4 X-CRM114-Status: GOOD ( 12.25 ) X-Spam-Score: -0.8 (/) Cc: "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Jul 1, 2014 at 11:43 AM, Arnd Bergmann wrote: >> I think the device-tree handling code is able to grok and process >> 64-bit addresses. Does it make sense to allow the phys_addr_t and >> the resource_size_t to take on different sizes? That is, to break the >> above definition of resource_size_t from types.h and allow its size >> to be determined independently of phys_addr_t? > > resource_size_t and phys_addr_t should really be the same all the > time. > > Arnd So, as an experiment I did this: + select RESOURCE_SIZE_T_64BIT Verified a few things: $ gdb -q ./vmlinux Reading symbols from vmlinux...done. (gdb) p sizeof(resource_size_t) $1 = 8 (gdb) p sizeof(phys_addr_t) $2 = 4 (gdb) p sizeof(dma_addr_t) $3 = 4 And it all booted just fine. jdl diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index 1f8fed9..0dfb76f 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig @@ -631,6 +631,9 @@ config ARCH_PHYS_ADDR_T_64BIT config ARCH_DMA_ADDR_T_64BIT bool +config RESOURCE_SIZE_T_64BIT + bool + config ARM_THUMB bool "Support Thumb user binaries" if !CPU_THUMBONLY depends on CPU_ARM720T || CPU_ARM740T || CPU_ARM920T || CPU_ARM922T || \ diff --git a/include/linux/types.h b/include/linux/types.h index 4d118ba..331d59a 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -164,7 +164,11 @@ typedef u64 phys_addr_t; typedef u32 phys_addr_t; #endif +#ifdef CONFIG_RESOURCE_SIZE_T_64BIT +typedef u64 resource_size_t; +#else typedef phys_addr_t resource_size_t; +#endif And then this: