From patchwork Thu Oct 30 15:48:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 39841 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 62F08202FE for ; Thu, 30 Oct 2014 15:48:56 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id n15sf3108606lbi.10 for ; Thu, 30 Oct 2014 08:48:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=yL29KxV8n5I631vYgbm5so1HfZGisMVKOIk5l8iPomk=; b=AMkuHQ8PypP0TUq5/gaMik/wl15z0WeAoOgreMMTgh7qKVAYU5qILMYBn14Nb82vZw vyJVMDbBYlFzhs5+hjzGkdmAKyvR2hx4JkxVgsZ8iT2zUZinvnGI5hr2wT8vg6I4WGp5 HfsFKf1OSxYNDFtu/pircrQuhX9KHYZUZ+tTxGHq1PDcjvck1aKxLjR7tHMVDs3D9AQV PynHu6WVF3aWPMe+NZ7HXDbYMCpCrgSLrBPsgEJ+ijEvzh7b7akfvGEZUPlMFjzH6GUF m13reN/2D98UQKt3WL0x7ZtcnfvKasC/Cx3XYtDZYBV5mQI6waIgsQ/d9iT4oPdbJOZi Maqw== X-Gm-Message-State: ALoCoQkGbLbEmNNfg0CX9uCiJbtZXmDlt+K5Vom0m9Gtrbb0eUgg1i9D0jTjoT5pT+bHmdQD/CL9 X-Received: by 10.180.105.74 with SMTP id gk10mr709841wib.0.1414684134991; Thu, 30 Oct 2014 08:48:54 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.72 with SMTP id q8ls288534laq.98.gmail; Thu, 30 Oct 2014 08:48:54 -0700 (PDT) X-Received: by 10.152.37.69 with SMTP id w5mr6806796laj.84.1414684134801; Thu, 30 Oct 2014 08:48:54 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id kh7si12697188lbc.17.2014.10.30.08.48.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 30 Oct 2014 08:48:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by mail-la0-f43.google.com with SMTP id ge10so4715154lab.16 for ; Thu, 30 Oct 2014 08:48:54 -0700 (PDT) X-Received: by 10.152.6.228 with SMTP id e4mr19840943laa.71.1414684134714; Thu, 30 Oct 2014 08:48:54 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.84.229 with SMTP id c5csp67916lbz; Thu, 30 Oct 2014 08:48:54 -0700 (PDT) X-Received: by 10.180.188.239 with SMTP id gd15mr20639837wic.68.1414684133787; Thu, 30 Oct 2014 08:48:53 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id fk6si11050981wib.96.2014.10.30.08.48.53 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 30 Oct 2014 08:48:53 -0700 (PDT) Received-SPF: none (google.com: pm215@archaic.org.uk does not designate permitted sender hosts) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1Xjry0-0006FE-De; Thu, 30 Oct 2014 15:48:52 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Greg Bellows , Sergey Fedorov , "Edgar E. Iglesias" , Fabian Aggeler Subject: [PATCH v2 2/2] target-arm: Correct condition for taking VIRQ and VFIQ Date: Thu, 30 Oct 2014 15:48:52 +0000 Message-Id: <1414684132-23971-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1414684132-23971-1-git-send-email-peter.maydell@linaro.org> References: <1414684132-23971-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 Reviewed-by: Edgar E. Iglesias --- 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; }