Patchwork [for,1.6,2/2] Revert "memory: Return -1 again on reads from unsigned regions"

login
register
mail settings
Submitter Jan Kiszka
Date Aug. 9, 2013, 12:01 p.m.
Message ID <2f195665d6707ea875d385abce84c845f116a275.1376049708.git.jan.kiszka@siemens.com>
Download mbox | patch
Permalink /patch/266015/
State New
Headers show

Comments

Jan Kiszka - Aug. 9, 2013, 12:01 p.m.
This reverts commit 9b8c69243585a32d14b9bb9fcd52c37b0b5a1b71.

The commit was wrong: We only return -1 on invalid accesses, not on
valid but unbacked ones. This broke various corner cases.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 memory.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Andreas Färber - Aug. 9, 2013, 5:33 p.m.
Am 09.08.2013 14:01, schrieb Jan Kiszka:
> This reverts commit 9b8c69243585a32d14b9bb9fcd52c37b0b5a1b71.
> 
> The commit was wrong: We only return -1 on invalid accesses, not on
> valid but unbacked ones. This broke various corner cases.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

Tested-by: Andreas Färber <andreas.faerber@web.de>

Restores previous PReP behavior.

Thanks,
Andreas

Patch

diff --git a/memory.c b/memory.c
index 886f838..5a10fd0 100644
--- a/memory.c
+++ b/memory.c
@@ -872,7 +872,7 @@  static uint64_t unassigned_mem_read(void *opaque, hwaddr addr,
     if (current_cpu != NULL) {
         cpu_unassigned_access(current_cpu, addr, false, false, 0, size);
     }
-    return -1ULL;
+    return 0;
 }
 
 static void unassigned_mem_write(void *opaque, hwaddr addr,