From: Nico Boehr <nrb@linux.ibm.com>
To: Thomas Huth <thuth@redhat.com>,
kvm@vger.kernel.org, linux-s390@vger.kernel.org
Cc: frankja@linux.ibm.com, imbrenda@linux.ibm.com
Subject: Re: [kvm-unit-tests PATCH v1 1/4] lib: s390x: add support for SCLP console read
Date: Wed, 13 Apr 2022 16:41:25 +0200 [thread overview]
Message-ID: <bc1f4b507234702e662a4fa19c6875d95d5591b1.camel@linux.ibm.com> (raw)
In-Reply-To: <3cac38d6-41f1-1c5e-1af1-c19f3f68aab2@redhat.com>
On Tue, 2022-04-12 at 10:02 +0200, Thomas Huth wrote:
> On 11/04/2022 12.07, Nico Boehr wrote:
> > Add a basic implementation for reading from the SCLP ACII console.
> > The goal of
>
> s/ACII/ASCII/
Thanks, fixed.
[...]
> > diff --git a/lib/s390x/sclp-console.c b/lib/s390x/sclp-console.c
> > index fa36a6a42381..8e22660bf25d 100644
[...]
> > +static int console_refill_read_buffer(void)
> > +{
> > + const int MAX_EVENT_BUFFER_LEN = SCCB_SIZE -
> > offsetof(ReadEventDataAsciiConsole, ebh);
> > + ReadEventDataAsciiConsole *sccb = (void *)_sccb;
> > + const int EVENT_BUFFER_ASCII_RECV_HEADER_LEN = sizeof(sccb-
> > >ebh) + sizeof(sccb->type);
> > + int ret = -1;
> > +
> > + sclp_console_enable_read();
> > +
> > + sclp_mark_busy();
> > + memset(sccb, 0, 4096);
> > + sccb->h.length = PAGE_SIZE;
> > + sccb->h.function_code = SCLP_UNCONDITIONAL_READ;
> > + sccb->h.control_mask[2] = 0x80;
>
> Add at least a comment about what the 0x80 means, please?
Oh yes, thanks. We already have a define for it which I will use
instead of the comment: SCLP_CM2_VARIABLE_LENGTH_RESPONSE
[...]
> > +
> > + read_buf_end = sccb->ebh.length -
> > EVENT_BUFFER_ASCII_RECV_HEADER_LEN;
> > +
> > + assert(read_buf_end <= sizeof(read_buf));
> > + memcpy(read_buf, sccb->data, read_buf_end);
> > +
> > + read_index = 0;
>
> Set "ret = 0" here?
Oooops, excellent catch. Thanks, fixed.
next prev parent reply other threads:[~2022-04-13 14:41 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-11 10:07 [kvm-unit-tests PATCH v1 0/4] s390x: add migration test suport Nico Boehr
2022-04-11 10:07 ` [kvm-unit-tests PATCH v1 1/4] lib: s390x: add support for SCLP console read Nico Boehr
2022-04-12 8:02 ` Thomas Huth
2022-04-13 14:41 ` Nico Boehr [this message]
2022-04-12 15:32 ` Janosch Frank
2022-04-13 15:00 ` Nico Boehr
2022-04-11 10:07 ` [kvm-unit-tests PATCH v1 2/4] s390x: add support for migration tests Nico Boehr
2022-04-11 12:58 ` Claudio Imbrenda
2022-04-12 8:05 ` Thomas Huth
2022-04-11 10:07 ` [kvm-unit-tests PATCH v1 3/4] s390x: don't run migration tests under PV Nico Boehr
2022-04-11 12:58 ` Claudio Imbrenda
2022-04-12 8:06 ` Thomas Huth
2022-04-11 10:07 ` [kvm-unit-tests PATCH v1 4/4] s390x: add selftest for migration Nico Boehr
2022-04-11 12:49 ` Claudio Imbrenda
2022-04-12 11:49 ` Nico Boehr
2022-04-13 8:42 ` Claudio Imbrenda
2022-04-11 15:30 ` Thomas Huth
2022-04-12 7:41 ` Nico Boehr
2022-04-12 7:49 ` Thomas Huth
2022-04-13 14:32 ` Nico Boehr
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=bc1f4b507234702e662a4fa19c6875d95d5591b1.camel@linux.ibm.com \
--to=nrb@linux.ibm.com \
--cc=frankja@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--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