Re: [RFC PATCH 1/4] KVM: selftests: Guard struct kvm_vcpu_events with __KVM_HAVE_VCPU_EVENTS

2019-05-20 Thread Christian Borntraeger



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 
>> Acked-by: Christian Borntraeger 
>>
>> 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).



Re: [RFC PATCH 1/4] KVM: selftests: Guard struct kvm_vcpu_events with __KVM_HAVE_VCPU_EVENTS

2019-05-20 Thread Thomas Huth
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 
> Acked-by: Christian Borntraeger 
> 
> 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


Re: [RFC PATCH 1/4] KVM: selftests: Guard struct kvm_vcpu_events with __KVM_HAVE_VCPU_EVENTS

2019-05-20 Thread Christian Borntraeger


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 
Acked-by: Christian Borntraeger 

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
> 



Re: [RFC PATCH 1/4] KVM: selftests: Guard struct kvm_vcpu_events with __KVM_HAVE_VCPU_EVENTS

2019-05-16 Thread David Hildenbrand
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 
> ---
>  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 

-- 

Thanks,

David / dhildenb