Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp945505rwb; Wed, 14 Dec 2022 04:56:07 -0800 (PST) X-Google-Smtp-Source: AA0mqf509cAf9loPMSk9mEdyLt3ayQTUsPo+UYw99cO20CvTqyr2Xr/owVBSfHTBURbiLoIi65Tw X-Received: by 2002:a17:906:1818:b0:7c1:8ba6:6eaf with SMTP id v24-20020a170906181800b007c18ba66eafmr7273515eje.5.1671022567784; Wed, 14 Dec 2022 04:56:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671022567; cv=none; d=google.com; s=arc-20160816; b=R5KjFUS02md14dsE3nI0O6VEWNZClg0VDDlilv+a1k28JDrfg6tsI0U9miN5DQS7oD A4BIzFnRvWaghdduB5L4gya64Dz5bJV9/Cv5gR9EShITZEvFFYD1ChWEwkpxSCIu6HBY sNp+Mf2+/jRxZ3Bnf3Gn/Xr7d3ampd0DASvryvfg6E0EL8PeJbiXuCTq8/ZbzMG+rmiQ nio0WUjSEa0ppqk3OYm1LbETwOY3JFD5GhETrxMhg9PQfkQeboYTd9y5LCxajXkxrdUr bk4bOLwjWmF93TV+NJ9pBLSaRWAdY43K0WLbmJCCK/2zphxv1YLVCjsYcgmQMz1yoBiw VrFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=jYZg+kLIKhBDF5wW/QrkjH6TjMMJkibiqKu73DC6phE=; b=Cw+yH0doPUgrv3YAqAz5Dak7IETD2rR6kkaEZ4YOfB6Wtu18St9CV69SZA69CjWvpa NZzCMOoPyCYt86ZRvsHB/HjJJwlmsd+TDah4/JAJ9UzEf7irVdTHUG+GJ6qaSjRwynpN zh9jmKAiEVyPyu+8c5SMvo9kQjBOtw6d9Z7FS4eYAZzycMquL57JAKRLsdh20PNDjGY/ CHsFitvtm2yn2/gjMM1RW87PvquSou8N2oc2plPpC04G6Ms+2BWlp+XYnvL/CwRG4Dpf NTzcXPdf7bohdshpLgvTyOYXsxcLJ/vexOkAH/N4+2azPyhK6nT1SOJI1/tmJftUiSeJ UVMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=XPvm7Vk5; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds15-20020a170907724f00b007c172bd367fsi6904381ejc.193.2022.12.14.04.55.50; Wed, 14 Dec 2022 04:56:07 -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=XPvm7Vk5; 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 S229867AbiLNLvd (ORCPT + 69 others); Wed, 14 Dec 2022 06:51:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238164AbiLNLva (ORCPT ); Wed, 14 Dec 2022 06:51:30 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 768BD19C3B; Wed, 14 Dec 2022 03:51:28 -0800 (PST) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BEB8d85012742; Wed, 14 Dec 2022 11:51:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=jYZg+kLIKhBDF5wW/QrkjH6TjMMJkibiqKu73DC6phE=; b=XPvm7Vk5cNKz97h4ILY0d9QiCc0vHqbykDz2GLYolY7vtQRWT/+aeV7Ty6VImdAF4a4t uHj+OCyHZIznbK3QsJD5+QyztH1W56N/ff7F0SeKEFDYWASKGp8VUBi8ukh0+dcd9MJ9 uwjwatCztPCJ9bpMwBUJYAUbzO5uYv09QAssZcOtpsV1yCQRNQRwwRlrzILEFPCJJ6YB qIGCGt00iC2HiGVH76zfpUWUx9UJJlT+kbn4RZ/6Is2Pm0anmQy/vd4+cRPTBbpzx83u zJyrjD2K3aarRUtwBU+WrNHSkkql1z/sjB52NhF/urE1ASzJZ77kEN/TedKF3e7RPcIY OQ== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3mf6rd12tq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 14 Dec 2022 11:51:14 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2BEBpEo1026364 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 14 Dec 2022 11:51:14 GMT Received: from [10.79.43.91] (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; Wed, 14 Dec 2022 03:51:09 -0800 Message-ID: Date: Wed, 14 Dec 2022 17:21:06 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH 4/4] remoteproc: qcom_q6v5_mss: Use a carveout to authenticate modem headers Content-Language: en-US To: Krzysztof Kozlowski , , , , CC: , , , , , , , , , , References: <20221213140724.8612-1-quic_sibis@quicinc.com> <20221213140724.8612-5-quic_sibis@quicinc.com> <8739f59b-c551-2da4-5523-a89f960bd402@linaro.org> <1d3c7d01-bfa9-6654-28d9-b9f4964a88a4@linaro.org> From: Sibi Sankar In-Reply-To: <1d3c7d01-bfa9-6654-28d9-b9f4964a88a4@linaro.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit 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: p-WLqOpF4P2JSpD1Ydh6GjQ-DyeR3XZO X-Proofpoint-ORIG-GUID: p-WLqOpF4P2JSpD1Ydh6GjQ-DyeR3XZO 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-14_04,2022-12-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 adultscore=0 impostorscore=0 mlxscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212140092 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 On 12/14/22 16:58, Krzysztof Kozlowski wrote: > On 14/12/2022 11:33, Sibi Sankar wrote: >> >> >> On 12/14/22 01:17, Krzysztof Kozlowski wrote: >>> On 13/12/2022 15:07, Sibi Sankar wrote: >>>> The memory region allocated using dma_alloc_attr with no kernel mapping >>>> attribute set would still be a part of the linear kernel map. Any access >>>> to this region by the application processor after assigning it to the >>>> remote Q6 will result in a XPU violation. Fix this by replacing the >>>> dynamically allocated memory region with a no-map carveout and unmap the >>>> modem metadata memory region before passing control to the remote Q6. >>>> >>>> Reported-by: Amit Pundir >>>> Fixes: 6c5a9dc2481b ("remoteproc: qcom: Make secure world call for mem ownership switch") >>>> Signed-off-by: Sibi Sankar >>>> --- >>> >>> Thank you for your patch. There is something to discuss/improve. >>>> >>>> return ret < 0 ? ret : 0; >>>> @@ -1882,6 +1899,26 @@ static int q6v5_alloc_memory_region(struct q6v5 *qproc) >>>> qproc->mpss_phys = qproc->mpss_reloc = r.start; >>>> qproc->mpss_size = resource_size(&r); >>>> >>>> + if (!child) { >>>> + node = of_parse_phandle(qproc->dev->of_node, "memory-region", 2); >>>> + } else { >>>> + child = of_get_child_by_name(qproc->dev->of_node, "metadata"); >>> >>> Bindings do not allow to have child "metadata", do they? >> >> memory-region property was used to specify mba/mpss region in a phandle >> array only from SC7180 SoC. All the older dtbs in the wild/upstream >> still had sub-nodes to achieve the same. Patch 3 allows for a sub-set >> of the SoCs (MSM8996/MSM8998/SDM845) to use metadata as a sub-node so >> as to not break bindings when newer kernel uses a older dtb. > > This does not explain why you extend the driver without extending the > bindings. You do not do it for legacy stuff but for SC7180. But even for > legacy devices you cannot add new properties without having it in some > legacy bindings. https://patchwork.kernel.org/project/linux-arm-msm/patch/20221213140724.8612-4-quic_sibis@quicinc.com/ The legacy bindings are a part of patch 3 ^^. > > > Best regards, > Krzysztof >