Skip to contentSkip to conversation

KVM: Add compat ioctl for KVM_SET_SIGNAL_MASK

PATCH In review Alexander Graf 2 participants 2 messages Jun 7, 2011 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: Add compat ioctl for KVM_SET_SIGNAL_MASK

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.

---
 kernel/compat.c     |    1 +
 virt/kvm/kvm_main.c |   50 +++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 50 insertions(+), 1 deletions(-)
kernel/compat.c +1 -0
index 9214dcd..506e176 100644
@@ -882,6 +882,7 @@ sigset_from_compat (sigset_t *set, compat_sigset_t *compat)
 	case 1: set->sig[0] = compat->sig[0] | (((long)compat->sig[1]) << 32 );
 	}
 }
+EXPORT_SYMBOL_GPL(sigset_from_compat);
 
 asmlinkage long
 compat_sys_rt_sigtimedwait (compat_sigset_t __user *uthese,
virt/kvm/kvm_main.c +49 -1

68 lines not on this page · raw message

Signature · 1 line
1.6.0.2
#1 lore raw

virt/kvm/kvm_main.c out: · line 1886

Quoted 5 lines · On Tuesday 07 June 2011 22:25:15 Alexander Graf wrote:
virt/kvm/kvm_main.c +5 -0
+static long kvm_vcpu_compat_ioctl(struct file *filp,
+                                 unsigned int ioctl, unsigned long arg)
+{
+       struct kvm_vcpu *vcpu = filp->private_data;
+       void __user *argp = (void __user *)arg;

Converting a compat user argument into a pointer should use the compat_ptr() function to do the right thing on s390. Otherwise your patch looks good.

Arnd