KVM: s390: check the given debug flags, not the set ones
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Tue, 20 May 2014 15:25:20 +0000 (17:25 +0200)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Fri, 30 May 2014 07:39:38 +0000 (09:39 +0200)
This patch fixes a minor bug when updating the guest debug settings.
We should check the given debug flags, not the already set ones.
Doesn't do any harm but too many (for now unused) flags could be set internally
without error.

Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/kvm/kvm-s390.c

index e519860c6031a0b5c8b24b448fd70feba1fc1fac..06d1888f91798d1a5861331fc7fc2af1e769d023 100644 (file)
@@ -950,7 +950,7 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
        vcpu->guest_debug = 0;
        kvm_s390_clear_bp_data(vcpu);
 
-       if (vcpu->guest_debug & ~VALID_GUESTDBG_FLAGS)
+       if (dbg->control & ~VALID_GUESTDBG_FLAGS)
                return -EINVAL;
 
        if (dbg->control & KVM_GUESTDBG_ENABLE) {