On Mon, 3 Jul 2017 12:20:03 +0200 Christian Borntraeger <borntrae...@de.ibm.com> wrote:
> On 07/03/2017 10:51 AM, QingFeng Hao wrote: > > > diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c > > index a3d00196f4..c37f9c3b9e 100644 > > --- a/target/s390x/kvm.c > > +++ b/target/s390x/kvm.c > > @@ -2220,6 +2220,9 @@ int kvm_s390_assign_subch_ioeventfd(EventNotifier > > *notifier, uint32_t sch, > > .addr = sch, > > .len = 8, > > }; > > + if (!kvm_enabled()) { > > + return 0; > > + } > > thinking more about it. wouldnt it be better to do something like this instead > > diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h > index 058ddad..cc47831 100644 > --- a/target/s390x/cpu.h > +++ b/target/s390x/cpu.h > @@ -1240,7 +1240,11 @@ static inline int > s390_assign_subch_ioeventfd(EventNotifier *notifier, > uint32_t sch_id, int vq, > bool assign) > { > - return kvm_s390_assign_subch_ioeventfd(notifier, sch_id, vq, assign); > + if (kvm_enabled()) { > + return kvm_s390_assign_subch_ioeventfd(notifier, sch_id, vq, assign); > + } else { > + return 0; > + } > } > > static inline void s390_crypto_reset(void) Agreed. > > > FWIW, it seems that we (s390) do not have a functional equivalent function as > commit > 8c56c1a592b5092d91da8d8943c17777d6462a6f ("memory: emulate ioeventfd") , so > we will > not use the iothreads. Should not be a problem, I think. We may want to cook up an equivalent, though. > > > > if (!kvm_check_extension(kvm_state, KVM_CAP_IOEVENTFD)) { > > return -ENOSYS; > > } > > > >