Kaynağa Gözat

msm: adsprpc: Share CP secure context banks

Currently CPZ secure context banks are not shared on CDSP. Share
CP secure context banks among applications that use secure memory,
so that many CPZ applications can be spawned and offloaded to DSP.

Change-Id: I77d95bab86ef527e41c9fe79058742615f4adb0e
Signed-off-by: Himateja Reddy <[email protected]>
Himateja Reddy 2 yıl önce
ebeveyn
işleme
38ca55b8e5
2 değiştirilmiş dosya ile 6 ekleme ve 1 silme
  1. 4 1
      dsp/adsprpc.c
  2. 2 0
      dsp/adsprpc_shared.h

+ 4 - 1
dsp/adsprpc.c

@@ -1207,7 +1207,7 @@ static int fastrpc_mmap_create(struct fastrpc_file *fl, int fd, struct dma_buf *
 		map->secure = (mem_buf_dma_buf_exclusive_owner(map->buf)) ? 0 : 1;
 		if (map->secure) {
 			if (!fl->secsctx)
-				err = fastrpc_session_alloc(chan, 1, 0,
+				err = fastrpc_session_alloc(chan, 1, me->share_securecb,
 							&fl->secsctx);
 			if (err) {
 				ADSPRPC_ERR(
@@ -7374,6 +7374,9 @@ static int fastrpc_cb_probe(struct device *dev)
 
 	if (of_get_property(dev->of_node, "shared-cb", NULL) != NULL) {
 		sess->smmu.sharedcb = 1;
+		// Set share_securecb, if the secure context bank is shared
+		if (sess->smmu.secure)
+			me->share_securecb = 1;
 		err = of_property_read_u32(dev->of_node, "shared-cb",
 				&sharedcb_count);
 		if (err)

+ 2 - 0
dsp/adsprpc_shared.h

@@ -945,6 +945,8 @@ struct fastrpc_apps {
 	struct mutex mut_uid;
 	/* Indicates cdsp device status */
 	int remote_cdsp_status;
+	/* Indicates secure context bank to be shared */
+	int share_securecb;
 };
 
 struct fastrpc_mmap {