mbox series

[v1,00/16] Add missing features to FastRPC driver

Message ID 20240202064039.15505-1-quic_ekangupt@quicinc.com (mailing list archive)
Headers show
Series Add missing features to FastRPC driver | expand

Message

Ekansh Gupta Feb. 2, 2024, 6:40 a.m. UTC
This patch series adds the listed features that have been missing
in upstream fastRPC driver.

- Redesign and improve remote heap management.
- Add static PD restart support for audio and sensors PD using
  PDR framework.
- Add changes to support multimode invocation ioctl request. This
  ioctl call facilitates multiple types of requests from user including
  CRC check, performance counters, shared context bank usage, etc.
  This series also carries patch to save and restore interrupted
  context.
- Add early wakeup support to allow DSP user to send early response
  to CPU and improve fastrpc performance.
- Add polling mode support with which driver polls on memory to avoid
  CPU from going to low power modes.
- Add notifications frameworks to provide users with the DSP PD status
  notifications.
- Add a control mechanism to allow users to clean up DSP user PD
- Add wakelock management support
- Add DSP signalling support
- Add check for untrusted applications and allow trusted processed to
  offload to system unsigned PD.

Ekansh Gupta (16):
  misc: fastrpc: Redesign remote heap management
  misc: fastrpc: Add support for unsigned PD
  misc: fastrpc: Add static PD restart support
  misc: fastrpc: Add fastrpc multimode invoke request support
  misc: fastrpc: Add CRC support for remote buffers
  misc: fastrpc: Capture kernel and DSP performance counters
  misc: fastrpc: Add support to save and restore interrupted
  misc: fastrpc: Add support to allocate shared context bank
  misc: fastrpc: Add early wakeup support for fastRPC driver
  misc: fastrpc: Add polling mode support for fastRPC driver
  misc: fastrpc: Add DSP PD notification support
  misc: fastrpc: Add support for users to clean up DSP user PD
  misc: fastrpc: Add wakelock management support
  misc: fastrpc: Add DSP signal support
  misc: fastrpc: Restrict untrusted apk to spawn privileged PD
  misc: fastrpc: Add system unsigned PD support

 drivers/misc/fastrpc.c      | 1949 +++++++++++++++++++++++++++++++----
 include/uapi/misc/fastrpc.h |  112 ++
 2 files changed, 1844 insertions(+), 217 deletions(-)

Comments

Neil Armstrong Feb. 2, 2024, 8:11 a.m. UTC | #1
Hi,

On 02/02/2024 07:40, Ekansh Gupta wrote:
> This patch series adds the listed features that have been missing
> in upstream fastRPC driver.
> 
> - Redesign and improve remote heap management.
> - Add static PD restart support for audio and sensors PD using
>    PDR framework.
> - Add changes to support multimode invocation ioctl request. This
>    ioctl call facilitates multiple types of requests from user including
>    CRC check, performance counters, shared context bank usage, etc.
>    This series also carries patch to save and restore interrupted
>    context.
> - Add early wakeup support to allow DSP user to send early response
>    to CPU and improve fastrpc performance.
> - Add polling mode support with which driver polls on memory to avoid
>    CPU from going to low power modes.
> - Add notifications frameworks to provide users with the DSP PD status
>    notifications.
> - Add a control mechanism to allow users to clean up DSP user PD
> - Add wakelock management support
> - Add DSP signalling support
> - Add check for untrusted applications and allow trusted processed to
>    offload to system unsigned PD.

Could you precise:
- Which workload are you fixing
- Which platforms are concerned
- Which platforms were tested

So far I've been trying to run the "getserial" on SM8550-QRD and SM8650-QRD without
success, would those changes fix this ?
Is there any chance we could get an open-source minimal implementation of a fastRPC SDK using
the open-source Hexagon LLVM like we have for the AIC100 ?
It would definitely help validating the upstream fastRPC implementation.

Thanks,
Neil

