diff mbox series

s390/sclp: improve special wait psw logic

Message ID 1582204582-22995-1-git-send-email-borntraeger@de.ibm.com
State New
Headers show
Series s390/sclp: improve special wait psw logic | expand

Commit Message

Christian Borntraeger Feb. 20, 2020, 1:16 p.m. UTC
There is a special quiesce PSW that we check for "shutdown". Otherwise disabled
wait is detected as "crashed". Architecturally we must only check PSW bits
116-127. Fix this.

Cc: qemu-stable@nongnu.org
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 target/s390x/helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Hildenbrand Feb. 20, 2020, 1:26 p.m. UTC | #1
On 20.02.20 14:16, Christian Borntraeger wrote:
> There is a special quiesce PSW that we check for "shutdown". Otherwise disabled
> wait is detected as "crashed". Architecturally we must only check PSW bits
> 116-127. Fix this.
> 
> Cc: qemu-stable@nongnu.org

Is this really stable material?

Reviewed-by: David Hildenbrand <david@redhat.com>
Christian Borntraeger Feb. 20, 2020, 1:35 p.m. UTC | #2
On 20.02.20 14:26, David Hildenbrand wrote:
> On 20.02.20 14:16, Christian Borntraeger wrote:
>> There is a special quiesce PSW that we check for "shutdown". Otherwise disabled
>> wait is detected as "crashed". Architecturally we must only check PSW bits
>> 116-127. Fix this.
>>
>> Cc: qemu-stable@nongnu.org
> 
> Is this really stable material?

Guests that end with lets say 0xaafffUL would be considered "crashed" instead of "shutdown".
I will let Conny decide. 
> 
> Reviewed-by: David Hildenbrand <david@redhat.com>
>
Janosch Frank Feb. 20, 2020, 1:47 p.m. UTC | #3
On 2/20/20 2:16 PM, Christian Borntraeger wrote:
> There is a special quiesce PSW that we check for "shutdown". Otherwise disabled
> wait is detected as "crashed". Architecturally we must only check PSW bits
> 116-127. Fix this.
> 
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>

Acked-by: Janosch Frank <frankja@linux.ibm.com>

> ---
>  target/s390x/helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/s390x/helper.c b/target/s390x/helper.c
> index a3a4916..6808dfd 100644
> --- a/target/s390x/helper.c
> +++ b/target/s390x/helper.c
> @@ -89,7 +89,7 @@ hwaddr s390_cpu_get_phys_addr_debug(CPUState *cs, vaddr vaddr)
>  static inline bool is_special_wait_psw(uint64_t psw_addr)
>  {
>      /* signal quiesce */
> -    return psw_addr == 0xfffUL;
> +    return (psw_addr & 0xfffUL) == 0xfffUL;
>  }
>  
>  void s390_handle_wait(S390CPU *cpu)
>
Cornelia Huck Feb. 20, 2020, 4:27 p.m. UTC | #4
On Thu, 20 Feb 2020 14:35:01 +0100
Christian Borntraeger <borntraeger@de.ibm.com> wrote:

> On 20.02.20 14:26, David Hildenbrand wrote:
> > On 20.02.20 14:16, Christian Borntraeger wrote:  
> >> There is a special quiesce PSW that we check for "shutdown". Otherwise disabled
> >> wait is detected as "crashed". Architecturally we must only check PSW bits
> >> 116-127. Fix this.
> >>
> >> Cc: qemu-stable@nongnu.org  
> > 
> > Is this really stable material?  
> 
> Guests that end with lets say 0xaafffUL would be considered "crashed" instead of "shutdown".
> I will let Conny decide. 

It cannot really hurt; but would be interesting if you have seen that
in the wild.

> > 
> > Reviewed-by: David Hildenbrand <david@redhat.com>
> >   
>
Cornelia Huck Feb. 20, 2020, 5 p.m. UTC | #5
On Thu, 20 Feb 2020 14:16:22 +0100
Christian Borntraeger <borntraeger@de.ibm.com> wrote:

> There is a special quiesce PSW that we check for "shutdown". Otherwise disabled
> wait is detected as "crashed". Architecturally we must only check PSW bits
> 116-127. Fix this.
> 
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
>  target/s390x/helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, applied.
diff mbox series

Patch

diff --git a/target/s390x/helper.c b/target/s390x/helper.c
index a3a4916..6808dfd 100644
--- a/target/s390x/helper.c
+++ b/target/s390x/helper.c
@@ -89,7 +89,7 @@  hwaddr s390_cpu_get_phys_addr_debug(CPUState *cs, vaddr vaddr)
 static inline bool is_special_wait_psw(uint64_t psw_addr)
 {
     /* signal quiesce */
-    return psw_addr == 0xfffUL;
+    return (psw_addr & 0xfffUL) == 0xfffUL;
 }
 
 void s390_handle_wait(S390CPU *cpu)