Received: from eggs.gnu.org ([2001:4830:134:3::10]:46423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkEK0-0000La-Dt for qemu-devel@nongnu.org; Fri, 31 Oct 2014 11:42:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xjry9-0000Uc-0I for qemu-devel@nongnu.org; Thu, 30 Oct 2014 11:49:01 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:54324) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xjry8-0000L4-Po for qemu-devel@nongnu.org; Thu, 30 Oct 2014 11:49:00 -0400 From: Peter Maydell Date: Thu, 30 Oct 2014 15:48:52 +0000 Message-Id: <1414684132-23971-3-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1414684132-23971-1-git-send-email-peter.maydell@linaro.org> References: <1414684132-23971-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH v2 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. 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..7f80090 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