accel/tcg: Accept more page flags in page_check_range
authorRichard Henderson <richard.henderson@linaro.org>
Fri, 7 Jul 2023 20:40:51 +0000 (21:40 +0100)
committerRichard Henderson <richard.henderson@linaro.org>
Sat, 15 Jul 2023 07:02:32 +0000 (08:02 +0100)
Only PAGE_WRITE needs special attention, all others can be
handled as we do for PAGE_READ.  Adjust the mask.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230707204054.8792-24-richard.henderson@linaro.org>

accel/tcg/user-exec.c

index e4f95637307f6d33a42bcd885bd8bf02a1498e8a..1e8fcaf6b068f8e2f48a1b775a0017ed9f65e27f 100644 (file)
@@ -561,8 +561,8 @@ int page_check_range(target_ulong start, target_ulong len, int flags)
         }
 
         missing = flags & ~p->flags;
-        if (missing & PAGE_READ) {
-            ret = -1; /* page not readable */
+        if (missing & ~PAGE_WRITE) {
+            ret = -1; /* page doesn't match */
             break;
         }
         if (missing & PAGE_WRITE) {