qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Sergey Fedorov <serge.fdrv@gmail.com>,
	Greg Bellows <greg.bellows@linaro.org>,
	qemu-devel@nongnu.org, Fabian Aggeler <aggelerf@ethz.ch>,
	patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH 2/2] target-arm: Correct condition for taking VIRQ and VFIQ
Date: Tue, 28 Oct 2014 09:25:41 +1000	[thread overview]
Message-ID: <20141027232541.GI16081@toto> (raw)
In-Reply-To: <1414414687-14265-3-git-send-email-peter.maydell@linaro.org>

On Mon, Oct 27, 2014 at 12:58:07PM +0000, Peter Maydell wrote:
> 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 '&&'.

Hi Peter,

Shouldn't this be:

if (secure || ....

?

Cheers,
Edgar

> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  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
> 

  reply	other threads:[~2014-10-27 23:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-27 12:58 [Qemu-devel] [PATCH 0/2] target-arm: fix some exception-masking issues Peter Maydell
2014-10-27 12:58 ` [Qemu-devel] [PATCH 1/2] target-arm: Separate out M profile cpu_exec_interrupt handling Peter Maydell
2014-10-28  0:12   ` Edgar E. Iglesias
2014-10-27 12:58 ` [Qemu-devel] [PATCH 2/2] target-arm: Correct condition for taking VIRQ and VFIQ Peter Maydell
2014-10-27 23:25   ` Edgar E. Iglesias [this message]
2014-10-27 23:37     ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141027232541.GI16081@toto \
    --to=edgar.iglesias@gmail.com \
    --cc=aggelerf@ethz.ch \
    --cc=greg.bellows@linaro.org \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=serge.fdrv@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).