Skip to content

Commit

Permalink
Merge tag 'tags/s390x-2018-06-18' into staging
Browse files Browse the repository at this point in the history
Add support for pxelinux.cfg-style network booting to the s390x firmware

# gpg: Signature made Mon 18 Jun 2018 03:59:06 PM CEST
# gpg:                using RSA key 2ED9D774FE702DB5
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [undefined]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [undefined]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]

* tag 'tags/s390x-2018-06-18':
  pc-bios/s390-ccw: Update the s390-netboot.img binary
  pc-bios/s390-ccw: Optimize the s390-netboot.img for size
  pc-bios/s390-ccw/net: Try to load pxelinux.cfg file accoring to the UUID
  pc-bios/s390-ccw/net: Add support for pxelinux-style config files
  pc-bios/s390-ccw/net: Update code for the latest changes in SLOF
  roms: Update SLOF submodule to current status
  pc-bios/s390-ccw: define loadparm length

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
  • Loading branch information
cohuck committed Jun 18, 2018
2 parents 23ad956 + 4046826 commit 49b67e9
Show file tree
Hide file tree
Showing 9 changed files with 174 additions and 84 deletions.
1 change: 1 addition & 0 deletions pc-bios/s390-ccw/Makefile
Expand Up @@ -15,6 +15,7 @@ OBJECTS = start.o main.o bootmap.o jump2ipl.o sclp.o menu.o \
QEMU_CFLAGS := $(filter -W%, $(QEMU_CFLAGS))
QEMU_CFLAGS += -ffreestanding -fno-delete-null-pointer-checks -msoft-float
QEMU_CFLAGS += -march=z900 -fPIE -fno-strict-aliasing
QEMU_CFLAGS += -fno-asynchronous-unwind-tables
QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), -fno-stack-protector)
LDFLAGS += -Wl,-pie -nostdlib

Expand Down
4 changes: 3 additions & 1 deletion pc-bios/s390-ccw/iplb.h
Expand Up @@ -12,6 +12,8 @@
#ifndef IPLB_H
#define IPLB_H

#define LOADPARM_LEN 8

struct IplBlockCcw {
uint8_t reserved0[85];
uint8_t ssid;
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions pc-bios/s390-ccw/main.c
Expand Up @@ -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 "
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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));
Expand Down
13 changes: 7 additions & 6 deletions pc-bios/s390-ccw/netboot.mak
Expand Up @@ -19,22 +19,23 @@ s390-netboot.img: s390-netboot.elf

# libc files:

LIBC_CFLAGS := $(QEMU_CFLAGS) $(LIBC_INC) $(LIBNET_INC)
LIBC_CFLAGS := $(QEMU_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC)

CTYPE_OBJS = isdigit.o isxdigit.o toupper.o
%.o : $(SLOF_DIR)/lib/libc/ctype/%.c
$(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,"CC","$(TARGET_DIR)$@")

STRING_OBJS = strcat.o strchr.o strcmp.o strcpy.o strlen.o strncmp.o strncpy.o \
strstr.o memset.o memcpy.o memmove.o memcmp.o
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 $@ $<,"CC","$(TARGET_DIR)$@")

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 $@ $<,"CC","$(TARGET_DIR)$@")

STDIO_OBJS = sprintf.o vfprintf.o vsnprintf.o vsprintf.o fprintf.o \
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 $@ $<,"CC","$(TARGET_DIR)$@")
Expand All @@ -50,8 +51,8 @@ libc.a: $(LIBCOBJS)
# 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
LIBNETCFLAGS := $(QEMU_CFLAGS) -DDHCPARCH=0x1F $(LIBC_INC) $(LIBNET_INC)
dhcpv6.o ethernet.o ipv4.o ndp.o tftp.o pxelinux.o
LIBNETCFLAGS := $(QEMU_CFLAGS) $(CFLAGS) -DDHCPARCH=0x1F $(LIBC_INC) $(LIBNET_INC)

%.o : $(SLOF_DIR)/lib/libnet/%.c
$(call quiet-command,$(CC) $(LIBNETCFLAGS) -c -o $@ $<,"CC","$(TARGET_DIR)$@")
Expand Down

0 comments on commit 49b67e9

Please sign in to comment.