From: Pierre Morel <pmorel@linux.ibm.com>
To: Claudio Imbrenda <imbrenda@linux.ibm.com>
Cc: linux-s390@vger.kernel.org, frankja@linux.ibm.com,
thuth@redhat.com, kvm@vger.kernel.org, david@redhat.com,
nrb@linux.ibm.com, nsg@linux.ibm.com, cohuck@redhat.com
Subject: Re: [kvm-unit-tests PATCH v4 2/2] s390x: sclp: Implement SCLP_RC_INSUFFICIENT_SCCB_LENGTH
Date: Thu, 1 Jun 2023 14:30:07 +0200 [thread overview]
Message-ID: <65a1e826-5aea-701e-cd9f-defe1d12b0a2@linux.ibm.com> (raw)
In-Reply-To: <20230530173544.378a63c6@p-imbrenda>
On 5/30/23 17:35, Claudio Imbrenda wrote:
> On Tue, 30 May 2023 14:52:43 +0200
> Pierre Morel <pmorel@linux.ibm.com> wrote:
>
>> If SCLP_CMDW_READ_SCP_INFO fails due to a short buffer, retry
>> with a greater buffer.
> the idea is good, but I wonder if the code can be simplified (see below)
>
>> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
>> ---
>> lib/s390x/sclp.c | 58 +++++++++++++++++++++++++++++++++++++++++-------
>> 1 file changed, 50 insertions(+), 8 deletions(-)
>>
>> diff --git a/lib/s390x/sclp.c b/lib/s390x/sclp.c
>> index 34a31da..9d51ca4 100644
>> --- a/lib/s390x/sclp.c
>> +++ b/lib/s390x/sclp.c
>> @@ -17,13 +17,14 @@
>> #include "sclp.h"
>> #include <alloc_phys.h>
>> #include <alloc_page.h>
>> +#include <asm/facility.h>
>>
>> extern unsigned long stacktop;
>>
>> static uint64_t storage_increment_size;
>> static uint64_t max_ram_size;
>> static uint64_t ram_size;
>> -char _read_info[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE)));
>> +char _read_info[2 * PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE)));
> this is ok ^
>
> [skip everything else]
>
>> void sclp_read_info(void)
>> {
>> - sclp_read_scp_info((void *)_read_info, SCCB_SIZE);
> sclp_read_scp_info((void *)_read_info,
> test_facility(140) ? sizeof(_read_info) : SCCB_SIZE;
>
>> + sclp_read_scp_info((void *)_read_info);
>> read_info = (ReadInfo *)_read_info;
>> }
>>
You are right, no need to begin with a short buffer if we can go with a
big one at first try.
I take it
thx
prev parent reply other threads:[~2023-06-01 12:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-30 12:52 [kvm-unit-tests PATCH v4 0/2] Fixing infinite loop on SCLP READ SCP INFO error Pierre Morel
2023-05-30 12:52 ` [kvm-unit-tests PATCH v4 1/2] s390x: sclp: consider monoprocessor on read_info error Pierre Morel
2023-05-31 6:20 ` Nico Boehr
2023-05-30 12:52 ` [kvm-unit-tests PATCH v4 2/2] s390x: sclp: Implement SCLP_RC_INSUFFICIENT_SCCB_LENGTH Pierre Morel
2023-05-30 15:35 ` Claudio Imbrenda
2023-06-01 12:30 ` Pierre Morel [this message]
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=65a1e826-5aea-701e-cd9f-defe1d12b0a2@linux.ibm.com \
--to=pmorel@linux.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=frankja@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=nrb@linux.ibm.com \
--cc=nsg@linux.ibm.com \
--cc=thuth@redhat.com \
/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