On Thu, Jan 17, 2019 at 08:49:04PM +0800, Li Zhijian wrote: > Since linux commit: cf8fa920cb42 ("i386: handle an initrd in highmem (version > 2)") > linux has supported initrd up to 4 GB, but the header field > ramdisk_max is still set to 2 GB to avoid "possible bootloader bugs". > > When use '-kernel vmlinux -initrd initrd.cgz' to launch a VM, > the firmware(it could be linuxboot_dma.bin) helps to read initrd > contents into guest memory(below ramdisk_max) and jump to kernel. > that's similar with what bootloader does, like grub. > > In addition, initrd_max is uint32_t simply because QEMU doesn't support > the 64-bit boot protocol (specifically the ext_ramdisk_image field). > > Therefore here just limit initrd_max to UINT32_MAX simply as well to > allow initrd to be loaded below 4 GB. > > NOTE: it's possible that linux protocol within [0x208, 0x20c] > supports up to 4 GB initrd as well. > > CC: Paolo Bonzini <pbonz...@redhat.com> > CC: Richard Henderson <r...@twiddle.net> > CC: Eduardo Habkost <ehabk...@redhat.com> > CC: "Michael S. Tsirkin" <m...@redhat.com> > CC: Marcel Apfelbaum <marcel.apfelb...@gmail.com> > Signed-off-by: Li Zhijian <lizhij...@cn.fujitsu.com>
Reviewed-by: Eduardo Habkost <ehabk...@redhat.com> Michael, should this go through your tree? -- Eduardo