All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: LIU Zhiwei <zhiwei_liu@c-sky.com>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, alex.bennee@linaro.org
Subject: Re: [PATCH 1/4] target/arm: Fixup special cross page case for sve continuous load/store
Date: Tue, 8 Dec 2020 14:13:59 -0600	[thread overview]
Message-ID: <db6fc9eb-0134-23d4-e0d9-55951e14c2c1@linaro.org> (raw)
In-Reply-To: <20201207044655.2312-2-zhiwei_liu@c-sky.com>

On 12/6/20 10:46 PM, LIU Zhiwei wrote:
> If the split element is also the first active element of the vector,
> mem_off_first[0] should equal to mem_off_split.
> 
> Signed-off-by: LIU Zhiwei <zhiwei_liu@c-sky.com>
> ---
>  target/arm/sve_helper.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c
> index 5f037c3a8f..91d1d24725 100644
> --- a/target/arm/sve_helper.c
> +++ b/target/arm/sve_helper.c
> @@ -4282,9 +4282,10 @@ static bool sve_cont_ldst_pages(SVEContLdSt *info, SVEContFault fault,
>           * to generate faults for the second page.  For no-fault,
>           * we have work only if the second page is valid.
>           */
> -        if (info->mem_off_first[0] < info->mem_off_split) {
> -            nofault = FAULT_FIRST;
> -            have_work = false;
> +        if (info->mem_off_first[0] == info->mem_off_split) {
> +            if (nofault) {
> +                have_work = false;
> +            }

There are two separate bugs here.  The first is as you describe, and applies
only to the first line.

The second is the assignment of an enumerator to a boolean, and the incorrect
unconditional clearing of have_work.  The change could more consisely be

-  nofault = FAULT_FIRST;
-  have_work = false;
+  /* For nofault, we only have work if the second page is valid. */
+  have_work = !nofault;

We can either split the two changes, or improve the patch comment.


r~


  reply	other threads:[~2020-12-08 21:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-07  4:46 [PATCH 0/4] target/arm bug fix LIU Zhiwei
2020-12-07  4:46 ` [PATCH 1/4] target/arm: Fixup special cross page case for sve continuous load/store LIU Zhiwei
2020-12-08 20:13   ` Richard Henderson [this message]
2020-12-07  4:46 ` [PATCH 2/4] target/arm: Fixup contiguous first-fault and no-fault loads LIU Zhiwei
2020-12-08 20:16   ` Richard Henderson
2020-12-10 11:54     ` LIU Zhiwei
2020-12-07  4:46 ` [PATCH 3/4] target/arm: Fixup SIMD fcmla(by element) in 4H arrangement LIU Zhiwei
2020-12-08 21:04   ` Richard Henderson
2020-12-07  4:46 ` [PATCH 4/4] target/arm: adjust CPTR_EL2 according to HCR_EL2.E2H LIU Zhiwei
2020-12-08 20:58   ` Richard Henderson

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=db6fc9eb-0134-23d4-e0d9-55951e14c2c1@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=zhiwei_liu@c-sky.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.