|
@@ -11,7 +11,7 @@
|
|
|
|
|
|
#include "qemu/osdep.h"
|
|
#include "qemu/osdep.h"
|
|
#include "cpu.h"
|
|
#include "cpu.h"
|
|
-#include "hw/boards.h"
|
|
|
|
|
|
+#include "hw/s390x/s390-virtio-ccw.h"
|
|
#include "hw/s390x/s390-hypercall.h"
|
|
#include "hw/s390x/s390-hypercall.h"
|
|
#include "hw/s390x/ioinst.h"
|
|
#include "hw/s390x/ioinst.h"
|
|
#include "hw/s390x/css.h"
|
|
#include "hw/s390x/css.h"
|
|
@@ -57,6 +57,13 @@ static int handle_virtio_ccw_notify(uint64_t subch_id, uint64_t data)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static uint64_t handle_storage_limit(void)
|
|
|
|
+{
|
|
|
|
+ S390CcwMachineState *s390ms = S390_CCW_MACHINE(qdev_get_machine());
|
|
|
|
+
|
|
|
|
+ return s390_get_memory_limit(s390ms) - 1;
|
|
|
|
+}
|
|
|
|
+
|
|
void handle_diag_500(S390CPU *cpu, uintptr_t ra)
|
|
void handle_diag_500(S390CPU *cpu, uintptr_t ra)
|
|
{
|
|
{
|
|
CPUS390XState *env = &cpu->env;
|
|
CPUS390XState *env = &cpu->env;
|
|
@@ -69,6 +76,9 @@ void handle_diag_500(S390CPU *cpu, uintptr_t ra)
|
|
case DIAG500_VIRTIO_CCW_NOTIFY:
|
|
case DIAG500_VIRTIO_CCW_NOTIFY:
|
|
env->regs[2] = handle_virtio_ccw_notify(env->regs[2], env->regs[3]);
|
|
env->regs[2] = handle_virtio_ccw_notify(env->regs[2], env->regs[3]);
|
|
break;
|
|
break;
|
|
|
|
+ case DIAG500_STORAGE_LIMIT:
|
|
|
|
+ env->regs[2] = handle_storage_limit();
|
|
|
|
+ break;
|
|
default:
|
|
default:
|
|
s390_program_interrupt(env, PGM_SPECIFICATION, ra);
|
|
s390_program_interrupt(env, PGM_SPECIFICATION, ra);
|
|
}
|
|
}
|