* [Qemu-devel] [PATCH] pc-bios/s390-ccw: define loadparm length
@ 2018-05-29 4:40 Collin Walling
2018-05-29 7:19 ` Laszlo Ersek
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Collin Walling @ 2018-05-29 4:40 UTC (permalink / raw)
To: qemu-devel, qemu-s390x, cohuck, lersek
Loadparm is defined by the s390 architecture to be 8 bytes
in length. Let's define this size in the s390-ccw bios.
Suggested-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Collin Walling <walling@linux.ibm.com>
---
pc-bios/s390-ccw/iplb.h | 4 +++-
pc-bios/s390-ccw/main.c | 8 ++++----
pc-bios/s390-ccw/sclp.c | 2 +-
pc-bios/s390-ccw/sclp.h | 2 +-
4 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/pc-bios/s390-ccw/iplb.h b/pc-bios/s390-ccw/iplb.h
index ded20c8..772d5c5 100644
--- a/pc-bios/s390-ccw/iplb.h
+++ b/pc-bios/s390-ccw/iplb.h
@@ -12,6 +12,8 @@
#ifndef IPLB_H
#define IPLB_H
+#define LOADPARM_LEN 8
+
struct IplBlockCcw {
uint8_t reserved0[85];
uint8_t ssid;
@@ -61,7 +63,7 @@ struct IplParameterBlock {
uint8_t pbt;
uint8_t flags;
uint16_t reserved01;
- uint8_t loadparm[8];
+ uint8_t loadparm[LOADPARM_LEN];
union {
IplBlockCcw ccw;
IplBlockFcp fcp;
diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
index 26f9adf..544851d 100644
--- a/pc-bios/s390-ccw/main.c
+++ b/pc-bios/s390-ccw/main.c
@@ -15,7 +15,7 @@
char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE)));
static SubChannelId blk_schid = { .one = 1 };
IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));
-static char loadparm_str[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+static char loadparm_str[LOADPARM_LEN + 1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
QemuIplParameters qipl;
#define LOADPARM_PROMPT "PROMPT "
@@ -80,13 +80,13 @@ static bool find_dev(Schib *schib, int dev_no)
static void menu_setup(void)
{
- if (memcmp(loadparm_str, LOADPARM_PROMPT, 8) == 0) {
+ if (memcmp(loadparm_str, LOADPARM_PROMPT, LOADPARM_LEN) == 0) {
menu_set_parms(QIPL_FLAG_BM_OPTS_CMD, 0);
return;
}
/* If loadparm was set to any other value, then do not enable menu */
- if (memcmp(loadparm_str, LOADPARM_EMPTY, 8) != 0) {
+ if (memcmp(loadparm_str, LOADPARM_EMPTY, LOADPARM_LEN) != 0) {
return;
}
@@ -117,7 +117,7 @@ static void virtio_setup(void)
enable_mss_facility();
sclp_get_loadparm_ascii(loadparm_str);
- memcpy(ldp + 10, loadparm_str, 8);
+ memcpy(ldp + 10, loadparm_str, LOADPARM_LEN);
sclp_print(ldp);
memcpy(&qipl, early_qipl, sizeof(QemuIplParameters));
diff --git a/pc-bios/s390-ccw/sclp.c b/pc-bios/s390-ccw/sclp.c
index 3836cb4..c0223fa 100644
--- a/pc-bios/s390-ccw/sclp.c
+++ b/pc-bios/s390-ccw/sclp.c
@@ -114,7 +114,7 @@ void sclp_get_loadparm_ascii(char *loadparm)
memset((char *)_sccb, 0, sizeof(ReadInfo));
sccb->h.length = sizeof(ReadInfo);
if (!sclp_service_call(SCLP_CMDW_READ_SCP_INFO, sccb)) {
- ebcdic_to_ascii((char *) sccb->loadparm, loadparm, 8);
+ ebcdic_to_ascii((char *) sccb->loadparm, loadparm, LOADPARM_LEN);
}
}
diff --git a/pc-bios/s390-ccw/sclp.h b/pc-bios/s390-ccw/sclp.h
index 0dd987f..8450161 100644
--- a/pc-bios/s390-ccw/sclp.h
+++ b/pc-bios/s390-ccw/sclp.h
@@ -56,7 +56,7 @@ typedef struct ReadInfo {
uint16_t rnmax;
uint8_t rnsize;
uint8_t reserved[13];
- uint8_t loadparm[8];
+ uint8_t loadparm[LOADPARM_LEN];
} __attribute__((packed)) ReadInfo;
typedef struct SCCB {
--
2.7.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] pc-bios/s390-ccw: define loadparm length
2018-05-29 4:40 [Qemu-devel] [PATCH] pc-bios/s390-ccw: define loadparm length Collin Walling
@ 2018-05-29 7:19 ` Laszlo Ersek
2018-05-29 7:20 ` [Qemu-devel] [qemu-s390x] " Thomas Huth
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Laszlo Ersek @ 2018-05-29 7:19 UTC (permalink / raw)
To: Collin Walling, qemu-devel, qemu-s390x, cohuck
On 05/29/18 06:40, Collin Walling wrote:
> Loadparm is defined by the s390 architecture to be 8 bytes
> in length. Let's define this size in the s390-ccw bios.
>
> Suggested-by: Laszlo Ersek <lersek@redhat.com>
> Signed-off-by: Collin Walling <walling@linux.ibm.com>
> ---
> pc-bios/s390-ccw/iplb.h | 4 +++-
> pc-bios/s390-ccw/main.c | 8 ++++----
> pc-bios/s390-ccw/sclp.c | 2 +-
> pc-bios/s390-ccw/sclp.h | 2 +-
> 4 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/pc-bios/s390-ccw/iplb.h b/pc-bios/s390-ccw/iplb.h
> index ded20c8..772d5c5 100644
> --- a/pc-bios/s390-ccw/iplb.h
> +++ b/pc-bios/s390-ccw/iplb.h
> @@ -12,6 +12,8 @@
> #ifndef IPLB_H
> #define IPLB_H
>
> +#define LOADPARM_LEN 8
> +
> struct IplBlockCcw {
> uint8_t reserved0[85];
> uint8_t ssid;
> @@ -61,7 +63,7 @@ struct IplParameterBlock {
> uint8_t pbt;
> uint8_t flags;
> uint16_t reserved01;
> - uint8_t loadparm[8];
> + uint8_t loadparm[LOADPARM_LEN];
> union {
> IplBlockCcw ccw;
> IplBlockFcp fcp;
> diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
> index 26f9adf..544851d 100644
> --- a/pc-bios/s390-ccw/main.c
> +++ b/pc-bios/s390-ccw/main.c
> @@ -15,7 +15,7 @@
> char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE)));
> static SubChannelId blk_schid = { .one = 1 };
> IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));
> -static char loadparm_str[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
> +static char loadparm_str[LOADPARM_LEN + 1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
> QemuIplParameters qipl;
>
> #define LOADPARM_PROMPT "PROMPT "
> @@ -80,13 +80,13 @@ static bool find_dev(Schib *schib, int dev_no)
>
> static void menu_setup(void)
> {
> - if (memcmp(loadparm_str, LOADPARM_PROMPT, 8) == 0) {
> + if (memcmp(loadparm_str, LOADPARM_PROMPT, LOADPARM_LEN) == 0) {
> menu_set_parms(QIPL_FLAG_BM_OPTS_CMD, 0);
> return;
> }
>
> /* If loadparm was set to any other value, then do not enable menu */
> - if (memcmp(loadparm_str, LOADPARM_EMPTY, 8) != 0) {
> + if (memcmp(loadparm_str, LOADPARM_EMPTY, LOADPARM_LEN) != 0) {
> return;
> }
>
> @@ -117,7 +117,7 @@ static void virtio_setup(void)
> enable_mss_facility();
>
> sclp_get_loadparm_ascii(loadparm_str);
> - memcpy(ldp + 10, loadparm_str, 8);
> + memcpy(ldp + 10, loadparm_str, LOADPARM_LEN);
> sclp_print(ldp);
>
> memcpy(&qipl, early_qipl, sizeof(QemuIplParameters));
> diff --git a/pc-bios/s390-ccw/sclp.c b/pc-bios/s390-ccw/sclp.c
> index 3836cb4..c0223fa 100644
> --- a/pc-bios/s390-ccw/sclp.c
> +++ b/pc-bios/s390-ccw/sclp.c
> @@ -114,7 +114,7 @@ void sclp_get_loadparm_ascii(char *loadparm)
> memset((char *)_sccb, 0, sizeof(ReadInfo));
> sccb->h.length = sizeof(ReadInfo);
> if (!sclp_service_call(SCLP_CMDW_READ_SCP_INFO, sccb)) {
> - ebcdic_to_ascii((char *) sccb->loadparm, loadparm, 8);
> + ebcdic_to_ascii((char *) sccb->loadparm, loadparm, LOADPARM_LEN);
> }
> }
>
> diff --git a/pc-bios/s390-ccw/sclp.h b/pc-bios/s390-ccw/sclp.h
> index 0dd987f..8450161 100644
> --- a/pc-bios/s390-ccw/sclp.h
> +++ b/pc-bios/s390-ccw/sclp.h
> @@ -56,7 +56,7 @@ typedef struct ReadInfo {
> uint16_t rnmax;
> uint8_t rnsize;
> uint8_t reserved[13];
> - uint8_t loadparm[8];
> + uint8_t loadparm[LOADPARM_LEN];
> } __attribute__((packed)) ReadInfo;
>
> typedef struct SCCB {
>
I didn't look for more possible occurrences, but the above look correct
to me.
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Thanks
Laszlo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [qemu-s390x] [PATCH] pc-bios/s390-ccw: define loadparm length
2018-05-29 4:40 [Qemu-devel] [PATCH] pc-bios/s390-ccw: define loadparm length Collin Walling
2018-05-29 7:19 ` Laszlo Ersek
@ 2018-05-29 7:20 ` Thomas Huth
2018-05-30 7:47 ` [Qemu-devel] " Cornelia Huck
2018-05-30 17:31 ` Farhan Ali
3 siblings, 0 replies; 6+ messages in thread
From: Thomas Huth @ 2018-05-29 7:20 UTC (permalink / raw)
To: Collin Walling, qemu-devel, qemu-s390x, cohuck, lersek
On 29.05.2018 06:40, Collin Walling wrote:
> Loadparm is defined by the s390 architecture to be 8 bytes
> in length. Let's define this size in the s390-ccw bios.
>
> Suggested-by: Laszlo Ersek <lersek@redhat.com>
> Signed-off-by: Collin Walling <walling@linux.ibm.com>
> ---
> pc-bios/s390-ccw/iplb.h | 4 +++-
> pc-bios/s390-ccw/main.c | 8 ++++----
> pc-bios/s390-ccw/sclp.c | 2 +-
> pc-bios/s390-ccw/sclp.h | 2 +-
> 4 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/pc-bios/s390-ccw/iplb.h b/pc-bios/s390-ccw/iplb.h
> index ded20c8..772d5c5 100644
> --- a/pc-bios/s390-ccw/iplb.h
> +++ b/pc-bios/s390-ccw/iplb.h
> @@ -12,6 +12,8 @@
> #ifndef IPLB_H
> #define IPLB_H
>
> +#define LOADPARM_LEN 8
> +
> struct IplBlockCcw {
> uint8_t reserved0[85];
> uint8_t ssid;
> @@ -61,7 +63,7 @@ struct IplParameterBlock {
> uint8_t pbt;
> uint8_t flags;
> uint16_t reserved01;
> - uint8_t loadparm[8];
> + uint8_t loadparm[LOADPARM_LEN];
> union {
> IplBlockCcw ccw;
> IplBlockFcp fcp;
> diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
> index 26f9adf..544851d 100644
> --- a/pc-bios/s390-ccw/main.c
> +++ b/pc-bios/s390-ccw/main.c
> @@ -15,7 +15,7 @@
> char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE)));
> static SubChannelId blk_schid = { .one = 1 };
> IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));
> -static char loadparm_str[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
> +static char loadparm_str[LOADPARM_LEN + 1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
> QemuIplParameters qipl;
>
> #define LOADPARM_PROMPT "PROMPT "
> @@ -80,13 +80,13 @@ static bool find_dev(Schib *schib, int dev_no)
>
> static void menu_setup(void)
> {
> - if (memcmp(loadparm_str, LOADPARM_PROMPT, 8) == 0) {
> + if (memcmp(loadparm_str, LOADPARM_PROMPT, LOADPARM_LEN) == 0) {
> menu_set_parms(QIPL_FLAG_BM_OPTS_CMD, 0);
> return;
> }
>
> /* If loadparm was set to any other value, then do not enable menu */
> - if (memcmp(loadparm_str, LOADPARM_EMPTY, 8) != 0) {
> + if (memcmp(loadparm_str, LOADPARM_EMPTY, LOADPARM_LEN) != 0) {
> return;
> }
>
> @@ -117,7 +117,7 @@ static void virtio_setup(void)
> enable_mss_facility();
>
> sclp_get_loadparm_ascii(loadparm_str);
> - memcpy(ldp + 10, loadparm_str, 8);
> + memcpy(ldp + 10, loadparm_str, LOADPARM_LEN);
> sclp_print(ldp);
>
> memcpy(&qipl, early_qipl, sizeof(QemuIplParameters));
> diff --git a/pc-bios/s390-ccw/sclp.c b/pc-bios/s390-ccw/sclp.c
> index 3836cb4..c0223fa 100644
> --- a/pc-bios/s390-ccw/sclp.c
> +++ b/pc-bios/s390-ccw/sclp.c
> @@ -114,7 +114,7 @@ void sclp_get_loadparm_ascii(char *loadparm)
> memset((char *)_sccb, 0, sizeof(ReadInfo));
> sccb->h.length = sizeof(ReadInfo);
> if (!sclp_service_call(SCLP_CMDW_READ_SCP_INFO, sccb)) {
> - ebcdic_to_ascii((char *) sccb->loadparm, loadparm, 8);
> + ebcdic_to_ascii((char *) sccb->loadparm, loadparm, LOADPARM_LEN);
> }
> }
>
> diff --git a/pc-bios/s390-ccw/sclp.h b/pc-bios/s390-ccw/sclp.h
> index 0dd987f..8450161 100644
> --- a/pc-bios/s390-ccw/sclp.h
> +++ b/pc-bios/s390-ccw/sclp.h
> @@ -56,7 +56,7 @@ typedef struct ReadInfo {
> uint16_t rnmax;
> uint8_t rnsize;
> uint8_t reserved[13];
> - uint8_t loadparm[8];
> + uint8_t loadparm[LOADPARM_LEN];
> } __attribute__((packed)) ReadInfo;
>
> typedef struct SCCB {
>
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] pc-bios/s390-ccw: define loadparm length
2018-05-29 4:40 [Qemu-devel] [PATCH] pc-bios/s390-ccw: define loadparm length Collin Walling
2018-05-29 7:19 ` Laszlo Ersek
2018-05-29 7:20 ` [Qemu-devel] [qemu-s390x] " Thomas Huth
@ 2018-05-30 7:47 ` Cornelia Huck
2018-05-30 7:56 ` Thomas Huth
2018-05-30 17:31 ` Farhan Ali
3 siblings, 1 reply; 6+ messages in thread
From: Cornelia Huck @ 2018-05-30 7:47 UTC (permalink / raw)
To: Collin Walling, Thomas Huth; +Cc: qemu-devel, qemu-s390x, lersek
On Tue, 29 May 2018 00:40:09 -0400
Collin Walling <walling@linux.ibm.com> wrote:
> Loadparm is defined by the s390 architecture to be 8 bytes
> in length. Let's define this size in the s390-ccw bios.
>
> Suggested-by: Laszlo Ersek <lersek@redhat.com>
> Signed-off-by: Collin Walling <walling@linux.ibm.com>
> ---
> pc-bios/s390-ccw/iplb.h | 4 +++-
> pc-bios/s390-ccw/main.c | 8 ++++----
> pc-bios/s390-ccw/sclp.c | 2 +-
> pc-bios/s390-ccw/sclp.h | 2 +-
> 4 files changed, 9 insertions(+), 7 deletions(-)
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Thomas, I assume this will go via your tree?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] pc-bios/s390-ccw: define loadparm length
2018-05-30 7:47 ` [Qemu-devel] " Cornelia Huck
@ 2018-05-30 7:56 ` Thomas Huth
0 siblings, 0 replies; 6+ messages in thread
From: Thomas Huth @ 2018-05-30 7:56 UTC (permalink / raw)
To: Cornelia Huck, Collin Walling; +Cc: qemu-devel, qemu-s390x, lersek
On 30.05.2018 09:47, Cornelia Huck wrote:
> On Tue, 29 May 2018 00:40:09 -0400
> Collin Walling <walling@linux.ibm.com> wrote:
>
>> Loadparm is defined by the s390 architecture to be 8 bytes
>> in length. Let's define this size in the s390-ccw bios.
>>
>> Suggested-by: Laszlo Ersek <lersek@redhat.com>
>> Signed-off-by: Collin Walling <walling@linux.ibm.com>
>> ---
>> pc-bios/s390-ccw/iplb.h | 4 +++-
>> pc-bios/s390-ccw/main.c | 8 ++++----
>> pc-bios/s390-ccw/sclp.c | 2 +-
>> pc-bios/s390-ccw/sclp.h | 2 +-
>> 4 files changed, 9 insertions(+), 7 deletions(-)
>
> Reviewed-by: Cornelia Huck <cohuck@redhat.com>
>
> Thomas, I assume this will go via your tree?
Yes, I'll pick it up (I'll include it with the new version of the
pxelinux.cfg patches once they are ready).
Thomas
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] pc-bios/s390-ccw: define loadparm length
2018-05-29 4:40 [Qemu-devel] [PATCH] pc-bios/s390-ccw: define loadparm length Collin Walling
` (2 preceding siblings ...)
2018-05-30 7:47 ` [Qemu-devel] " Cornelia Huck
@ 2018-05-30 17:31 ` Farhan Ali
3 siblings, 0 replies; 6+ messages in thread
From: Farhan Ali @ 2018-05-30 17:31 UTC (permalink / raw)
To: Collin Walling, qemu-devel, qemu-s390x, cohuck, lersek
On 05/29/2018 12:40 AM, Collin Walling wrote:
> Loadparm is defined by the s390 architecture to be 8 bytes
> in length. Let's define this size in the s390-ccw bios.
>
> Suggested-by: Laszlo Ersek<lersek@redhat.com>
> Signed-off-by: Collin Walling<walling@linux.ibm.com>
> ---
> pc-bios/s390-ccw/iplb.h | 4 +++-
> pc-bios/s390-ccw/main.c | 8 ++++----
> pc-bios/s390-ccw/sclp.c | 2 +-
> pc-bios/s390-ccw/sclp.h | 2 +-
> 4 files changed, 9 insertions(+), 7 deletions(-)
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-05-30 17:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-29 4:40 [Qemu-devel] [PATCH] pc-bios/s390-ccw: define loadparm length Collin Walling
2018-05-29 7:19 ` Laszlo Ersek
2018-05-29 7:20 ` [Qemu-devel] [qemu-s390x] " Thomas Huth
2018-05-30 7:47 ` [Qemu-devel] " Cornelia Huck
2018-05-30 7:56 ` Thomas Huth
2018-05-30 17:31 ` Farhan Ali
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.