Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1005147ybh; Tue, 10 Mar 2020 12:34:28 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu/bKsNxE46tAz5Q/kq+UlRvZVSvhmEoU4D1rOFjq1coLAqjBHq5pSEujuOuJ0+3mgbhqUw X-Received: by 2002:a05:6830:150f:: with SMTP id k15mr5994137otp.251.1583868868268; Tue, 10 Mar 2020 12:34:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583868868; cv=none; d=google.com; s=arc-20160816; b=weghDXaKwXuRj1DK5Xr8eXJwAKChkoVVUzGWxqL3WGvschOf6MTU7tygzbQUgMCBrA T++hptCCspgp0QZ08z7/9oNXhMqOPvrWzf2h9+8id0JLRiOW4ir9nWOr0HFLv4LgBr+4 YI2KDyygBV42Wllc6gIGVnl/np5w4KU/oAEGb93dPsFCFQb4LVmWDdGDZ1ufVFjC/w61 QTBCxe6412NKNdGT34Fr/w87PGgYJOJPd63ttAt5SNe2YHR7d7Eb1q2Vf6jLrEdggNbO E0YRVLB9U9+7ZcxQhF1eynYyku6rd3spxLFJRvKZeJrlF524/pObt2c30D++xYnC9HHb DewA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=qMuGgR0+CRDM0BuHZ2Ae6KXyGRvF/Wi0RAPV3JkXST8=; b=hxzyT5mujfmj75UtHKzU8qmyDUKPIbBGsZSvGIO77J7yvm9RYP0HMMYgxHH8qiJYos 6m3eImrzVSnVnZE4RVXwoE5DD2jIuqqiRvH+HS+GSivu2eb2v5vjXq8LE/me5x/jnH/f kQSdZsIFCV5Cku56Tav332fu0BAh8dXGTAjB4SpUyQPvg3mrVbiCXaD8V5cBXhdf6/y2 lj7uwcj1gbKqg+BXqbd5LpGIYmH3t3fWpoSxEa6bTX7+RK920/PXjNAsc+URJsGPI0fP 5riZIK5bH3l+NmxJQJmqHd7SZl67NYBN0qfpsDZqkcjc1Nb7Prbam69NeE+wG2uh2Tra NuHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="O7XNI6K/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c21si3719954oto.137.2020.03.10.12.34.07; Tue, 10 Mar 2020 12:34:28 -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; dkim=pass header.i=@linaro.org header.s=google header.b="O7XNI6K/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727465AbgCJTc7 (ORCPT + 99 others); Tue, 10 Mar 2020 15:32:59 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:44462 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727445AbgCJTc6 (ORCPT ); Tue, 10 Mar 2020 15:32:58 -0400 Received: by mail-pf1-f194.google.com with SMTP id b72so3400252pfb.11 for ; Tue, 10 Mar 2020 12:32:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=qMuGgR0+CRDM0BuHZ2Ae6KXyGRvF/Wi0RAPV3JkXST8=; b=O7XNI6K/jach7eBMD0zokAVd37z8MwdLv7WqFDGJUXpzEHJv/6LF5IM1MssL5NHx69 sERBdH0/wvxJRbfXc8ZfBW6WmU/BI5HjmYU5Pwy6aJgYPsoC/QOCaZUUfklrPzeM+LmE PliHwz3PwFW+ET0WFX++nrj0fUsGiY5wb79UMhnPsZ4NSU56/TwfJhVBhRED1eo7IZvY tSQ6LFPA1n/cAURoK6zJWkEVSXYiL6y+KiwY8l+yxV5JDY+n10m2MA3KzHqx7bRV4sL6 CAx0URzemFt5ihkASDeSRezGbX69RIjNEsoJ9YZzp9qrBY5Pp5i1yewl1O6hD70yt0SH wjTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qMuGgR0+CRDM0BuHZ2Ae6KXyGRvF/Wi0RAPV3JkXST8=; b=AB7i/9C9eOItbLwkcmGZANbFxzSMHWfJy61yL52F8ESvAL5h4iDNXu/tqxVZ1IShoG mw79D3zBbf+/2G5L1WznnYX8tTLl5sMAVXdt7JO7pE2qB9zKxrdXOrXEM/++/Jqh9mCk oAS/8jGu0id1kVhZvuPfmRI9HylAwqiYEMRjwQA/XTSCjwi7z4WA2V9DDqszYk9Kb8Ey NEAzRjdSfRYwp0g1QCJflI0vQdCTdy3Qb+l2YdZBxUEoG8yqAZl0Z1mfPCLl9ZbXemXA 3NWXx4uAJLY/R87zka5t5BFSiv+cpIRsYg2AsYfuRsaSAwBHDylSJHq3f7y46qj33B9c Tl2A== X-Gm-Message-State: ANhLgQ2ESTa4N8P6dqZYrmtdogGyvGc7BQfoxIu7K1qtzcze3Y6izX8j FB5rQLC7orFPJNJ4BZGzbVH3xQ== X-Received: by 2002:a63:7f09:: with SMTP id a9mr22043810pgd.375.1583868777114; Tue, 10 Mar 2020 12:32:57 -0700 (PDT) Received: from yoga (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id s18sm3003094pjp.24.2020.03.10.12.32.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Mar 2020 12:32:56 -0700 (PDT) Date: Tue, 10 Mar 2020 12:32:53 -0700 From: Bjorn Andersson To: Cl?ment Leger Cc: Mathieu Poirier , Ohad Ben-Cohen , 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 Subject: Re: [PATCH v5 3/8] remoteproc: Use u64 type for boot_addr Message-ID: <20200310193253.GL264362@yoga> References: <20200210162209.23149-1-cleger@kalray.eu> <20200302093902.27849-1-cleger@kalray.eu> <20200302093902.27849-4-cleger@kalray.eu> <20200309195247.GC1399@xps15> <1297722115.9030349.1583827151221.JavaMail.zimbra@kalray.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1297722115.9030349.1583827151221.JavaMail.zimbra@kalray.eu> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 10 Mar 00:59 PDT 2020, Cl?ment Leger wrote: > > > ----- 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. > Sorry, I forgot to reply to this one. I fixed it up while applying the patch. Thanks, Bjorn > > > >> 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