diff mbox

KVM: Add compat ioctl for KVM_SET_SIGNAL_MASK

Message ID 4DF0ED75.3040500@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Paolo Bonzini June 9, 2011, 3:57 p.m. UTC
On 06/09/2011 02:24 PM, Avi Kivity wrote:
> On 06/08/2011 03:45 AM, Alexander Graf wrote:
>> KVM has an ioctl to define which signal mask should be used while running
>> inside VCPU_RUN. At least for big endian systems, this mask is different
>> on 32-bit and 64-bit systems (though the size is identical).
>>
>> Add a compat wrapper that converts the mask to whatever the kernel
>> accepts,
>> allowing 32-bit kvm user space to set signal masks.
>>
>> This patch fixes qemu with --enable-io-thread on ppc64 hosts when running
>> 32-bit user land.
>
> Applied, thanks.

And here's the matching documentation change.  Kunz-kunz, Alex. :)

-------------------------- 8< -----------------------------
 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <pbonzini@redhat.com>
Date: Thu, 9 Jun 2011 17:48:50 +0200
Subject: [PATCH] KVM: fix documentation for KVM_SET_SIGNAL_MASK

The signal mask passed to KVM_SET_SIGNAL_MASK needs to be ABI-compatible
with sigprocmask, so that functions operating on sigset_t can be used
with it.  Referring to the signal mask as an array of bytes is incorrect
on big endian systems, fix it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
  Documentation/kvm/api.txt |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Avi Kivity June 19, 2011, 1:37 p.m. UTC | #1
On 06/09/2011 06:57 PM, Paolo Bonzini wrote:
>
> -------------------------- 8< -----------------------------
> From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
> From: Paolo Bonzini <pbonzini@redhat.com>
> Date: Thu, 9 Jun 2011 17:48:50 +0200
> Subject: [PATCH] KVM: fix documentation for KVM_SET_SIGNAL_MASK
>
> The signal mask passed to KVM_SET_SIGNAL_MASK needs to be ABI-compatible
> with sigprocmask, so that functions operating on sigset_t can be used
> with it.  Referring to the signal mask as an array of bytes is incorrect
> on big endian systems, fix it.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  Documentation/kvm/api.txt |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt
> index 9bef4e4..ec15972 100644
> --- a/Documentation/kvm/api.txt
> +++ b/Documentation/kvm/api.txt
> @@ -464,8 +464,8 @@ signal mask.
>
>  /* for KVM_SET_SIGNAL_MASK */
>  struct kvm_signal_mask {
> -    __u32 len;
> -    __u8  sigset[0];
> +    __u32          len;
> +    unsigned long  sigset[0];
>  };

But that doesn't match the definition in kvm.h.  If someone sets 
kvm_signal_mask::sigset[3], they'll get different answers if they look 
at the documentation or the code.

So it needs to be documented in English, not C.

(and not whitespace-damaged, either)
diff mbox

Patch

diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt
index 9bef4e4..ec15972 100644
--- a/Documentation/kvm/api.txt
+++ b/Documentation/kvm/api.txt
@@ -464,8 +464,8 @@  signal mask.

  /* for KVM_SET_SIGNAL_MASK */
  struct kvm_signal_mask {
-	__u32 len;
-	__u8  sigset[0];
+	__u32          len;
+	unsigned long  sigset[0];
  };

  4.22 KVM_GET_FPU