mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Clément Leger" <cleger@kalray.eu>
To: s-anna <s-anna@ti.com>
Cc: Ohad Ben-Cohen <ohad@wizery.com>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Patrice Chotard <patrice.chotard@st.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	linux-remoteproc <linux-remoteproc@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	linux-stm32 <linux-stm32@st-md-mailman.stormreply.com>
Subject: Re: [PATCH v2] remoteproc: remove rproc_elf32_sanity_check
Date: Tue, 21 Apr 2020 17:38:06 +0200 (CEST)	[thread overview]
Message-ID: <777435415.16656480.1587483486065.JavaMail.zimbra@kalray.eu> (raw)
In-Reply-To: <a7994631-7a63-5477-df70-e40b995fe14f@ti.com>

Hi Anna,

----- On 21 Apr, 2020, at 17:30, s-anna s-anna@ti.com wrote:

> Hi Clement,
> 
> On 3/31/20 10:13 AM, Suman Anna wrote:
>> On 3/31/20 3:33 AM, Clement Leger wrote:
>>> Since checks are present in the remoteproc elf loader before calling
>>> da_to_va, loading a elf64 will work on 32bits flavors of kernel.
>>> Indeed, if a segment size is larger than what size_t can hold, the
>>> loader will return an error so the functionality is equivalent to
>>> what exists today.
>>>
>>> Signed-off-by: Clement Leger <cleger@kalray.eu>
>> 
>> Acked-by: Suman Anna <s-anna@ti.com>
> 
> Can you repost this after rebasing on top of the rproc-next branch
> which has the rproc_alloc refactoring changes pushed now?

Yes, I will do that.

Regards,

Clément

