From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XijsR-0002T3-O0 for qemu-devel@nongnu.org; Mon, 27 Oct 2014 08:58:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XijsH-0001rr-Nn for qemu-devel@nongnu.org; Mon, 27 Oct 2014 08:58:27 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:54296) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XijsH-0001qz-HN for qemu-devel@nongnu.org; Mon, 27 Oct 2014 08:58:17 -0400 From: Peter Maydell Date: Mon, 27 Oct 2014 12:58:07 +0000 Message-Id: <1414414687-14265-3-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1414414687-14265-1-git-send-email-peter.maydell@linaro.org> References: <1414414687-14265-1-git-send-email-peter.maydell@linaro.org> Subject: [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: qemu-devel@nongnu.org Cc: Sergey Fedorov , Greg Bellows , "Edgar E. Iglesias" , Fabian Aggeler , patches@linaro.org 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 '&&'. 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