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 X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E64C7C43331 for ; Tue, 31 Mar 2020 06:51:45 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id BAF1B20748 for ; Tue, 31 Mar 2020 06:51:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DNG6EZuJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BAF1B20748 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kalrayinc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Subject:References: In-Reply-To:Message-ID:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=N9RUz8u1L7I9v/0BFvKDXHrGrnCrl2q0xC4ECRNfTkI=; b=DNG6EZuJnS+lve VblMoIrZm3JXen9TYFbDGBW4g9sU9CKTO7KU5o5nOjCxPzjh8iz9jN7ERzixwrIhJS90Tj4BuHNlX g1ybbA70zKydryKZiLJmx6RsK5/UOiHGG62gg7K5qRDIzQ2iJyHY+hDci5CUIfdFZt8HFk1dySucq rkU5NI4IIWQlRbxylNMrRLY3UvqsFhSfQt74PMxXvqpM0qu5K28n6d1YiRKIYwTL+93yBE1Jrwi6F fBHMXEPyutLO6vYkd1wPjjgGWgsZULkb9qhoRIKCl2tATEmA5gcw8UAFD91fv9euHhLkX3hUweHwj MtxnyjZwtT56xplEwsIQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jJAkT-000098-73; Tue, 31 Mar 2020 06:51:45 +0000 Received: from zimbra2.kalray.eu ([92.103.151.219]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jJAkP-00008Q-LB for linux-arm-kernel@lists.infradead.org; Tue, 31 Mar 2020 06:51:43 +0000 Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id 146DD27E03B2; Tue, 31 Mar 2020 08:51:37 +0200 (CEST) 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 waJ4S9bw_HMh; Tue, 31 Mar 2020 08:51:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id D319527E0450; Tue, 31 Mar 2020 08:51:35 +0200 (CEST) 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 31zHK_ttVHDg; Tue, 31 Mar 2020 08:51:35 +0200 (CEST) Received: from zimbra2.kalray.eu (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id B7D2527E03B2; Tue, 31 Mar 2020 08:51:35 +0200 (CEST) Date: Tue, 31 Mar 2020 08:51:35 +0200 (CEST) From: =?utf-8?Q?Cl=C3=A9ment?= Leger To: s-anna Message-ID: <1759281267.12964559.1585637495215.JavaMail.zimbra@kalray.eu> In-Reply-To: <23fc7800-4ba4-07d0-de15-d81498f04d3c@ti.com> References: <20200327084939.8321-1-cleger@kalray.eu> <20200327161733.GA18041@xps15> <23fc7800-4ba4-07d0-de15-d81498f04d3c@ti.com> Subject: Re: [PATCH] remoteproc: remove rproc_elf32_sanity_check MIME-Version: 1.0 X-Originating-IP: [192.168.40.202] X-Mailer: Zimbra 8.8.15_GA_3895 (ZimbraWebClient - GC80 (Linux)/8.8.15_GA_3895) Thread-Topic: remoteproc: remove rproc_elf32_sanity_check Thread-Index: 3VVoXwttsIAMn4RaA/dROFzI1f5hRw== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200330_235142_050475_DCC949D7 X-CRM114-Status: GOOD ( 10.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ohad Ben-Cohen , Alexandre Torgue , Mathieu Poirier , linux-kernel , linux-remoteproc , Patrice Chotard , Bjorn Andersson , Maxime Coquelin , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Suman, ----- On 30 Mar, 2020, at 21:11, s-anna s-anna@ti.com wrote: > Hi Clement, > > On 3/27/20 11:17 AM, Mathieu Poirier wrote: >> On Fri, Mar 27, 2020 at 09:49:39AM +0100, 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 >>> --- >>> drivers/remoteproc/remoteproc_core.c | 2 +- >>> 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(+), 26 deletions(-) >> >> Reviewed-by: Mathieu Poirier >> >>> >>> diff --git a/drivers/remoteproc/remoteproc_core.c >>> b/drivers/remoteproc/remoteproc_core.c >>> index a9ac1d01e09b..02ff076b0122 100644 >>> --- a/drivers/remoteproc/remoteproc_core.c >>> +++ b/drivers/remoteproc/remoteproc_core.c >>> @@ -2069,7 +2069,7 @@ struct rproc *rproc_alloc(struct device *dev, const char >>> *name, >>> 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; > > Do you still need the capability to override the sanity_check? As I > understand, you introduced this to allow platform drivers to use the > appropriate elf32 or elf64 one during the ELF64 loader support series. Indeed, this is probably not needed anymore, I will modify that. > > regards > Suman > >>> 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, >>> }; >>> >>> -- >>> 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel