Re: [kvm-unit-tests PATCH 1/1] s390x: sclp: consider monoprocessor on read_info error

Claudio Imbrenda
2023-04-25T12:16:57Z

On Tue, 25 Apr 2023 13:45:13 +0200
Pierre Morel <pmorel@linux.ibm.com> wrote:

> On 4/25/23 13:33, Janosch Frank wrote:
> > On 4/25/23 12:53, Pierre Morel wrote:
> >>
> >> On 4/25/23 10:26, Claudio Imbrenda wrote:
> >>> On Mon, 24 Apr 2023 19:42:18 +0200
> >>> Pierre Morel <pmorel@linux.ibm.com> wrote:
> >>>
> >
> > How is this considered to be a fix and not a workaround?
> >
> >
> > Set the variable response bit in the control mask and vary the length
> > based on stfle 140. See __init sclp_early_read_info() in
> > drivers/s390/char/sclp_early_core.c

I agree that the SCLP needs to be fixed

>
>
> Yes it is something to do anyway.
>
> Still in case of error we will need this fix or workaround.

and I agree that we need this fix anyway

therefore the comment should be more generic and just mention the fact
that the test would hang if an abort happens before SCLP Read SCP
Information has completed.

>
>
> >
> >
> >>>
> >>>> Fixes: 52076a63d569 ("s390x: Consolidate sclp read info")
> >>>> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
> >>>> ---
> >>>>    lib/s390x/sclp.c | 5 +++--
> >>>>    1 file changed, 3 insertions(+), 2 deletions(-)
> >>>>
> >>>> diff --git a/lib/s390x/sclp.c b/lib/s390x/sclp.c
> >>>> index acdc8a9..c09360d 100644
> >>>> --- a/lib/s390x/sclp.c
> >>>> +++ b/lib/s390x/sclp.c
> >>>> @@ -119,8 +119,9 @@ void sclp_read_info(void)
> >>>>       int sclp_get_cpu_num(void)
> >>>>    {
> >>>> -    assert(read_info);
> >>>> -    return read_info->entries_cpu;
> >>>> +    if (read_info)
> >>>> +        return read_info->entries_cpu;
> >>>> +    return 1;
> >>>>    }
> >>>>       CPUEntry *sclp_get_cpu_entries(void)
> >