From mboxrd@z Thu Jan 1 00:00:00 1970 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 269AC23EA8E for ; Fri, 30 Jan 2026 11:57:43 +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=1769774265; cv=none; b=htFzYtDHZirGH55cE4kxdsZKHuHHrwdieWeo97Yihwp+uHpRi778B8xHGwQr3Jd7P9qgBQG5qyqDHuMTCnr5rWrDsepQcg0njPHntAeAfuDwHBnh/YW+NrpsDzLk6F1HA34e4goDi7IE0EJDcX05ea/69T0Hg22Yzy9FmZbZsw4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769774265; c=relaxed/simple; bh=G2rV932q4SPE5ovdyXodes8U9OvCPmJBv/MOS4B4cTs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=K6PMqIckv+bHLgvQesqVYeiJ2kjfsbhqvSkLb1pi8/x5a3H4O1LkMYKVl/vXgb3syvF2F3Q3RtVydxpZbS5HONCvYCfg8iHu1C2kbetW7ZLXuKgJaogQyAlK4H108reCCdXxFMFhyed9rLLhHi16G3Uz6fKcdNYC4mscDMkzqwc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=kBsZJa06; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=RG9UJZf0; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="kBsZJa06"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="RG9UJZf0" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60UBGnJx996202 for ; Fri, 30 Jan 2026 11:57:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= e1fXKHZMycN74+GHHi+y/sp4SJEcWi40nQnF91q3AIQ=; b=kBsZJa065k+BbQho EbFYJ+sHWRg7Y6/HMUyRq1f+eVjZ9As0oSIY7XRuLQDA7qcukZ2amYzI4CkPCsOf elCZCSxMO4ci2dQhB+b54MiaFTXZdMG1sHM2zaYdMt5eg1Jft5hKUG/9sgvjm4FP SwG47WdKWCeLaRK++8AVOKuf576RGxShnCOhUS1Wwr8Z9yEYFywmEMKoaisrg9dH 4KDuPVMRUNns5GTSYVvVYPg5jiH6Ty0L96wAA05vq+v4GHO0ce+ikZHDHPjQ+dpV 7eOkKyuwZM0/icTpnUHGSYDjP3ADx60w3qrXTR4aETKxkpTtz6RDx+SpVfJY+X7p +NSkGg== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4c0bvvjynj-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 30 Jan 2026 11:57:42 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-34c38781efcso2160048a91.2 for ; Fri, 30 Jan 2026 03:57:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1769774262; x=1770379062; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=e1fXKHZMycN74+GHHi+y/sp4SJEcWi40nQnF91q3AIQ=; b=RG9UJZf0AUTxniKBsMHaHwYzDTX1Drm9RCmCADmunc7Km2RSB11fZphRyCRIkUtfCl ECmJs9LNKKDxVgwB/fzvLbKRR4ZtCRG+pWVqo2e8eQumuYMcYzsXnY1AkR+QrHX/wDxx m5CqzrwNLHNc6gFwfPS6MZBB7i4oSTq8oGDMkM5yRAbgU/hti0NzSvXFD0Sn/AKtoXiZ KqeN0fJh/IuV5wple/xScl92LDT51FcVgX0bDzz6s0qUaP4blsmYRuRqz5pte+T8Pcyo EAl8CLDk0xZU6PpweK/rn1OF21fGZIS4fsF8hjV87pqOGtx8sLsG6tylk4wkH40xQlg0 uoyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769774262; x=1770379062; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=e1fXKHZMycN74+GHHi+y/sp4SJEcWi40nQnF91q3AIQ=; b=gFpE+ivrs6Dd+k961bLH1tKh9RHnHQvS+K58w9VPZ/4fxFajHsE+bmc3NVRhgnzWlQ EInoXFaMcx55vcPdnHvKcQpXQlnO6swYaGlIVUBz5IllrdUko1bKNKeFj2Yn3kogBPEA 8BsIAus50TAKLzC3XPjipbVaiZJBiE0MgpbYuFRCLhBV+a1RRpk2viSUcoYt2hNu6TIe GMrj4xepNoTG4CiltPoJADgXAJvNKA3GH+t6tBBeQI5y9ZXqUQTxX0Ka7YCGr6HMx3pC XYwhK3ALXUksrY2sMrk6M2yM15Sds/B1PH7XY4OwlMcDxiPQojARiXxlTD2AEx/92BpD ZH6g== X-Forwarded-Encrypted: i=1; AJvYcCV5w7XbFWFogsUcC0pGwa0g12/cHUuuQY9jNnVkY7DxWYJxyQVNFF0tYAYmuyT1sCiC9YC+cBC+weiPjO4=@vger.kernel.org X-Gm-Message-State: AOJu0YwzzjqGrFd/vvlt4yXodOqPOi56dPP3OimAm+/xSKhUcA1y5PRe dpUZquy0xGgzJo/NJyEup2oJxMKVeBKqexMoGufLWGWcEkKx/vdpmN5cvwXu+uKC0lHSDlcOhfO cpPA2HKAG7QO7wwiBy0GGU378E94Ot5CuuFMypio/aAPSCfxmqnQnARNQGBcPbIVnysw= X-Gm-Gg: AZuq6aKlseP8N5ESkH8le+WwVHtgymHHZ1XC207DG1patJ+fpPlLCZMsfFaIAZVUfYI Z0bCrd6N8UHh2LKj/zT69ciDOvdVs3VhULjbgNqm2Z/WQ4D2mqJ1IId0W2KiMUa0gRgXdRjNvyy NFCIYNL0KqM7kV/z5WBitzIf5d0th4Y8pr9L0md30Mo8LscvvObzpd6rcC1QIZoCzeawIOPlme4 27fcwADriUxfeRbXSxeTusUNqzVeMZdQOYYwW09NWEcn2kKIsn15XK8lFifpruv1aOUgx5Gn4YW f4I+GKo9b4oLqYrQSgeHHtWTPeTxnySkmj0ZjAb+4g5/aiCmsdil2WgjYQX8IysX43PPH8Eur0+ azfUXT8Yxo/5PSAdnqKRmt0PNbzPei76/j9cIBQ== X-Received: by 2002:a17:90b:5404:b0:353:100:2f20 with SMTP id 98e67ed59e1d1-3543b3283ecmr2260477a91.10.1769774261972; Fri, 30 Jan 2026 03:57:41 -0800 (PST) X-Received: by 2002:a17:90b:5404:b0:353:100:2f20 with SMTP id 98e67ed59e1d1-3543b3283ecmr2260453a91.10.1769774261498; Fri, 30 Jan 2026 03:57:41 -0800 (PST) Received: from [10.206.99.28] ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-353f6206386sm11200479a91.15.2026.01.30.03.57.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 30 Jan 2026 03:57:41 -0800 (PST) Message-ID: Date: Fri, 30 Jan 2026 17:27:37 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 3/3] misc: fastrpc: Support mapping userspace-allocated buffers To: Dmitry Baryshkov Cc: srini@kernel.org, linux-arm-msm@vger.kernel.org, gregkh@linuxfoundation.org, quic_bkumar@quicinc.com, linux-kernel@vger.kernel.org, quic_chennak@quicinc.com, dri-devel@lists.freedesktop.org, arnd@arndb.de References: <20251230110225.3655707-1-ekansh.gupta@oss.qualcomm.com> <20251230110225.3655707-4-ekansh.gupta@oss.qualcomm.com> <69cb2d42-6672-4c42-935f-e3fff9bf38f8@oss.qualcomm.com> <33xoq7nt7j3sgcrnxjmbfogrdy3hyskym3yzurmqzwdqxtlgwe@vywpjmegteel> Content-Language: en-US From: Ekansh Gupta In-Reply-To: <33xoq7nt7j3sgcrnxjmbfogrdy3hyskym3yzurmqzwdqxtlgwe@vywpjmegteel> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Authority-Analysis: v=2.4 cv=ZdEQ98VA c=1 sm=1 tr=0 ts=697c9cb6 cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=7TOm-_SFLvYlJXCAKM4A:9 a=QEXdDO2ut3YA:10 a=iS9zxrgQBfv6-_F4QbHw:22 X-Proofpoint-GUID: kkWIqUcbe3WY7_kGDt3KQ_3LrxZ8sZM2 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTMwMDA5NyBTYWx0ZWRfX7otKe45Oag7d BegqNJ1yZma4+56YYrCGG8iDOnvW7dYl5Y9ynTh3An/yD8ClpLKvlbyjkswpRZTaOCktDcHYR1q CVc9WVhI+TdFUpjpeaFgT/2ZIK/pVSOc0e80EnPRlJAT6Io7D0lOEoEyCYuA+/4nTWWN9VFyRzx PCMV3zULaY/P8qDYK6NT2dDog9fA37RhOOeW1R662vWnMIJ3S4RjHzFN2EOS3gtEyYoibzsdDDB TLaUFDZyO6kCgtOyuhBQeg/pMaGxJoh2jF+67xiewdujX6p6ZE/eAikUH2iHqWtu2ozwhMme2Gu U0kNveS8UGlQy+elE4cHxCe/X+d3e4IHujuxsfRg3WdfPV32lK7yqS8dtMq/7mvzhljfYCaX3lH QopMrefVMuvMPIZO0WF+yjw1T52QSbiTzClUfOkeREkp6iLfJuYfg+e163xgGS+nhJaBDEtJKi3 rz1G3IiPwD8qExqbmqw== X-Proofpoint-ORIG-GUID: kkWIqUcbe3WY7_kGDt3KQ_3LrxZ8sZM2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-01-30_01,2026-01-29_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 phishscore=0 spamscore=0 suspectscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601300097 On 1/30/2026 7:59 AM, Dmitry Baryshkov wrote: > On Thu, Jan 29, 2026 at 04:09:41PM +0530, Ekansh Gupta wrote: >> >> On 1/6/2026 8:21 AM, Dmitry Baryshkov wrote: >>> On Tue, Dec 30, 2025 at 04:32:25PM +0530, Ekansh Gupta wrote: >>>> Currently, FastRPC only supports mapping buffers allocated by the >>>> kernel. This limits flexibility for applications that allocate memory >>>> in userspace using rpcmem or DMABUF and need to share it with the DSP. >>> Hmm, for DMABUF we need _import_ support rather than support for mapping >>> of userspace-allocated buffers. >>> >>>> Add support for mapping and unmapping userspace-allocated buffers to >>>> the DSP through SMMU. This includes handling map requests for rpcmem >>>> and DMABUF-backed memory and providing corresponding unmap >>>> functionality. >>> For me this definitely looks like a step back. For drm/accel we are >>> going to have GEM-managed buffers only. Why do we need to handle >>> userspace-allocated buffers here? >> That's correct, GEM-PRIME will handle it properly. Here, the reason to add this >> change is to enable routing of DSP logs to HLOS which is done by using a shared >> buffer between userspace process and DSP PD. The buffer can be allocated from >> both fastrpc driver's DMA-BUF or DMABUF heap(eg. system heap). >> >> So this shared buffer is getting mapped to both process's IOMMU device and DSP PD >> with this change. > So, you have the DMA-BUF buffer. Instead of mapping it from userspace > with unclean semantics, please import the buffer. I'm assuming fastrpc_map_create is sort of importing the buffer by calling dma_buf_map_attachment. Is this not the correct understanding? This assumption is based on the existing part inside fastrpc_get_args, where fastrpc_map_create is getting called for each of user passed DMA-BUF. Moving to accel based driver is going to standardize this as the .gem_prime_import implementation is going to handle this case. //Ekansh > >>>> Signed-off-by: Ekansh Gupta >>>> --- >>>> drivers/misc/fastrpc.c | 97 +++++++++++++++++++++++++++++++++++++----- >>>> 1 file changed, 86 insertions(+), 11 deletions(-) >>>>