Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1095228pxb; Wed, 6 Apr 2022 08:36:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtdwsXcuAT4xaYCumxn5LE2KByD1FjSPaTXTohTOGb6QTQtKD/oss4NWRpBK1El2q2wRiN X-Received: by 2002:a17:90b:2246:b0:1c6:5781:7193 with SMTP id hk6-20020a17090b224600b001c657817193mr10813661pjb.48.1649259370057; Wed, 06 Apr 2022 08:36:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649259370; cv=none; d=google.com; s=arc-20160816; b=GuPPokMbC0PGbIOaxC0n2FdsEx071TM1NRaaZhrwLIF4InfxA/B+3Pp7QzbyICDQ+8 W8Gk8S/5TRctU8sggXPyG1J4LtT0REU3/CXp8yXuxKaBr27QOuTAKOUyQsc0zlAf23zE n73U37M4bjiGQR8YM3nV+j7z+EI1xB+TiWFlag/OsVIa5Gx4kfY0K2LRKAule0BaIyKs qtCwDpAlZFhy9muafdz6AjOxzZHPVNHm5P1x6frK5TWnqypXy2ECC9yr1HOQht8MhuwH wpOCNo8HH5xcwDkjaCoVFgOS80oW/DU3xwRY7cpAmOeLxuUnKvK1WjlmE1Q+ygb/PhVW qw8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=fRfBKq2P4//0SFuNiXfECCkNKXeLtDttSZNKsMp2WCU=; b=bvO+aRkESI92QRFCiKfTzu5bxYcYRduL6qvLejL1sMNpp06x4xJizcYplVA8W9bvgj /PjN2sS1Z9dJU8hUKSrpHg3XzxZt++8RrcxQ2L8NzjDn7uQFtc/VIyzS7p4sJWS858Tm n17PIE1QoVyUy1tZjrcapoCOumlcg0GJqCXzr9bM7Jb768c9TNJ+Up57w20H/66sAbVz Z0CfA/6Vt8sV/2WVptSl2J8zq99koY6MQ2Oj0h3QA/YCvIReUR8DpKKD9UMG7ubWnEjF 6xQIQqqS0U72XoeYizSVdUOc2aFt2UziS1FiYzj+G9zWVEJ2tmuOG2D6RJnaTXzAyM9i 556g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=janivnOr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k17-20020a635a51000000b003827526f8bbsi16407286pgm.526.2022.04.06.08.36.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 08:36:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=janivnOr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6A094399C87; Wed, 6 Apr 2022 06:49:22 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233871AbiDFNvR (ORCPT + 99 others); Wed, 6 Apr 2022 09:51:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233819AbiDFNuu (ORCPT ); Wed, 6 Apr 2022 09:50:50 -0400 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE62655A9BD; Wed, 6 Apr 2022 04:25:17 -0700 (PDT) Received: by mail-qt1-x836.google.com with SMTP id j21so3812858qta.0; Wed, 06 Apr 2022 04:25:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fRfBKq2P4//0SFuNiXfECCkNKXeLtDttSZNKsMp2WCU=; b=janivnOrj0WfAFDkiZfQFj1YfWZDlUxLJTw3WrTNerLK5hPgZs8wsCo3ypjgltR5/3 KvLCk0pSySZp28oIj9QX+PIx6stQLgU8LQEZ6SvwxXVlR7CUdQ4vSsyKKkR2krVj0LaH 7XVQCeOarYh6xONc0SV+BdsZOgNgOJiGxfxbUdaW9g0lq+dfFpbLDHC+8ywqBpFJN2vx WuF7TERkP8dRRjMxyVRZbaNNKnRGFBO57MDUz7yZdtBeYlGsPX0Hp/swq4D/vHmLTCdC HeURi7Z6PIrkhP6WDKSbbDgylCDtYPIXoYVVgfb+1vsrpfw2kXJA4dPtuB5GYTyL8ROC l2gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fRfBKq2P4//0SFuNiXfECCkNKXeLtDttSZNKsMp2WCU=; b=IkX0nQRaO0GC8ssVEQMPf2wo5mKyx/MRqMPIUssjanmvwKVqi5DNiDkY3I3SgV4G6z NuiIRpqJB+UF9tVP+Q9aUFf+uiZJYo6K46Wa6joOY1V1rX+95J6zV0MqU/huyy7AkVSG Fu6bPFhaiVPe6ji0ubmcVjB7pyZxi1GISleQMwUPL7Y9cixmVbZBXEUHaoc3iTBZU9ew Iko2p4EUIF4GqhJnWCRHS//dYp5nGAYjX30/sjnXbs3kBVH4IuhdL3DL06qukhxuaqxN 6fThG5igRdt0xg6J7ahQGtJhzGEF1IcGefN2bVibVdRvqTjU7hQTKN3ui7ZJzd1W91fj TrlA== X-Gm-Message-State: AOAM532leRSywJWHTWGFleVifzKY5W8N0iceMF0ALOt4yluSzLTbtc52 +6iHfO+pT+hEWZaESSA0u5FBwaM/+vqEzV8C6m88DP9Xfgo= X-Received: by 2002:a05:622a:1343:b0:2eb:8171:ce27 with SMTP id w3-20020a05622a134300b002eb8171ce27mr6939126qtk.8.1649244316577; Wed, 06 Apr 2022 04:25:16 -0700 (PDT) MIME-Version: 1.0 References: <20220323064944.1351923-1-peng.fan@oss.nxp.com> <20220323064944.1351923-3-peng.fan@oss.nxp.com> In-Reply-To: From: Daniel Baluta Date: Wed, 6 Apr 2022 14:25:04 +0300 Message-ID: Subject: Re: [PATCH 2/2] remoteproc: imx_dsp_rproc: use common rproc_elf_load_segments To: Peng Fan Cc: "Peng Fan (OSS)" , "bjorn.andersson@linaro.org" , Mathieu Poirier , Shawn Guo , Sascha Hauer , "S.J. Wang" , "linux-remoteproc@vger.kernel.org" , Linux Kernel Mailing List , Pengutronix Kernel Team , Fabio Estevam , dl-linux-imx , linux-arm-kernel Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 6, 2022 at 1:58 PM Peng Fan wrote: > > > Subject: Re: [PATCH 2/2] remoteproc: imx_dsp_rproc: use common > > rproc_elf_load_segments > > > > On Thu, Mar 24, 2022 at 1:34 AM Peng Fan (OSS) > > wrote: > > > > > > From: Peng Fan > > > > > > remoteproc elf loader supports the specific case that segments have > > > PT_LOAD and memsz/filesz set to zero, so no duplicate code. > > > > > > Signed-off-by: Peng Fan > > > > I think this change OK, but we have a case with the DSP were reads/writes > > should be done in multiples of 32/64. > > > > We need a way to provide our own "memcpy" function to be used by > > rproc_elf_load_segments. > > I think when generating elf file, the sections needs to be 32/64bits aligned. Sure, that could be a fix. But some malicious user can crash the kernel by crafting an elf with unaligned sections.