From c2271e301dc441944dfc4c19ac932ea4f926a863 Mon Sep 17 00:00:00 2001 From: Dylan Johnson Date: Tue, 2 Aug 2016 10:38:02 +0100 Subject: arm: Fix secure state checking in various places Faults that could potentially be routed to the hypervisor checked whether or not they were in a secure state without checking if security was enabled or not. This caused faults not to be routed correctly. This patch causes secure state checking to first ask if security is enabled. Change-Id: I179e9b181b27f552734c9bab2b18d05ac579a119 --- src/arch/arm/interrupts.hh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/arch/arm/interrupts.hh') diff --git a/src/arch/arm/interrupts.hh b/src/arch/arm/interrupts.hh index d09176ca9..77287e6dd 100644 --- a/src/arch/arm/interrupts.hh +++ b/src/arch/arm/interrupts.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2012-2013 ARM Limited + * Copyright (c) 2010, 2012-2013, 2016 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -141,10 +141,9 @@ class Interrupts : public SimObject return false; CPSR cpsr = tc->readMiscReg(MISCREG_CPSR); - SCR scr = tc->readMiscReg(MISCREG_SCR); bool isHypMode = cpsr.mode == MODE_HYP; - bool isSecure = inSecureState(scr, cpsr); + bool isSecure = inSecureState(tc); bool allowVIrq = !cpsr.i && hcr.imo && !isSecure && !isHypMode; bool allowVFiq = !cpsr.f && hcr.fmo && !isSecure && !isHypMode; bool allowVAbort = !cpsr.a && hcr.amo && !isSecure && !isHypMode; @@ -229,13 +228,12 @@ class Interrupts : public SimObject HCR hcr = tc->readMiscReg(MISCREG_HCR); CPSR cpsr = tc->readMiscReg(MISCREG_CPSR); - SCR scr = tc->readMiscReg(MISCREG_SCR); // Calculate a few temp vars so we can work out if there's a pending // virtual interrupt, and if its allowed to happen // ARM ARM Issue C section B1.9.9, B1.9.11, and B1.9.13 bool isHypMode = cpsr.mode == MODE_HYP; - bool isSecure = inSecureState(scr, cpsr); + bool isSecure = inSecureState(tc); bool allowVIrq = !cpsr.i && hcr.imo && !isSecure && !isHypMode; bool allowVFiq = !cpsr.f && hcr.fmo && !isSecure && !isHypMode; bool allowVAbort = !cpsr.a && hcr.amo && !isSecure && !isHypMode; -- cgit v1.2.3