msm: adsprpc: Allocate designated context bank session

Currently SMMU context banks are chosen dynamically based on
available context bank. Few use cases requires context banks to
be fixed to retain SMMU mappings even after process exits and resumes
again. Few other use cases requires to use multiple context banks of
similar remote subsystem process types. Allocate designated context
bank session with process type  matching with remote subsystem
process type.

Change-Id: Ie8ccad2fde4e2e21aaf8c6ede0ab31645cdf350c
Signed-off-by: Himateja Reddy <quic_hmreddy@quicinc.com>
Tento commit je obsažen v:
Himateja Reddy
2023-05-15 08:53:34 -07:00
rodič 4cb568d62b
revize 4c5701814d
2 změnil soubory, kde provedl 129 přidání a 11 odebrání

29
dsp/adsprpc_shared.h Spustitelný soubor → Normální soubor
Zobrazit soubor

@@ -294,6 +294,14 @@ struct fastrpc_ioctl_notif_rsp {
uint32_t status; /* Status of the process */
};
/* FastRPC ioctl structure to set session related info */
struct fastrpc_proc_sess_info {
uint32_t domain_id; /* Set the remote subsystem, Domain ID of the session */
uint32_t session_id; /* Unused, Set the Session ID on remote subsystem */
uint32_t pd_type; /* Set the process type on remote subsystem */
uint32_t sharedcb; /* Unused, Session can share context bank with other sessions */
};
/* INIT a new process or attach to guestos */
enum fastrpc_init_flags {
FASTRPC_INIT_NO_CREATE = -1,
@@ -309,6 +317,8 @@ enum fastrpc_invoke2_type {
FASTRPC_INVOKE2_KERNEL_OPTIMIZATIONS,
FASTRPC_INVOKE2_STATUS_NOTIF,
FASTRPC_INVOKE2_PROC_SHAREDBUF_INFO,
/* Set session info of remote sub system */
FASTRPC_INVOKE2_SESS_INFO,
};
struct fastrpc_ioctl_invoke2 {
@@ -634,6 +644,21 @@ enum fastrpc_process_exit_states {
FASTRPC_PROCESS_DSP_EXIT_ERROR = 4,
};
/*
* Process types on remote subsystem
* Always add new PD types at the end, before MAX_PD_TYPE
*/
#define DEFAULT_UNUSED 0 /* pd type not configured for context banks */
#define ROOT_PD 1 /* Root PD */
#define AUDIO_STATICPD 2 /* ADSP Audio Static PD */
#define SENSORS_STATICPD 3 /* ADSP Sensors Static PD */
#define SECURE_STATICPD 4 /* CDSP Secure Static PD */
#define OIS_STATICPD 5 /* ADSP OIS Static PD */
#define CPZ_USERPD 6 /* CDSP CPZ USER PD */
#define USERPD 7 /* DSP User Dynamic PD */
#define GUEST_OS_SHARED 8 /* Legacy Guest OS Shared */
#define MAX_PD_TYPE 9 /* Max PD type */
struct fastrpc_file;
int fastrpc_transport_send(int cid, void *rpc_msg, uint32_t rpc_msg_size, int tvm_remote_domain);
@@ -869,6 +894,7 @@ struct fastrpc_smmu {
int secure;
int coherent;
int sharedcb;
int pd_type; /* Process type on remote sub system */
/* gen pool for QRTR */
struct gen_pool *frpc_genpool;
/* fastrpc gen pool buffer */
@@ -974,6 +1000,8 @@ struct fastrpc_apps {
int remote_cdsp_status;
/* Indicates secure context bank to be shared */
int share_securecb;
/* Indicates process type is configured for SMMU context bank */
bool cb_pd_type;
};
struct fastrpc_mmap {
@@ -1073,6 +1101,7 @@ struct fastrpc_file {
int file_close;
int dsp_proc_init;
int sharedcb;
int pd_type; /* Process type on remote subsystem */
struct fastrpc_apps *apps;
struct dentry *debugfs_file;
struct dev_pm_qos_request *dev_pm_qos_req;