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: David Hildenbrand <david@redhat.com>,
	qemu-s390x@nongnu.org,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Ilya Leoshkevich <iii@linux.ibm.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Eric Farman <farman@linux.ibm.com>,
	Matthew Rosato <mjrosato@linux.ibm.com>,
	Halil Pasic <pasic@linux.ibm.com>
Subject: Re: [PATCH 2/9] target/s390x: Factor diag_iplb_read() out
Date: Mon, 6 Oct 2025 15:57:13 +0200	[thread overview]
Message-ID: <aed7caad-b980-4040-a8af-e508df8e27be@redhat.com> (raw)
In-Reply-To: <20251002091132.65703-3-philmd@linaro.org>

On 02/10/2025 11.11, Philippe Mathieu-Daudé wrote:

This patch is also missing a proper reasoning in the patch description.

  Thomas


> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   target/s390x/diag.c | 31 +++++++++++++++++++------------
>   1 file changed, 19 insertions(+), 12 deletions(-)
> 
> diff --git a/target/s390x/diag.c b/target/s390x/diag.c
> index ed320fc0c1f..c2fedc55213 100644
> --- a/target/s390x/diag.c
> +++ b/target/s390x/diag.c
> @@ -73,6 +73,24 @@ static int diag308_parm_check(CPUS390XState *env, uint64_t r1, uint64_t addr,
>       return 0;
>   }
>   
> +static bool diag_iplb_read(IplParameterBlock *iplb, S390CPU *cpu, uint64_t addr)
> +{
> +    if (s390_is_pv()) {
> +        s390_cpu_pv_mem_read(cpu, 0, iplb, sizeof(iplb->len));
> +        if (!iplb_valid_len(iplb)) {
> +            return false;
> +        }
> +        s390_cpu_pv_mem_read(cpu, 0, iplb, be32_to_cpu(iplb->len));
> +    } else {
> +        cpu_physical_memory_read(addr, iplb, sizeof(iplb->len));
> +        if (!iplb_valid_len(iplb)) {
> +            return false;
> +        }
> +        cpu_physical_memory_read(addr, iplb, be32_to_cpu(iplb->len));
> +    }
> +    return true;
> +}
> +
>   static void diag_iplb_write(IplParameterBlock *iplb, S390CPU *cpu, uint64_t addr)
>   {
>       const size_t iplb_len = be32_to_cpu(iplb->len);
> @@ -125,23 +143,12 @@ void handle_diag_308(CPUS390XState *env, uint64_t r1, uint64_t r3, uintptr_t ra)
>               return;
>           }
>           iplb = g_new0(IplParameterBlock, 1);
> -        if (!s390_is_pv()) {
> -            cpu_physical_memory_read(addr, iplb, sizeof(iplb->len));
> -        } else {
> -            s390_cpu_pv_mem_read(cpu, 0, iplb, sizeof(iplb->len));
> -        }
>   
> -        if (!iplb_valid_len(iplb)) {
> +        if (!diag_iplb_read(iplb, cpu, addr)) {
>               env->regs[r1 + 1] = DIAG_308_RC_INVALID;
>               goto out;
>           }
>   
> -        if (!s390_is_pv()) {
> -            cpu_physical_memory_read(addr, iplb, be32_to_cpu(iplb->len));
> -        } else {
> -            s390_cpu_pv_mem_read(cpu, 0, iplb, be32_to_cpu(iplb->len));
> -        }
> -
>           valid = subcode == DIAG308_PV_SET ? iplb_valid_pv(iplb) : iplb_valid(iplb);
>           if (!valid) {
>               if (subcode == DIAG308_SET && iplb->pbt == S390_IPL_TYPE_QEMU_SCSI) {



  reply	other threads:[~2025-10-06 13:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-02  9:11 [PATCH 0/9] target/s390x: Remove legacy cpu_physical_memory_*() calls Philippe Mathieu-Daudé
2025-10-02  9:11 ` [PATCH 1/9] target/s390x: Factor diag_iplb_write() out Philippe Mathieu-Daudé
2025-10-06 13:55   ` Thomas Huth
2025-10-02  9:11 ` [PATCH 2/9] target/s390x: Factor diag_iplb_read() out Philippe Mathieu-Daudé
2025-10-06 13:57   ` Thomas Huth [this message]
2025-10-02  9:11 ` [PATCH 3/9] target/s390x: Replace legacy cpu_physical_memory_read/write() calls Philippe Mathieu-Daudé
2025-10-06 14:04   ` Thomas Huth
2025-10-06 14:44     ` Philippe Mathieu-Daudé
2025-10-02  9:11 ` [PATCH 4/9] target/s390x: Replace legacy cpu_physical_memory_[un]map() calls (1/3) Philippe Mathieu-Daudé
2025-10-02  9:11 ` [PATCH 5/9] target/s390x: Propagate CPUS390XState to cpu_unmap_lowcore() Philippe Mathieu-Daudé
2025-10-06 14:08   ` Thomas Huth
2025-10-02  9:11 ` [PATCH 6/9] target/s390x: Replace legacy cpu_physical_memory_[un]map() calls (2/3) Philippe Mathieu-Daudé
2025-10-06 14:09   ` Thomas Huth
2025-10-02  9:11 ` [PATCH 7/9] target/s390x: Reduce s390_store_adtl_status() scope Philippe Mathieu-Daudé
2025-10-06 14:11   ` Thomas Huth
2025-10-02  9:11 ` [PATCH 8/9] target/s390x: Reduce s390_store_status() scope Philippe Mathieu-Daudé
2025-10-06 14:16   ` Thomas Huth
2025-10-02  9:11 ` [PATCH 9/9] target/s390x: Replace legacy cpu_physical_memory_[un]map() calls (3/3) Philippe Mathieu-Daudé

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=aed7caad-b980-4040-a8af-e508df8e27be@redhat.com \
    --to=thuth@redhat.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=farman@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=pasic@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).