> 
> Ekansh Gupta (16):
>    misc: fastrpc: Redesign remote heap management
>    misc: fastrpc: Add support for unsigned PD
>    misc: fastrpc: Add static PD restart support
>    misc: fastrpc: Add fastrpc multimode invoke request support
>    misc: fastrpc: Add CRC support for remote buffers
>    misc: fastrpc: Capture kernel and DSP performance counters
>    misc: fastrpc: Add support to save and restore interrupted
>    misc: fastrpc: Add support to allocate shared context bank
>    misc: fastrpc: Add early wakeup support for fastRPC driver
>    misc: fastrpc: Add polling mode support for fastRPC driver
>    misc: fastrpc: Add DSP PD notification support
>    misc: fastrpc: Add support for users to clean up DSP user PD
>    misc: fastrpc: Add wakelock management support
>    misc: fastrpc: Add DSP signal support
>    misc: fastrpc: Restrict untrusted apk to spawn privileged PD
>    misc: fastrpc: Add system unsigned PD support
> 
>   drivers/misc/fastrpc.c      | 1949 +++++++++++++++++++++++++++++++----
>   include/uapi/misc/fastrpc.h |  112 ++
>   2 files changed, 1844 insertions(+), 217 deletions(-)
>
Ekansh Gupta Feb. 7, 2024, 8:30 a.m. UTC | #2
On 2/2/2024 1:41 PM, neil.armstrong@linaro.org wrote:
> Hi,
>
> On 02/02/2024 07:40, Ekansh Gupta wrote:
>> This patch series adds the listed features that have been missing
>> in upstream fastRPC driver.
>>
>> - Redesign and improve remote heap management.
>> - Add static PD restart support for audio and sensors PD using
>>    PDR framework.
>> - Add changes to support multimode invocation ioctl request. This
>>    ioctl call facilitates multiple types of requests from user including
>>    CRC check, performance counters, shared context bank usage, etc.
>>    This series also carries patch to save and restore interrupted
>>    context.
>> - Add early wakeup support to allow DSP user to send early response
>>    to CPU and improve fastrpc performance.
>> - Add polling mode support with which driver polls on memory to avoid
>>    CPU from going to low power modes.
>> - Add notifications frameworks to provide users with the DSP PD status
>>    notifications.
>> - Add a control mechanism to allow users to clean up DSP user PD
>> - Add wakelock management support
>> - Add DSP signalling support
>> - Add check for untrusted applications and allow trusted processed to
>>    offload to system unsigned PD.
>
> Could you precise:
> - Which workload are you fixing
> - Which platforms are concerned
> - Which platforms were tested
>
1. This patch mostly consists of missing features from fastrpc driver and it doesn't
carry any bug fixes.
2. We are not targeting these changes for any specific platform. These features are
applicable for most of the recent platforms .
3. These changes were tested on SM8650 and QCM6490 platforms.

> So far I've been trying to run the "getserial" on SM8550-QRD and 
> SM8650-QRD without
> success, would those changes fix this ?

Can you please help me with the "getserial" failure details? Or the steps that you are
running to get to the failure? I can have a look at that to understand the reason for
failure.

> Is there any chance we could get an open-source minimal implementation 
> of a fastRPC SDK using
> the open-source Hexagon LLVM like we have for the AIC100 ?
> It would definitely help validating the upstream fastRPC implementation.

Generally Hexagon SDK is used to write and test fastRPC use-cases which is well documented.
Is there anything else that you can suggest would help here?

>
> Thanks,
> Neil
>
Hi Neil, added my comments.

--ekansh

