WSL2-Linux-Kernel/drivers/soc
Volodymyr Babchuk eaff392c1e soc: qcom: cmd-db: Map shared memory as WC, not WB
commit f9bb896eab221618927ae6a2f1d566567999839d 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>
2024-09-04 13:23:40 +02:00
..
actions
amlogic drivers: meson: secure-pwrc: always enable DMA domain 2023-07-23 13:47:09 +02:00
aspeed soc: aspeed: socinfo: Add kfree for kstrdup 2023-08-26 14:23:36 +02:00
atmel ARM: at91: fix soc detection for SAM9X60 SiPs 2022-07-12 16:35:15 +02:00
bcm soc: brcmstb: pm-arm: Fix refcount leak and __iomem leak bugs 2022-09-15 11:30:04 +02:00
canaan
dove
fsl soc: fsl: qbman: Use raw spinlock for cgr_lock 2024-04-10 16:18:42 +02:00
gemini
imx soc: imx8m: Enable OCOTP clock for imx8mm before reading registers 2023-10-06 13:18:14 +02:00
ixp4xx soc: ixp4xx/npe: Fix unused match warning 2022-07-21 21:24:40 +02:00
lantiq
litex
mediatek soc: mediatek: cmdq: Fix typo of CMDQ_JUMP_RELATIVE 2024-06-16 13:39:17 +02:00
qcom soc: qcom: cmd-db: Map shared memory as WC, not WB 2024-09-04 13:23:40 +02:00
renesas pmdomain: renesas: r8a77980-sysc: CR7 must be always on 2024-03-01 13:21:48 +01:00
rockchip
samsung
sifive soc: sifive: l2_cache: fix missing of_node_put() in sifive_l2_init() 2023-04-26 13:51:56 +02:00
sunxi soc: sunxi: sram: Fix debugfs info for A64 SRAM C 2022-10-05 10:39:41 +02:00
tegra soc/tegra: fuse: Drop Kconfig dependency on TEGRA20_APB_DMA 2022-10-26 12:35:00 +02:00
ti soc: ti: wkup_m3_ipc: Send NULL dummy message instead of pointer message 2024-07-05 09:14:44 +02:00
ux500 ARM: ux500: do not directly dereference __iomem 2023-01-12 11:58:50 +01:00
versatile
xilinx drivers: soc: xilinx: check return status of get_api_version() 2024-08-19 05:45:29 +02:00
Kconfig
Makefile