diff --git a/drivers/firmware/qtee_shmbridge.c b/drivers/firmware/qtee_shmbridge.c index 6ce7d8d1a6bb..015eca9fe396 100644 --- a/drivers/firmware/qtee_shmbridge.c +++ b/drivers/firmware/qtee_shmbridge.c @@ -3,7 +3,7 @@ * QTI TEE shared memory bridge driver * * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #include @@ -20,6 +20,9 @@ #include #include +#include +#include + #include "qtee_shmbridge_internal.h" #define DEFAULT_BRIDGE_SIZE SZ_4M /*4M*/ @@ -203,6 +206,8 @@ int32_t qtee_shmbridge_register( uint64_t ns_vmids = 0; int i = 0; + gh_vmid_t temp_vmid; + if (!qtee_shmbridge_enabled) return 0; @@ -217,6 +222,23 @@ int32_t qtee_shmbridge_register( if (ret) goto exit; + if (support_hyp) { + + /* Calls to create SHMBridge from HLOS-VM is handled by QHEEBSP AC Layer while from + * secondary CPU-VMs, such as OEM-VM and QTVM, it is handled by Hypervisor RM. + * RM always expects the destination VM fields to be 0 and only expects the self + * owner bit to be set. + */ + + if (ns_vmid_num == 1) { + if (!gh_rm_get_this_vmid(&temp_vmid) && + (temp_vmid == ns_vmid_list[0])) { + + ns_vmid_num = 0; + } + } + } + for (i = 0; i < ns_vmid_num; i++) { ns_perms = UPDATE_NS_PERMS(ns_perms, ns_vm_perm_list[i]); ns_vmids = UPDATE_NS_VMIDS(ns_vmids, ns_vmid_list[i]); diff --git a/modules.list.msm.kalama b/modules.list.msm.kalama index 8b2a89db4361..0510df3098ae 100644 --- a/modules.list.msm.kalama +++ b/modules.list.msm.kalama @@ -1,5 +1,10 @@ qcom_wdt_core.ko gh_virt_wdt.ko +gh_arm_drv.ko +gh_ctrl.ko +gh_dbl.ko +gh_msgq.ko +gh_rm_drv.ko clk-rpmh.ko gcc-kalama.ko icc-rpmh.ko