void HELPER(sske)(CPUS390XState *env, uint64_t r1, uint64_t r2)
  {
-    MachineState *ms = MACHINE(qdev_get_machine());
      static S390SKeysState *ss;
      static S390SKeysClass *skeyclass;
      uint64_t addr = wrap_address(env, r2);
      uint8_t key;
+    int rc;
addr = mmu_real2abs(env, addr);
-    if (addr > ms->ram_size) {
-        return;
+    if (!mmu_absolute_addr_valid(addr, false)) {
+        trigger_pgm_exception(env, PGM_ADDRESSING);
      }
if (unlikely(!ss)) {
@@ -2213,7 +2216,11 @@ void HELPER(sske)(CPUS390XState *env, uint64_t r1, 
uint64_t r2)
      }
key = r1 & 0xfe;
-    skeyclass->set_skeys(ss, addr / TARGET_PAGE_SIZE, 1, &key);
+    rc = skeyclass->set_skeys(ss, addr / TARGET_PAGE_SIZE, 1, &key);
+    if (rc) {
+        trace_set_skeys_nonzero(rc);
+        return 0;

^ this has to go.


--
Thanks,

David / dhildenb


Reply via email to