linux/drivers/soc/qcom
Volodymyr Babchuk d9d48d70e9 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:25:03 +02:00
..
apr.c soc: qcom: apr: Make qcom,protection-domain optional again 2023-01-24 07:24:44 +01:00
cmd-db.c soc: qcom: cmd-db: Map shared memory as WC, not WB 2024-09-04 13:25:03 +02:00
cpr.c PM: AVS: qcom-cpr: Fix an error handling path in cpr_probe() 2023-02-01 08:34:08 +01:00
icc-bwmon.c soc: qcom: icc-bwmon: fix incorrect error code passed to dev_err_probe() 2023-06-14 11:15:28 +02:00
Kconfig soc: qcom: Select REMAP_MMIO for ICC_BWMON driver 2023-01-07 11:11:36 +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 15:27:28 -08:00
Makefile soc: qcom: icc-bwmon: Add bandwidth monitoring driver 2022-07-06 15:57:51 -05:00
mdt_loader.c soc: qcom: mdt_loader: Fix unconditional call to scm_pas_mem_setup 2023-07-23 13:49:34 +02:00
ocmem.c soc: qcom: ocmem: Fix NUM_PORTS & NUM_MACROS macros 2023-09-13 09:42:36 +02:00
pdr_interface.c soc: qcom: pdr: fix parsing of domains lists 2024-08-03 08:48:58 +02:00
pdr_internal.h soc: qcom: pdr: use static for servreg_* variables 2022-05-05 22:08:15 -05:00
qcom-geni-se.c soc: qcom: geni: Disable MMIO tracing for GENI SE 2022-06-15 17:41:12 +02:00
qcom_aoss.c soc: qcom: aoss: Fix refcount leak in qmp_cooling_devices_register 2022-06-30 22:03:58 -05:00
qcom_gsbi.c soc: qcom: gsbi: Make use of the helper function devm_platform_ioremap_resource() 2021-09-21 17:41:48 -05:00
qcom_stats.c soc: qcom: stats: Populate all subsystem debugfs files 2023-03-11 13:55:22 +01:00
qmi_encdec.c soc: qcom: qmi_encdec: Restrict string length in decode 2023-09-19 12:27:57 +02:00
qmi_interface.c soc: qcom: qmi: use const for struct qmi_elem_info 2022-08-29 17:33:01 -05: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-03 08:48:57 +02:00
rpmh.c soc: qcom: rpmh-rsc: Ensure irqs aren't disabled by rpmh_rsc_send_data() callers 2024-08-03 08:48:57 +02:00
rpmhpd.c pmdomain: qcom: rpmhpd: Drop SA8540P gfx.lvl 2024-03-26 18:20:32 -04:00
rpmpd.c soc: qcom: rpmpd: Add SM6375 support 2022-09-13 22:25:35 -05:00
smd-rpm.c soc: qcom: smd-rpm: Add compatible for MSM8909 2022-07-18 18:05:07 -05:00
smem.c soc: qcom: smem: Fix incompatible types in comparison 2023-09-13 09:42:42 +02:00
smem_state.c soc: qcom: smem_state: Add refcounting for the 'state->of_node' 2022-08-18 14:13:46 -05:00
smp2p.c soc: qcom: correct kerneldoc 2022-06-25 22:05:31 -05:00
smsm.c soc: qcom: smsm: Fix refcount leak bugs in qcom_smsm_probe() 2022-08-18 14:13:46 -05:00
socinfo.c soc: qcom: socinfo: Add PM6125 ID 2022-08-18 14:13:46 -05:00
spm.c soc: qcom: spm: Add CPU data for MSM8909 2022-07-18 18:05:07 -05: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