qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] pc-bios/s390-ccw: fix sclp_get_loadparm_ascii
@ 2019-11-28 12:33 Claudio Imbrenda
  2019-11-28 12:35 ` Christian Borntraeger
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Claudio Imbrenda @ 2019-11-28 12:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: thuth, frankja, david, cohuck, borntraeger, qemu-s390x

The existing s390 bios gets the LOADPARM information from the system using
an SCLP call that specifies a buffer length too small to contain all the
output.

The recent fixes in the SCLP code have exposed this bug, since now the
SCLP call will return an error (as per architecture) instead of
writing partially and completing successfully.

The solution is simply to specify the full page length as the SCCB
length instead of a smaller size.

Fixes: 832be0d8a3bb ("s390x: sclp: Report insufficient SCCB length")
Fixes: 9a22473c70f3 ("pc-bios/s390-ccw: get LOADPARM stored in SCP Read Info")

Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
---
 pc-bios/s390-ccw/sclp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pc-bios/s390-ccw/sclp.c b/pc-bios/s390-ccw/sclp.c
index c0223fa..7251f9a 100644
--- a/pc-bios/s390-ccw/sclp.c
+++ b/pc-bios/s390-ccw/sclp.c
@@ -112,7 +112,7 @@ void sclp_get_loadparm_ascii(char *loadparm)
     ReadInfo *sccb = (void *)_sccb;
 
     memset((char *)_sccb, 0, sizeof(ReadInfo));
-    sccb->h.length = sizeof(ReadInfo);
+    sccb->h.length = SCCB_SIZE;
     if (!sclp_service_call(SCLP_CMDW_READ_SCP_INFO, sccb)) {
         ebcdic_to_ascii((char *) sccb->loadparm, loadparm, LOADPARM_LEN);
     }
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-11-29  8:49 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-28 12:33 [PATCH v1 1/1] pc-bios/s390-ccw: fix sclp_get_loadparm_ascii Claudio Imbrenda
2019-11-28 12:35 ` Christian Borntraeger
2019-11-28 12:45   ` Cornelia Huck
2019-11-28 12:48     ` Christian Borntraeger
2019-11-28 15:05       ` Peter Maydell
2019-11-29  7:38         ` Christian Borntraeger
2019-11-29  8:10           ` Thomas Huth
2019-11-28 13:11   ` Thomas Huth
2019-11-28 13:16     ` Cornelia Huck
2019-11-28 14:45       ` Christian Borntraeger
2019-11-28 12:37 ` Janosch Frank
2019-11-28 12:44 ` Marc Hartmayer
2019-11-28 12:44 ` Claudio Imbrenda
2019-11-28 13:32 ` Cornelia Huck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).