Message ID | 20190516111253.4494-2-thuth@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | KVM selftests for s390x | expand |
On 16.05.19 13:12, Thomas Huth wrote: > The struct kvm_vcpu_events code is only available on certain architectures > (arm, arm64 and x86). To be able to compile kvm_util.c also for other > architectures, we've got to fence the code with __KVM_HAVE_VCPU_EVENTS. > > Signed-off-by: Thomas Huth <thuth@redhat.com> > --- > tools/testing/selftests/kvm/include/kvm_util.h | 2 ++ > tools/testing/selftests/kvm/lib/kvm_util.c | 2 ++ > 2 files changed, 4 insertions(+) > > diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing/selftests/kvm/include/kvm_util.h > index 07b71ad9734a..1e46ab205038 100644 > --- a/tools/testing/selftests/kvm/include/kvm_util.h > +++ b/tools/testing/selftests/kvm/include/kvm_util.h > @@ -114,10 +114,12 @@ void vcpu_sregs_set(struct kvm_vm *vm, uint32_t vcpuid, > struct kvm_sregs *sregs); > int _vcpu_sregs_set(struct kvm_vm *vm, uint32_t vcpuid, > struct kvm_sregs *sregs); > +#ifdef __KVM_HAVE_VCPU_EVENTS > void vcpu_events_get(struct kvm_vm *vm, uint32_t vcpuid, > struct kvm_vcpu_events *events); > void vcpu_events_set(struct kvm_vm *vm, uint32_t vcpuid, > struct kvm_vcpu_events *events); > +#endif > > const char *exit_reason_str(unsigned int exit_reason); > > diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c > index 4ca96b228e46..8d63ccb93e10 100644 > --- a/tools/testing/selftests/kvm/lib/kvm_util.c > +++ b/tools/testing/selftests/kvm/lib/kvm_util.c > @@ -1224,6 +1224,7 @@ void vcpu_regs_set(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_regs *regs) > ret, errno); > } > > +#ifdef __KVM_HAVE_VCPU_EVENTS > void vcpu_events_get(struct kvm_vm *vm, uint32_t vcpuid, > struct kvm_vcpu_events *events) > { > @@ -1249,6 +1250,7 @@ void vcpu_events_set(struct kvm_vm *vm, uint32_t vcpuid, > TEST_ASSERT(ret == 0, "KVM_SET_VCPU_EVENTS, failed, rc: %i errno: %i", > ret, errno); > } > +#endif > > /* > * VM VCPU System Regs Get > Reviewed-by: David Hildenbrand <david@redhat.com>
On 16.05.19 13:12, Thomas Huth wrote: > The struct kvm_vcpu_events code is only available on certain architectures > (arm, arm64 and x86). To be able to compile kvm_util.c also for other > architectures, we've got to fence the code with __KVM_HAVE_VCPU_EVENTS. > > Signed-off-by: Thomas Huth <thuth@redhat.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> According to the MAINTAINERS patches, you want me to pick these patches. Correct? > --- > tools/testing/selftests/kvm/include/kvm_util.h | 2 ++ > tools/testing/selftests/kvm/lib/kvm_util.c | 2 ++ > 2 files changed, 4 insertions(+) > > diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing/selftests/kvm/include/kvm_util.h > index 07b71ad9734a..1e46ab205038 100644 > --- a/tools/testing/selftests/kvm/include/kvm_util.h > +++ b/tools/testing/selftests/kvm/include/kvm_util.h > @@ -114,10 +114,12 @@ void vcpu_sregs_set(struct kvm_vm *vm, uint32_t vcpuid, > struct kvm_sregs *sregs); > int _vcpu_sregs_set(struct kvm_vm *vm, uint32_t vcpuid, > struct kvm_sregs *sregs); > +#ifdef __KVM_HAVE_VCPU_EVENTS > void vcpu_events_get(struct kvm_vm *vm, uint32_t vcpuid, > struct kvm_vcpu_events *events); > void vcpu_events_set(struct kvm_vm *vm, uint32_t vcpuid, > struct kvm_vcpu_events *events); > +#endif > > const char *exit_reason_str(unsigned int exit_reason); > > diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c > index 4ca96b228e46..8d63ccb93e10 100644 > --- a/tools/testing/selftests/kvm/lib/kvm_util.c > +++ b/tools/testing/selftests/kvm/lib/kvm_util.c > @@ -1224,6 +1224,7 @@ void vcpu_regs_set(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_regs *regs) > ret, errno); > } > > +#ifdef __KVM_HAVE_VCPU_EVENTS > void vcpu_events_get(struct kvm_vm *vm, uint32_t vcpuid, > struct kvm_vcpu_events *events) > { > @@ -1249,6 +1250,7 @@ void vcpu_events_set(struct kvm_vm *vm, uint32_t vcpuid, > TEST_ASSERT(ret == 0, "KVM_SET_VCPU_EVENTS, failed, rc: %i errno: %i", > ret, errno); > } > +#endif > > /* > * VM VCPU System Regs Get >
On 20/05/2019 09.12, Christian Borntraeger wrote: > > On 16.05.19 13:12, Thomas Huth wrote: >> The struct kvm_vcpu_events code is only available on certain architectures >> (arm, arm64 and x86). To be able to compile kvm_util.c also for other >> architectures, we've got to fence the code with __KVM_HAVE_VCPU_EVENTS. >> >> Signed-off-by: Thomas Huth <thuth@redhat.com> > Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> > > According to the MAINTAINERS patches, you want me to pick these patches. Correct? That would be nice, yes. But if you don't want to be responsible for s390x-related KVM selftest patches, please let me know, then I'll drop these hunks from the patches again. Thomas
On 20.05.19 10:08, Thomas Huth wrote: > On 20/05/2019 09.12, Christian Borntraeger wrote: >> >> On 16.05.19 13:12, Thomas Huth wrote: >>> The struct kvm_vcpu_events code is only available on certain architectures >>> (arm, arm64 and x86). To be able to compile kvm_util.c also for other >>> architectures, we've got to fence the code with __KVM_HAVE_VCPU_EVENTS. >>> >>> Signed-off-by: Thomas Huth <thuth@redhat.com> >> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> >> >> According to the MAINTAINERS patches, you want me to pick these patches. Correct? > > That would be nice, yes. But if you don't want to be responsible for > s390x-related KVM selftest patches, please let me know, then I'll drop > these hunks from the patches again. I can take care of these (as part of the normal KVM maintainership).
diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing/selftests/kvm/include/kvm_util.h index 07b71ad9734a..1e46ab205038 100644 --- a/tools/testing/selftests/kvm/include/kvm_util.h +++ b/tools/testing/selftests/kvm/include/kvm_util.h @@ -114,10 +114,12 @@ void vcpu_sregs_set(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_sregs *sregs); int _vcpu_sregs_set(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_sregs *sregs); +#ifdef __KVM_HAVE_VCPU_EVENTS void vcpu_events_get(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_vcpu_events *events); void vcpu_events_set(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_vcpu_events *events); +#endif const char *exit_reason_str(unsigned int exit_reason); diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c index 4ca96b228e46..8d63ccb93e10 100644 --- a/tools/testing/selftests/kvm/lib/kvm_util.c +++ b/tools/testing/selftests/kvm/lib/kvm_util.c @@ -1224,6 +1224,7 @@ void vcpu_regs_set(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_regs *regs) ret, errno); } +#ifdef __KVM_HAVE_VCPU_EVENTS void vcpu_events_get(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_vcpu_events *events) { @@ -1249,6 +1250,7 @@ void vcpu_events_set(struct kvm_vm *vm, uint32_t vcpuid, TEST_ASSERT(ret == 0, "KVM_SET_VCPU_EVENTS, failed, rc: %i errno: %i", ret, errno); } +#endif /* * VM VCPU System Regs Get
The struct kvm_vcpu_events code is only available on certain architectures (arm, arm64 and x86). To be able to compile kvm_util.c also for other architectures, we've got to fence the code with __KVM_HAVE_VCPU_EVENTS. Signed-off-by: Thomas Huth <thuth@redhat.com> --- tools/testing/selftests/kvm/include/kvm_util.h | 2 ++ tools/testing/selftests/kvm/lib/kvm_util.c | 2 ++ 2 files changed, 4 insertions(+)