Received: from eggs.gnu.org ([2001:4830:134:3::10]:43746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XitlU-0007Bl-1r for qemu-devel@nongnu.org; Mon, 27 Oct 2014 19:32:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XitlO-0003vH-JI for qemu-devel@nongnu.org; Mon, 27 Oct 2014 19:31:56 -0400 Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]:63298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XitlO-0003ue-BG for qemu-devel@nongnu.org; Mon, 27 Oct 2014 19:31:50 -0400 Received: by mail-pa0-f47.google.com with SMTP id kx10so6445995pab.34 for ; Mon, 27 Oct 2014 16:31:48 -0700 (PDT) Date: Tue, 28 Oct 2014 09:25:41 +1000 From: "Edgar E. Iglesias" Message-ID: <20141027232541.GI16081@toto> References: <1414414687-14265-1-git-send-email-peter.maydell@linaro.org> <1414414687-14265-3-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1414414687-14265-3-git-send-email-peter.maydell@linaro.org> Subject: Re: [Qemu-devel] [PATCH 2/2] target-arm: Correct condition for taking VIRQ and VFIQ List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Sergey Fedorov , Greg Bellows , qemu-devel@nongnu.org, Fabian Aggeler , patches@linaro.org On Mon, Oct 27, 2014 at 12:58:07PM +0000, Peter Maydell wrote: > The VIRQ and VFIQ exceptions are (as the comments say) only > taken if the CPU is in Non-secure state and the IMO/FMO bits > are set to enable virtualized interrupts. Correct the code > to actually implement this by using '||' rather than '&&'. Hi Peter, Shouldn't this be: if (secure || .... ? Cheers, Edgar > > Signed-off-by: Peter Maydell > --- > target-arm/cpu.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/target-arm/cpu.h b/target-arm/cpu.h > index 97eaf79..6145403 100644 > --- a/target-arm/cpu.h > +++ b/target-arm/cpu.h > @@ -1269,13 +1269,13 @@ static inline bool arm_excp_unmasked(CPUState *cs, unsigned int excp_idx) > } > return !(env->daif & PSTATE_I); > case EXCP_VFIQ: > - if (!secure && !(env->cp15.hcr_el2 & HCR_FMO)) { > + if (!secure || !(env->cp15.hcr_el2 & HCR_FMO)) { > /* VFIQs are only taken when hypervized and non-secure. */ > return false; > } > return !(env->daif & PSTATE_F); > case EXCP_VIRQ: > - if (!secure && !(env->cp15.hcr_el2 & HCR_IMO)) { > + if (!secure || !(env->cp15.hcr_el2 & HCR_IMO)) { > /* VIRQs are only taken when hypervized and non-secure. */ > return false; > } > -- > 1.9.1 >