pc-bios/s390-ccw: Merge the netboot loader into s390-ccw.img
cover pc-bios/s390-ccw: Merge the netboot loader into s390-ccw.img
We originally built a separate binary for the netboot code since it was considered as experimental and we could not be sure that the necessary SLOF module had been checked out. Time passed, the netboot code proved its usefulness, and the build system nowadays makes sure that the SLOF module is checked out if you have a s390x compiler available for building the s390-ccw bios. In fact, the possibility to build the s390-ccw.img without s390-netboot.img has been removed in commit bf6903f6944f ("pc-bios/s390-ccw: always build network bootloader") already.
So it does not make too much sense anymore to keep the netboot code in a separate binary. To make it easier to support a more flexible boot process soon that supports more than one boot device via the bootindex properties, let's finally merge the netboot code into the main s390-ccw.img binary now.
Thomas Huth (7):
pc-bios/s390-ccw: Remove duplicated LDFLAGS
hw/s390x/ipl: Provide more memory to the s390-ccw.img firmware pc-bios/s390-ccw: Use the libc from SLOF for the main s390-ccw.img
binary, too
pc-bios/s390-ccw: Link the netboot code into the main s390-ccw.img
binary
hw/s390x: Remove the possibility to load the s390-netboot.img binary pc-bios/s390-ccw: Merge netboot.mak into the main Makefile docs/system/s390x/bootdevices: Update the documentation about network
booting
docs/system/s390x/bootdevices.rst | 20 +++---- pc-bios/s390-ccw/netboot.mak | 62 --------------------- hw/s390x/ipl.h | 12 ++-- pc-bios/s390-ccw/cio.h | 2 + pc-bios/s390-ccw/iplb.h | 4 +- pc-bios/s390-ccw/libc.h | 89 ------------------------------ pc-bios/s390-ccw/s390-ccw.h | 10 +++- pc-bios/s390-ccw/virtio.h | 1 - hw/s390x/ipl.c | 65 +++------------------- hw/s390x/s390-virtio-ccw.c | 10 +--- pc-bios/s390-ccw/bootmap.c | 4 +- pc-bios/s390-ccw/cio.c | 2 +- pc-bios/s390-ccw/dasd-ipl.c | 2 +- pc-bios/s390-ccw/jump2ipl.c | 2 +- pc-bios/s390-ccw/libc.c | 88 ----------------------------- pc-bios/s390-ccw/main.c | 15 +++-- pc-bios/s390-ccw/menu.c | 25 ++++----- pc-bios/s390-ccw/netmain.c | 15 +---- pc-bios/s390-ccw/sclp.c | 2 +- pc-bios/s390-ccw/virtio-blkdev.c | 1 - pc-bios/s390-ccw/virtio-scsi.c | 2 +- pc-bios/s390-ccw/virtio.c | 2 +- pc-bios/meson.build | 1 - pc-bios/s390-ccw/Makefile | 69 +++++++++++++++++++---- pc-bios/s390-netboot.img | Bin 67232 -> 0 bytes 25 files changed, 122 insertions(+), 383 deletions(-) delete mode 100644 pc-bios/s390-ccw/netboot.mak delete mode 100644 pc-bios/s390-ccw/libc.h delete mode 100644 pc-bios/s390-ccw/libc.c delete mode 100644 pc-bios/s390-netboot.img
Signature · 1 line
2.45.2
PATCH 1/7 pc-bios/s390-ccw: Remove duplicated LDFLAGS
The -Wl,-pie and -nostdlib flags are added to LDFLAGS twice. Merge the two lines to get rid of the duplicates.
--- pc-bios/s390-ccw/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
pc-bios/s390-ccw/Makefile +1 -3
@@ -40,7 +40,7 @@ EXTRA_CFLAGS += -ffreestanding -fno-delete-null-pointer-checks -fno-common -fPIE EXTRA_CFLAGS += -fwrapv -fno-strict-aliasing -fno-asynchronous-unwind-tables EXTRA_CFLAGS += -msoft-float EXTRA_CFLAGS += -std=gnu99 -LDFLAGS += -Wl,-pie -nostdlib +LDFLAGS += -Wl,-pie -nostdlib -z noexecstack cc-test = $(CC) -Werror $1 -c -o /dev/null -xc /dev/null >/dev/null 2>/dev/null cc-option = if $(call cc-test, $1); then \
@@ -55,8 +55,6 @@ config-cc.mak: Makefile $(call cc-option,-march=z900,-march=z10)) 3> config-cc.mak -include config-cc.mak -LDFLAGS += -Wl,-pie -nostdlib -z noexecstack - build-all: s390-ccw.img s390-netboot.img s390-ccw.elf: $(OBJECTS)
Signature · 1 line
2.45.2
PATCH 2/7 hw/s390x/ipl: Provide more memory to the s390-ccw.img firmware
In reply to Thomas HuthWe are going to link the SLOF libc into the s390-ccw.img, and this libc needs more memory for providing space for malloc() and friends. Thus bump the memory size that we reserve for the bios to 3 MiB instead of only 2 MiB. While we're at it, add a proper check that there is really enough memory assigned to the machine before blindly using it.
--- hw/s390x/ipl.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
hw/s390x/ipl.c +9 -1
@@ -45,6 +45,7 @@#define INITRD_PARM_START 0x010408UL#define PARMFILE_START 0x001000UL#define ZIPL_IMAGE_START 0x009000UL +#define BIOS_MAX_SIZE 0x300000UL#define IPL_PSW_MASK (PSW_MASK_32 | PSW_MASK_64)static bool iplb_extended_needed (void *opaque)
@@ -144,7 +145,14 @@ static void s390_ipl_realize(DeviceState *dev, Error **errp)* even if an external kernel has been defined. */ if (!ipl->kernel || ipl->enforce_bios) { -uint64_t fwbase = (MIN (ms->ram_size,0x80000000U ) -0x200000 ) & ~0xffffUL ; +uint64_t fwbase; + +if (ms->ram_size <BIOS_MAX_SIZE ) { +error_setg (errp,"not enough RAM to load the BIOS file" ); +return ; + } + + fwbase = (MIN (ms->ram_size,0x80000000U ) -BIOS_MAX_SIZE ) & ~0xffffUL ; bios_filename =qemu_find_file (QEMU_FILE_TYPE_BIOS , ipl->firmware);if (bios_filename ==NULL ) {
Signature · 1 line
2.45.2
PATCH 3/7 pc-bios/s390-ccw: Use the libc from SLOF for the main s390-ccw.img binary, too
In reply to Thomas HuthWe are already using the libc from SLOF for the s390-netboot.img, and this libc implementation is way more complete and accurate than the simple implementation that we currently use for the s390-ccw.img binary. Since we are now always assuming that the SLOF submodule is available when building the s390-ccw bios (see commit bf6903f6944f), we can drop the simple implementation and use the SLOF libc for the s390-ccw.img binary, too.
--- pc-bios/s390-ccw/netboot.mak | 3 -- pc-bios/s390-ccw/libc.h | 89 -------------------------------- pc-bios/s390-ccw/s390-ccw.h | 7 +-- pc-bios/s390-ccw/bootmap.c | 2 +- pc-bios/s390-ccw/cio.c | 2 +- pc-bios/s390-ccw/dasd-ipl.c | 2 +- pc-bios/s390-ccw/jump2ipl.c | 2 +- pc-bios/s390-ccw/libc.c | 88 ------------------------------- pc-bios/s390-ccw/main.c | 5 +- pc-bios/s390-ccw/menu.c | 25 ++++----- pc-bios/s390-ccw/sclp.c | 2 +- pc-bios/s390-ccw/virtio-blkdev.c | 1 - pc-bios/s390-ccw/virtio-scsi.c | 2 +- pc-bios/s390-ccw/virtio.c | 2 +- pc-bios/s390-ccw/Makefile | 15 ++++-- 15 files changed, 34 insertions(+), 213 deletions(-) delete mode 100644 pc-bios/s390-ccw/libc.h delete mode 100644 pc-bios/s390-ccw/libc.c
pc-bios/s390-ccw/netboot.mak +0 -3
@@ -1,9 +1,6 @@ -SLOF_DIR := $(SRC_PATH)/../../roms/SLOF - NETOBJS := start.o sclp.o cio.o virtio.o virtio-net.o jump2ipl.o netmain.o -LIBC_INC := -nostdinc -I$(SLOF_DIR)/lib/libc/include LIBNET_INC := -I$(SLOF_DIR)/lib/libnet NETLDFLAGS := $(LDFLAGS) -Wl,-Ttext=0x7800000
pc-bios/s390-ccw/libc.h deleted +0 -89
89 lines not on this page · raw message
pc-bios/s390-ccw/s390-ccw.h +4 -3
@@ -13,6 +13,10 @@/* #define DEBUG */ +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> +typedef unsigned char u8 ;typedef unsigned short u16 ;typedef unsigned int u32 ;
@@ -26,9 +30,6 @@ typedef unsigned long long u64;#define EBUSY 2#define ENODEV 3 -#ifndef NULL -#define NULL 0 -#endif #ifndef MIN #define MIN (a, b) (((a) < (b)) ? (a) : (b))#endif
pc-bios/s390-ccw/bootmap.c +1 -1
@@ -8,7 +8,7 @@* directory. */ -#include "libc.h" +#include <string.h> #include "s390-ccw.h" #include "s390-arch.h" #include "bootmap.h"
pc-bios/s390-ccw/cio.c +1 -1
@@ -11,7 +11,7 @@* directory. */ -#include "libc.h" +#include <string.h> #include "s390-ccw.h" #include "s390-arch.h" #include "helper.h"
pc-bios/s390-ccw/dasd-ipl.c +1 -1
@@ -8,7 +8,7 @@* directory. */ -#include "libc.h" +#include <string.h> #include "s390-ccw.h" #include "s390-arch.h" #include "dasd-ipl.h"
pc-bios/s390-ccw/jump2ipl.c +1 -1
@@ -6,7 +6,7 @@* directory. */ -#include "libc.h" +#include <string.h> #include "s390-ccw.h" #include "s390-arch.h"
pc-bios/s390-ccw/libc.c deleted +0 -88
88 lines not on this page · raw message
pc-bios/s390-ccw/main.c +3 -2
@@ -8,7 +8,8 @@* directory. */ -#include "libc.h" +#include <stdlib.h> +#include <string.h> #include "helper.h" #include "s390-arch.h" #include "s390-ccw.h"
@@ -50,7 +51,7 @@ void write_iplb_location(void)unsigned int get_loadparm_index (void ) { -return atoui (loadparm_str); +return atoi (loadparm_str); }static int is_dev_possibly_bootable (int dev_no,int sch_no)
pc-bios/s390-ccw/menu.c +10 -15
@@ -9,7 +9,10 @@* directory. */ -#include "libc.h" +#include <ctype.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> #include "s390-ccw.h" #include "sclp.h" #include "s390-time.h"
@@ -140,20 +143,17 @@ static int get_index(void) } } -return atoui (buf); +return atoi (buf); }static void boot_menu_prompt (bool retry) { -char tmp[11 ]; -if (retry) {sclp_print ("\nError: undefined configuration" "\nPlease choose:\n" ); }else if (timeout >0 ) { -sclp_print ("Please choose (default will boot in " ); -sclp_print (uitoa (timeout /1000 , tmp,sizeof (tmp))); -sclp_print (" seconds):\n" ); +printf ("Please choose (default will boot in %d seconds):\n" , + (int )(timeout /1000 )); }else {sclp_print ("Please choose:\n" ); }
@@ -163,7 +163,6 @@ static int get_boot_index(bool *valid_entries) {int boot_index;bool retry = false; -char tmp[5 ]; do { boot_menu_prompt(retry);
@@ -172,8 +171,7 @@ static int get_boot_index(bool *valid_entries) }while (boot_index <0 || boot_index >=MAX_BOOT_ENTRIES || !valid_entries[boot_index]); -sclp_print ("\nBooting entry #" ); -sclp_print (uitoa (boot_index, tmp,sizeof (tmp))); +printf ("\nBooting entry #%d" , boot_index);return boot_index; }
@@ -189,7 +187,7 @@ static int zipl_print_entry(const char *data, size_t len)sclp_print (buf); -return buf[0 ] ==' ' ?atoui (buf +1 ) :atoui (buf); +return buf[0 ] ==' ' ?atoi (buf +1 ) :atoi (buf); }int menu_get_zipl_boot_index (const char *menu_data)
@@ -231,7 +229,6 @@ int menu_get_zipl_boot_index(const char *menu_data)int menu_get_enum_boot_index (bool *valid_entries) { -char tmp[3 ];int i;sclp_print ("s390-ccw Enumerated Boot Menu.\n\n" );
@@ -241,9 +238,7 @@ int menu_get_enum_boot_index(bool *valid_entries)if (i <10 ) {sclp_print (" " ); } -sclp_print ("[" ); -sclp_print (uitoa (i, tmp,sizeof (tmp))); -sclp_print ("]" ); +printf ("[%d]" , i);if (i ==0 ) {sclp_print (" default\n" ); }
pc-bios/s390-ccw/sclp.c +1 -1
@@ -8,7 +8,7 @@* directory. */ -#include "libc.h" +#include <string.h> #include "s390-ccw.h" #include "sclp.h"
pc-bios/s390-ccw/virtio-blkdev.c +0 -1
@@ -8,7 +8,6 @@* directory. */ -#include "libc.h" #include "s390-ccw.h" #include "virtio.h" #include "virtio-scsi.h"
pc-bios/s390-ccw/virtio-scsi.c +1 -1
@@ -9,7 +9,7 @@* directory. */ -#include "libc.h" +#include <string.h> #include "s390-ccw.h" #include "virtio.h" #include "scsi.h"
pc-bios/s390-ccw/virtio.c +1 -1
@@ -8,7 +8,7 @@* directory. */ -#include "libc.h" +#include <string.h> #include "s390-ccw.h" #include "cio.h" #include "virtio.h"
pc-bios/s390-ccw/Makefile +10 -5
@@ -33,13 +33,18 @@ QEMU_DGFLAGS = -MMD -MP -MT $@ -MF $(@D)/$(*F).d .PHONY : all clean build-all distclean OBJECTS = start.o main.o bootmap.o jump2ipl.o sclp.o menu.o \ - virtio.o virtio-scsi.o virtio-blkdev.o libc.o cio.o dasd-ipl.o + virtio.o virtio-scsi.o virtio-blkdev.o cio.o dasd-ipl.o + +SLOF_DIR := $(SRC_PATH)/../../roms/SLOF + +LIBC_INC := -nostdinc -I$(SLOF_DIR)/lib/libc/include EXTRA_CFLAGS += -Wall EXTRA_CFLAGS += -ffreestanding -fno-delete-null-pointer-checks -fno-common -fPIE EXTRA_CFLAGS += -fwrapv -fno-strict-aliasing -fno-asynchronous-unwind-tables EXTRA_CFLAGS += -msoft-float EXTRA_CFLAGS += -std=gnu99 +EXTRA_CFLAGS += $(LIBC_INC) LDFLAGS += -Wl,-pie -nostdlib -z noexecstack cc-test = $(CC) -Werror $1 -c -o /dev/null -xc /dev/null >/dev/null 2>/dev/null
@@ -55,18 +60,18 @@ config-cc.mak: Makefile $(call cc-option,-march=z900,-march=z10)) 3> config-cc.mak -include config-cc.mak +include $(SRC_PATH)/netboot.mak + build-all: s390-ccw.img s390-netboot.img -s390-ccw.elf: $(OBJECTS) - $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $(OBJECTS),Linking) +s390-ccw.elf: $(OBJECTS) libc.a + $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $^,Linking) s390-ccw.img: s390-ccw.elf $(call quiet-command,$(STRIP) --strip-unneeded $< -o $@,Stripping $< into) $(OBJECTS): Makefile -include $(SRC_PATH)/netboot.mak - ALL_OBJS = $(sort $(OBJECTS) $(NETOBJS) $(LIBCOBJS) $(LIBNETOBJS)) -include $(ALL_OBJS:%.o=%.d)
Signature · 1 line
2.45.2
PATCH 4/7 pc-bios/s390-ccw: Link the netboot code into the main s390-ccw.img binary
In reply to Thomas HuthWe originally built a separate binary for the netboot code since it was considered as experimental and we could not be sure that the necessary SLOF module had been checked out. Time passed, the code proved its usefulness, and the build system nowadays makes sure that the SLOF module is checked out if you have a s390x compiler available for building the s390-ccw bios. So there is no real compelling reason anymore to keep the netboot code in a separate binary. Linking the code together with the main s390-ccw.img will make future enhancements much easier, like supporting more than one boot device.
--- pc-bios/s390-ccw/netboot.mak | 14 -------------- pc-bios/s390-ccw/cio.h | 2 ++ pc-bios/s390-ccw/iplb.h | 4 ++-- pc-bios/s390-ccw/s390-ccw.h | 3 +++ pc-bios/s390-ccw/virtio.h | 1 - pc-bios/s390-ccw/bootmap.c | 2 +- pc-bios/s390-ccw/main.c | 10 +++++++--- pc-bios/s390-ccw/netmain.c | 15 ++------------- pc-bios/s390-ccw/Makefile | 13 +++++++------ 9 files changed, 24 insertions(+), 40 deletions(-)
pc-bios/s390-ccw/netboot.mak +0 -14
@@ -1,18 +1,4 @@ -NETOBJS := start.o sclp.o cio.o virtio.o virtio-net.o jump2ipl.o netmain.o - -LIBNET_INC := -I$(SLOF_DIR)/lib/libnet - -NETLDFLAGS := $(LDFLAGS) -Wl,-Ttext=0x7800000 - -$(NETOBJS): EXTRA_CFLAGS += $(LIBC_INC) $(LIBNET_INC) - -s390-netboot.elf: $(NETOBJS) libnet.a libc.a - $(call quiet-command,$(CC) $(NETLDFLAGS) -o $@ $^,Linking) - -s390-netboot.img: s390-netboot.elf - $(call quiet-command,$(STRIP) --strip-unneeded $< -o $@,Stripping $< into) - # libc files: LIBC_CFLAGS = $(EXTRA_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \
pc-bios/s390-ccw/cio.h +2 -0
@@ -361,6 +361,8 @@ typedef struct CcwSearchIdData {uint8_t record; } __attribute__((packed)) CcwSearchIdData; +extern SubChannelId net_schid; +int enable_mss_facility (void );void enable_subchannel (SubChannelId schid);uint16_t cu_type (SubChannelId schid);
pc-bios/s390-ccw/iplb.h +2 -2
@@ -87,9 +87,9 @@ extern IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE)));struct QemuIplParameters {uint8_t qipl_flags;uint8_t reserved1[3 ]; -uint64_t netboot_start_addr; +uint64_t reserved2;uint32_t boot_menu_timeout; -uint8_t reserved2[12 ]; +uint8_t reserved3[12 ]; } __attribute__ ((packed));typedef struct QemuIplParameters QemuIplParameters ;
pc-bios/s390-ccw/s390-ccw.h +3 -0
@@ -54,6 +54,9 @@ void write_iplb_location(void);unsigned int get_loadparm_index (void );void main (void ); +/* netmain.c */ +void netmain (void ); +/* sclp.c */ void sclp_print (const char *string);void sclp_set_write_mask (uint32_t receive_mask,uint32_t send_mask);
pc-bios/s390-ccw/virtio.h +0 -1
@@ -253,7 +253,6 @@ struct VDev {uint8_t scsi_dev_heads;bool scsi_device_selected;ScsiDevice selected_scsi_device; -uint64_t netboot_start_addr;uint32_t max_transfer;uint32_t guest_features[2 ]; };
pc-bios/s390-ccw/bootmap.c +1 -1
@@ -928,7 +928,7 @@ void zipl_load(void) }if (virtio_get_device_type () ==VIRTIO_ID_NET ) { -jump_to_IPL_code (vdev->netboot_start_addr); +netmain (); }ipl_scsi ();
pc-bios/s390-ccw/main.c +7 -3
@@ -37,8 +37,13 @@ LowCore *lowcore; /* Yes, this *is* a pointer to address 0 */*/ void write_subsystem_identification (void ) { - lowcore->subchannel_id = blk_schid.sch_id; - lowcore->subchannel_nr = blk_schid.sch_no; +if (cutype ==CU_TYPE_VIRTIO &&virtio_get_device_type () ==VIRTIO_ID_NET ) { + lowcore->subchannel_id = net_schid.sch_id; + lowcore->subchannel_nr = net_schid.sch_no; + }else { + lowcore->subchannel_id = blk_schid.sch_id; + lowcore->subchannel_nr = blk_schid.sch_no; + } lowcore->io_int_parm =0 ; }
@@ -230,7 +235,6 @@ static int virtio_setup(void)switch (vdev->senseid.cu_model) {case VIRTIO_ID_NET :sclp_print ("Network boot device detected\n" ); - vdev->netboot_start_addr = qipl.netboot_start_addr;return 0 ;case VIRTIO_ID_BLOCK : ret =virtio_blk_setup_device (blk_schid);
pc-bios/s390-ccw/netmain.c +2 -13
@@ -41,7 +41,6 @@#define DEFAULT_TFTP_RETRIES 20extern char _start[]; -void write_iplb_location (void ) {}#define KERNEL_ADDR ((void *)0L)#define KERNEL_MAX_SIZE ((long)_start)
@@ -50,10 +49,9 @@ void write_iplb_location(void) {}/* STSI 3.2.2 offset of first vmdb + offset of uuid inside vmdb */ #define STSI322_VMDB_UUID_OFFSET ((8 + 12) * 4) -IplParameterBlock iplb __attribute__((aligned(PAGE_SIZE)));static char cfgbuf[2048 ]; -static SubChannelId net_schid = { .one =1 }; +SubChannelId net_schid = { .one =1 };static uint8_t mac[6 ];static uint64_t dest_timer;
@@ -438,15 +436,6 @@ static int net_try_direct_tftp_load(filename_ip_t *fn_ip)return rc; } -void write_subsystem_identification (void ) -{ -SubChannelId *schid = (SubChannelId *)184 ; -uint32_t *zeroes = (uint32_t *)188 ; - - *schid = net_schid; - *zeroes =0 ; -} -static bool find_net_dev (Schib *schib,int dev_no) {int i, r;
@@ -509,7 +498,7 @@ static void virtio_setup(void)IPL_assert (found,"No virtio net device found" ); } -void main (void ) +void netmain (void ) {filename_ip_t fn_ip;int rc, fnlen;
pc-bios/s390-ccw/Makefile +7 -6
@@ -32,19 +32,20 @@ QEMU_DGFLAGS = -MMD -MP -MT $@ -MF $(@D)/$(*F).d .PHONY : all clean build-all distclean -OBJECTS = start.o main.o bootmap.o jump2ipl.o sclp.o menu.o \ - virtio.o virtio-scsi.o virtio-blkdev.o cio.o dasd-ipl.o +OBJECTS = start.o main.o bootmap.o jump2ipl.o sclp.o menu.o netmain.o \ + virtio.o virtio-net.o virtio-scsi.o virtio-blkdev.o cio.o dasd-ipl.o SLOF_DIR := $(SRC_PATH)/../../roms/SLOF LIBC_INC := -nostdinc -I$(SLOF_DIR)/lib/libc/include +LIBNET_INC := -I$(SLOF_DIR)/lib/libnet EXTRA_CFLAGS += -Wall EXTRA_CFLAGS += -ffreestanding -fno-delete-null-pointer-checks -fno-common -fPIE EXTRA_CFLAGS += -fwrapv -fno-strict-aliasing -fno-asynchronous-unwind-tables EXTRA_CFLAGS += -msoft-float EXTRA_CFLAGS += -std=gnu99 -EXTRA_CFLAGS += $(LIBC_INC) +EXTRA_CFLAGS += $(LIBC_INC) $(LIBNET_INC) LDFLAGS += -Wl,-pie -nostdlib -z noexecstack cc-test = $(CC) -Werror $1 -c -o /dev/null -xc /dev/null >/dev/null 2>/dev/null
@@ -62,9 +63,9 @@ config-cc.mak: Makefile include $(SRC_PATH)/netboot.mak -build-all: s390-ccw.img s390-netboot.img +build-all: s390-ccw.img -s390-ccw.elf: $(OBJECTS) libc.a +s390-ccw.elf: $(OBJECTS) libnet.a libc.a $(call quiet-command,$(CC) $(LDFLAGS) -o $@ $^,Linking) s390-ccw.img: s390-ccw.elf
@@ -72,7 +73,7 @@ s390-ccw.img: s390-ccw.elf $(OBJECTS): Makefile -ALL_OBJS = $(sort $(OBJECTS) $(NETOBJS) $(LIBCOBJS) $(LIBNETOBJS)) +ALL_OBJS = $(sort $(OBJECTS) $(LIBCOBJS) $(LIBNETOBJS)) -include $(ALL_OBJS:%.o=%.d) clean:
Signature · 1 line
2.45.2
PATCH 5/7 hw/s390x: Remove the possibility to load the s390-netboot.img binary
In reply to Thomas HuthSince the netboot code has now been merged into the main s390-ccw.img binary, we don't need the separate s390-netboot.img anymore. Remove it and the code that was responsible for loading it.
--- hw/s390x/ipl.h | 12 +++----- hw/s390x/ipl.c | 55 ------------------------------------- hw/s390x/s390-virtio-ccw.c | 10 ++----- pc-bios/meson.build | 1 - pc-bios/s390-netboot.img | Bin 67232 -> 0 bytes 5 files changed, 6 insertions(+), 72 deletions(-) delete mode 100644 pc-bios/s390-netboot.img
hw/s390x/ipl.h +4 -8
@@ -134,11 +134,8 @@ void s390_ipl_clear_reset_request(void);/* * The QEMU IPL Parameters will be stored at absolute address * 204 (0xcc) which means it is 32-bit word aligned but not -* double-word aligned. -* Placement of data fields in this area must account for -* their alignment needs. E.g., netboot_start_address must -* have an offset of 4 + n * 8 bytes within the struct in order -* to keep it double-word aligned. +* double-word aligned. Placement of 64-bit data fields in this +* area must account for their alignment needs. * The total size of the struct must never exceed 28 bytes. * This definition must be kept in sync with the definition * in pc-bios/s390-ccw/iplb.h.
@@ -146,9 +143,9 @@ void s390_ipl_clear_reset_request(void);struct QemuIplParameters {uint8_t qipl_flags;uint8_t reserved1[3 ]; -uint64_t netboot_start_addr; +uint64_t reserved2;uint32_t boot_menu_timeout; -uint8_t reserved2[12 ]; +uint8_t reserved3[12 ]; }QEMU_PACKED ;typedef struct QemuIplParameters QemuIplParameters ;
@@ -178,7 +175,6 @@ struct S390IPLState {char *initrd;char *cmdline;char *firmware; -char *netboot_fw;uint8_t cssid;uint8_t ssid;uint16_t devno;
hw/s390x/ipl.c +0 -55
73 lines not on this page · raw message
hw/s390x/s390-virtio-ccw.c +2 -8
@@ -186,11 +186,10 @@ static void s390_memory_init(MemoryRegion *ram)static void s390_init_ipl_dev (const char *kernel_filename,const char *kernel_cmdline,const char *initrd_filename,const char *firmware, -const char *netboot_fw,bool enforce_bios) +bool enforce_bios) {Object *new =object_new (TYPE_S390_IPL );DeviceState *dev =DEVICE (new); -char *netboot_fw_prop;if (kernel_filename) {qdev_prop_set_string (dev,"kernel" , kernel_filename);
@@ -201,11 +200,6 @@ static void s390_init_ipl_dev(const char *kernel_filename,qdev_prop_set_string (dev,"cmdline" , kernel_cmdline);qdev_prop_set_string (dev,"firmware" , firmware);qdev_prop_set_bit (dev,"enforce_bios" , enforce_bios); - netboot_fw_prop =object_property_get_str (new,"netboot_fw" , &error_abort); -if (!strlen (netboot_fw_prop)) { -qdev_prop_set_string (dev,"netboot_fw" , netboot_fw); - } -g_free (netboot_fw_prop);object_property_add_child (qdev_get_machine (),TYPE_S390_IPL , new);object_unref (new);
@@ -270,7 +264,7 @@ static void ccw_init(MachineState *machine)s390_init_ipl_dev (machine->kernel_filename, machine->kernel_cmdline, machine->initrd_filename, machine->firmware ?:"s390-ccw.img" , -"s390-netboot.img" , true); + true); dev =qdev_new (TYPE_S390_PCI_HOST_BRIDGE ); object_property_add_child(qdev_get_machine(), TYPE_S390_PCI_HOST_BRIDGE,
pc-bios/meson.build +0 -1
@@ -64,7 +64,6 @@ blobs = [ 'kvmvapic.bin', 'pvh.bin', 's390-ccw.img', - 's390-netboot.img', 'slof.bin', 'skiboot.lid', 'palcode-clipper',
pc-bios/s390-netboot.img deleted binary +0 -0
Signature · 1 line
2.45.2
PATCH 6/7 pc-bios/s390-ccw: Merge netboot.mak into the main Makefile
In reply to Thomas HuthNow that the netboot code has been merged into the main s390-ccw.img, it also does not make sense to keep the build rules in a separate file. Thus let's merge netboot.mak into the main Makefile.
--- pc-bios/s390-ccw/netboot.mak | 45 ---------------------------------- pc-bios/s390-ccw/Makefile | 47 +++++++++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 46 deletions(-) delete mode 100644 pc-bios/s390-ccw/netboot.mak
pc-bios/s390-ccw/netboot.mak deleted +0 -45
@@ -1,45 +0,0 @@ - -# libc files: - -LIBC_CFLAGS = $(EXTRA_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \ - -MMD -MP -MT $@ -MF $(@:%.o=%.d) - -CTYPE_OBJS = isdigit.o isxdigit.o toupper.o -%.o : $(SLOF_DIR)/lib/libc/ctype/%.c - $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) - -STRING_OBJS = strcat.o strchr.o strrchr.o strcpy.o strlen.o strncpy.o \ - strcmp.o strncmp.o strcasecmp.o strncasecmp.o strstr.o \ - memset.o memcpy.o memmove.o memcmp.o -%.o : $(SLOF_DIR)/lib/libc/string/%.c - $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) - -STDLIB_OBJS = atoi.o atol.o strtoul.o strtol.o rand.o malloc.o free.o -%.o : $(SLOF_DIR)/lib/libc/stdlib/%.c - $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) - -STDIO_OBJS = sprintf.o snprintf.o vfprintf.o vsnprintf.o vsprintf.o fprintf.o \ - printf.o putc.o puts.o putchar.o stdchnls.o fileno.o -%.o : $(SLOF_DIR)/lib/libc/stdio/%.c - $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) - -sbrk.o: $(SLOF_DIR)/slof/sbrk.c - $(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling) - -LIBCOBJS := $(STRING_OBJS) $(CTYPE_OBJS) $(STDLIB_OBJS) $(STDIO_OBJS) sbrk.o - -libc.a: $(LIBCOBJS) - $(call quiet-command,$(AR) -rc $@ $^,Creating static library) - -# libnet files: - -LIBNETOBJS := args.o dhcp.o dns.o icmpv6.o ipv6.o tcp.o udp.o bootp.o \ - dhcpv6.o ethernet.o ipv4.o ndp.o tftp.o pxelinux.o -LIBNETCFLAGS = $(EXTRA_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \ - -DDHCPARCH=0x1F -MMD -MP -MT $@ -MF $(@:%.o=%.d) - -%.o : $(SLOF_DIR)/lib/libnet/%.c - $(call quiet-command,$(CC) $(LIBNETCFLAGS) -c -o $@ $<,Compiling) - -libnet.a: $(LIBNETOBJS) - $(call quiet-command,$(AR) -rc $@ $^,Creating static library)
pc-bios/s390-ccw/Makefile +46 -1
53 lines not on this page · raw message
Signature · 1 line
2.45.2
PATCH 7/7 docs/system/s390x/bootdevices: Update the documentation about network booting
In reply to Thomas HuthRemove the information about the separate s390-netboot.img from the documentation.
--- docs/system/s390x/bootdevices.rst | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-)
docs/system/s390x/bootdevices.rst +7 -13
@@ -82,23 +82,17 @@ Note that ``0`` can be used to boot the default entry. Booting from a network device ----------------------------- -Beside the normal guest firmware (which is loaded from the file ``s390-ccw.img`` -in the data directory of QEMU, or via the ``-bios`` option), QEMU ships with -a small TFTP network bootloader firmware for virtio-net-ccw devices, too. This -firmware is loaded from a file called ``s390-netboot.img`` in the QEMU data -directory. In case you want to load it from a different filename instead, -you can specify it via the ``-global s390-ipl.netboot_fw=filename`` -command line option. - -The ``bootindex`` property is especially important for booting via the network. -If you don't specify the ``bootindex`` property here, the network bootloader -firmware code won't get loaded into the guest memory so that the network boot -will fail. For a successful network boot, try something like this:: +The firmware that ships with QEMU includes a small TFTP network bootloader +for virtio-net-ccw devices. The ``bootindex`` property is especially +important for booting via the network. If you don't specify the ``bootindex`` +property here, the network bootloader won't be taken into consideration and +the network boot will fail. For a successful network boot, try something +like this:: qemu-system-s390x -netdev user,id=n1,tftp=...,bootfile=... \ -device virtio-net-ccw,netdev=n1,bootindex=1 -The network bootloader firmware also has basic support for pxelinux.cfg-style +The network bootloader also has basic support for pxelinux.cfg-style configuration files. See the `PXELINUX Configuration page <https://wiki.syslinux.org/wiki/index.php?title=PXELINUX#Configuration>`__ for details how to set up the configuration file on your TFTP server.
Signature · 1 line
2.45.2
[...]
Quoted 17 lines
docs/system/s390x/bootdevices.rst | 20 +++---- pc-bios/s390-ccw/netboot.mak | 62 --------------------- hw/s390x/ipl.h | 12 ++-- pc-bios/s390-ccw/cio.h | 2 + pc-bios/s390-ccw/iplb.h | 4 +- pc-bios/s390-ccw/libc.h | 89 ------------------------------ pc-bios/s390-ccw/s390-ccw.h | 10 +++- pc-bios/s390-ccw/virtio.h | 1 - hw/s390x/ipl.c | 65 +++------------------- hw/s390x/s390-virtio-ccw.c | 10 +--- pc-bios/s390-ccw/bootmap.c | 4 +- pc-bios/s390-ccw/cio.c | 2 +- pc-bios/s390-ccw/dasd-ipl.c | 2 +- pc-bios/s390-ccw/jump2ipl.c | 2 +- pc-bios/s390-ccw/libc.c | 88 ----------------------------- pc-bios/s390-ccw/main.c | 15 +++-- pc-bios/s390-ccw/menu.c | 25 ++++-----
Quoted 8 lines
pc-bios/s390-ccw/netmain.c | 15 +---- pc-bios/s390-ccw/sclp.c | 2 +- pc-bios/s390-ccw/virtio-blkdev.c | 1 - pc-bios/s390-ccw/virtio-scsi.c | 2 +- pc-bios/s390-ccw/virtio.c | 2 +- pc-bios/meson.build | 1 - pc-bios/s390-ccw/Makefile | 69 +++++++++++++++++++---- pc-bios/s390-netboot.img | Bin 67232 -> 0 bytes
Shouldnt you also update the s390-ccw.img file?
Quoted 6 lines
25 files changed, 122 insertions(+), 383 deletions(-)delete mode 100644 pc-bios/s390-ccw/netboot.mak
delete mode 100644pc-bios/s390-ccw/libc.h
delete mode 100644pc-bios/s390-ccw/libc.c
delete mode 100644 pc-bios/s390-netboot.img
Quoted 27 lines · Christian Borntraeger
[...]
Quoted 17 lines
docs/system/s390x/bootdevices.rst| 20 +++---- pc-bios/s390-ccw/netboot.mak | 62 --------------------- hw/s390x/ipl.h | 12 ++-- pc-bios/s390-ccw/cio.h | 2 + pc-bios/s390-ccw/iplb.h | 4 +- pc-bios/s390-ccw/libc.h | 89 ------------------------------ pc-bios/s390-ccw/s390-ccw.h | 10 +++- pc-bios/s390-ccw/virtio.h | 1 -
hw/s390x/ipl.c | 65 +++------------------- hw/s390x/s390-virtio-ccw.c | 10 +--- pc-bios/s390-ccw/bootmap.c | 4 +- pc-bios/s390-ccw/cio.c | 2 +- pc-bios/s390-ccw/dasd-ipl.c | 2 +- pc-bios/s390-ccw/jump2ipl.c | 2 +-pc-bios/s390-ccw/libc.c | 88 ----------------------------- pc-bios/s390-ccw/main.c | 15 +++-- pc-bios/s390-ccw/menu.c | 25 ++++-----Quoted 8 lines
pc-bios/s390-ccw/netmain.c | 15 +---- pc-bios/s390-ccw/sclp.c | 2 +- pc-bios/s390-ccw/virtio-blkdev.c | 1 - pc-bios/s390-ccw/virtio-scsi.c | 2 +- pc-bios/s390-ccw/virtio.c | 2 +- pc-bios/meson.build | 1 - pc-bios/s390-ccw/Makefile | 69 +++++++++++++++++++---- pc-bios/s390-netboot.img | Bin 67232 -> 0 bytes
Quoted 1 line
Shouldnt you also update the s390-ccw.img file?
Sure, but I didn't want to spam the mailing list with a binary blob as long as this is not final yet (not sure whether we want to commit this separately or wait 'til Jared finished his series, too). Sorry, I should have mentioned it in the cover letter.
Thomas
Quoted 11 lines · Thomas Huth
We originally built a separate binary for the netboot code since it was considered as experimental and we could not be sure that the necessary SLOF module had been checked out. Time passed, the netboot code proved its usefulness, and the build system nowadays makes sure that the SLOF module is checked out if you have a s390x compiler available
for building the s390-ccw bios. In fact, the possibility to build the s390-ccw.img without s390-netboot.img has been removed in commitbf6903f6944f("pc-bios/s390-ccw: always build network bootloader") already.
Quoted 5 lines
So it does not make too much sense anymore to keep the netboot code in a separate binary. To make it easier to support a more flexible boot process soon that supports more than one boot device via the bootindex properties, let's finally merge the netboot code into the main s390-ccw.img binary now.
Hi Thomas,
I find myself wondering about the side effects of the s/sclp_print/printf/ changes, but I haven't come up with anything I can put my finger on. Maybe something will come to me over the weekend, but all-in-all I like the looks of this. So, FWIW:
Quoted 48 lines
Thomas Huth (7):
pc-bios/s390-ccw: Remove duplicated LDFLAGS hw/s390x/ipl: Provide more memory to the s390-ccw.img firmware pc-bios/s390-ccw: Use the libc from SLOF for the main s390-ccw.img binary, too
pc-bios/s390-ccw: Link the netboot code into the main s390-ccw.img binary
hw/s390x: Remove the possibility to load the s390-netboot.img binary
pc-bios/s390-ccw: Merge netboot.mak into the mainMakefiledocs/system/s390x/bootdevices: Update the documentation about network
bootingdocs/system/s390x/bootdevices.rst | 20 +++---- pc-bios/s390-ccw/netboot.mak | 62 --------------------- hw/s390x/ipl.h | 12 ++-- pc-bios/s390-ccw/cio.h | 2 + pc-bios/s390-ccw/iplb.h | 4 +- pc-bios/s390-ccw/libc.h | 89 ---------------------------- --
pc-bios/s390-ccw/s390-ccw.h | 10 +++- pc-bios/s390-ccw/virtio.h | 1 -
hw/s390x/ipl.c | 65 +++------------------- hw/s390x/s390-virtio-ccw.c | 10 +--- pc-bios/s390-ccw/bootmap.c | 4 +- pc-bios/s390-ccw/cio.c | 2 +- pc-bios/s390-ccw/dasd-ipl.c | 2 +- pc-bios/s390-ccw/jump2ipl.c | 2 +- pc-bios/s390-ccw/libc.c | 88 ---------------------------- -
pc-bios/s390-ccw/main.c | 15 +++-- pc-bios/s390-ccw/menu.c | 25 ++++----- pc-bios/s390-ccw/netmain.c | 15 +---- pc-bios/s390-ccw/sclp.c | 2 +- pc-bios/s390-ccw/virtio-blkdev.c | 1 - pc-bios/s390-ccw/virtio-scsi.c | 2 +- pc-bios/s390-ccw/virtio.c | 2 +- pc-bios/meson.build | 1 - pc-bios/s390-ccw/Makefile | 69 +++++++++++++++++++---- pc-bios/s390-netboot.img | Bin 67232 -> 0 bytes25 files changed, 122 insertions(+), 383 deletions(-)delete mode 100644 pc-bios/s390-ccw/netboot.mak
delete mode 100644pc-bios/s390-ccw/libc.h
delete mode 100644pc-bios/s390-ccw/libc.c
delete mode 100644 pc-bios/s390-netboot.img
Quoted 18 lines · Eric Farman
Quoted 11 lines · Thomas Huth
We originally built a separate binary for the netboot code since it was considered as experimental and we could not be sure that the necessary SLOF module had been checked out. Time passed, the netboot code proved its usefulness, and the build system nowadays makes sure that the SLOF module is checked out if you have a s390x compiler available
for building the s390-ccw bios. In fact, the possibility to build the s390-ccw.img without s390-netboot.img has been removed in commitbf6903f6944f("pc-bios/s390-ccw: always build network bootloader") already.Quoted 5 lines
So it does not make too much sense anymore to keep the netboot code in a separate binary. To make it easier to support a more flexible boot process soon that supports more than one boot device via the bootindex properties, let's finally merge the netboot code into the main s390-ccw.img binary now.
Quoted 6 lines
Hi Thomas,
I find myself wondering about the side effects of the s/sclp_print/printf/ changes, but I haven't come up with anything I can put my finger on. Maybe something will come to me over the weekend, but all-in-all I like the looks of this.
I think it should be fine, both functions are basically just a wrapper around the write() function in sclp.c, with sclp_print() being rather dumb while printf() is doing the usual string formatting before writing it out. I think in the long run, it would be nice to get rid of sclp_print() and replace it by puts() or printf() in the whole code, but doing that right now would likely cause quite some conflicts for Jared with his patch series, so I'd rather postpone that to a later point in time.
Quoted 1 line
Reviewed-by Eric Farman <[email protected]>
Thanks!
Thomas
Quoted 3 lines · Thomas Huth
[...]
I think it should be fine, both functions are basically just a wrapper around the
write()function insclp.c, withsclp_print()being rather dumb whileprintf()is doing the usual string formatting before writing it out. I think in the long run, it would be nice to get rid ofsclp_print()and replace it byputs()orprintf()in the whole code, but doing that right now would likely cause quite some conflicts for Jared with his patch series, so I'd rather postpone that to a later point in time.
Hi Thomas,
Converting the panics to returns will require me to modify/move some of the sclp_print() calls. Shall I go ahead and change them to printf() and puts() while I'm at it, or would you rather preserve the sclp_print() for now and then have a dedicated patch for the all replacements later? I'm not sure if we want to try to maintain some amount of consistency until we do a total conversion, or if you are OK with a mix of sclp_print() and printf() throughout in the meantime.
Regards,
Jared Rossi
Quoted 10 lines · Jared Rossi
Quoted 3 lines · Thomas Huth
[...]
I think it should be fine, both functions are basically just a wrapper around the
write()function insclp.c, withsclp_print()being rather dumb whileprintf()is doing the usual string formatting before writing it out. I think in the long run, it would be nice to get rid ofsclp_print()and replace it byputs()orprintf()in the whole code, but doing that right now would likely cause quite some conflicts for Jared with his patch series, so I'd rather postpone that to a later point in time.Hi Thomas,
Converting the panics to returns will require me to modify/move some of the
sclp_print()calls. Shall I go ahead and change them toprintf()andputs()while I'm at it, or would you rather preserve thesclp_print()for now and then have a dedicated patch for the all replacements later? I'm not sure if we want to try to maintain some amount of consistency until we do a total conversion, or if you are OK with a mix ofsclp_print()andprintf()throughout in the meantime.
Hi,
I'm ok if we mix them for a while, so I'd say go ahead and use printf or puts for the new code.
Thomas
Quoted 10 lines · Thomas Huth
We originally built a separate binary for the netboot code since it was considered as experimental and we could not be sure that the necessary SLOF module had been checked out. Time passed, the netboot code proved its usefulness, and the build system nowadays makes sure that the SLOF module is checked out if you have a s390x compiler available for building the s390-ccw bios. In fact, the possibility to build the s390-ccw.img without s390-netboot.img has been removed in commit
bf6903f6944f("pc-bios/s390-ccw: always build network bootloader") already.
Quoted 5 lines
So it does not make too much sense anymore to keep the netboot code in a separate binary. To make it easier to support a more flexible boot process soon that supports more than one boot device via the bootindex properties, let's finally merge the netboot code into the main s390-ccw.img binary now.
Hi Thomas, One area that could possibly be cleaned up further are places where net devices are treated as corner cases due to the separate bootloader. Off the top of my head I know in pc-bios main.c, the is_dev_possibly_bootable() function rejects net devices for this reason. I'm not sure if that is the only place though. Otherwise it looks good to me. I can work on a v2 of the boot order support that assumes the network bootloader is integrated. Regards, Jared Rossi
Quoted 44 lines
Thomas Huth (7):
pc-bios/s390-ccw: Remove duplicated LDFLAGS
hw/s390x/ipl: Provide more memory to the s390-ccw.img firmware pc-bios/s390-ccw: Use the libc from SLOF for the main s390-ccw.img
binary, too
pc-bios/s390-ccw: Link the netboot code into the main s390-ccw.img
binary
hw/s390x: Remove the possibility to load the s390-netboot.img binary pc-bios/s390-ccw: Merge netboot.mak into the mainMakefiledocs/system/s390x/bootdevices: Update the documentation about network
bootingdocs/system/s390x/bootdevices.rst | 20 +++---- pc-bios/s390-ccw/netboot.mak | 62 --------------------- hw/s390x/ipl.h | 12 ++-- pc-bios/s390-ccw/cio.h | 2 + pc-bios/s390-ccw/iplb.h | 4 +- pc-bios/s390-ccw/libc.h | 89 ------------------------------ pc-bios/s390-ccw/s390-ccw.h | 10 +++- pc-bios/s390-ccw/virtio.h | 1 - hw/s390x/ipl.c | 65 +++------------------- hw/s390x/s390-virtio-ccw.c | 10 +--- pc-bios/s390-ccw/bootmap.c | 4 +- pc-bios/s390-ccw/cio.c | 2 +- pc-bios/s390-ccw/dasd-ipl.c | 2 +- pc-bios/s390-ccw/jump2ipl.c | 2 +- pc-bios/s390-ccw/libc.c | 88 ----------------------------- pc-bios/s390-ccw/main.c | 15 +++-- pc-bios/s390-ccw/menu.c | 25 ++++----- pc-bios/s390-ccw/netmain.c | 15 +---- pc-bios/s390-ccw/sclp.c | 2 +- pc-bios/s390-ccw/virtio-blkdev.c | 1 - pc-bios/s390-ccw/virtio-scsi.c | 2 +- pc-bios/s390-ccw/virtio.c | 2 +- pc-bios/meson.build | 1 - pc-bios/s390-ccw/Makefile | 69 +++++++++++++++++++---- pc-bios/s390-netboot.img | Bin 67232 -> 0 bytes 25 files changed, 122 insertions(+), 383 deletions(-)delete mode 100644 pc-bios/s390-ccw/netboot.mak
delete mode 100644pc-bios/s390-ccw/libc.h
delete mode 100644pc-bios/s390-ccw/libc.c
delete mode 100644 pc-bios/s390-netboot.img
Hi Thomas,
I just wanted to get your thoughts on the status of the netboot loader merge. I see that the first patch from this series was merged, but not the others. Is there any issue with the rest of the changes?
I would like to put together a comprehensive rework for all device types that replaces the IPL panics with returns, but as we discussed this is best applied after the netboot loader has been unified with the main s390-ccw.img file.
I can base my patches on either current master (with a special case for netboot) or the combined bootloader, depending on how you would like to proceed. Let me know if there is anything I can do to help with test/review of the changes from your side.
Thanks,
Jared Rossi
Quoted 59 lines · Thomas Huth
We originally built a separate binary for the netboot code since it was considered as experimental and we could not be sure that the necessary SLOF module had been checked out. Time passed, the netboot code proved its usefulness, and the build system nowadays makes sure that the SLOF module is checked out if you have a s390x compiler available for building the s390-ccw bios. In fact, the possibility to build the s390-ccw.img without s390-netboot.img has been removed in commit
bf6903f6944f("pc-bios/s390-ccw: always build network bootloader") already.So it does not make too much sense anymore to keep the netboot code in a separate binary. To make it easier to support a more flexible boot process soon that supports more than one boot device via the bootindex properties, let's finally merge the netboot code into the main s390-ccw.img binary now.
Thomas Huth (7):
pc-bios/s390-ccw: Remove duplicated LDFLAGS
hw/s390x/ipl: Provide more memory to the s390-ccw.img firmware pc-bios/s390-ccw: Use the libc from SLOF for the main s390-ccw.img
binary, too
pc-bios/s390-ccw: Link the netboot code into the main s390-ccw.img
binary
hw/s390x: Remove the possibility to load the s390-netboot.img binary pc-bios/s390-ccw: Merge netboot.mak into the mainMakefiledocs/system/s390x/bootdevices: Update the documentation about network
bootingdocs/system/s390x/bootdevices.rst | 20 +++---- pc-bios/s390-ccw/netboot.mak | 62 --------------------- hw/s390x/ipl.h | 12 ++-- pc-bios/s390-ccw/cio.h | 2 + pc-bios/s390-ccw/iplb.h | 4 +- pc-bios/s390-ccw/libc.h | 89 ------------------------------ pc-bios/s390-ccw/s390-ccw.h | 10 +++- pc-bios/s390-ccw/virtio.h | 1 - hw/s390x/ipl.c | 65 +++------------------- hw/s390x/s390-virtio-ccw.c | 10 +--- pc-bios/s390-ccw/bootmap.c | 4 +- pc-bios/s390-ccw/cio.c | 2 +- pc-bios/s390-ccw/dasd-ipl.c | 2 +- pc-bios/s390-ccw/jump2ipl.c | 2 +- pc-bios/s390-ccw/libc.c | 88 ----------------------------- pc-bios/s390-ccw/main.c | 15 +++-- pc-bios/s390-ccw/menu.c | 25 ++++----- pc-bios/s390-ccw/netmain.c | 15 +---- pc-bios/s390-ccw/sclp.c | 2 +- pc-bios/s390-ccw/virtio-blkdev.c | 1 - pc-bios/s390-ccw/virtio-scsi.c | 2 +- pc-bios/s390-ccw/virtio.c | 2 +- pc-bios/meson.build | 1 - pc-bios/s390-ccw/Makefile | 69 +++++++++++++++++++---- pc-bios/s390-netboot.img | Bin 67232 -> 0 bytes 25 files changed, 122 insertions(+), 383 deletions(-)delete mode 100644 pc-bios/s390-ccw/netboot.mak
delete mode 100644pc-bios/s390-ccw/libc.h
delete mode 100644pc-bios/s390-ccw/libc.c
delete mode 100644 pc-bios/s390-netboot.img
Quoted 5 lines · Jared Rossi
Hi Thomas,
I just wanted to get your thoughts on the status of the netboot loader merge. I see that the first patch from this series was merged, but not the others. Is there any issue with the rest of the changes?
Hi Jared,
there's no issue with that patch series - it's just that QEMU is in freeze now and only accepts bug fixes. See https://wiki.qemu.org/Planning/9.1
Quoted 8 lines
I would like to put together a comprehensive rework for all device types that replaces the IPL panics with returns, but as we discussed this is best applied after the netboot loader has been unified with the main s390-ccw.img file.
I can base my patches on either current master (with a special case for netboot) or the combined bootloader, depending on how you would like to proceed. Let me know if there is anything I can do to help with test/review of the changes from your side.
I think it's maybe best if you'd include my patches at the top of your patch series, so you could also rework them in case you need something to be changed there. That way, we also do not have to rebuild the binaries in the git repo multiple times and just have to update them one time once your series is ready to go.
Alternatively, if you don't want to juggle with my patches, I can also try to get them merged as soon as QEMU 9.1 has been released. Just let me know if you prefer that.
Thomas
Quoted 6 lines · Thomas Huth
I think it's maybe best if you'd include my patches at the top of your patch series, so you could also rework them in case you need something to be changed there. That way, we also do not have to rebuild the binaries in the git repo multiple times and just have to update them one time once your series is ready to go.
Alternatively, if you don't want to juggle with my patches, I can also try to get them merged as soon as QEMU 9.1 has been released. Just let me know if you prefer that.
Thomas
I am fine with including your patches in my series. I will get all that put together and submit a V2 after QEMU 9.1 is squared away.
Thanks again,
Jared Rossi