From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roel Kluin Subject: Re: [PATCH] kvm: ||/&& typo Date: Tue, 17 Feb 2009 16:16:49 +0100 Message-ID: <499AD4E1.8040700@gmail.com> References: <499ACE6B.6020407@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, jvpeetz@web.de, Andrew Morton To: avi@redhat.com Return-path: Received: from fk-out-0910.google.com ([209.85.128.187]:51965 "EHLO fk-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751690AbZBQPQu (ORCPT ); Tue, 17 Feb 2009 10:16:50 -0500 Received: by fk-out-0910.google.com with SMTP id f33so1353742fkf.5 for ; Tue, 17 Feb 2009 07:16:49 -0800 (PST) In-Reply-To: <499ACE6B.6020407@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: Roel Kluin wrote: > This was also reported by J=F6rg-Volker Peetz here: > http://lkml.org/lkml/2009/2/16/325 Please use this one, It gives J=F6rg-Volker Peetz credits, and I missed another issue just below. ------------------->8---------------------8<----------------------- Since ss.type is always either not 3 or not 7. Reported-by: J=F6rg-Volker Peetz Signed-off-by: Roel Kluin --- diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 6259d74..3f3cab2 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -1813,7 +1813,7 @@ static bool stack_segment_valid(struct kvm_vcpu *= vcpu) vmx_get_segment(vcpu, &ss, VCPU_SREG_SS); ss_rpl =3D ss.selector & SELECTOR_RPL_MASK; =20 - if ((ss.type !=3D 3) || (ss.type !=3D 7)) + if ((ss.type !=3D 3) && (ss.type !=3D 7)) return false; if (!ss.s) return false; @@ -1856,7 +1856,7 @@ static bool tr_valid(struct kvm_vcpu *vcpu) =20 if (tr.selector & SELECTOR_TI_MASK) /* TI =3D 1 */ return false; - if ((tr.type !=3D 3) || (tr.type !=3D 11)) /* TODO: Check if guest is= in IA32e mode */ + if ((tr.type !=3D 3) && (tr.type !=3D 11)) /* TODO: Check if guest is= in IA32e mode */ return false; if (!tr.present) return false;