xemu/rust
Junjie Mao f7ceab1e30 rust/pl011: Fix range checks for device ID accesses
The peripheral and PrimeCell identification registers of pl011 are located at
offset 0xFE0 - 0xFFC. To check if a read falls to such registers, the C
implementation checks if the offset-shifted-by-2 (not the offset itself) is in
the range 0x3F8 - 0x3FF.

Use the same check in the Rust implementation.

This fixes the timeout of the following avocado tests:

  * tests/avocado/boot_linux_console.py:BootLinuxConsole.test_arm_virt
  * tests/avocado/replay_kernel.py:ReplayKernelNormal.test_arm_virt
  * tests/avocado/replay_kernel.py:ReplayKernelNormal.test_arm_vexpressa9

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Junjie Mao <junjie.mao@hotmail.com>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <SY0P300MB102644C4AC34A3AAD75DC4D5955C2@SY0P300MB1026.AUSP300.PROD.OUTLOOK.COM>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20241121165806.476008-39-alex.bennee@linaro.org>
2024-11-25 10:27:47 +00:00
..
hw rust/pl011: Fix range checks for device ID accesses 2024-11-25 10:27:47 +00:00
qemu-api rust: do not use --generate-cstr 2024-11-05 14:18:17 +01:00
qemu-api-macros rust: qemu-api-macros: always process subprojects before dependencies 2024-11-09 08:34:07 +01:00
.gitignore rust: add bindgen step as a meson dependency 2024-10-11 12:32:17 +02:00
Cargo.lock rust: introduce alternative implementation of offset_of! 2024-11-05 14:18:16 +01:00
Cargo.toml rust: create a cargo workspace 2024-11-05 14:18:16 +01:00
Kconfig rust: add PL011 device model 2024-11-05 14:18:15 +01:00
meson.build rust: add PL011 device model 2024-11-05 14:18:15 +01:00
rustfmt.toml rust: add crate to expose bindings and interfaces 2024-10-11 12:32:17 +02:00
wrapper.h rust/wrapper.h: define memory_order enum 2024-11-05 14:18:15 +01:00