On Tue, Jan 09, 2018 at 10:39:30PM +0000, Stuart Henderson wrote:
> There was a new release of SeaBIOS recently which includes its own
> serial console redirection code. This updates SeaBIOS, enables
> CONFIG_SERCON and removes SGABIOS and the option rom-related
> code/config.
>
> Working here in a quick test with OpenBSD guest (also gets rid of the
> doubled characters in the boot loader seen before with SGABIOS) but I'm
> not making heavy use of vmm myself.
>
> After building, to test:
>
> fw_update -p /path/to/packages/amd64/ -D unsigned
>
> To revert to the old one in case of problems, pkg_delete vmm-firmware
> and re-run fw_update with no command line.
cool, seems ok to me. if we do a quick sanity test with a linux guest
bootloader (eg can you see grub), then I think this can become the default.
thanks sthen
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/sysutils/firmware/vmm/Makefile,v
> retrieving revision 1.11
> diff -u -p -r1.11 Makefile
> --- Makefile 27 Nov 2017 22:34:14 -0000 1.11
> +++ Makefile 9 Jan 2018 22:38:49 -0000
> @@ -2,22 +2,21 @@
>
> ONLY_FOR_ARCHS= amd64 i386
>
> -# XXX errors with with clang
> +# XXX errors with clang -
> # ./src/string.c:24:16: error: invalid output constraint '=Qi' in asm
> +#
> +# ... and ports-gcc -
> +# ld: Relocatable linking with relocations from format elf64-x86-64
> (out/ccode16.o) to format elf32-i386 (out/code16.o) is not supported
> +
> CC = /usr/bin/gcc
>
> FW_DRIVER= vmm
> -FW_VER= 1.10.2
> -SB_VER= 20100422
> -REVISION= 5
> +FW_VER= 1.11.0
> DISTNAME= seabios-${FW_VER}
> -DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \
> - sgabios-20100422{23d474943dcd55d0550a3d20b3d30e9040a4f15b}.tar.gz:0
>
> HOMEPAGE= https://www.seabios.org/
>
> MASTER_SITES= https://code.coreboot.org/p/seabios/downloads/get/
> -MASTER_SITES0= https://github.com/qemu/sgabios/archive/
>
> # LGPLv3 but distributed via fw_update/firmware.openbsd.org so disable
> # normal packaging.
> @@ -42,31 +41,17 @@ MAKE_FLAGS= PYTHON="${MODPY_BIN}" V=1 EX
> LD32BIT_FLAG=-melf_i386_obsd LD="${LD} -nopie -znorelro"
>
> post-extract:
> - mv ${WRKDIR}/sgabios-* ${WRKDIR}/sgabios
> cp ${FILESDIR}/config ${WRKSRC}/.config
>
> post-build:
> - sed -i 's,^#define BUILD_CL.*,#define BUILD_CL "${SB_VER}",' \
> - ${WRKDIR}/sgabios/sgabios.S
> - cd ${WRKDIR}/sgabios; env ${MAKE_ENV} ${MAKE_PROGRAM} \
> - BUILD_USER='\"_<vmm\"' BUILD_HOST='\"OpenBSD>\"'
> - dd if=/dev/zero of=${WRKDIR}/space bs=1 count=196608
> - cat ${WRKDIR}/sgabios/sgabios.bin ${WRKDIR}/space \
> - ${WRKSRC}/out/bios.bin > ${WRKDIR}/vmm-bios
> - printf 'vmm-bios includes SeaBIOS (LGPLv3) and ' >
> ${WRKDIR}/vmm-bios-license
> - printf 'SGABIOS (Apache License 2.0\\n-----\\n' >>
> ${WRKDIR}/vmm-bios-license
> - cat ${WRKSRC}/COPYING.LESSER >> ${WRKDIR}/vmm-bios-license
> - printf '-----\\n' >> ${WRKDIR}/vmm-bios-license
> - cat ${WRKDIR}/sgabios/COPYING >> ${WRKDIR}/vmm-bios-license
> - printf '-----\\n' >> ${WRKDIR}/vmm-bios-license
> -
> -post-build:
> @if ! grep -q "\"${FW_VER}${EXTRAVERSION}\"" \
> ${WRKSRC}/out/autoversion.h; then printf \
> "\\nPort problem: 'cleanbuild' version string not used.\\n\\n"; \
> tail -2 ${WRKSRC}/out/autoversion.h; echo; exit 1; fi
>
> do-install:
> - ${INSTALL_DATA} ${WRKDIR}/vmm-bios{,-license} ${PREFIX}/firmware/
> + ${INSTALL_DATA} ${WRKSRC}/out/bios.bin ${PREFIX}/firmware/vmm-bios
> + ${INSTALL_DATA} ${WRKSRC}/COPYING.LESSER \
> + ${PREFIX}/firmware/vmm-bios-license
>
> .include <bsd.port.mk>
> Index: distinfo
> ===================================================================
> RCS file: /cvs/ports/sysutils/firmware/vmm/distinfo,v
> retrieving revision 1.2
> diff -u -p -r1.2 distinfo
> --- distinfo 25 Apr 2017 20:09:35 -0000 1.2
> +++ distinfo 9 Jan 2018 22:38:49 -0000
> @@ -1,4 +1,2 @@
> -SHA256 (firmware/seabios-1.10.2.tar.gz) =
> iccLcPp6sXlpTvuVwsidT1Cjk4EyHL7V2DAsubJelT0=
> -SHA256 (firmware/sgabios-20100422.tar.gz) =
> +GidGDnBpBFHhvTWaR61NL95A18Y1Lm93Ijp7+biDg4=
> -SIZE (firmware/seabios-1.10.2.tar.gz) = 589283
> -SIZE (firmware/sgabios-20100422.tar.gz) = 31191
> +SHA256 (firmware/seabios-1.11.0.tar.gz) =
> YitDLruKOwsTuKzNbUoZan6zrxHyQ4FeX3112c65m/c=
> +SIZE (firmware/seabios-1.11.0.tar.gz) = 607746
> Index: files/config
> ===================================================================
> RCS file: /cvs/ports/sysutils/firmware/vmm/files/config,v
> retrieving revision 1.4
> diff -u -p -r1.4 config
> --- files/config 27 Nov 2017 22:34:14 -0000 1.4
> +++ files/config 9 Jan 2018 22:38:49 -0000
> @@ -39,6 +39,7 @@ CONFIG_VIRTIO_SCSI=y
> # CONFIG_PS2PORT is not set
> # CONFIG_USB is not set
> CONFIG_SERIAL=y
> +CONFIG_SERCON=y
> # CONFIG_LPT is not set
> CONFIG_RTC_TIMER=y
> CONFIG_HARDWARE_IRQ=y
> @@ -56,7 +57,7 @@ CONFIG_CDROM_EMU=y
> # CONFIG_PCIBIOS is not set
> CONFIG_APMBIOS=y
> # CONFIG_PNPBIOS is not set
> -CONFIG_OPTIONROMS=y
> +# CONFIG_OPTIONROMS is not set
> # CONFIG_PMM is not set
> CONFIG_BOOT=y
> CONFIG_KEYBOARD=y
> Index: patches/patch-Makefile
> ===================================================================
> RCS file: /cvs/ports/sysutils/firmware/vmm/patches/patch-Makefile,v
> retrieving revision 1.1
> diff -u -p -r1.1 patch-Makefile
> --- patches/patch-Makefile 16 Jul 2017 14:11:21 -0000 1.1
> +++ patches/patch-Makefile 9 Jan 2018 22:38:49 -0000
> @@ -3,7 +3,7 @@ $OpenBSD: patch-Makefile,v 1.1 2017/07/1
> Index: Makefile
> --- Makefile.orig
> +++ Makefile
> -@@ -55,10 +55,18 @@ EXTRAVERSION=
> +@@ -56,10 +56,18 @@ EXTRAVERSION=
>
> CPPFLAGS = -P -MD -MT $@
>
> Index: patches/patch-src_fw_paravirt_c
> ===================================================================
> RCS file: /cvs/ports/sysutils/firmware/vmm/patches/patch-src_fw_paravirt_c,v
> retrieving revision 1.1
> diff -u -p -r1.1 patch-src_fw_paravirt_c
> --- patches/patch-src_fw_paravirt_c 19 Jul 2017 19:33:51 -0000 1.1
> +++ patches/patch-src_fw_paravirt_c 9 Jan 2018 22:38:49 -0000
> @@ -6,7 +6,7 @@ qemu config device which VMM doesn't hav
> Index: src/fw/paravirt.c
> --- src/fw/paravirt.c.orig
> +++ src/fw/paravirt.c
> -@@ -489,6 +489,18 @@ qemu_cfg_e820(void)
> +@@ -500,6 +500,18 @@ qemu_cfg_e820(void)
> dprintf(1, "RamSizeOver4G: 0x%016llx [cmos]\n", RamSizeOver4G);
> }
>
> Index: patches/patch-src_fw_paravirt_h
> ===================================================================
> RCS file: /cvs/ports/sysutils/firmware/vmm/patches/patch-src_fw_paravirt_h,v
> retrieving revision 1.1
> diff -u -p -r1.1 patch-src_fw_paravirt_h
> --- patches/patch-src_fw_paravirt_h 19 Jul 2017 19:33:51 -0000 1.1
> +++ patches/patch-src_fw_paravirt_h 9 Jan 2018 22:38:49 -0000
> @@ -6,7 +6,7 @@ qemu config device which VMM doesn't hav
> Index: src/fw/paravirt.h
> --- src/fw/paravirt.h.orig
> +++ src/fw/paravirt.h
> -@@ -59,4 +59,5 @@ int qemu_cfg_write_file(void *src, struct romfile_s *f
> +@@ -60,4 +60,5 @@ int qemu_cfg_write_file(void *src, struct romfile_s *f
> int qemu_cfg_write_file_simple(void *src, u16 key, u32 offset, u32 len);
> u16 qemu_get_romfile_key(struct romfile_s *file);
>
> Index: patches/patch-src_fw_pciinit_c
> ===================================================================
> RCS file: /cvs/ports/sysutils/firmware/vmm/patches/patch-src_fw_pciinit_c,v
> retrieving revision 1.1
> diff -u -p -r1.1 patch-src_fw_pciinit_c
> --- patches/patch-src_fw_pciinit_c 26 Mar 2017 17:06:29 -0000 1.1
> +++ patches/patch-src_fw_pciinit_c 9 Jan 2018 22:38:49 -0000
> @@ -3,9 +3,10 @@ $OpenBSD: patch-src_fw_pciinit_c,v 1.1 2
> Since we hijacked the OpenBSD PCI vendor ID, this diff should probably
> not be upstreamed.
>
> ---- src/fw/pciinit.c.orig Fri Feb 24 15:01:20 2017
> -+++ src/fw/pciinit.c Sat Mar 25 14:19:56 2017
> -@@ -141,6 +141,11 @@ static int mch_pci_slot_get_irq(struct pci_device *pci
> +Index: src/fw/pciinit.c
> +--- src/fw/pciinit.c.orig
> ++++ src/fw/pciinit.c
> +@@ -142,6 +142,11 @@ static int mch_pci_slot_get_irq(struct pci_device *pci
> return pci_irqs[(pin - 1 + pin_addend) & 3];
> }
>
> @@ -17,7 +18,7 @@ not be upstreamed.
> /* PIIX3/PIIX4 PCI to ISA bridge */
> static void piix_isa_bridge_setup(struct pci_device *pci, void *arg)
> {
> -@@ -506,11 +511,18 @@ static void mch_mem_addr_setup(struct pci_device *dev,
> +@@ -507,11 +512,18 @@ static void mch_mem_addr_setup(struct pci_device *dev,
> pci_io_low_end = acpi_pm_base;
> }
>
> Index: patches/patch-src_hw_pci_ids_h
> ===================================================================
> RCS file: /cvs/ports/sysutils/firmware/vmm/patches/patch-src_hw_pci_ids_h,v
> retrieving revision 1.1
> diff -u -p -r1.1 patch-src_hw_pci_ids_h
> --- patches/patch-src_hw_pci_ids_h 26 Mar 2017 17:06:29 -0000 1.1
> +++ patches/patch-src_hw_pci_ids_h 9 Jan 2018 22:38:49 -0000
> @@ -3,9 +3,10 @@ $OpenBSD: patch-src_hw_pci_ids_h,v 1.1 2
> Since we hijacked the OpenBSD PCI vendor ID, this diff should probably
> not be upstreamed.
>
> ---- src/hw/pci_ids.h.orig Fri Feb 24 15:01:20 2017
> -+++ src/hw/pci_ids.h Sat Mar 25 14:13:05 2017
> -@@ -146,6 +146,9 @@
> +Index: src/hw/pci_ids.h
> +--- src/hw/pci_ids.h.orig
> ++++ src/hw/pci_ids.h
> +@@ -147,6 +147,9 @@
> #define PCI_DEVICE_ID_BERKOM_A4T 0xffa4
> #define PCI_DEVICE_ID_BERKOM_SCITEL_QUADRO 0xffa8
>
> Index: patches/patch-src_optionroms_c
> ===================================================================
> RCS file: patches/patch-src_optionroms_c
> diff -N patches/patch-src_optionroms_c
> --- patches/patch-src_optionroms_c 19 Jul 2017 19:33:51 -0000 1.2
> +++ /dev/null 1 Jan 1970 00:00:00 -0000
> @@ -1,16 +0,0 @@
> -$OpenBSD: patch-src_optionroms_c,v 1.2 2017/07/19 19:33:51 sthen Exp $
> -
> -Needed for SGABIOS option ROM for VMM. Normally these are setup based on
> -the qemu fw_cfg interface (or coreboot CBFS on hardware).
> -
> ---- src/optionroms.c.orig Fri Mar 31 09:34:40 2017
> -+++ src/optionroms.c Fri Mar 31 09:35:35 2017
> -@@ -361,7 +361,7 @@ optionrom_setup(void)
> -
> - // All option roms found and deployed - now build BEV/BCV vectors.
> -
> -- u32 pos = post_vga;
> -+ u32 pos = BUILD_BIOS_ADDR - BUILD_ROM_START;
> - while (pos < rom_get_last()) {
> - struct rom_header *rom = (void*)pos;
> - if (! is_valid_rom(rom)) {
>