qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clegoate@redhat.com>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	richard.henderson@linaro.org, hsp.cat7@gmail.com,
	qemu-devel@nongnu.org
Subject: Re: [PATCH 1/2] accel/tcg: fix start page passed to tb_invalidate_phys_page_range__locked()
Date: Thu, 29 Jun 2023 11:08:24 +0200	[thread overview]
Message-ID: <e0897f0c-f1a2-9e11-09a6-06f0c076985e@redhat.com> (raw)
In-Reply-To: <20230629082522.606219-2-mark.cave-ayland@ilande.co.uk>

On 6/29/23 10:25, Mark Cave-Ayland wrote:
> Due to a copy-paste error in tb_invalidate_phys_range() the start address of the
> invalidation range was being passed to tb_invalidate_phys_page_range__locked()
> instead of the start address of the current page.
> 
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> Fixes: e506ad6a05 ("accel/tcg: Pass last not end to tb_invalidate_phys_range")


Cc: qemu-stable@nongnu.org

> ---
>   accel/tcg/tb-maint.c | 10 ++++++----
>   1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c
> index 3541419845..33ea1aadd1 100644
> --- a/accel/tcg/tb-maint.c
> +++ b/accel/tcg/tb-maint.c
> @@ -1182,15 +1182,17 @@ void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t last)
>       index_last = last >> TARGET_PAGE_BITS;
>       for (index = start >> TARGET_PAGE_BITS; index <= index_last; index++) {
>           PageDesc *pd = page_find(index);
> -        tb_page_addr_t bound;
> +        tb_page_addr_t page_start, page_last;
>   
>           if (pd == NULL) {
>               continue;
>           }
>           assert_page_locked(pd);
> -        bound = (index << TARGET_PAGE_BITS) | ~TARGET_PAGE_MASK;
> -        bound = MIN(bound, last);
> -        tb_invalidate_phys_page_range__locked(pages, pd, start, bound, 0);
> +        page_start = index << TARGET_PAGE_BITS;
> +        page_last = page_start | ~TARGET_PAGE_MASK;
> +        page_last = MIN(page_last, last);
> +        tb_invalidate_phys_page_range__locked(pages, pd,
> +                                              page_start, page_last, 0);
>       }
>       page_collection_unlock(pages);
>   }



  reply	other threads:[~2023-06-29  9:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-29  8:25 [PATCH 0/2] accel/tcg: fix page invalidation in tb_invalidate_phys_range() Mark Cave-Ayland
2023-06-29  8:25 ` [PATCH 1/2] accel/tcg: fix start page passed to tb_invalidate_phys_page_range__locked() Mark Cave-Ayland
2023-06-29  9:08   ` Cédric Le Goater [this message]
2023-06-29  8:25 ` [PATCH 2/2] accel/tcg: add assert() check in tb_invalidate_phys_page_range__locked() Mark Cave-Ayland
2023-06-29  9:08   ` Philippe Mathieu-Daudé
2023-06-30  8:05   ` Michael Tokarev
2023-06-30 11:25     ` BALATON Zoltan
2023-06-30 13:34 ` [PATCH 0/2] accel/tcg: fix page invalidation in tb_invalidate_phys_range() 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=e0897f0c-f1a2-9e11-09a6-06f0c076985e@redhat.com \
    --to=clegoate@redhat.com \
    --cc=hsp.cat7@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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).