From patchwork Mon Jul 1 11:52:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ekansh Gupta X-Patchwork-Id: 13717969 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9119313E41A; Mon, 1 Jul 2024 11:52:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719834780; cv=none; b=JuglEigjtgWLBcHkEuqHOs9xSYC57kAJK/1q1obl2LIqo3NbTQcbRlGsIWqnMGZUC8aplEeCQdsguFsCzG0JtrQardKLhmkSwjUFIvhFPYZADAIYdJFO63enE74yHiT9otL0gIYwQ1bFh0cUBuKZaQTXDO6NadGAWo3zDHl5mSE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719834780; c=relaxed/simple; bh=vC8Wg9uyPfH19TAKIkd6tsMzMiqvNHuFYvYVi4ccAu8=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Vko81qaKBU86fG2DwzeMgv1YkG/pArwuGBw0u5r+ls+6HgYm9AuOYTW14cxSatlYOKIavvk/IPuS+0g+NW3wV27kR7HsAn1ZGhNa3t+47/P8ZKW4ikLTdMphSIYnqcBVEBCGWrAq26qcXzi6yYF6mC8OvcoR6i5g19qAJOGB7DY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=BhewBGw3; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="BhewBGw3" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 461Ajnux032262; Mon, 1 Jul 2024 11:52:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=rLzwaptejh6PMQlRjVqQkJ NdM424sEKrpESq6j0uD6U=; b=BhewBGw3XqUnDb2T25zqmCLv+yGyvitpRRX1YF ve/JFcV8unjHGi+qnyKqhC/0cKdxoJrPDfDsoiuPrp1NZXE6/mTdmYGpLkpp10uZ vxnZw54bd8lSMqRAt6UeTIur2l3EcA1Q1qcQ6xKlt0neb90AsnNEUWRo/p6kzGC1 qGoLpjEyf3iWfWRhunrr/gwTNwBlPHZN2QmGRn0/KYzDlDFeFYxANbuFMLjCmQ3U dqMntvBFYqRdDdBfAeqmMZ7UUYoqucRKmHtDRqJbUVv6ZBtUW1K2Q2syjLq1tnGh Er6w9yCJGZw73+OCTIW+1KRUo6HYW9wthdyY3YPp4NM9Vskg== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 402an743dp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 01 Jul 2024 11:52:50 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA02.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 461BqnuO016675 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 1 Jul 2024 11:52:49 GMT Received: from hu-ekangupt-hyd.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Mon, 1 Jul 2024 04:52:45 -0700 From: Ekansh Gupta To: , CC: , , , , , , stable Subject: [PATCH v3] misc: fastrpc: Increase max user PD initmem size Date: Mon, 1 Jul 2024 17:22:37 +0530 Message-ID: <20240701115237.371020-1-quic_ekangupt@quicinc.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: kkIkvsmszgf-RRkCTuNayolp_gphQoU3 X-Proofpoint-ORIG-GUID: kkIkvsmszgf-RRkCTuNayolp_gphQoU3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-01_09,2024-06-28_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 clxscore=1015 adultscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 impostorscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2407010091 For user PD initialization, initmem is allocated and sent to DSP for initial memory requirements like shell loading. This size is passed by user space and is checked against a max size. For unsigned PD offloading requirement, more than 2MB size could be passed by user which would result in PD initialization failure. Increase the maximum size that can be passed py user for user PD initmem allocation. Any additional memory sent to DSP during PD init is used as the PD heap. Fixes: 7f1f481263c3 ("misc: fastrpc: check before loading process to the DSP") Cc: stable Signed-off-by: Ekansh Gupta --- Changes in v2: - Modified commit text. - Removed size check instead of updating max file size. Changes in v3: - Added bound check again with a higher max size definition. - Modified commit text accordingly. drivers/misc/fastrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 5204fda51da3..11a230af0b10 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -38,7 +38,7 @@ #define FASTRPC_INIT_HANDLE 1 #define FASTRPC_DSP_UTILITIES_HANDLE 2 #define FASTRPC_CTXID_MASK (0xFF0) -#define INIT_FILELEN_MAX (2 * 1024 * 1024) +#define INIT_FILELEN_MAX (5 * 1024 * 1024) #define INIT_FILE_NAMELEN_MAX (128) #define FASTRPC_DEVICE_NAME "fastrpc"