diff options
| author | Neeti Desai <neetid@codeaurora.org> | 2015-06-05 18:44:24 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-22 11:04:48 -0700 |
| commit | a04defd9b7e777351bb4b36c5eec4a5749d8229e (patch) | |
| tree | 9fe36ff7943658981f32d2271f0e00057d92f5fd | |
| parent | a3f96ffb79a4132cbfaf58de129ed17330abae5f (diff) | |
msm: secure_buffer: Update the hyp_assign_phys() api
The hyp_assign_phys() api can be called by different
usecases where it is not guaranteed that the source vm is
always VMID_HLOS.
Pass the responsibility of setting the source_vm to
caller of the function.
Change-Id: I3851a6681f49d4bb6fa5b7a889a16a158497e9e6
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
| -rw-r--r-- | drivers/soc/qcom/secure_buffer.c | 11 | ||||
| -rw-r--r-- | include/soc/qcom/secure_buffer.h | 12 |
2 files changed, 11 insertions, 12 deletions
diff --git a/drivers/soc/qcom/secure_buffer.c b/drivers/soc/qcom/secure_buffer.c index bdc95ea2d6e7..3aa83b0eac98 100644 --- a/drivers/soc/qcom/secure_buffer.c +++ b/drivers/soc/qcom/secure_buffer.c @@ -318,12 +318,11 @@ err1: return ret; } -int hyp_assign_phys(phys_addr_t addr, u64 size, - int *dest_vmids, int *dest_perms, - int dest_nelems) +int hyp_assign_phys(phys_addr_t addr, u64 size, u32 *source_vm_list, + int source_nelems, int *dest_vmids, + int *dest_perms, int dest_nelems) { struct sg_table *table; - u32 source_vm; int ret; table = kzalloc(sizeof(struct sg_table), GFP_KERNEL); @@ -335,9 +334,7 @@ int hyp_assign_phys(phys_addr_t addr, u64 size, sg_set_page(table->sgl, phys_to_page(addr), size, 0); - source_vm = VMID_HLOS; - - ret = hyp_assign_table(table, &source_vm, 1, dest_vmids, + ret = hyp_assign_table(table, source_vm_list, source_nelems, dest_vmids, dest_perms, dest_nelems); if (ret) goto err2; diff --git a/include/soc/qcom/secure_buffer.h b/include/soc/qcom/secure_buffer.h index 4a8cb1f647ca..893c139c8c04 100644 --- a/include/soc/qcom/secure_buffer.h +++ b/include/soc/qcom/secure_buffer.h @@ -40,8 +40,8 @@ int hyp_assign_table(struct sg_table *table, int *dest_vmids, int *dest_perms, int dest_nelems); int hyp_assign_phys(phys_addr_t addr, u64 size, - int *dest_vmids, int *dest_perms, - int dest_nelems); + u32 *source_vmlist, int source_nelems, + int *dest_vmids, int *dest_perms, int dest_nelems); bool msm_secure_v2_is_supported(void); #else static inline int msm_secure_table(struct sg_table *table) @@ -59,12 +59,14 @@ int hyp_assign_table(struct sg_table *table, { return -EINVAL; } -int hyp_assign_phys(phys_addr_t addr, u64 size, - int *dest_vmids, int *dest_perms, - int dest_nelems) + +static inline int hyp_assign_phys(phys_addr_t addr, u64 size, + u32 *source_vmlist, int source_nelems, + int *dest_vmids, int *dest_perms, int dest_nelems) { return -EINVAL; } + static inline bool msm_secure_v2_is_supported(void) { return false; |
