qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: Richard Henderson <richard.henderson@linaro.org>,
	qemu-s390x@nongnu.org, Ilya Leoshkevich <iii@linux.ibm.com>,
	David Hildenbrand <david@redhat.com>
Subject: Re: [PATCH v2 1/2] target/s390x/mmu_helper: Simplify s390_cpu_virt_mem_rw() logic
Date: Thu, 16 Oct 2025 11:34:32 +0200	[thread overview]
Message-ID: <4fd19e9b-2a91-4a55-880e-ddd9826fbf29@redhat.com> (raw)
In-Reply-To: <20251008141410.99865-2-philmd@linaro.org>

On 08/10/2025 16.14, Philippe Mathieu-Daudé wrote:
> In order to simplify the next commit, move the
> trigger_access_exception() call after the address_space_rw()
> calls. No logical change intended.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/s390x/mmu_helper.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c
> index 487c41bf933..22d3d4a97df 100644
> --- a/target/s390x/mmu_helper.c
> +++ b/target/s390x/mmu_helper.c
> @@ -541,9 +541,7 @@ int s390_cpu_virt_mem_rw(S390CPU *cpu, vaddr laddr, uint8_t ar, void *hostbuf,
>       pages = g_malloc(nr_pages * sizeof(*pages));
>   
>       ret = translate_pages(cpu, laddr, nr_pages, pages, is_write, &tec);
> -    if (ret) {
> -        trigger_access_exception(&cpu->env, ret, tec);
> -    } else if (hostbuf != NULL) {
> +    if (ret == 0 && hostbuf != NULL) {
>           AddressSpace *as = CPU(cpu)->as;
>   
>           /* Copy data by stepping through the area page by page */
> @@ -556,6 +554,9 @@ int s390_cpu_virt_mem_rw(S390CPU *cpu, vaddr laddr, uint8_t ar, void *hostbuf,
>               len -= currlen;
>           }
>       }
> +    if (ret) {
> +        trigger_access_exception(&cpu->env, ret, tec);
> +    }
>   
>       g_free(pages);
>       return ret;

Reviewed-by: Thomas Huth <thuth@redhat.com>



  reply	other threads:[~2025-10-16  9:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-08 14:14 [PATCH v2 0/2] target/s390x/mmu_helper: Do not ignore address_space_rw() errors Philippe Mathieu-Daudé
2025-10-08 14:14 ` [PATCH v2 1/2] target/s390x/mmu_helper: Simplify s390_cpu_virt_mem_rw() logic Philippe Mathieu-Daudé
2025-10-16  9:34   ` Thomas Huth [this message]
2025-10-08 14:14 ` [PATCH v2 2/2] target/s390x/mmu_helper: Do not ignore address_space_rw() errors Philippe Mathieu-Daudé
2025-10-16  9:36   ` Thomas Huth

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=4fd19e9b-2a91-4a55-880e-ddd9826fbf29@redhat.com \
    --to=thuth@redhat.com \
    --cc=david@redhat.com \
    --cc=iii@linux.ibm.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@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).