linux/drivers/soc/qcom
Volodymyr Babchuk eaff392c1e soc: qcom: cmd-db: Map shared memory as WC, not WB
commit f9bb896eab upstream.

Linux does not write into cmd-db region. This region of memory is write
protected by XPU. XPU may sometime falsely detect clean cache eviction
as "write" into the write protected region leading to secure interrupt
which causes an endless loop somewhere in Trust Zone.

The only reason it is working right now is because Qualcomm Hypervisor
maps the same region as Non-Cacheable memory in Stage 2 translation
tables. The issue manifests if we want to use another hypervisor (like
Xen or KVM), which does not know anything about those specific mappings.

Changing the mapping of cmd-db memory from MEMREMAP_WB to MEMREMAP_WT/WC
removes dependency on correct mappings in Stage 2 tables. This patch
fixes the issue by updating the mapping to MEMREMAP_WC.

I tested this on SA8155P with Xen.

Fixes: 312416d917 ("drivers: qcom: add command DB driver")
Cc: stable@vger.kernel.org # 5.4+
Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Tested-by: Nikita Travkin <nikita@trvn.ru> # sc7180 WoA in EL2
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
Tested-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Link: https://lore.kernel.org/r/20240718-cmd_db_uncached-v2-1-f6cf53164c90@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2024-09-04 13:23:40 +02:00
..
apr.c soc: qcom: apr: Make qcom,protection-domain optional again 2023-01-24 07:22:49 +01:00
cmd-db.c soc: qcom: cmd-db: Map shared memory as WC, not WB 2024-09-04 13:23:40 +02:00
cpr.c PM: AVS: qcom-cpr: Fix an error handling path in cpr_probe() 2023-02-01 08:27:06 +01:00
Kconfig soc: qcom: Select REMAP_MMIO for LLCC driver 2023-01-12 11:58:49 +01:00
kryo-l2-accessors.c soc: qcom: kryo-l2-accessors: Fix misnaming of 'val' 2020-11-10 23:23:02 -06:00
llcc-qcom.c soc: qcom: llcc: Fix dis_cap_alloc and retain_on_pc configuration 2024-01-25 14:52:39 -08:00
Makefile PM: AVS: qcom-cpr: Move the driver to the qcom specific drivers 2020-10-22 18:38:21 +02:00
mdt_loader.c soc: qcom: mdt_loader: Drop PT_LOAD check on hash segment 2021-09-19 19:55:20 -05:00
ocmem.c soc: qcom: ocmem: Fix NUM_PORTS & NUM_MACROS macros 2023-09-19 12:22:35 +02:00
pdr_interface.c soc: qcom: pdr: fix parsing of domains lists 2024-08-19 05:44:52 +02:00
pdr_internal.h soc: qcom: pdr: Fixup array type of get_domain_list_resp message 2020-09-14 23:53:29 +00:00
qcom-geni-se.c soc: qcom: geni: Add support for gpi dma 2021-08-04 14:23:31 -05:00
qcom_aoss.c soc: qcom: aoss: Fix refcount leak in qmp_cooling_devices_register 2022-08-17 14:23:10 +02:00
qcom_gsbi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 409 2019-06-05 17:37:14 +02:00
qmi_encdec.c soc: qcom: qmi_encdec: Restrict string length in decode 2023-09-19 12:22:56 +02:00
qmi_interface.c soc: qcom: qmi: Return EPROBE_DEFER if no address family 2019-12-10 22:44:34 -08:00
rmtfs_mem.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
rpmh-internal.h soc: qcom: rpmh-rsc: Sleep waiting for tcs slots to be free 2020-09-10 16:56:12 +00:00
rpmh-rsc.c soc: qcom: rpmh-rsc: Ensure irqs aren't disabled by rpmh_rsc_send_data() callers 2024-08-19 05:44:52 +02:00
rpmh.c soc: qcom: rpmh-rsc: Ensure irqs aren't disabled by rpmh_rsc_send_data() callers 2024-08-19 05:44:52 +02:00
rpmhpd.c pmdomain: qcom: rpmhpd: Fix enabled_corner aggregation 2024-03-06 14:38:49 +00:00
rpmpd.c soc: qcom: rpmpd: Check for null return of devm_kcalloc 2022-04-08 14:23:15 +02:00
smd-rpm.c soc: qcom: smd-rpm: Add SM6115 compatible 2021-08-04 18:22:22 -05:00
smem.c soc: qcom: smem: Update max processor count 2021-03-11 20:22:20 -06:00
smem_state.c soc: qcom: smem_state: Add refcounting for the 'state->of_node' 2022-10-26 12:34:58 +02:00
smp2p.c soc: qcom: smp2p: Fix missing of_node_put() in smp2p_parse_ipc 2022-06-09 10:23:04 +02:00
smsm.c soc: qcom: smsm: Fix refcount leak bugs in qcom_smsm_probe() 2022-10-26 12:34:58 +02:00
socinfo.c soc: qcom: socinfo: add two missing PMIC IDs 2021-11-18 19:16:53 +01:00
trace-rpmh.h drivers: qcom: rpmh-rsc: log RPMH requests in FTRACE 2018-07-21 13:32:31 -05:00
wcnss_ctrl.c soc: qcom: wcnss_ctrl: Allow reading firmware-name from DT 2021-04-05 22:35:06 -05:00