qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] target/s390x: fix s390_probe_access to check PAGE_WRITE_ORG for writeability
@ 2021-04-22 15:44 Alex Bennée
  2021-04-22 16:10 ` Richard Henderson
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Alex Bennée @ 2021-04-22 15:44 UTC (permalink / raw)
  To: qemu-devel
  Cc: fam, Thomas Huth, berrange, David Hildenbrand, Cornelia Huck,
	Richard Henderson, f4bug, Laurent Vivier,
	open list:S390 general arch..., stefanha, crosa, pbonzini,
	Alex Bennée, aurelien

We can remove PAGE_WRITE when (internally) marking a page read-only
because it contains translated code. This can get confused when we are
executing signal return code on signal stacks.

Fixes: e56552cf07 ("target/s390x: Implement the MVPG condition-code-option bit")
Found-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Cc: Cornelia Huck <cohuck@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Laurent Vivier <laurent@vivier.eu>
---
 target/s390x/mem_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c
index 12e84a4285..f6a7d29273 100644
--- a/target/s390x/mem_helper.c
+++ b/target/s390x/mem_helper.c
@@ -145,7 +145,7 @@ static int s390_probe_access(CPUArchState *env, target_ulong addr, int size,
 
 #if defined(CONFIG_USER_ONLY)
     flags = page_get_flags(addr);
-    if (!(flags & (access_type == MMU_DATA_LOAD ?  PAGE_READ : PAGE_WRITE))) {
+    if (!(flags & (access_type == MMU_DATA_LOAD ?  PAGE_READ : PAGE_WRITE_ORG))) {
         env->__excp_addr = addr;
         flags = (flags & PAGE_VALID) ? PGM_PROTECTION : PGM_ADDRESSING;
         if (nonfault) {
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-04-23 15:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-22 15:44 [PATCH] target/s390x: fix s390_probe_access to check PAGE_WRITE_ORG for writeability Alex Bennée
2021-04-22 16:10 ` Richard Henderson
2021-04-22 16:43 ` David Hildenbrand
2021-04-23 12:22 ` Cornelia Huck
2021-04-23 13:06   ` Peter Maydell
2021-04-23 13:28     ` Thomas Huth
2021-04-23 13:52       ` Cornelia Huck
2021-04-23 13:56         ` Peter Maydell
2021-04-23 15:44           ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).