diff --git a/drivers/soc/qcom/secure_buffer.c b/drivers/soc/qcom/secure_buffer.c index 87dcc52d4cb8..62f0f2beefbe 100644 --- a/drivers/soc/qcom/secure_buffer.c +++ b/drivers/soc/qcom/secure_buffer.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2011 Google, Inc - * Copyright (c) 2011-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2020, The Linux Foundation. All rights reserved. */ #include @@ -280,6 +280,8 @@ const char *msm_secure_vmid_to_string(int secure_vmid) return "VMID_CP_SPSS_SP_SHARED"; case VMID_CP_SPSS_HLOS_SHARED: return "VMID_CP_SPSS_HLOS_SHARED"; + case VMID_TRUSTED_UI: + return "VMID_TRUSTED_UI"; case VMID_INVAL: return "VMID_INVAL"; default: diff --git a/drivers/staging/android/ion/heaps/ion_secure_util.c b/drivers/staging/android/ion/heaps/ion_secure_util.c index be7d98d2115e..26f5515d6ef5 100644 --- a/drivers/staging/android/ion/heaps/ion_secure_util.c +++ b/drivers/staging/android/ion/heaps/ion_secure_util.c @@ -21,7 +21,8 @@ bool is_secure_vmid_valid(int vmid) vmid == VMID_CP_SPSS_SP || vmid == VMID_CP_SPSS_SP_SHARED || vmid == VMID_CP_SPSS_HLOS_SHARED || - vmid == VMID_CP_CDSP); + vmid == VMID_CP_CDSP || + vmid == VMID_TRUSTED_UI); } int get_secure_vmid(unsigned long flags) @@ -50,6 +51,8 @@ int get_secure_vmid(unsigned long flags) return VMID_CP_SPSS_HLOS_SHARED; if (flags & ION_FLAG_CP_CDSP) return VMID_CP_CDSP; + if (flags & ION_FLAG_CP_TRUSTED_UI) + return VMID_TRUSTED_UI; return -EINVAL; } @@ -79,6 +82,8 @@ int get_ion_flags(u32 vmid) return ION_FLAG_CP_SPSS_HLOS_SHARED; if (vmid == VMID_CP_CDSP) return ION_FLAG_CP_CDSP; + if (vmid == VMID_TRUSTED_UI) + return ION_FLAG_CP_TRUSTED_UI; return -EINVAL; } EXPORT_SYMBOL(get_ion_flags); diff --git a/include/soc/qcom/secure_buffer.h b/include/soc/qcom/secure_buffer.h index 584a0b8814d8..a063a8edc18a 100644 --- a/include/soc/qcom/secure_buffer.h +++ b/include/soc/qcom/secure_buffer.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* - * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. */ #ifndef __QCOM_SECURE_BUFFER_H__ @@ -33,6 +33,7 @@ enum vmid { VMID_CP_SPSS_SP_SHARED = 0x22, VMID_CP_SPSS_HLOS_SHARED = 0x24, VMID_CP_CDSP = 0x2A, + VMID_TRUSTED_UI = 0x31, VMID_LAST, VMID_INVAL = -1 }; diff --git a/include/uapi/linux/msm_ion.h b/include/uapi/linux/msm_ion.h index 5d6f948408b7..44ed10a462a0 100644 --- a/include/uapi/linux/msm_ion.h +++ b/include/uapi/linux/msm_ion.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* - * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. */ #ifndef _UAPI_LINUX_MSM_ION_H #define _UAPI_LINUX_MSM_ION_H @@ -27,6 +27,8 @@ enum msm_ion_heap_types { * Flags to be used when allocating from the secure heap for * content protection */ +#define ION_FLAG_CP_TRUSTED_UI ION_BIT(15) +/* ION_FLAG_POOL_FORCE_ALLOC uses ION_BIT(16) */ #define ION_FLAG_CP_TOUCH ION_BIT(17) #define ION_FLAG_CP_BITSTREAM ION_BIT(18) #define ION_FLAG_CP_PIXEL ION_BIT(19) @@ -42,7 +44,7 @@ enum msm_ion_heap_types { #define ION_FLAG_CP_CDSP ION_BIT(29) #define ION_FLAG_CP_SPSS_HLOS_SHARED ION_BIT(30) -#define ION_FLAGS_CP_MASK 0x6FFE0000 +#define ION_FLAGS_CP_MASK 0x6FFE8000 /** * Flag to allow non continguous allocation of memory from secure