mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 18:44:58 -06:00
s390x/kvm: Guest Migration TOD clock synchronization
Synchronizes the guest TOD clock across a migration by sending the guest TOD clock value to the destination system. If the guest TOD clock is not preserved across a migration then the guest's view of time will snap backwards if the destination host clock is behind the source host clock. This will cause the guest to hang immediately upon resuming on the destination system. Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Jason J. Herne <jjherne@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Message-Id: <1425912968-54387-1-git-send-email-jfrei@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
This commit is contained in:
parent
ae4a2bd759
commit
3f9e59bb53
4 changed files with 129 additions and 0 deletions
|
@ -401,6 +401,8 @@ void kvm_s390_vcpu_interrupt(S390CPU *cpu, struct kvm_s390_irq *irq);
|
|||
void kvm_s390_floating_interrupt(struct kvm_s390_irq *irq);
|
||||
int kvm_s390_inject_flic(struct kvm_s390_irq *irq);
|
||||
void kvm_s390_access_exception(S390CPU *cpu, uint16_t code, uint64_t te_code);
|
||||
int kvm_s390_get_clock(uint8_t *tod_high, uint64_t *tod_clock);
|
||||
int kvm_s390_set_clock(uint8_t *tod_high, uint64_t *tod_clock);
|
||||
#else
|
||||
static inline void kvm_s390_virtio_irq(int config_change, uint64_t token)
|
||||
{
|
||||
|
@ -408,11 +410,40 @@ static inline void kvm_s390_virtio_irq(int config_change, uint64_t token)
|
|||
static inline void kvm_s390_service_interrupt(uint32_t parm)
|
||||
{
|
||||
}
|
||||
static inline int kvm_s390_get_clock(uint8_t *tod_high, uint64_t *tod_low)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
static inline int kvm_s390_set_clock(uint8_t *tod_high, uint64_t *tod_low)
|
||||
{
|
||||
return -ENOSYS;
|
||||
}
|
||||
static inline void kvm_s390_access_exception(S390CPU *cpu, uint16_t code,
|
||||
uint64_t te_code)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline int s390_get_clock(uint8_t *tod_high, uint64_t *tod_low)
|
||||
{
|
||||
if (kvm_enabled()) {
|
||||
return kvm_s390_get_clock(tod_high, tod_low);
|
||||
}
|
||||
/* Fixme TCG */
|
||||
*tod_high = 0;
|
||||
*tod_low = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int s390_set_clock(uint8_t *tod_high, uint64_t *tod_low)
|
||||
{
|
||||
if (kvm_enabled()) {
|
||||
return kvm_s390_set_clock(tod_high, tod_low);
|
||||
}
|
||||
/* Fixme TCG */
|
||||
return 0;
|
||||
}
|
||||
|
||||
S390CPU *s390_cpu_addr2state(uint16_t cpu_addr);
|
||||
unsigned int s390_cpu_halt(S390CPU *cpu);
|
||||
void s390_cpu_unhalt(S390CPU *cpu);
|
||||
|
@ -422,6 +453,9 @@ static inline uint8_t s390_cpu_get_state(S390CPU *cpu)
|
|||
return cpu->env.cpu_state;
|
||||
}
|
||||
|
||||
void gtod_save(QEMUFile *f, void *opaque);
|
||||
int gtod_load(QEMUFile *f, void *opaque, int version_id);
|
||||
|
||||
/* service interrupts are floating therefore we must not pass an cpustate */
|
||||
void s390_sclp_extint(uint32_t parm);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue