hw/misc: Set valid access size for Exynos4210 RNG
PATCH v3 1/1 hw/misc: Set valid access size for Exynos4210 RNG
The Exynos4210 RNG module requires 32-bit (4-byte) accesses to its registers. According to the User Manual Section 25.3[1], the registers for RNG operations are 32-bit. This change ensures that the memory region operations for the RNG module enforce the correct access sizes, preventing invalid memory accesses.
Reproducer:
cat << EOF | qemu-system-aarch64 -display none \
-machine accel=qtest, -m 512M -machine smdkc210 -qtest stdio readb 0x10830454
EOF
---
Changes in v3:
- point to the device specification
--- hw/misc/exynos4210_rng.c | 2 ++ 1 file changed, 2 insertions(+)
hw/misc/exynos4210_rng.c +2 -0
@@ -217,6 +217,8 @@ static const MemoryRegionOps exynos4210_rng_ops = { .read = exynos4210_rng_read, .write = exynos4210_rng_write, .endianness = DEVICE_NATIVE_ENDIAN, + .valid.min_access_size = 4, + .valid.max_access_size = 4, };static void exynos4210_rng_reset (DeviceState *dev)
Signature · 1 line
2.34.1
Peter Maydell
AppliedQuoted 14 lines · Zheyu Ma
The Exynos4210 RNG module requires 32-bit (4-byte) accesses to its registers. According to the User Manual Section 25.3[1], the registers for RNG operations are 32-bit. This change ensures that the memory region operations for the RNG module enforce the correct access sizes, preventing invalid memory accesses.
Reproducer:
cat << EOF | qemu-system-aarch64 -display none \
-machine accel=qtest, -m 512M -machine smdkc210 -qtest stdio readb0x10830454
EOF
Quoted 5 lines
Suggested-by Philippe Mathieu-Daudé <[email protected]>Signed-off-by Zheyu Ma <[email protected]>---
Changes in v3:
- point to the device specification
Applied to target-arm.next, thanks.
-- PMM