Skip to contentSkip to conversation

hw/misc: Set valid access size for Exynos4210 RNG

PATCH Superseded Zheyu Ma 2 participants 2 messages Jun 18, 2024 Arm Samsung Exynos

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Zheyu Ma

author
#0 lore raw

PATCH v2 1/1 hw/misc: Set valid access size for Exynos4210 RNG

This commit ensures that accesses to the RNG memory region are properly validated and align with expected access sizes.

Reproducer:
cat << EOF | qemu-system-aarch64 -display none \
-machine accel=qtest, -m 512M -machine smdkc210 -qtest stdio readb 0x10830454
EOF

---
 hw/misc/exynos4210_rng.c | 2 ++
 1 file changed, 2 insertions(+)
hw/misc/exynos4210_rng.c +2 -0
index 0756bd3205..674d8eece5 100644
@@ -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
#1 lore raw
Quoted 2 lines · Zheyu Ma

This commit ensures that accesses to the RNG memory region are properly validated and align with expected access sizes.

Please point to the device specifications.

Quoted 24 lines

Reproducer:
cat << EOF | qemu-system-aarch64 -display none \
-machine accel=qtest, -m 512M -machine smdkc210 -qtest stdio readb 0x10830454
EOF

---
  hw/misc/exynos4210_rng.c | 2 ++
  1 file changed, 2 insertions(+)
hw/misc/exynos4210_rng.c +2 -0
index 0756bd3205..674d8eece5 100644
@@ -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)