From: Ekansh Gupta <quic_ekangupt@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: <srinivas.kandagatla@linaro.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>,
stable <stable@kernel.org>
Subject: Re: [PATCH v6 1/2] misc: fastrpc: Define a new initmem size for user PD
Date: Tue, 23 Jul 2024 10:04:57 +0530 [thread overview]
Message-ID: <63c52fd2-9f31-418b-8c6c-4c91f7c69fd3@quicinc.com> (raw)
In-Reply-To: <ydp5ntlresenovs6qaqt7wdaleuruubem5hajbfadkratfsiam@wjn33ymp4gyc>
On 7/22/2024 2:02 PM, Dmitry Baryshkov wrote:
> On Mon, Jul 22, 2024 at 01:31:59PM GMT, Ekansh Gupta wrote:
>> For user PD initialization, initmem is allocated and sent to DSP for
>> initial memory requirements like shell loading. The size of this memory
>> is decided based on the shell size that is passed by the user space.
>> With the current implementation, a minimum of 2MB is always allocated
>> for initmem even if the size passed by user is less than that. For this
>> a MACRO is being used which is intended for shell size bound check.
>> This minimum size of 2MB is not recommended as the PD will have very
>> less memory for heap and will have to request HLOS again for memory.
>> Define a new macro for initmem minimum length of 3MB.
>>
>> Fixes: d73f71c7c6ee ("misc: fastrpc: Add support for create remote init process")
>> Cc: stable <stable@kernel.org>
>> Signed-off-by: Ekansh Gupta <quic_ekangupt@quicinc.com>
>> ---
>> drivers/misc/fastrpc.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
>> index a7a2bcedb37e..a3a5b745936e 100644
>> --- a/drivers/misc/fastrpc.c
>> +++ b/drivers/misc/fastrpc.c
>> @@ -39,6 +39,7 @@
>> #define FASTRPC_DSP_UTILITIES_HANDLE 2
>> #define FASTRPC_CTXID_MASK (0xFF0)
>> #define INIT_FILELEN_MAX (2 * 1024 * 1024)
>> +#define FASTRPC_INITLEN_MIN (3 * 1024 * 1024)
> So, what is the difference between INIT_FILELEN_MAX and
> FASTRPC_INITLEN_MIN?
INIT_FILELEN_MAX is the maximum shell size that can be passed by user.
FASTRPC_INITLEN_MIN is the minimum initmem length for PD.
>
>> #define INIT_FILE_NAMELEN_MAX (128)
>> #define FASTRPC_DEVICE_NAME "fastrpc"
>>
>> @@ -1410,7 +1411,7 @@ static int fastrpc_init_create_process(struct fastrpc_user *fl,
>> goto err;
>> }
>>
>> - memlen = ALIGN(max(INIT_FILELEN_MAX, (int)init.filelen * 4),
>> + memlen = ALIGN(max(FASTRPC_INITLEN_MIN, (int)init.filelen * 4),
> BTW: why is the code multiplying filelen by 4? Nothing in the source
> code suggests that filelen is in u32 words, so I'd assume it's measured
> in bytes.
The passed filelen is actually the size of fastrpc shell. This size is not sufficient for the user
PD initialization. The 4x of filelen gives the approx. needed memory for signed PD initialization.
Yes, filelen is measured in bytes.
>
>> 1024 * 1024);
>> err = fastrpc_buf_alloc(fl, fl->sctx->dev, memlen,
>> &imem);
>> --
>> 2.34.1
>>
next prev parent reply other threads:[~2024-07-23 4:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-22 8:01 [PATCH v6 0/2] Fix user PD inimem requirements Ekansh Gupta
2024-07-22 8:01 ` [PATCH v6 1/2] misc: fastrpc: Define a new initmem size for user PD Ekansh Gupta
2024-07-22 8:32 ` Dmitry Baryshkov
2024-07-23 4:34 ` Ekansh Gupta [this message]
2024-07-23 9:13 ` Dmitry Baryshkov
2024-07-22 8:02 ` [PATCH v6 2/2] misc: fastrpc: Increase unsigned PD initmem size Ekansh Gupta
2024-07-22 8:34 ` Dmitry Baryshkov
2024-07-23 4:36 ` Ekansh Gupta
2024-07-23 9:14 ` Dmitry Baryshkov
2024-07-22 8:26 ` [PATCH v6 0/2] Fix user PD inimem requirements Dmitry Baryshkov
2024-07-23 4:37 ` Ekansh Gupta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=63c52fd2-9f31-418b-8c6c-4c91f7c69fd3@quicinc.com \
--to=quic_ekangupt@quicinc.com \
--cc=arnd@arndb.de \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_bkumar@quicinc.com \
--cc=quic_chennak@quicinc.com \
--cc=srinivas.kandagatla@linaro.org \
--cc=stable@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®