edu: mmio: allow 64-bit access in read dispatch
authorLi Qiang <liq3ea@163.com>
Fri, 10 May 2019 16:43:48 +0000 (09:43 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 3 Jun 2019 12:03:01 +0000 (14:03 +0200)
The edu spec says when address >= 0x80, the MMIO area can
be accessed by 64-bit.

Signed-off-by: Li Qiang <liq3ea@163.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Message-Id: <20190510164349.81507-3-liq3ea@163.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/misc/edu.c

index 65fc32b928491d3d2e7ba176f7712d02614f4330..33de05141fbfa32fde7e6b52a12350731b30ddd7 100644 (file)
@@ -185,7 +185,11 @@ static uint64_t edu_mmio_read(void *opaque, hwaddr addr, unsigned size)
     EduState *edu = opaque;
     uint64_t val = ~0ULL;
 
-    if (size != 4) {
+    if (addr < 0x80 && size != 4) {
+        return val;
+    }
+
+    if (addr >= 0x80 && size != 4 && size != 8) {
         return val;
     }