summaryrefslogtreecommitdiff
path: root/target-s390x/cpu.h
diff options
context:
space:
mode:
authorFan Zhang <zhangfan@linux.vnet.ibm.com>2016-03-09 13:11:17 +0100
committerCornelia Huck <cornelia.huck@de.ibm.com>2016-05-17 15:50:29 +0200
commit9700230b0d6d68d8650206ffd10d132219678db1 (patch)
tree14b645e6981f227520f4decb3317b45c397e620e /target-s390x/cpu.h
parent946e55f3c7ff3eb9fa49e57e15c209858aaa9ac9 (diff)
downloadqemu-9700230b0d6d68d8650206ffd10d132219678db1.tar.gz
qemu-9700230b0d6d68d8650206ffd10d132219678db1.tar.bz2
qemu-9700230b0d6d68d8650206ffd10d132219678db1.zip
s390x: enable runtime instrumentation
Introduce run-time-instrumentation support when running under kvm for virtio-ccw 2.7 machine and make sure older machines can not enable it. The new ri_allowed field in the s390MachineClass serves as an indicator whether the feature can be used by the machine and should therefore be activated if available. riccb_needed() is used to check whether riccb is needed or not in live migration. Signed-off-by: Fan Zhang <zhangfan@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'target-s390x/cpu.h')
-rw-r--r--target-s390x/cpu.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h
index 07f76ad884..996b79023e 100644
--- a/target-s390x/cpu.h
+++ b/target-s390x/cpu.h
@@ -135,6 +135,8 @@ typedef struct CPUS390XState {
uint64_t gbea;
uint64_t pp;
+ uint8_t riccb[64];
+
CPU_COMMON
/* reset does memset(0) up to here */
@@ -1159,6 +1161,7 @@ void kvm_s390_reset_vcpu(S390CPU *cpu);
int kvm_s390_set_mem_limit(KVMState *s, uint64_t new_limit, uint64_t *hw_limit);
void kvm_s390_vcpu_interrupt_pre_save(S390CPU *cpu);
int kvm_s390_vcpu_interrupt_post_load(S390CPU *cpu);
+int kvm_s390_get_ri(void);
void kvm_s390_crypto_reset(void);
#else
static inline void kvm_s390_io_interrupt(uint16_t subchannel_id,
@@ -1209,6 +1212,10 @@ static inline int kvm_s390_vcpu_interrupt_post_load(S390CPU *cpu)
{
return 0;
}
+static inline int kvm_s390_get_ri(void)
+{
+ return 0;
+}
static inline void kvm_s390_crypto_reset(void)
{
}
@@ -1272,11 +1279,22 @@ static inline bool vregs_needed(void *opaque)
}
return 0;
}
+static inline bool riccb_needed(void *opaque)
+{
+ if (kvm_enabled()) {
+ return kvm_s390_get_ri();
+ }
+ return 0;
+}
#else
static inline bool vregs_needed(void *opaque)
{
return 0;
}
+static inline bool riccb_needed(void *opaque)
+{
+ return 0;
+}
#endif
/* machine check interruption code */