>>
>> Ekansh Gupta (16):
>>    misc: fastrpc: Redesign remote heap management
>>    misc: fastrpc: Add support for unsigned PD
>>    misc: fastrpc: Add static PD restart support
>>    misc: fastrpc: Add fastrpc multimode invoke request support
>>    misc: fastrpc: Add CRC support for remote buffers
>>    misc: fastrpc: Capture kernel and DSP performance counters
>>    misc: fastrpc: Add support to save and restore interrupted
>>    misc: fastrpc: Add support to allocate shared context bank
>>    misc: fastrpc: Add early wakeup support for fastRPC driver
>>    misc: fastrpc: Add polling mode support for fastRPC driver
>>    misc: fastrpc: Add DSP PD notification support
>>    misc: fastrpc: Add support for users to clean up DSP user PD
>>    misc: fastrpc: Add wakelock management support
>>    misc: fastrpc: Add DSP signal support
>>    misc: fastrpc: Restrict untrusted apk to spawn privileged PD
>>    misc: fastrpc: Add system unsigned PD support
>>
>>   drivers/misc/fastrpc.c      | 1949 +++++++++++++++++++++++++++++++----
>>   include/uapi/misc/fastrpc.h |  112 ++
>>   2 files changed, 1844 insertions(+), 217 deletions(-)
>>
>
Dmitry Baryshkov Feb. 7, 2024, 9:51 a.m. UTC | #3
On Wed, 7 Feb 2024 at 10:30, Ekansh Gupta <quic_ekangupt@quicinc.com> wrote:
>
>
> On 2/2/2024 1:41 PM, neil.armstrong@linaro.org wrote:
> > Hi,
> >
> > On 02/02/2024 07:40, Ekansh Gupta wrote:
> >> This patch series adds the listed features that have been missing
> >> in upstream fastRPC driver.
> >>
> >> - Redesign and improve remote heap management.
> >> - Add static PD restart support for audio and sensors PD using
> >>    PDR framework.
> >> - Add changes to support multimode invocation ioctl request. This
> >>    ioctl call facilitates multiple types of requests from user including
> >>    CRC check, performance counters, shared context bank usage, etc.
> >>    This series also carries patch to save and restore interrupted
> >>    context.
> >> - Add early wakeup support to allow DSP user to send early response
> >>    to CPU and improve fastrpc performance.
> >> - Add polling mode support with which driver polls on memory to avoid
> >>    CPU from going to low power modes.
> >> - Add notifications frameworks to provide users with the DSP PD status
> >>    notifications.
> >> - Add a control mechanism to allow users to clean up DSP user PD
> >> - Add wakelock management support
> >> - Add DSP signalling support
> >> - Add check for untrusted applications and allow trusted processed to
> >>    offload to system unsigned PD.
> >
> > Could you precise:
> > - Which workload are you fixing
> > - Which platforms are concerned
> > - Which platforms were tested
> >
> 1. This patch mostly consists of missing features from fastrpc driver and it doesn't
> carry any bug fixes.
> 2. We are not targeting these changes for any specific platform. These features are
> applicable for most of the recent platforms .

Please define 'recent'. The upstream kernel supports a wide set of
platforms. We have fastrpc supported since msm8916. Please make sure
that your patches will not break on such platforms.

> 3. These changes were tested on SM8650 and QCM6490 platforms.
>
> > So far I've been trying to run the "getserial" on SM8550-QRD and
> > SM8650-QRD without
> > success, would those changes fix this ?
>
> Can you please help me with the "getserial" failure details? Or the steps that you are
> running to get to the failure? I can have a look at that to understand the reason for
> failure.
>
> > Is there any chance we could get an open-source minimal implementation
> > of a fastRPC SDK using
> > the open-source Hexagon LLVM like we have for the AIC100 ?
> > It would definitely help validating the upstream fastRPC implementation.
>
> Generally Hexagon SDK is used to write and test fastRPC use-cases which is well documented.
> Is there anything else that you can suggest would help here?

Hexagon SDK is a closed source toolkit. Both in terms of toolchain,
library code and generated code.
The fastrpc_shell_N, which is used to handle loaded code, is also
closed source. As such, it is nearly impossible to verify the code.
Please consider the requirements for the drivers/accel/ subsystem: to
have complete open source userspace. Qualcomm AIC100, for example,
fulfills those requirements.

