From: Ekansh Gupta <quic_ekangupt@quicinc.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: <srinivas.kandagatla@linaro.org>, <linux-arm-msm@vger.kernel.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 v5 2/2] misc: fastrpc: Increase unsigned PD initmem size
Date: Mon, 22 Jul 2024 11:55:19 +0530 [thread overview]
Message-ID: <35e52822-a81f-4b2c-adc1-903785ce1849@quicinc.com> (raw)
In-Reply-To: <2024072235-daydream-clunky-0272@gregkh>
On 7/22/2024 11:30 AM, Greg KH wrote:
> On Mon, Jul 22, 2024 at 11:24:37AM +0530, Ekansh Gupta wrote:
>> For unsigned PD offloading requirement, additional memory is required
>> because of additional static heap initialization. Without this
>> additional memory, PD initialization would fail. Increase the initmem
>> size by 2MB for unsigned PD initmem buffer 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 <stable@kernel.org>
>> Signed-off-by: Ekansh Gupta <quic_ekangupt@quicinc.com>
>> ---
>> drivers/misc/fastrpc.c | 7 +++++++
>> 1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
>> index a3a5b745936e..18668b020a87 100644
>> --- a/drivers/misc/fastrpc.c
>> +++ b/drivers/misc/fastrpc.c
>> @@ -40,6 +40,7 @@
>> #define FASTRPC_CTXID_MASK (0xFF0)
>> #define INIT_FILELEN_MAX (2 * 1024 * 1024)
>> #define FASTRPC_INITLEN_MIN (3 * 1024 * 1024)
>> +#define FASTRPC_STATIC_HEAP_LEN (2 * 1024 * 1024)
>> #define INIT_FILE_NAMELEN_MAX (128)
>> #define FASTRPC_DEVICE_NAME "fastrpc"
>>
>> @@ -1411,8 +1412,14 @@ static int fastrpc_init_create_process(struct fastrpc_user *fl,
>> goto err;
>> }
>>
>> + /* Allocate buffer in kernel for donating to remote process.
>> + * Unsigned PD requires additional memory because of the
> What is "PD"?
DSP PD(protection domain) is execution environment supported by DSP.
>
>> + * additional static heap initialized within the process.
>> + */
> Why are you using networking comment style for a non-networking file?
I observed similar style in this driver file. I will update this in proper style in the next patch.
>
>> memlen = ALIGN(max(FASTRPC_INITLEN_MIN, (int)init.filelen * 4),
>> 1024 * 1024);
>> + if (unsigned_module)
>> + memlen += FASTRPC_STATIC_HEAP_LEN;
> I don't understand, why is "static heap length" being added for
> something that is "unsigned"? Why isn't this just "SIGNING FREE SPACE"
> or something like that?
The difference between signed PD and unsigned PD is:
Signed PD: Available on all DSPs and requires that the shared objects being loaded in the PD
are signed with a digital signature.
Unsigned PD: Sandboxed low-rights process that allows signature-free shared objects to run on
CDSP.
For unsigned PD there are some additional statically initialized heap for which additional memory
is required. I'll try to come up with a better name.
Thanks for the review.
--Ekansh
>
> thanks,
>
> greg "naming is hard" k-h
>
prev parent reply other threads:[~2024-07-22 6:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-22 5:54 [PATCH v5 0/2] Fix user PD inimem requirements Ekansh Gupta
2024-07-22 5:54 ` [PATCH v5 1/2] misc: fastrpc: Define a new initmem size for user PD Ekansh Gupta
2024-07-22 5:58 ` Greg KH
2024-07-22 6:12 ` Ekansh Gupta
2024-07-22 7:39 ` Greg KH
2024-07-22 7:53 ` Ekansh Gupta
2024-07-22 8:21 ` Dmitry Baryshkov
2024-07-22 5:54 ` [PATCH v5 2/2] misc: fastrpc: Increase unsigned PD initmem size Ekansh Gupta
2024-07-22 6:00 ` Greg KH
2024-07-22 6:25 ` Ekansh Gupta [this message]
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=35e52822-a81f-4b2c-adc1-903785ce1849@quicinc.com \
--to=quic_ekangupt@quicinc.com \
--cc=arnd@arndb.de \
--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®