> 
> regards
> Suman
> 
>> 
>> regards
>> Suman
>> 
>>> ---
>>> Changes from v1 -> v2:
>>>   - Remove possibity to override sanity_check operation
>>>
>>>   drivers/remoteproc/remoteproc_core.c       |  3 +--
>>>   drivers/remoteproc/remoteproc_elf_loader.c | 21 ---------------------
>>>   drivers/remoteproc/remoteproc_internal.h   |  1 -
>>>   drivers/remoteproc/st_remoteproc.c         |  2 +-
>>>   drivers/remoteproc/st_slim_rproc.c         |  2 +-
>>>   drivers/remoteproc/stm32_rproc.c           |  2 +-
>>>   6 files changed, 4 insertions(+), 27 deletions(-)
>>>
>>> diff --git a/drivers/remoteproc/remoteproc_core.c
>>> b/drivers/remoteproc/remoteproc_core.c
>>> index a9ac1d01e09b..191560048c1a 100644
>>> --- a/drivers/remoteproc/remoteproc_core.c
>>> +++ b/drivers/remoteproc/remoteproc_core.c
>>> @@ -2068,8 +2068,7 @@ struct rproc *rproc_alloc(struct device *dev, const char
>>> *name,
>>>   		rproc->ops->load = rproc_elf_load_segments;
>>>   		rproc->ops->parse_fw = rproc_elf_load_rsc_table;
>>>   		rproc->ops->find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table;
>>> -		if (!rproc->ops->sanity_check)
>>> -			rproc->ops->sanity_check = rproc_elf32_sanity_check;
>>> +		rproc->ops->sanity_check = rproc_elf_sanity_check;
>>>   		rproc->ops->get_boot_addr = rproc_elf_get_boot_addr;
>>>   	}
>>>   
>>> diff --git a/drivers/remoteproc/remoteproc_elf_loader.c
>>> b/drivers/remoteproc/remoteproc_elf_loader.c
>>> index 16e2c496fd45..29034f99898d 100644
>>> --- a/drivers/remoteproc/remoteproc_elf_loader.c
>>> +++ b/drivers/remoteproc/remoteproc_elf_loader.c
>>> @@ -112,27 +112,6 @@ int rproc_elf_sanity_check(struct rproc *rproc, const
>>> struct firmware *fw)
>>>   }
>>>   EXPORT_SYMBOL(rproc_elf_sanity_check);
>>>   
>>> -/**
>>> - * rproc_elf_sanity_check() - Sanity Check ELF32 firmware image
>>> - * @rproc: the remote processor handle
>>> - * @fw: the ELF32 firmware image
>>> - *
>>> - * Make sure this fw image is sane.
>>> - */
>>> -int rproc_elf32_sanity_check(struct rproc *rproc, const struct firmware *fw)
>>> -{
>>> -	int ret = rproc_elf_sanity_check(rproc, fw);
>>> -
>>> -	if (ret)
>>> -		return ret;
>>> -
>>> -	if (fw_elf_get_class(fw) == ELFCLASS32)
>>> -		return 0;
>>> -
>>> -	return -EINVAL;
>>> -}
>>> -EXPORT_SYMBOL(rproc_elf32_sanity_check);
>>> -
>>>   /**
>>>    * rproc_elf_get_boot_addr() - Get rproc's boot address.
>>>    * @rproc: the remote processor handle
>>> diff --git a/drivers/remoteproc/remoteproc_internal.h
>>> b/drivers/remoteproc/remoteproc_internal.h
>>> index b389dc79da81..31994715fd43 100644
>>> --- a/drivers/remoteproc/remoteproc_internal.h
>>> +++ b/drivers/remoteproc/remoteproc_internal.h
>>> @@ -54,7 +54,6 @@ void *rproc_da_to_va(struct rproc *rproc, u64 da, size_t len);
>>>   phys_addr_t rproc_va_to_pa(void *cpu_addr);
>>>   int rproc_trigger_recovery(struct rproc *rproc);
>>>   
>>> -int rproc_elf32_sanity_check(struct rproc *rproc, const struct firmware *fw);
>>>   int rproc_elf_sanity_check(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);
>>> diff --git a/drivers/remoteproc/st_remoteproc.c
>>> b/drivers/remoteproc/st_remoteproc.c
>>> index a6cbfa452764..a3268d95a50e 100644
>>> --- a/drivers/remoteproc/st_remoteproc.c
>>> +++ b/drivers/remoteproc/st_remoteproc.c
>>> @@ -233,7 +233,7 @@ static const struct rproc_ops st_rproc_ops = {
>>>   	.parse_fw		= st_rproc_parse_fw,
>>>   	.load			= rproc_elf_load_segments,
>>>   	.find_loaded_rsc_table	= rproc_elf_find_loaded_rsc_table,
>>> -	.sanity_check		= rproc_elf32_sanity_check,
>>> +	.sanity_check		= rproc_elf_sanity_check,
>>>   	.get_boot_addr		= rproc_elf_get_boot_addr,
>>>   };
>>>   
>>> diff --git a/drivers/remoteproc/st_slim_rproc.c
>>> b/drivers/remoteproc/st_slim_rproc.c
>>> index 3cca8b65a8db..09bcb4d8b9e0 100644
>>> --- a/drivers/remoteproc/st_slim_rproc.c
>>> +++ b/drivers/remoteproc/st_slim_rproc.c
>>> @@ -203,7 +203,7 @@ static const struct rproc_ops slim_rproc_ops = {
>>>   	.da_to_va       = slim_rproc_da_to_va,
>>>   	.get_boot_addr	= rproc_elf_get_boot_addr,
>>>   	.load		= rproc_elf_load_segments,
>>> -	.sanity_check	= rproc_elf32_sanity_check,
>>> +	.sanity_check	= rproc_elf_sanity_check,
>>>   };
>>>   
>>>   /**
>>> diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c
>>> index 6a66dbf2df40..2e07a95439c8 100644
>>> --- a/drivers/remoteproc/stm32_rproc.c
>>> +++ b/drivers/remoteproc/stm32_rproc.c
>>> @@ -505,7 +505,7 @@ static struct rproc_ops st_rproc_ops = {
>>>   	.load		= rproc_elf_load_segments,
>>>   	.parse_fw	= stm32_rproc_parse_fw,
>>>   	.find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table,
>>> -	.sanity_check	= rproc_elf32_sanity_check,
>>> +	.sanity_check	= rproc_elf_sanity_check,
>>>   	.get_boot_addr	= rproc_elf_get_boot_addr,
>>>   };
>>>   
>>>

      reply	other threads:[~2020-04-21 15:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-31  8:33 Clement Leger
2020-03-31 15:13 ` Suman Anna
2020-04-21 15:30   ` Suman Anna
2020-04-21 15:38     ` Clément Leger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=777435415.16656480.1587483486065.JavaMail.zimbra@kalray.eu \
    --to=cleger@kalray.eu \
    --cc=alexandre.torgue@st.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=ohad@wizery.com \
    --cc=patrice.chotard@st.com \
    --cc=s-anna@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®