All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Eric Farman <farman@linux.ibm.com>,
	Halil Pasic <pasic@linux.ibm.com>,
	Cornelia Huck <cohuck@redhat.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>
Cc: qemu-devel@nongnu.org, qemu-s390x@nongnu.org,
	Richard Henderson <richard.henderson@linaro.org>,
	Janosch Frank <frankja@linux.ibm.com>,
	David Hildenbrand <david@redhat.com>
Subject: Re: [RFC PATCH v1 1/2] s390x: sigp: Force Set Architecture to return Invalid Parameter
Date: Sat, 9 Oct 2021 07:40:23 +0200	[thread overview]
Message-ID: <6bb65a7b-6a03-e2cd-74a6-4fc2b759e5a1@redhat.com> (raw)
In-Reply-To: <20211008203811.1980478-2-farman@linux.ibm.com>

On 08/10/2021 22.38, Eric Farman wrote:
> According to the Principles of Operation, the SIGP Set Architecture
> order will return Incorrect State if some CPUs are not stopped, but
> only if the CZAM facility is not present. If it is, the order will
> return Invalid Parameter because the architecture mode cannot be
> changed.
> 
> Since CZAM always exists when S390_FEAT_ZARCH exists, which in turn
> exists for every defined CPU model, we can simplify this code.
> 
> Fixes: 075e52b81664 ("s390x/cpumodel: we are always in zarchitecture mode")
> Signed-off-by: Eric Farman <farman@linux.ibm.com>
> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
> Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
> ---
>   target/s390x/sigp.c | 18 +-----------------
>   1 file changed, 1 insertion(+), 17 deletions(-)
> 
> diff --git a/target/s390x/sigp.c b/target/s390x/sigp.c
> index d57427ced8..51c727834c 100644
> --- a/target/s390x/sigp.c
> +++ b/target/s390x/sigp.c
> @@ -428,26 +428,10 @@ static int handle_sigp_single_dst(S390CPU *cpu, S390CPU *dst_cpu, uint8_t order,
>   static int sigp_set_architecture(S390CPU *cpu, uint32_t param,
>                                    uint64_t *status_reg)
>   {
> -    CPUState *cur_cs;
> -    S390CPU *cur_cpu;
> -    bool all_stopped = true;
> -
> -    CPU_FOREACH(cur_cs) {
> -        cur_cpu = S390_CPU(cur_cs);
> -
> -        if (cur_cpu == cpu) {
> -            continue;
> -        }
> -        if (s390_cpu_get_state(cur_cpu) != S390_CPU_STATE_STOPPED) {
> -            all_stopped = false;
> -        }
> -    }
> -
>       *status_reg &= 0xffffffff00000000ULL;
>   
>       /* Reject set arch order, with czam we're always in z/Arch mode. */
> -    *status_reg |= (all_stopped ? SIGP_STAT_INVALID_PARAMETER :
> -                    SIGP_STAT_INCORRECT_STATE);
> +    *status_reg |= SIGP_STAT_INVALID_PARAMETER;
>       return SIGP_CC_STATUS_STORED;
>   }

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

By the way, I think we could now also get rid of SIGP_MODE_ESA_S390, 
SIGP_MODE_Z_ARCH_TRANS_ALL_PSW and SIGP_MODE_Z_ARCH_TRANS_CUR_PSW now (in a 
separate patch)...



  reply	other threads:[~2021-10-09  5:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-08 20:38 [RFC PATCH v1 0/2] Improvements to SIGP handling [QEMU] Eric Farman
2021-10-08 20:38 ` [RFC PATCH v1 1/2] s390x: sigp: Force Set Architecture to return Invalid Parameter Eric Farman
2021-10-09  5:40   ` Thomas Huth [this message]
2021-10-11  7:04   ` David Hildenbrand
2021-10-08 20:38 ` [RFC PATCH v1 2/2] s390x/kvm: Pass SIGP Stop flags Eric Farman
2021-10-11  7:09   ` David Hildenbrand
2021-10-11  8:40     ` Christian Borntraeger
2021-10-11  9:21       ` David Hildenbrand
2021-10-11 17:58         ` Eric Farman
2021-10-11 18:07           ` David Hildenbrand
2021-10-12  6:58 ` [RFC PATCH v1 0/2] Improvements to SIGP handling [QEMU] 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=6bb65a7b-6a03-e2cd-74a6-4fc2b759e5a1@redhat.com \
    --to=thuth@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=farman@linux.ibm.com \
    --cc=frankja@linux.ibm.com \
    --cc=pasic@linux.ibm.com \
    --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 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.