>
> >
> > Thanks,
> > Neil
> >
> Hi Neil, added my comments.
>
> --ekansh
>
> >>
> >> Ekansh Gupta (16):
> >>    misc: fastrpc: Redesign remote heap management
> >>    misc: fastrpc: Add support for unsigned PD
> >>    misc: fastrpc: Add static PD restart support
> >>    misc: fastrpc: Add fastrpc multimode invoke request support
> >>    misc: fastrpc: Add CRC support for remote buffers
> >>    misc: fastrpc: Capture kernel and DSP performance counters
> >>    misc: fastrpc: Add support to save and restore interrupted
> >>    misc: fastrpc: Add support to allocate shared context bank
> >>    misc: fastrpc: Add early wakeup support for fastRPC driver
> >>    misc: fastrpc: Add polling mode support for fastRPC driver
> >>    misc: fastrpc: Add DSP PD notification support
> >>    misc: fastrpc: Add support for users to clean up DSP user PD
> >>    misc: fastrpc: Add wakelock management support
> >>    misc: fastrpc: Add DSP signal support
> >>    misc: fastrpc: Restrict untrusted apk to spawn privileged PD
> >>    misc: fastrpc: Add system unsigned PD support
> >>
> >>   drivers/misc/fastrpc.c      | 1949 +++++++++++++++++++++++++++++++----
> >>   include/uapi/misc/fastrpc.h |  112 ++
> >>   2 files changed, 1844 insertions(+), 217 deletions(-)
> >>
> >
>
Wu, Wentong Feb. 22, 2024, 7:03 a.m. UTC | #4
> From: Ekansh Gupta <quic_ekangupt@quicinc.com>
> This patch series adds the listed features that have been missing in
> upstream fastRPC driver.

Thanks for the patch, and is there any latency data on driver side?

BR,
Wentong
> 
> - Redesign and improve remote heap management.
> - Add static PD restart support for audio and sensors PD using
>   PDR framework.
> - Add changes to support multimode invocation ioctl request. This
>   ioctl call facilitates multiple types of requests from user including
>   CRC check, performance counters, shared context bank usage, etc.
>   This series also carries patch to save and restore interrupted
>   context.
> - Add early wakeup support to allow DSP user to send early response
>   to CPU and improve fastrpc performance.
> - Add polling mode support with which driver polls on memory to avoid
>   CPU from going to low power modes.
> - Add notifications frameworks to provide users with the DSP PD status
>   notifications.
> - Add a control mechanism to allow users to clean up DSP user PD
> - Add wakelock management support
> - Add DSP signalling support
> - Add check for untrusted applications and allow trusted processed to
>   offload to system unsigned PD.
> 
> Ekansh Gupta (16):
>   misc: fastrpc: Redesign remote heap management
>   misc: fastrpc: Add support for unsigned PD
>   misc: fastrpc: Add static PD restart support
>   misc: fastrpc: Add fastrpc multimode invoke request support
>   misc: fastrpc: Add CRC support for remote buffers
>   misc: fastrpc: Capture kernel and DSP performance counters
>   misc: fastrpc: Add support to save and restore interrupted
>   misc: fastrpc: Add support to allocate shared context bank
>   misc: fastrpc: Add early wakeup support for fastRPC driver
>   misc: fastrpc: Add polling mode support for fastRPC driver
>   misc: fastrpc: Add DSP PD notification support
>   misc: fastrpc: Add support for users to clean up DSP user PD
>   misc: fastrpc: Add wakelock management support
>   misc: fastrpc: Add DSP signal support
>   misc: fastrpc: Restrict untrusted apk to spawn privileged PD
>   misc: fastrpc: Add system unsigned PD support
> 
>  drivers/misc/fastrpc.c      | 1949 +++++++++++++++++++++++++++++++----
>  include/uapi/misc/fastrpc.h |  112 ++
>  2 files changed, 1844 insertions(+), 217 deletions(-)
> 
> --
> 2.17.0
>