From patchwork Mon Oct 27 12:58:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 39629 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 991D52118A for ; Mon, 27 Oct 2014 12:58:12 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id q1sf1269913lam.8 for ; Mon, 27 Oct 2014 05:58:11 -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=8jCZB3B2mcABH3hVFT8i6hmfJJFvBOcQ1ZVaGRa1FyU=; b=Lw/n5oIPmsDRYysRwa0rVWDpzvMVJLDhu6LFP6xdmUyKeAkexJoQJmVidflpxEssLl KnLw/PI2JJ6qKmcklIgOS32OqBj0T7S81sjh/EuCmhQNoLYxJXdBykwOBBm5dJaMYydW CDaVo//bdBs89xIAw8HqxBTi1jUJjGk8wh5e188U1TVqk/1ajzJ1a5oo5QgxzRTrhTJB GUiR+KobeWq2bSpT/3cgnUmwBV53/62P4cXqoz4a8qTL4jCENphZ5Tcl62vQcBJcN9JR xYTH1qwo4Ji8RciRdUEYuFhMWAgwuYgRA4i91e+fNeXVAoIfcevjEtsKg2I4sp0N8yWv zBqA== X-Gm-Message-State: ALoCoQl5k7kcJaz7ta1zlb5lEa77lCl3QqNSx+xHTy34yRm0fCLUkFRsly1RnVEud2cK1rQNdfb5 X-Received: by 10.112.170.167 with SMTP id an7mr5525365lbc.4.1414414690818; Mon, 27 Oct 2014 05:58:10 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.38 with SMTP id bd6ls193940lab.24.gmail; Mon, 27 Oct 2014 05:58:10 -0700 (PDT) X-Received: by 10.152.44.233 with SMTP id h9mr23389963lam.73.1414414690591; Mon, 27 Oct 2014 05:58:10 -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 lc1si8138802lab.14.2014.10.27.05.58.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Oct 2014 05:58:10 -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 ge10so1674296lab.2 for ; Mon, 27 Oct 2014 05:58:10 -0700 (PDT) X-Received: by 10.152.87.98 with SMTP id w2mr23191059laz.27.1414414690147; Mon, 27 Oct 2014 05:58:10 -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 c5csp283998lbz; Mon, 27 Oct 2014 05:58:09 -0700 (PDT) X-Received: by 10.195.13.14 with SMTP id eu14mr21784106wjd.31.1414414689566; Mon, 27 Oct 2014 05:58:09 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id jp8si13860622wjc.4.2014.10.27.05.58.08 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 27 Oct 2014 05:58:09 -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 1Xijs7-0003ig-UC; Mon, 27 Oct 2014 12:58:07 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Greg Bellows , Sergey Fedorov , "Edgar E. Iglesias" , Fabian Aggeler Subject: [PATCH 2/2] target-arm: Correct condition for taking VIRQ and VFIQ Date: Mon, 27 Oct 2014 12:58:07 +0000 Message-Id: <1414414687-14265-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1414414687-14265-1-git-send-email-peter.maydell@linaro.org> References: <1414414687-14265-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 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; }