OSDN Git Service

hw/ssi/xilinx_spips: Avoid AXI writes to the LQSPI linear memory
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Mon, 15 Jul 2019 13:17:03 +0000 (14:17 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 15 Jul 2019 13:17:03 +0000 (14:17 +0100)
commit936a236c4e4b1068ade99220260cd04f68eb0212
treec18d2e5e53e3de4ad62b3fd12748dee982d5f7f3
parent5937bd50d3841b6ab2592c1ff4233448762a8483
hw/ssi/xilinx_spips: Avoid AXI writes to the LQSPI linear memory

Lei Sun found while auditing the code that a CPU write would
trigger a NULL pointer dereference.

>From UG1085 datasheet [*] AXI writes in this region are ignored
and generates an AXI Slave Error (SLVERR).

Fix by implementing the write_with_attrs() handler.
Return MEMTX_ERROR when the region is accessed (this error maps
to an AXI slave error).

[*] https://www.xilinx.com/support/documentation/user_guides/ug1085-zynq-ultrascale-trm.pdf

Reported-by: Lei Sun <slei.casper@gmail.com>
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
Tested-by: Francisco Iglesias <frasse.iglesias@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/ssi/xilinx_spips.c