Set channel as secure based on domain ID and secure domain DT property.
All DSP domains other than CDSP are set as secure by default and for
CDSP domain, secure flag is set if property is added to DT file.
Signed-off-by: Jeya R <[email protected]>
---
drivers/misc/fastrpc.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index 07c41a5..631713d 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -216,6 +216,7 @@ struct fastrpc_channel_ctx {
struct miscdevice miscdev;
struct miscdevice securedev;
struct kref refcount;
+ bool secure;
};
struct fastrpc_user {
@@ -1646,6 +1647,12 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
if (!data)
return -ENOMEM;
+ if (domain_id != CDSP_DOMAIN_ID)
+ data->secure = true;
+ else
+ data->secure = of_property_read_bool(rdev->of_node,
+ "qcom,secure-domain");
+
data->miscdev.minor = MISC_DYNAMIC_MINOR;
data->miscdev.name = devm_kasprintf(rdev, GFP_KERNEL, "fastrpc-%s",
domains[domain_id]);
--
2.7.4
On 24/09/2021 13:19, Jeya R wrote:
> Set channel as secure based on domain ID and secure domain DT property.
> All DSP domains other than CDSP are set as secure by default and for
> CDSP domain, secure flag is set if property is added to DT file.
>
> Signed-off-by: Jeya R <[email protected]>
> ---
> drivers/misc/fastrpc.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
> index 07c41a5..631713d 100644
> --- a/drivers/misc/fastrpc.c
> +++ b/drivers/misc/fastrpc.c
> @@ -216,6 +216,7 @@ struct fastrpc_channel_ctx {
> struct miscdevice miscdev;
> struct miscdevice securedev;
> struct kref refcount;
> + bool secure;
> };
>
> struct fastrpc_user {
> @@ -1646,6 +1647,12 @@ static int fastrpc_rpmsg_probe(struct rpmsg_device *rpdev)
> if (!data)
> return -ENOMEM;
>
> + if (domain_id != CDSP_DOMAIN_ID)
> + data->secure = true;
> + else
> + data->secure = of_property_read_bool(rdev->of_node,
> + "qcom,secure-domain");
> +
This whole logic of marking domains secured based on dsp type needs some
explanation.
--srini
> data->miscdev.minor = MISC_DYNAMIC_MINOR;
> data->miscdev.name = devm_kasprintf(rdev, GFP_KERNEL, "fastrpc-%s",
> domains[domain_id]);
>