[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [qemu-s390x] [Qemu-devel] [PATCH v7 06/12] s390-ccw: parse and set b
From: |
Viktor Mihajlovski |
Subject: |
Re: [qemu-s390x] [Qemu-devel] [PATCH v7 06/12] s390-ccw: parse and set boot menu options |
Date: |
Mon, 19 Feb 2018 13:39:44 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 17.02.2018 09:26, Thomas Huth wrote:
[...]
>> struct QemuIplParameters {
>> - uint8_t reserved1[4];
>> + uint8_t boot_menu_flags;
>> + uint8_t reserved1[3];
>> + uint32_t boot_menu_timeout;
>> uint64_t netboot_start_addr;
>> - uint8_t reserved2[16];
>> + uint8_t reserved2[12];
>> } __attribute__ ((packed));
>> typedef struct QemuIplParameters QemuIplParameters;
>
> I think Victor's original intention was to get netboot_start_addr
> aligned in the lowcore memory. Now it's rather aligned in the host
> memory. Quite confusing, but I think I'd rather prefer Victor's idea to
> keep it aligned in the lowcore (since that's the "architected" part).
>
> Maybe it's better if we do not declare this as a packed struct at all,
> and then instead of doing a memcpy of the whole struct, we set the
> fields manually one by one on the host side into the lowcore, and read
> the fields manually one by one on the guest side? That's more
> cumbersome, but avoids future confusion about the alignments here...
>
> Thomas
>
Hm ... I would prefer to keep it all together and perhaps come up with
better comments (for the fields). BTW: I think it would make sense to
reserve the last 8 bytes 'seriously': in case more global configuration
data is needed in the future, we should have the possibility to install
a pointer to an extension block in there.
Anyway, here's the follup squash-in for a qipl-free IPLB.
---
diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index 3c6a411..fe70008 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -222,7 +222,7 @@ static Property s390_ipl_properties[] = {
DEFINE_PROP_END_OF_LIST(),
};
-static void s390_ipl_set_boot_menu(IplParameterBlock *iplb)
+static void s390_ipl_set_boot_menu(S390IPLState *ipl)
{
QemuOptsList *plist = qemu_find_opts("boot-opts");
QemuOpts *opts = QTAILQ_FIRST(&plist->head);
@@ -231,11 +231,11 @@ static void s390_ipl_set_boot_menu(IplParameterBlock
*iplb)
const char *tmp;
unsigned long splash_time = 0;
- switch (iplb->pbt) {
+ switch (ipl->iplb.pbt) {
case S390_IPL_TYPE_CCW:
case S390_IPL_TYPE_QEMU_SCSI:
- flags = &iplb->qipl.boot_menu_flags;
- timeout = &iplb->qipl.boot_menu_timeout;
+ flags = &ipl->qipl.boot_menu_flags;
+ timeout = &ipl->qipl.boot_menu_timeout;
break;
default:
error_report("boot menu is not supported for this device type.");
@@ -482,7 +482,7 @@ void s390_ipl_prepare_cpu(S390CPU *cpu)
}
ipl->qipl.netboot_start_addr = cpu_to_be64(ipl->start_addr);
}
- s390_ipl_set_boot_menu(&ipl->iplb);
+ s390_ipl_set_boot_menu(ipl);
s390_ipl_prepare_qipl(cpu);
}
--
Regards,
Viktor Mihajlovski
- [qemu-s390x] [PATCH v7 00/12] Interactive Boot Menu for DASD and SCSI Guests on s390x, Collin L. Walling, 2018/02/16
- [qemu-s390x] [PATCH v7 01/12] s390-ccw: refactor boot map table code, Collin L. Walling, 2018/02/16
- [qemu-s390x] [PATCH v7 03/12] s390-ccw: refactor IPL structs, Collin L. Walling, 2018/02/16
- [qemu-s390x] [PATCH v7 02/12] s390-ccw: refactor eckd_block_num to use CHS, Collin L. Walling, 2018/02/16
- [qemu-s390x] [PATCH v7 04/12] s390-ccw: update libc, Collin L. Walling, 2018/02/16