summaryrefslogtreecommitdiff
path: root/drivers/soc/qcom/hab (follow)
Commit message (Collapse)AuthorAge
* Merge tag 'LA.UM.8.4.c25-06600-8x98.0' of ↵Michael Bestas2022-11-05
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://git.codelinaro.org/clo/la/kernel/msm-4.4 into android13-4.4-msm8998 "LA.UM.8.4.c25-06600-8x98.0" * tag 'LA.UM.8.4.c25-06600-8x98.0' of https://git.codelinaro.org/clo/la/kernel/msm-4.4: diag: Prevent out of bound write while sending dci pkt to remote diag: Ensure dci entry is valid before sending the packet ion: Fix integer overflow in msm_ion_custom_ioctl diag: Use valid data_source for a valid token msm: kgsl: Remove 'fd' dependency to get dma_buf handle msm: kgsl: Fix gpuaddr_in_range() to check upper bound msm: adsprpc: Handle UAF in fastrpc debugfs read msm: kgsl: Add a sysfs node to control performance counter reads msm: kgsl: Perform cache flush on the pages obtained using get_user_pages() soc: qcom: hab: Add sanity check for payload_count msm: kgsl: Fix out of bound write in adreno_profile_submit_time futex: Fix inode life-time issue futex: Handle faults correctly for PI futexes futex: Simplify fixup_pi_state_owner() futex: Use pi_state_update_owner() in put_pi_state() rtmutex: Remove unused argument from rt_mutex_proxy_unlock() futex: Provide and use pi_state_update_owner() futex: Replace pointless printk in fixup_owner() futex: Avoid violating the 10th rule of futex futex: Rework inconsistent rt_mutex/futex_q state futex: Remove rt_mutex_deadlock_account_*() futex,rt_mutex: Provide futex specific rt_mutex API msm: adsprpc: Handle UAF in process shell memory Disable TRACER Check to improve Camera Performance msm: kgsl: Deregister gpu address on memdesc_sg_virt failure crypto: Fix possible stack out-of-bound error msm: kgsl: Correct the refcount on current process PID. msm: kgsl: Compare pid pointer instead of TGID for a new process qcom,max-freq-level change for trial msm: kgsl: Protect the memdesc->gpuaddr in SVM use cases. msm: kgsl: Stop using memdesc->usermem. Conflicts: drivers/char/adsprpc.c drivers/char/diag/diag_dci.c drivers/gpu/msm/kgsl.c drivers/gpu/msm/kgsl_debugfs.c drivers/gpu/msm/kgsl_iommu.c drivers/gpu/msm/kgsl_mmu.c drivers/gpu/msm/kgsl_sharedmem.c drivers/gpu/msm/kgsl_trace.h kernel/futex.c kernel/locking/rtmutex.c kernel/locking/rtmutex_common.h Change-Id: I777ee96b855e2967ef6733e603d12f40174974d0
| * soc: qcom: hab: Add sanity check for payload_countlixiang2021-10-13
| | | | | | | | | | | | | | | | | | | | When handling memory import, payload_count is used for memory alloc calculation. If the payload_count is too large, size will overflow when creating page list. Adding a sanity check for payload_count is necessary. Change-Id: I6d60cea0c62bd29092852c55b766b77a94cb6e3b Signed-off-by: lixiang <lixiang@codeaurora.org>
* | fixup! BACKPORT: treewide: Fix function prototypes for module_param_call()Nolen Johnson2022-11-01
|/ | | | Change-Id: Id4056255732a1865e4b97a443ba936a51954e407
* soc: qcom: hab: run the dispatcher's tasklet w/ high priorityYong Ding2019-11-28
| | | | | | | | | | HAB uses tasklets as the bottom half to receive message from the remote side. Even when the whole system is overloaded, HAB clients (e.g., audio, display, gfx) still expect low latency for good user experience. So here, tasklet_hi_schedule() is used. Change-Id: I0b8ed281f090e9c251eb62fe5e78900ea2e9dc8d Signed-off-by: Yong Ding <yongding@codeaurora.org>
* soc: qcom: hab: reset comm-dev after freeShiju Mathew2019-09-18
| | | | | | | To prevent use after the release. Change-Id: I1f79fdd4bce38dd3870f5da57ffdc8ee7d719735 Signed-off-by: Shiju Mathew <shijum@codeaurora.org>
* soc: qcom: hab: add error handling when dt item is missingJiacheng Zheng2019-06-20
| | | | | | | | | | | If certain testgipc node under aliases in device tree is missing, ep_path remains NULL and it will cause NULL dereference problem later in the code. We need to go to error handler and deinitialize everything under this condition. Change-Id: I98a27acfb2e8af9687114d610304a31a1ac9c3ca Signed-off-by: Jiacheng Zheng <jiaczhen@codeaurora.org>
* soc: qcom: hab: add missing variable declarationShiju Mathew2019-06-11
| | | | | | | This line was lost in last submission. Change-Id: If957de37e58d2ddb8ada9e4f00f83abc3eb19d20 Signed-off-by: Shiju Mathew <shijum@codeaurora.org>
* soc: qcom: hab: Add open local-cancel and compiler warning fixesShiju Mathew2019-05-29
| | | | | | | | | Allow user to call close with mmid to do open local-cancel.Fix various compiler warning regarding uninitialized variable and type mismatch. Add more parameter check during physical channel send to avoid corner cases. Change-Id: I0a557d7b1a3dac327a758cdb96052609fc8959cc Signed-off-by: Shiju Mathew <shijum@codeaurora.org>
* soc: qcom: hab: unify variable type to avoid implicit conversionYao Jiang2019-03-13
| | | | | | | | correcting the type of sizebytes and total_size to size_t,it can avoid implicit conversion which maybe cause some unknown issue. Change-Id: I1c1cc9e92ca2920cc49685edef0d928dd67454c7 Signed-off-by: Yao Jiang <yaojia@codeaurora.org>
* soc: qcom: hab: adapt to the new get_user_pages()Yong Ding2019-01-16
| | | | | | | | | The previous write and force parameters of get_user_pages() are replaced with gup_flags, so HAB needs the relevant change since it uses this API. Change-Id: I8bb8eac3bd9ef0090a29fce28745b9904e087e0c Signed-off-by: Yong Ding <yongding@codeaurora.org>
* Merge "soc: qcom: hab: benchmark cross VM schdule latency"Linux Build Service Account2018-11-08
|\
| * soc: qcom: hab: benchmark cross VM schdule latencyChao Bi2018-10-22
| | | | | | | | | | | | | | | | | | | | Develop a mechanism to measure the latency of cross-vm scheduling. It makes use of mpm_timer and leverage hab driver to record the time when previous vm is scheduled out and when next vm is schduled in, and pass these values to habtest to calculate the latency of schduling. Change-Id: I0051d5a42979826b8e249ac704fcc7ed87d8d581 Signed-off-by: Chao Bi <chaobi@codeaurora.org>
* | soc: qcom: hab: refine hab virtual channel's resource freeYong Ding2018-11-01
| | | | | | | | | | | | | | | | | | | | | | | | Whenever a vchan is locally closed in hab_vchan_close or hab_free, 4 actions should be taken immediately, including, - remove it from the local hab context - mark its local closed flag - notify remote side and unblock local blocking calls over it - decrease the refcnt on the vchan Change-Id: I3fbde9464f6405b6dadac248768a5fd857a29128 Signed-off-by: Yong Ding <yongding@codeaurora.org>
* | soc: hab: Fix a memory leakage when unexportYajun Li2018-10-30
| | | | | | | | | | | | | | | | | | When the remote vchan is closed and unexport happens in local at the same time, function hab_get_vchan_fromvcid will return null in hab unexport, which will cause memory leak. Change-Id: I8dac4f4154f24734dc2a11aa73f726cd705cc291 Signed-off-by: Yajun Li <yajunl@codeaurora.org>
* | soc: hab: fix uninitialized variable and relocate vchan refcntYajun Li2018-10-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Init hab msg pointer to avoid accessing an uninitialized pointer. The format specifier "%p" can leak kernel addresses. Use "%pK" instead. Check the status of the pfn_table, because of wrong pagetable coming from the corresponding hab client unexpectedly. Change-Id: Ic8c6ba0243d27007d014165f2869a5775a96c09d Signed-off-by: Yajun Li <yajunl@codeaurora.org>
* | soc: qcom: hab: add rx queue empty check after getting the lockYong Ding2018-10-23
|/ | | | | | | | | | Need to do empty check again when we have the lock of the rx queue of a given virtual channel. Without this check, it is possible that the list head of the queue will be wrongly taken as a valid message node if the valid message has already been fetched by some other thread. Change-Id: I65f73acd86fe2fb709e2af2ffeaa42581b4168ca Signed-off-by: Yong Ding <yongding@codeaurora.org>
* soc: hab: add size checking when hab import bufferYajun Li2018-10-12
| | | | | | | | | If the input size of import buffer isn't equal to the real size of this buffer, hab should reject this import function. Change-Id: I184a0752d37e9f1bf6a8705ccf8f2fdfd6796d5e Signed-off-by: Yajun Li <yajunl@codeaurora.org>
* soc: hab: recycle mmid from qcpe to videoShiju Mathew2018-10-10
| | | | | | | | Add new mmid for video and other minor logging and efficiency fixes. Change-Id: I0ebbfadff76e7efb7f9afff9896dadf1bd8df9a1 Signed-off-by: Shiju Mathew <shijum@codeaurora.org>
* Merge "soc: hab: refine codes to support multi import"Linux Build Service Account2018-10-09
|\
| * soc: hab: refine codes to support multi importYajun Li2018-10-07
| | | | | | | | | | | | | | | | | | Make HAB clients have chance to import the same export id to fd and uva before unimport happens. Change-Id: I59fdc701dcdc086e58865fa216b10f9fe6a45e29 Signed-off-by: Yajun Li <yajunl@codeaurora.org>
* | soc: qcom: hab: fix the leak risk in hab_vchan_getYao Jiang2018-10-07
| | | | | | | | | | | | | | | | | | | | | | | | When getting a vchan after receiving a message, it has probability that this vchan is closed concurrently. So when refcount is increased by kref_get_unless_zero, but flag vchan->otherend_closed or vchan->closed is true at this time, it will return vchan as NULL, and the hab_vchan_put will not be called in hab_msg_rev. So adjust the timing here can avoid the leak risk. Change-Id: If78c1c41bc4fd05b3288c0324bb9e0aed8493c5f Signed-off-by: Yao Jiang <yaojia@codeaurora.org>
* | soc: qcom: hab: replace kref_get with kref_get_unless_zeroYao Jiang2018-10-07
|/ | | | | | | | | If refcount was 0 before increment, it maybe has a race condition that this kref is freeing by some other thread right now. In this case we should not increments refcount, so replace with kref_get_unless_zero. Change-Id: Ic15eaefc111770a966094d05b19eca2a04d52fc2 Signed-off-by: Yao Jiang <yaojia@codeaurora.org>
* Merge "soc: qcom: hab: fix the soft lockup in vchan free schedule"Linux Build Service Account2018-10-03
|\
| * soc: qcom: hab: fix the soft lockup in vchan free scheduleYao Jiang2018-10-03
| | | | | | | | | | | | | | | | | | | | | | With a certain probability soft lockup when do hab vchan free schedule. one vchan do the local hab close while another vchan in the same context through softirq also try to acquire write lock in the free schedule at the same time, it will cause watchdog bite. Disable local softirq could avoid race condition handling between tasklet and process context. Change-Id: I4ee9b980dab7ecb1986af1d61f70157fc30d1048 Signed-off-by: Yao Jiang <yaojia@codeaurora.org>
* | Merge "soc: hab: change lifecycle of exp_id from vchan to ctx"Linux Build Service Account2018-10-03
|\ \
| * | soc: hab: change lifecycle of exp_id from vchan to ctxYajun Li2018-09-26
| |/ | | | | | | | | | | | | | | | | To make sure unexport/unimport the same buffer successfully in different threads from export/import function, only check pchan's validation, instead of vchan id. Change-Id: I3203f198c37e8b169090d8f93d92e87bbd4cdb6e Signed-off-by: Yajun Li <yajunl@codeaurora.org>
* / soc: hab: fix mmap failure issue when hab importYajun Li2018-09-27
|/ | | | | | | | | If hab client import the same buffer with different size, only checking pages_list->index is not enough, so add the buffer size checking. Change-Id: I92d16d124e69131cee9b81a49dc9fa02075a96b6 Signed-off-by: Yajun Li <yajunl@codeaurora.org>
* Merge "soc: hab: add more return error checking"Linux Build Service Account2018-09-25
|\
| * soc: hab: add more return error checkingYajun Li2018-09-21
| | | | | | | | | | | | | | | | | | If the exported buffer has been freed in other threads, dma_buf_get maybe return error, therefore need error checking here. Change-Id: Ic1674cada8dc6e0d6b09d75abf695a68896b8bff Signed-off-by: Yajun Li <yajunl@codeaurora.org>
* | soc: hab: add bootmarker for hab driverYajun Li2018-09-19
|/ | | | | | | | To measure the boot kpi of hab driver,so add bootmarker in hab_init function Change-Id: Ib755e77e7a6768d028279331c4bf3e92c10141a4 Signed-off-by: Yajun Li <yajunl@codeaurora.org>
* soc: qcom: hab: add IRQF_NO_SUSPEND to irq flags.Yimin Peng2018-09-17
| | | | | | | | | The virtclk can disable clocks by hab in suspend flow. If hab irq is disabled then, the power manage task will stick in uninterruptable hab receive function. Change-Id: I780ecede7494346953f5f77d665dd77c2cc6d28a Signed-off-by: Yimin Peng <yiminp@codeaurora.org>
* soc: qcom: hab: fix the incompatible pointer initialization warningYong Ding2018-08-23
| | | | | | | | Such warning of "initialization from incompatible pointer type" is found in the build time, and it's good to fix it. Change-Id: Iaf820ae7ec4a7851185febbdebaaab3706fb2402 Signed-off-by: Yong Ding <yongding@codeaurora.org>
* soc: qcom: hab: add hab statistics supportYong Ding2018-07-31
| | | | | | | This allows user to read back hab runtime information. Change-Id: Id266dd17b9c9d38f0e93aa600510ae1c6b12cca5 Signed-off-by: Yong Ding <yongding@codeaurora.org>
* soc: qcom: hab: change the unregistration to be dummyYong Ding2018-07-20
| | | | | | | | | | | HAB service should be kept available as long as possible since it is very fundamental. It can possibly be used in the GVM(Guest Virtual Machine) shutdown procedure to talk with the hypervisor. And the unregistration function will only be left to give a log message. Change-Id: I0cbc153a68a0fb496d14fc49db6cfee211a01722 Signed-off-by: Yong Ding <yongding@codeaurora.org>
* Merge "soc: qcom: hab: check the buffer's pointer before exporting it"Linux Build Service Account2018-07-16
|\
| * soc: qcom: hab: check the buffer's pointer before exporting itYong Ding2018-07-04
| | | | | | | | | | | | | | | | When the buffer's pointer is NULL, -EINVAL will be returned for its export. Change-Id: I3fc949c6152974db360dc55d3dfdb0cb24150473 Signed-off-by: Yong Ding <yongding@codeaurora.org>
* | soc: qcom: hab: resolve NULL pointer dereference issuesYong Ding2018-07-12
|/ | | | | | | Some NULL pointer dereference issues are fixed. Change-Id: I0f7f8ede860c81d451f2105520750692fd4eee50 Signed-off-by: Yong Ding <yongding@codeaurora.org>
* Merge "soc: qcom: hab: increase the maximum size of message"Linux Build Service Account2018-06-28
|\
| * soc: qcom: hab: increase the maximum size of messageYong Ding2018-06-26
| | | | | | | | | | | | | | | | | | Previously, the supported maximum size of message sent over hab was 4K bytes. Now, it is increased to 0xFFFF bytes. Change-Id: I3b539e42df2f5c5d3be4bbac7084adeb198c9a0b Signed-off-by: Yong Ding <yongding@codeaurora.org>
* | soc: qcom: hab: resolve some compilation issuesYong Ding2018-06-28
|/ | | | | | | | hab_qvm.h and its relevant stuffs are only available when CONFIG_MSM_GVM_QUIN is enabled. Change-Id: I7975f65f0f5bc627b7547c05245a37d4e6500c81 Signed-off-by: Yong Ding <yongding@codeaurora.org>
* Merge "soc: qcom: hab: make LA compilation pass"Linux Build Service Account2018-06-23
|\
| * soc: qcom: hab: make LA compilation passChao Bi2018-06-21
| | | | | | | | | | | | | | | | | | | | Due to GCC problem (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119), it cause a warning in hab test code, this patch is a workaround to avoid this warning. This can be reverted once the GCC issue is fixed. Change-Id: I4d01920ef36cb42bae4dd9f331c518a38dfd9a5a Signed-off-by: Chao Bi <chaobi@codeaurora.org>
* | soc: qcom: hab: clean the compilation issuesYong Ding2018-06-19
| | | | | | | | | | | | | | | | This fixes the hab compilation issues found when CONFIG_GHS_VMM is enabled. Change-Id: Ie4b6aca5f0a7f549273d939dd6069e55db7877c4 Signed-off-by: Yong Ding <yongding@codeaurora.org>
* | soc: qcom: hab: return -EINTR if woken up by a signalYong Ding2018-06-19
| | | | | | | | | | | | | | | | The standard -EINTR will be returned if the hab open blocking call is woken up by a signal. Change-Id: I0329c3b3a70241a31a64eab6872808e0f7d21013 Signed-off-by: Yong Ding <yongding@codeaurora.org>
* | soc: qcom: hab: add support for multiple hypervisorsYong Ding2018-06-12
|/ | | | | | | | | | HAB(Hypervisor ABstraction) is used for message transaction and buffer sharing among different virtual machines with the underlying hypervisor support. Here is the change to add HAB support for linux running in multiple hypervisors. Change-Id: I0747b2fa0f16c7cc0ab662369d45467ac6ba62e5 Signed-off-by: Yong Ding <yongding@codeaurora.org>
* Merge "soc: qcom: hab: add performance test mechanism for HAB"Linux Build Service Account2018-06-04
|\
| * soc: qcom: hab: add performance test mechanism for HABChao Bi2018-05-24
| | | | | | | | | | | | | | | | | | | | | | | | Develop a mechanism to faciliate the performance test for hab and share memory. Use "echo 0 > /sys/module/msm_hab/parameters/perf_test" to start share memory throughput test, and use "cat /sys/module/msm_hab/parameters/perf_test" to get the result. Change-Id: Ic9e27ace5332bd022e444747ab58152bb3dfd584 Signed-off-by: Chao Bi <chaobi@codeaurora.org>
* | soc: qcom: hab: hold the message when the read buffer is smallerYong Ding2018-05-09
|/ | | | | | | | | If the receive buffer in habmm_socket_recv() is smaller than the message, it should be kept in the queue rather than dropped. Change-Id: Iabc1f73e5b443cc7ebdefc3961d5bec9049a265f Signed-off-by: Yong Ding <yongding@codeaurora.org>
* hab: import/export between remote buffer and dmafdYajun Li2018-04-26
| | | | | | | | | currently hab only supports importing remote buffer to cpu address, which can't be shared to other process. Therefore we add dma_buf import/export function in hab Change-Id: I156c925d7c0cefef5bf146ad8cff38de9c4b3bee Signed-off-by: Yajun Li <yajunl@codeaurora.org>
* soc: qcom: hab: add the uninterruptible receive supportYong Ding2018-04-11
| | | | | | | | | In the blocking mode of habmm_socket_recv(), it is an interruptible wait by default. Here, the uninterruptible version is added. Change-Id: Iba9ee10afb3f2529a99a9c90f6fc0cb56fb9cb08 Signed-off-by: Yong Ding <yongding@codeaurora.org>