Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp413886ybh; Tue, 10 Mar 2020 00:59:44 -0700 (PDT) X-Google-Smtp-Source: ADFU+vucue3h/dHesfy7yerBUaIcQAJ9kin17CB1IpfUqSLdaBZfpFTlWfx3veVRZx2Tc5N7m/vO X-Received: by 2002:aca:3f54:: with SMTP id m81mr249894oia.167.1583827184045; Tue, 10 Mar 2020 00:59:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583827184; cv=none; d=google.com; s=arc-20160816; b=k03cNetLgvGt4OugQNl09XLb7/G8qOW1zoNMeS4DotmD0NDqAjroqey5TCWjz8Cxon AXhBlX4rkT/bRimpiycPJPyphRbCyRTwaFJrUUwIEDsuXYXzNpewdMPTFVaSmYWz/WY+ 4yMMdG8aYpZiDSrASR2JAOLJn5/xOTDN7qpkbfxaDVKYJNz7p2umNRu5V1yjIYulQjOr RrlV/ZW4+hLgUafiPzvOLOytkgMgbxFebcbdjJX96BQ0DZQkjUyb/5zlqca2GGwouPIx gjA51aI69DcoHIzwVNQ7QBu9dD1346Gcvj4ZEbTC2QnY35Kc17LpUWbUof6LXjojs79o z8NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date; bh=NwUnfJJrdvq5iiMt7kTSKxMaF8Aa0+pcCFgx9WFZ/gE=; b=SqaS7xIu4tu5g7mD5enDXVTfT8CDML4QeS9nJgq6v0QHqtnYlMXHEPy98Jwz3NU9aM 4g4yDDuOUKkH+kSOSDqyijQfAFhHwbdnJsM/toC9I1318nU0Hx3Hk+MjdB4qM1kp3gbT gi1kH4doyY8tpGnUdyDMOtWOV1aBHIqPGoFfNTd93AkWupW4xa7u/26UEWNp2DfZ9W1B qTItCQodxDc9VQPnr5jgeM3mgN6ddulya0qc0Vr6nobEY9WFiZtY7KjGU6Yo71s1WuhG /MhT6sC5vzYCMw/H3yLGRrS4wOUUKIdhz2d9sH6JHGZfG1154UnPCQ2w3S2yl/4sQhU0 hM4Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4si2735813oig.197.2020.03.10.00.59.32; Tue, 10 Mar 2020 00:59:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726395AbgCJH7O (ORCPT + 99 others); Tue, 10 Mar 2020 03:59:14 -0400 Received: from zimbra2.kalray.eu ([92.103.151.219]:43156 "EHLO zimbra2.kalray.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725919AbgCJH7O (ORCPT ); Tue, 10 Mar 2020 03:59:14 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id 2CECC27E02D6; Tue, 10 Mar 2020 08:59:12 +0100 (CET) Received: from zimbra2.kalray.eu ([127.0.0.1]) by localhost (zimbra2.kalray.eu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id O2aoq_2XElxG; Tue, 10 Mar 2020 08:59:11 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id 8AD8727E03F9; Tue, 10 Mar 2020 08:59:11 +0100 (CET) X-Virus-Scanned: amavisd-new at zimbra2.kalray.eu Received: from zimbra2.kalray.eu ([127.0.0.1]) by localhost (zimbra2.kalray.eu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id XVsFBbfMBUc3; Tue, 10 Mar 2020 08:59:11 +0100 (CET) Received: from zimbra2.kalray.eu (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id 68ECA27E02D6; Tue, 10 Mar 2020 08:59:11 +0100 (CET) Date: Tue, 10 Mar 2020 08:59:11 +0100 (CET) From: =?utf-8?Q?Cl=C3=A9ment?= Leger To: Mathieu Poirier Cc: Ohad Ben-Cohen , Bjorn Andersson , Jonathan Corbet , Shawn Guo , Sascha Hauer , linux-remoteproc , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Andy Gross , Patrice Chotard , linux-doc , linux-kernel , linux-arm-kernel , linux-arm-msm , Arnaud Pouliquen , Loic PALLARDY , s-anna Message-ID: <1297722115.9030349.1583827151221.JavaMail.zimbra@kalray.eu> In-Reply-To: <20200309195247.GC1399@xps15> References: <20200210162209.23149-1-cleger@kalray.eu> <20200302093902.27849-1-cleger@kalray.eu> <20200302093902.27849-4-cleger@kalray.eu> <20200309195247.GC1399@xps15> Subject: Re: [PATCH v5 3/8] remoteproc: Use u64 type for boot_addr MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.40.202] X-Mailer: Zimbra 8.8.15_GA_3895 (ZimbraWebClient - GC75 (Linux)/8.8.15_GA_3895) Thread-Topic: remoteproc: Use u64 type for boot_addr Thread-Index: ao8uTq+xqlc9Y5G3EfGQfWYIgTgrfg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On 9 Mar, 2020, at 20:52, Mathieu Poirier mathieu.poirier@linaro.org wrote: > On Mon, Mar 02, 2020 at 10:38:57AM +0100, Clement Leger wrote: >> elf64 entry is defined as a u64. Since boot_addr is used to store the >> elf entry point, change boot_addr type to u64 to support both elf32 >> and elf64. In the same time, fix users that were using this variable. >> >> Signed-off-by: Clement Leger >> --- >> drivers/remoteproc/remoteproc_elf_loader.c | 2 +- >> drivers/remoteproc/remoteproc_internal.h | 2 +- >> drivers/remoteproc/st_remoteproc.c | 2 +- >> include/linux/remoteproc.h | 4 ++-- >> 4 files changed, 5 insertions(+), 5 deletions(-) >> >> diff --git a/drivers/remoteproc/remoteproc_elf_loader.c >> b/drivers/remoteproc/remoteproc_elf_loader.c >> index 606aae166eba..c2a9783cfb9a 100644 >> --- a/drivers/remoteproc/remoteproc_elf_loader.c >> +++ b/drivers/remoteproc/remoteproc_elf_loader.c >> @@ -102,7 +102,7 @@ EXPORT_SYMBOL(rproc_elf_sanity_check); >> * Note that the boot address is not a configurable property of all remote >> * processors. Some will always boot at a specific hard-coded address. >> */ >> -u32 rproc_elf_get_boot_addr(struct rproc *rproc, const struct firmware *fw) >> +u64 rproc_elf_get_boot_addr(struct rproc *rproc, const struct firmware *fw) >> { >> struct elf32_hdr *ehdr = (struct elf32_hdr *)fw->data; >> >> diff --git a/drivers/remoteproc/remoteproc_internal.h >> b/drivers/remoteproc/remoteproc_internal.h >> index 58580210575c..0deae5f237b8 100644 >> --- a/drivers/remoteproc/remoteproc_internal.h >> +++ b/drivers/remoteproc/remoteproc_internal.h >> @@ -55,7 +55,7 @@ phys_addr_t rproc_va_to_pa(void *cpu_addr); >> int rproc_trigger_recovery(struct rproc *rproc); >> >> int rproc_elf_sanity_check(struct rproc *rproc, const struct firmware *fw); >> -u32 rproc_elf_get_boot_addr(struct rproc *rproc, const struct firmware *fw); >> +u64 rproc_elf_get_boot_addr(struct rproc *rproc, const struct firmware *fw); >> int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw); >> int rproc_elf_load_rsc_table(struct rproc *rproc, const struct firmware *fw); >> struct resource_table *rproc_elf_find_loaded_rsc_table(struct rproc *rproc, > > The return type of function rproc_get_boot_addr() should also be changed from > u32 to u64. Or perhaps this is intentional to make sure rproc->bootaddr never > occupies more than 32bit? No, this is a mistake clearly. I haven't been able to test with a 64 bit boot address since our remote processors always boot in the 32 bits space. But since the elf64 boot address is on 64 bitsn this was a logical modification. I will fix that. > >> diff --git a/drivers/remoteproc/st_remoteproc.c >> b/drivers/remoteproc/st_remoteproc.c >> index ee13d23b43a9..a3268d95a50e 100644 >> --- a/drivers/remoteproc/st_remoteproc.c >> +++ b/drivers/remoteproc/st_remoteproc.c >> @@ -190,7 +190,7 @@ static int st_rproc_start(struct rproc *rproc) >> } >> } >> >> - dev_info(&rproc->dev, "Started from 0x%x\n", rproc->bootaddr); >> + dev_info(&rproc->dev, "Started from 0x%llx\n", rproc->bootaddr); >> >> return 0; >> >> diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h >> index bee559330204..1683d6c386a6 100644 >> --- a/include/linux/remoteproc.h >> +++ b/include/linux/remoteproc.h >> @@ -382,7 +382,7 @@ struct rproc_ops { >> struct rproc *rproc, const struct firmware *fw); >> int (*load)(struct rproc *rproc, const struct firmware *fw); >> int (*sanity_check)(struct rproc *rproc, const struct firmware *fw); >> - u32 (*get_boot_addr)(struct rproc *rproc, const struct firmware *fw); >> + u64 (*get_boot_addr)(struct rproc *rproc, const struct firmware *fw); >> }; >> >> /** >> @@ -498,7 +498,7 @@ struct rproc { >> int num_traces; >> struct list_head carveouts; >> struct list_head mappings; >> - u32 bootaddr; >> + u64 bootaddr; >> struct list_head rvdevs; >> struct list_head subdevs; >> struct idr notifyids; >> -- >> 2.15.0.276.g89ea799