Monday, December 26, 2022

Re: update seabios (vmm-firmware) removing vmd memory hacks

On Sat, Dec 10, 2022 at 06:12:38PM -0500, Dave Voutila wrote:
> ports@,
>
> Just sent an email to tech@ about this, subject:
> vmd(8): create a proper e820 bios memory map
> https://marc.info/?l=openbsd-tech&m=167071344902372&w=2
>
> In short, this nukes some old hacks we've been carrying to communicate
> things like >4GB of memory to SeaBIOS via CMOS. It assumes vmd(8)
> properly builds and conveys a bios e820 memory map via the fw_cfg api.
>
> While nuking, I also ripped out the etc/screen-and-debug tweak as vmd
> has been communicating that value (0) via fw_cfg for awhile now. There's
> no need to patch that.
>
> The below diff isn't ready to commit until the changes to vmm/vmd land
> (assuming they do), but I wanted to share this for any testers and get
> eyeballs on my approach.
>
> btw, I'm not bumping the SeaBIOS version at all, just revision.
>
> -dv
>

ok mlarkin

> diff refs/heads/master refs/heads/seabios-e820
> commit - 2e9128e724420d4d786f1537c31c67623878de0a
> commit + e27c83b9ed21ac29efaa0a8b2d8238af95799b0c
> blob - ba30a80601c23dfd2f64eaa489418518c1f75800
> blob + 32d68c925aa891000fdf411899d58bbe3805f333
> --- sysutils/firmware/vmm/Makefile
> +++ sysutils/firmware/vmm/Makefile
> @@ -17,7 +17,7 @@ REVISION= 0
> FW_VER= 1.14.0
> SB_VER= 20180715
> DISTNAME= seabios-${FW_VER}
> -REVISION= 0
> +REVISION= 1
> DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \
> sgabios-${SB_VER}{72f39d48bedf044e202fd51fecf3e2218fc2ae66}.tar.gz:0
>
> blob - 2382176b2d3b8f3ca809985fa0cafc40423a3a79
> blob + f81983fb071984dafe9a24ff6781244dbcd0086d
> --- sysutils/firmware/vmm/patches/patch-src_fw_paravirt_c
> +++ sysutils/firmware/vmm/patches/patch-src_fw_paravirt_c
> @@ -1,11 +1,9 @@
> - Don't use 'rep insb' to read IO ports, vmm does not support that yet.
> -- Allow detection of >4GB RAM. Normally seabios only allows this with the
> - QEMU config device which VMM does not have.
>
> Index: src/fw/paravirt.c
> --- src/fw/paravirt.c.orig
> +++ src/fw/paravirt.c
> -@@ -310,7 +310,9 @@ qemu_cfg_read(void *buf, int len)
> +@@ -310,6 +310,8 @@ qemu_cfg_read(void *buf, int len)
> if (qemu_cfg_dma_enabled()) {
> qemu_cfg_dma_transfer(buf, len, QEMU_CFG_DMA_CTL_READ);
> } else {
> @@ -15,23 +13,3 @@ Index: src/fw/paravirt.c
> + *d++ = inb(PORT_QEMU_CFG_DATA);
> }
> }
> -
> -@@ -515,6 +517,18 @@ qemu_cfg_e820(void)
> - e820_add(0xfffbc000, 4*4096, E820_RESERVED);
> - }
> -
> -+ // Check for memory over 4Gig in cmos
> -+ u64 high = ((rtc_read(CMOS_MEM_HIGHMEM_LOW) << 16)
> -+ | ((u32)rtc_read(CMOS_MEM_HIGHMEM_MID) << 24)
> -+ | ((u64)rtc_read(CMOS_MEM_HIGHMEM_HIGH) << 32));
> -+ RamSizeOver4G = high;
> -+ e820_add(0x100000000ull, high, E820_RAM);
> -+ dprintf(1, "RamSizeOver4G: 0x%016llx [cmos]\n", RamSizeOver4G);
> -+}
> -+
> -+void
> -+vmm_check_high_mem(void)
> -+{
> - // Check for memory over 4Gig in cmos
> - u64 high = ((rtc_read(CMOS_MEM_HIGHMEM_LOW) << 16)
> - | ((u32)rtc_read(CMOS_MEM_HIGHMEM_MID) << 24)
> blob - 06accf4cae866712fc782ccc6920e20184ee1957 (mode 644)
> blob + /dev/null
> --- sysutils/firmware/vmm/patches/patch-src_fw_paravirt_h
> +++ /dev/null
> @@ -1,12 +0,0 @@
> -Allow detection of >4GB RAM. Normally seabios only allows this with the
> -QEMU config device which VMM does not have.
> -
> -Index: src/fw/paravirt.h
> ---- src/fw/paravirt.h.orig
> -+++ src/fw/paravirt.h
> -@@ -75,4 +75,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);
> -
> -+void vmm_check_high_mem(void);
> -

No comments:

Post a Comment