s390x/kvm: reuse kvm_s390_reset_vcpu() to get rid of ifdefs
This patch reuses kvm_s390_reset_vcpu() to get rid of some CONFIG_KVM and CONFIG_USER_ONLY ifdefs in cpu.c. In order to get rid of CONFIG_USER_ONLY, kvm_s390_reset_vcpu() has to provide a dummy implementation - the two definitions are moved to the proper section in cpu.h. Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> CC: Andreas Faerber <afaerber@suse.de> Tested-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
This commit is contained in:
parent
c9e659c9ee
commit
99607144a4
|
@ -117,15 +117,11 @@ static void s390_cpu_initial_reset(CPUState *s)
|
||||||
|
|
||||||
env->pfault_token = -1UL;
|
env->pfault_token = -1UL;
|
||||||
|
|
||||||
#if defined(CONFIG_KVM)
|
|
||||||
/* Reset state inside the kernel that we cannot access yet from QEMU. */
|
/* Reset state inside the kernel that we cannot access yet from QEMU. */
|
||||||
if (kvm_enabled()) {
|
if (kvm_enabled()) {
|
||||||
if (kvm_vcpu_ioctl(s, KVM_S390_INITIAL_RESET, NULL)) {
|
kvm_s390_reset_vcpu(cpu);
|
||||||
perror("Initial CPU reset failed");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/* CPUClass:reset() */
|
/* CPUClass:reset() */
|
||||||
static void s390_cpu_full_reset(CPUState *s)
|
static void s390_cpu_full_reset(CPUState *s)
|
||||||
|
@ -145,11 +141,10 @@ static void s390_cpu_full_reset(CPUState *s)
|
||||||
|
|
||||||
env->pfault_token = -1UL;
|
env->pfault_token = -1UL;
|
||||||
|
|
||||||
#if !defined(CONFIG_USER_ONLY)
|
/* Reset state inside the kernel that we cannot access yet from QEMU. */
|
||||||
if (kvm_enabled()) {
|
if (kvm_enabled()) {
|
||||||
kvm_s390_reset_vcpu(cpu);
|
kvm_s390_reset_vcpu(cpu);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
tlb_flush(s, 1);
|
tlb_flush(s, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -389,16 +389,12 @@ int s390_virtio_hypercall(CPUS390XState *env);
|
||||||
void s390_virtio_irq(int config_change, uint64_t token);
|
void s390_virtio_irq(int config_change, uint64_t token);
|
||||||
|
|
||||||
#ifdef CONFIG_KVM
|
#ifdef CONFIG_KVM
|
||||||
void kvm_s390_reset_vcpu(S390CPU *cpu);
|
|
||||||
void kvm_s390_virtio_irq(int config_change, uint64_t token);
|
void kvm_s390_virtio_irq(int config_change, uint64_t token);
|
||||||
void kvm_s390_service_interrupt(uint32_t parm);
|
void kvm_s390_service_interrupt(uint32_t parm);
|
||||||
void kvm_s390_vcpu_interrupt(S390CPU *cpu, struct kvm_s390_irq *irq);
|
void kvm_s390_vcpu_interrupt(S390CPU *cpu, struct kvm_s390_irq *irq);
|
||||||
void kvm_s390_floating_interrupt(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);
|
int kvm_s390_inject_flic(struct kvm_s390_irq *irq);
|
||||||
#else
|
#else
|
||||||
static inline void kvm_s390_reset_vcpu(S390CPU *cpu)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
static inline void kvm_s390_virtio_irq(int config_change, uint64_t token)
|
static inline void kvm_s390_virtio_irq(int config_change, uint64_t token)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -1073,6 +1069,7 @@ int kvm_s390_cpu_restart(S390CPU *cpu);
|
||||||
int kvm_s390_get_memslot_count(KVMState *s);
|
int kvm_s390_get_memslot_count(KVMState *s);
|
||||||
void kvm_s390_clear_cmma_callback(void *opaque);
|
void kvm_s390_clear_cmma_callback(void *opaque);
|
||||||
int kvm_s390_set_cpu_state(S390CPU *cpu, uint8_t cpu_state);
|
int kvm_s390_set_cpu_state(S390CPU *cpu, uint8_t cpu_state);
|
||||||
|
void kvm_s390_reset_vcpu(S390CPU *cpu);
|
||||||
#else
|
#else
|
||||||
static inline void kvm_s390_io_interrupt(uint16_t subchannel_id,
|
static inline void kvm_s390_io_interrupt(uint16_t subchannel_id,
|
||||||
uint16_t subchannel_nr,
|
uint16_t subchannel_nr,
|
||||||
|
@ -1107,6 +1104,9 @@ static inline int kvm_s390_set_cpu_state(S390CPU *cpu, uint8_t cpu_state)
|
||||||
{
|
{
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
}
|
}
|
||||||
|
static inline void kvm_s390_reset_vcpu(S390CPU *cpu)
|
||||||
|
{
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline void cmma_reset(S390CPU *cpu)
|
static inline void cmma_reset(S390CPU *cpu)
|
||||||
|
|
|
@ -198,7 +198,7 @@ void kvm_s390_reset_vcpu(S390CPU *cpu)
|
||||||
* Before this ioctl cpu_synchronize_state() is called in common kvm
|
* Before this ioctl cpu_synchronize_state() is called in common kvm
|
||||||
* code (kvm-all) */
|
* code (kvm-all) */
|
||||||
if (kvm_vcpu_ioctl(cs, KVM_S390_INITIAL_RESET, NULL)) {
|
if (kvm_vcpu_ioctl(cs, KVM_S390_INITIAL_RESET, NULL)) {
|
||||||
perror("Can't reset vcpu\n");
|
error_report("Initial CPU reset failed on CPU %i\n", cs->cpu_index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue