From patchwork Wed Dec 21 06:10:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Srinivasa Rao Mandadapu X-Patchwork-Id: 35266 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp3363356wrn; Tue, 20 Dec 2022 22:20:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXtnL5gABAoHmrqezX5cHxIHhYA9GntmQwSVYoAA1GFNR4XMyeEI0YX1lITCBZRzDQ2nekQO X-Received: by 2002:a17:902:efcd:b0:189:f277:3830 with SMTP id ja13-20020a170902efcd00b00189f2773830mr748716plb.68.1671603643475; Tue, 20 Dec 2022 22:20:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671603643; cv=none; d=google.com; s=arc-20160816; b=RgGbXt1XC6M/Deq7c02CdPxks0gLCyGfOfhSc+8kb9MNKbn4X80DKsv5QrwKbcwb9w AV80tyd9FLKgInEwoTSpKupZrCTvLTAftIseXsdAa092YmbgWnc/mUM2iUQCqSI/Mzjw cG7P2VE8IaXhvx89J2g3D9AZoZ9Rvd6/7xcPcwuWelQSaPMexJxrR5BPVBI13d8eyTBf gJx+ImWmFI2fTi+MMbO2VufS9jGSj2Pn8HSoZc03VXYfP+0qTpeWUJMwfOuBIVK3mr5E E0zMdGpNS2fZ8k6tNxh5oysz4CFY4WAs35wldpzPZO6HOdnYVGwGewXYhqButKjF/0tW 6rJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=T59+OGJo76VoGlmNoaP6JZlHidx8e5QMXw8nvlGU/A0=; b=p/vTkb1ZV+Hzg1/ihFuwKXPnNy/sSGL+u7v+Bt4hpRggAjHpswMtktCP2kbQhqQAJj oQX+Fr5+dgBt/cnL1PVF5NFgMQyXEglY5WHgYDdHNn+m6xm+elQyOZbwkV2x6q4EdAi5 DlSQXMox740c7i70wImJptKGi+msINzuBaPl9iszBksq6G2ZXNSbdiOXEYOQbSEfRCpx 5uY8MZj39WhpryyASfBn8Aky11zKLaUb2+gNP1ggusQiph/ADx2gzZ2kShnGkzvhjj7f vXgjWUvJhk3DKSrxnFg7Wn59cfT5h2sHEtgYDo+FiFtbMNop7GerOV+izHlm6o0w78Jh 3cqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=fUba4cm4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o9-20020a170902e00900b00176d5b20ebesi14486168plo.355.2022.12.20.22.20.30; Tue, 20 Dec 2022 22:20:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=fUba4cm4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234488AbiLUGLw (ORCPT + 99 others); Wed, 21 Dec 2022 01:11:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbiLUGLu (ORCPT ); Wed, 21 Dec 2022 01:11:50 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A95421E; Tue, 20 Dec 2022 22:11:49 -0800 (PST) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BL5oFQj028376; Wed, 21 Dec 2022 06:11:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=qcppdkim1; bh=T59+OGJo76VoGlmNoaP6JZlHidx8e5QMXw8nvlGU/A0=; b=fUba4cm4RyWXngajAu6qTYjEdHSJx7gXKfAHwmqAYrHsh4dpSoC6evOL1OU0za2pxzf2 Q7FhH5Qhlfx5HOyhazccFcviHyqvXmGLwNhi8UoCpB7KilIemVYBanISGCnlyK2xX6MM 0h1jeBFhL5TiMNlRRr87aptxg2TnNOdHQq92DZTF7zZTVyA7jetGQSIt+Ey+VGmjBWG7 3RBdX0Foud9hrdjAqhExooy1HJ97Npc0DC/fpHHqRxBkXiLlFEepqvYh/P99MsVkoH0B Zo3G6vkvm6aSLLdPj3nw4Wc4VhJtbSGtUEz2UzTISrVGWdnNRV0uIklf3oAs8op1sMfA iQ== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3mjyk53haf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Dec 2022 06:11:04 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2BL6B3Md012882 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Dec 2022 06:11:03 GMT Received: from hu-srivasam-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Tue, 20 Dec 2022 22:10:57 -0800 From: Srinivasa Rao Mandadapu To: , , , , , , , , , , , , , , , , , , , CC: Srinivasa Rao Mandadapu Subject: [PATCH v4 1/2] remoteproc: elf_loader: Update resource table name check Date: Wed, 21 Dec 2022 11:40:32 +0530 Message-ID: <1671603033-4359-2-git-send-email-quic_srivasam@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1671603033-4359-1-git-send-email-quic_srivasam@quicinc.com> References: <1671603033-4359-1-git-send-email-quic_srivasam@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: Y315FuH7b539WBAQ_5YBIQ2ri_IgeJdG X-Proofpoint-ORIG-GUID: Y315FuH7b539WBAQ_5YBIQ2ri_IgeJdG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-21_02,2022-12-20_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 adultscore=0 clxscore=1015 suspectscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 phishscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212210044 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752803462457827493?= X-GMAIL-MSGID: =?utf-8?q?1752803462457827493?= Update the way of checking resource table name with prefix substring search instead of complete string search. In general, Qualcomm DSP binary is prepared by combining different ELFs'. Hence, section header name (e.g. .resource_table), appended with ELF name to differentiate with same section(e.g. resource_table.ac_bin_process) of different ELFs'. Example readelf output of DSP binary: [60] .start.ac_bin_process PROGBITS [61] .resource_table.ac_bin_process PROGBITS [62] .comment.ac_bin_process PROGBITS Signed-off-by: Srinivasa Rao Mandadapu Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Mukesh Ojha --- drivers/remoteproc/remoteproc_elf_loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/remoteproc/remoteproc_elf_loader.c b/drivers/remoteproc/remoteproc_elf_loader.c index 5a412d7..77330d6 100644 --- a/drivers/remoteproc/remoteproc_elf_loader.c +++ b/drivers/remoteproc/remoteproc_elf_loader.c @@ -272,7 +272,7 @@ find_table(struct device *dev, const struct firmware *fw) u64 offset = elf_shdr_get_sh_offset(class, shdr); u32 name = elf_shdr_get_sh_name(class, shdr); - if (strcmp(name_table + name, ".resource_table")) + if (!strstarts(name_table + name, ".resource_table")) continue; table = (struct resource_table *)(elf_data + offset); From patchwork Wed Dec 21 06:10:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Srinivasa Rao Mandadapu X-Patchwork-Id: 35267 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp3363375wrn; Tue, 20 Dec 2022 22:20:48 -0800 (PST) X-Google-Smtp-Source: AMrXdXtzhW1WlHTOUOU32s5xzQxf2AvAHJVv6CWrsKXvqkNtlzCqLLw6wUN/lTLm9RhT4m3Mh0SA X-Received: by 2002:a17:90b:2807:b0:219:5fc5:7790 with SMTP id qb7-20020a17090b280700b002195fc57790mr1031880pjb.16.1671603647709; Tue, 20 Dec 2022 22:20:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671603647; cv=none; d=google.com; s=arc-20160816; b=DjjCCbRYUz/5lgPcq40GbzmelphCTRwGzHdJ2dwdUmulI5/yD6nFV2EC3zBMJ08uX7 ULgbLmb+yUL7s2bCy6ynbJWRU5VgpyXr/jFCjBO/NW+3gLGPOucKMJJGj1bEz6/vYIYI Gpbig1XmdTHohtjR4fmTs73V11TZRbBbY1ablVG/Nv3a7YeaYqgKtvO0CxmxYh/sEOJZ zRCsmqoS5cQpzMFqJiaEn0K4bAvBLXeETYzBAm5f+wrRojwR3ilcP7DC0bXNVgJDFbQi 7NiOUzk+zFouPaczFGPKxB8L7+QiWxkWRl9BbFb+WeVuLOBUcYhG13NyCrwdumsDcgDP vhMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+heDGs/oZLOUaewrIht7Fb2HiZicHGJxI2rC5tPSqso=; b=WzYwgy/jRjlnPFf2JiQno0ZDi0qfBRhHkD9cjb1SImjk6Xv0ngNN4rxcirHzyDO/aq Dyj8shyS9zOa9CC1cf9jNMREat8fK0O0bnH6FGI7OHJ1mVS6aBMxmCGqOnWdBv9uDtma zDF5GUSNwqA9UQxn++SZuShRh0Udd68IcYcdZF0HN2FSesUflDrkottHUZHDg1aHN/B9 0VHQbweGwI4az2U8r7+6t+4GPJuK7rlAU5QU9VRngGqs0tp/x2LD9Di35VXccaoaHrQn JjVqwSnBpcO59+RNlGZqwi/TypO4d/pM0znBxo5Z2FdUw4xL4qAYaMRw4fs7/8sdo24q ufkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=SYU5lMgi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i18-20020a17090ad35200b0021a0b5c5f6asi683301pjx.156.2022.12.20.22.20.35; Tue, 20 Dec 2022 22:20:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=SYU5lMgi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234504AbiLUGMD (ORCPT + 99 others); Wed, 21 Dec 2022 01:12:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234494AbiLUGLx (ORCPT ); Wed, 21 Dec 2022 01:11:53 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C06F1C43B; Tue, 20 Dec 2022 22:11:52 -0800 (PST) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BL4vVnx023999; Wed, 21 Dec 2022 06:11:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=qcppdkim1; bh=+heDGs/oZLOUaewrIht7Fb2HiZicHGJxI2rC5tPSqso=; b=SYU5lMgi4Tmn+GdhJdBtrlx7EFhCyvfispuSdyLW9e71SEzxdQaFVjtKFy8I2BBtktDu IhUHMtb/A8SaTefNuee8LqtEfm//NPdFibDyUnnfzYOwhARniDjFMYNyQ12reua7e943 nMTEUg2oIVbQILyYDPavlDVxuK5H83wO2x9i+K3spiUE0Z5wB0HDICMX8+Cs6DI7EKr+ cHGwZ8ZGA4K7OwE+RRsUd9/0jLoGs/2GZ4BVcIwePrhYAhlyJUJHuNdOHBlR4hrHi9kJ BlfjtxoHuIU9fnAWuCIHGtTdSZAvRETSL2oLPDmriaqBKFOYOs7F8PRwOk5m6LURYtrb Xg== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3mkcxv9xme-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Dec 2022 06:11:11 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2BL6BArX026033 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Dec 2022 06:11:10 GMT Received: from hu-srivasam-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Tue, 20 Dec 2022 22:11:04 -0800 From: Srinivasa Rao Mandadapu To: , , , , , , , , , , , , , , , , , , , CC: Srinivasa Rao Mandadapu Subject: [PATCH v4 2/2] docs: remoteproc: Update section header name requirement Date: Wed, 21 Dec 2022 11:40:33 +0530 Message-ID: <1671603033-4359-3-git-send-email-quic_srivasam@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1671603033-4359-1-git-send-email-quic_srivasam@quicinc.com> References: <1671603033-4359-1-git-send-email-quic_srivasam@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: iIaKJcBDtKFQuJUyBS-h4uVK7IAHAyN7 X-Proofpoint-ORIG-GUID: iIaKJcBDtKFQuJUyBS-h4uVK7IAHAyN7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-21_02,2022-12-20_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 impostorscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 suspectscore=0 malwarescore=0 spamscore=0 mlxlogscore=928 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212210044 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752803466476008225?= X-GMAIL-MSGID: =?utf-8?q?1752803466476008225?= Add section header name requirement specification in elf segments. Signed-off-by: Srinivasa Rao Mandadapu Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Mukesh Ojha --- Documentation/staging/remoteproc.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/staging/remoteproc.rst b/Documentation/staging/remoteproc.rst index 348ee7e..0c9c10a 100644 --- a/Documentation/staging/remoteproc.rst +++ b/Documentation/staging/remoteproc.rst @@ -244,7 +244,10 @@ according to the specified device address (might be a physical address if the remote processor is accessing memory directly). In addition to the standard ELF segments, most remote processors would -also include a special section which we call "the resource table". +also include a special section which we call the "resource table". +A "resource table" section name must start with the ".resource_table" prefix, +optionally having a more descriptive string appended. For example, +".resource_table.my_rproc" is a valid section name. The resource table contains system resources that the remote processor requires before it should be powered on, such as allocation of physically