[patch] KVM: PPC: fix a sanity check

Subsystems: kernel virtual machine for powerpc (kvm/powerpc), linux for powerpc (32-bit and 64-bit), the rest

STALE3652d

3 messages, 3 authors, 2016-09-27 · open the first message on its own page

[patch] KVM: PPC: fix a sanity check

From: Dan Carpenter <hidden>
Date: 2016-07-14 10:16:10

We use logical negate where bitwise negate was intended.  It means that
we never return -EINVAL here.

Fixes: ce11e48b7fdd ('KVM: PPC: E500: Add userspace debug stub support')
Signed-off-by: Dan Carpenter <redacted>
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index 02b4672..df3f270 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -2038,7 +2038,7 @@ int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
 		if (type == KVMPPC_DEBUG_NONE)
 			continue;
 
-		if (type & !(KVMPPC_DEBUG_WATCH_READ |
+		if (type & ~(KVMPPC_DEBUG_WATCH_READ |
 			     KVMPPC_DEBUG_WATCH_WRITE |
 			     KVMPPC_DEBUG_BREAKPOINT))
 			return -EINVAL;

Re: [patch] KVM: PPC: fix a sanity check

From: Alexander Graf <hidden>
Date: 2016-07-14 11:10:24

On 07/14/2016 12:15 PM, Dan Carpenter wrote:
We use logical negate where bitwise negate was intended.  It means that
we never return -EINVAL here.

Fixes: ce11e48b7fdd ('KVM: PPC: E500: Add userspace debug stub support')
Signed-off-by: Dan Carpenter <redacted>
Oops :).

Reviewed-by: Alexander Graf <redacted>


Alex

Re: [patch] KVM: PPC: fix a sanity check

From: Paul Mackerras <hidden>
Date: 2016-09-27 05:47:33

On Thu, Jul 14, 2016 at 01:15:46PM +0300, Dan Carpenter wrote:
We use logical negate where bitwise negate was intended.  It means that
we never return -EINVAL here.

Fixes: ce11e48b7fdd ('KVM: PPC: E500: Add userspace debug stub support')
Signed-off-by: Dan Carpenter <redacted>
Thanks, applied to kvm-ppc-next.

Paul.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help