Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3957912f authored by Jeff Hugo's avatar Jeff Hugo
Browse files

msm: smp2p: convert to secured smem feature



The shared memory (smem) driver provides a feature where point-to-point
smem items shared between Linux apps and one other remote processor are
protected against a number of attacks by security hardware, provided system
support exists.  Clients of the smem driver must elect to use this feature
if applicable.

SMP2P is a point-to-point communication protocol to which the security
feature applies.  Update SMP2P to make use of the security feature.

Change-Id: Ief920a2074d43507f727bfcb02ad1997f3f78c28
Signed-off-by: default avatarJeffrey Hugo <jhugo@codeaurora.org>
parent 5c3bdb89
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -352,11 +352,13 @@ static void *smp2p_get_local_smem_item(int remote_pid)
		/* lookup or allocate SMEM item */
		smem_id = smp2p_get_smem_item_id(SMP2P_APPS_PROC, remote_pid);
		if (smem_id >= 0) {
			item_ptr = smem_get_entry(smem_id, &size);
			item_ptr = smem_get_entry_to_proc(smem_id, &size,
								remote_pid, 0);

			if (!item_ptr) {
				size = sizeof(struct smp2p_smem_item);
				item_ptr = smem_alloc2(smem_id, size);
				item_ptr = smem_alloc2_to_proc(smem_id, size,
								remote_pid, 0);
			}
		}
	} else if (remote_pid == SMP2P_REMOTE_MOCK_PROC) {
@@ -401,7 +403,8 @@ static void *smp2p_get_remote_smem_item(int remote_pid,

		smem_id = smp2p_get_smem_item_id(remote_pid, SMP2P_APPS_PROC);
		if (smem_id >= 0)
			item_ptr = smem_get_entry(smem_id, &size);
			item_ptr = smem_get_entry_to_proc(smem_id, &size,
								remote_pid, 0);
	} else if (remote_pid == SMP2P_REMOTE_MOCK_PROC) {
		item_ptr = msm_smp2p_get_remote_mock_smem_item(&size);
	}
+3 −2
Original line number Diff line number Diff line
@@ -381,8 +381,9 @@ static void smp2p_ut_remote_spinlock_rpm(struct seq_file *s)
		smem_spinlock = smem_get_remote_spinlock();
		UT_ASSERT_PTR(smem_spinlock, !=, NULL);

		data_ptr = smem_alloc2(SMEM_ID_VENDOR0,
				sizeof(struct rpm_spinlock_test));
		data_ptr = smem_alloc2_to_proc(SMEM_ID_VENDOR0,
				sizeof(struct rpm_spinlock_test), 0,
				SMEM_ANY_HOST_FLAG);
		UT_ASSERT_PTR(0, !=, data_ptr);

		/* Send start */