qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] s390x: Properly fetch and test the short psw on diag308 subc 0/1
@ 2019-11-05 18:44 Janosch Frank
  2019-11-05 19:29 ` David Hildenbrand
  0 siblings, 1 reply; 6+ messages in thread
From: Janosch Frank @ 2019-11-05 18:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: borntraeger, cohuck, david

We need to actually fetch the cpu mask and set it after checking for
psw bit 12 instead of completely ignoring it.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
---
 target/s390x/cpu.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
index 736a7903e2..0acba843a7 100644
--- a/target/s390x/cpu.c
+++ b/target/s390x/cpu.c
@@ -76,8 +76,15 @@ static bool s390_cpu_has_work(CPUState *cs)
 static void s390_cpu_load_normal(CPUState *s)
 {
     S390CPU *cpu = S390_CPU(s);
-    cpu->env.psw.addr = ldl_phys(s->as, 4) & PSW_MASK_ESA_ADDR;
-    cpu->env.psw.mask = PSW_MASK_32 | PSW_MASK_64;
+    uint64_t spsw = ldq_phys(s->as, 0);
+
+    /* Mask out bit 12 and instruction address */
+    cpu->env.psw.mask = spsw & 0xfff7ffff80000000UL;
+    cpu->env.psw.addr = spsw & 0x7fffffffUL;
+
+    if (!(spsw & 0x8000000000000UL)) {
+        s390_program_interrupt(&cpu->env, PGM_SPECIFICATION, 0, RA_IGNORED);
+    }
     s390_cpu_set_state(S390_CPU_STATE_OPERATING, cpu);
 }
 #endif
-- 
2.20.1



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

end of thread, other threads:[~2019-11-11 14:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-05 18:44 [PATCH] s390x: Properly fetch and test the short psw on diag308 subc 0/1 Janosch Frank
2019-11-05 19:29 ` David Hildenbrand
2019-11-05 19:34   ` Janosch Frank
2019-11-05 20:07     ` David Hildenbrand
2019-11-11 13:52       ` Janosch Frank
2019-11-11 14:09         ` David Hildenbrand

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).