aboutsummaryrefslogtreecommitdiff
path: root/target/s390x/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'target/s390x/cpu.c')
-rw-r--r--target/s390x/cpu.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
index f42e28ea25..4e1823a3e0 100644
--- a/target/s390x/cpu.c
+++ b/target/s390x/cpu.c
@@ -347,22 +347,34 @@ unsigned int s390_cpu_set_state(uint8_t cpu_state, S390CPU *cpu)
int s390_get_clock(uint8_t *tod_high, uint64_t *tod_low)
{
+ int r = 0;
+
if (kvm_enabled()) {
- return kvm_s390_get_clock(tod_high, tod_low);
+ r = kvm_s390_get_clock_ext(tod_high, tod_low);
+ if (r == -ENXIO) {
+ return kvm_s390_get_clock(tod_high, tod_low);
+ }
+ } else {
+ /* Fixme TCG */
+ *tod_high = 0;
+ *tod_low = 0;
}
- /* Fixme TCG */
- *tod_high = 0;
- *tod_low = 0;
- return 0;
+
+ return r;
}
int s390_set_clock(uint8_t *tod_high, uint64_t *tod_low)
{
+ int r = 0;
+
if (kvm_enabled()) {
- return kvm_s390_set_clock(tod_high, tod_low);
+ r = kvm_s390_set_clock_ext(tod_high, tod_low);
+ if (r == -ENXIO) {
+ return kvm_s390_set_clock(tod_high, tod_low);
+ }
}
/* Fixme TCG */
- return 0;
+ return r;
}
int s390_set_memory_limit(uint64_t new_limit, uint64_t *hw_limit)