Re: [PATCH] hw/core/loader: allow loading larger ROMs

2024-06-27 Thread Gregor Haas
rom->name, strerror(errno)); > > > +goto err; > > > +} > > > +sz += rc; > > > +} while (sz != rom->datasize); > > I think we can use load_image_size() instead. > > > > > > > > > > *From:* Gregor

RE: [PATCH] hw/core/loader: allow loading larger ROMs

2024-06-27 Thread Xingtao Yao (Fujitsu)
ad_image_size() instead. From: Gregor Haas Sent: Friday, June 28, 2024 1:35 AM To: Yao, Xingtao/姚 幸涛 Cc: qemu-devel@nongnu.org; phi...@linaro.org; richard.hender...@linaro.org Subject: Re: [PATCH] hw/core/loader: allow loading larger ROMs Hi Xingtao, > Can you reproduce this issue? Absolu

Re: [PATCH] hw/core/loader: allow loading larger ROMs

2024-06-27 Thread Gregor Haas
Hi Xingtao, > Can you reproduce this issue? Absolutely! I encountered this when trying to load an OpenSBI payload firmware using the bios option for the QEMU RISC-V virt board. These payload firmwares bundle the entire next boot stage, which in my case is a build of the Linux kernel (which is a st

RE: [PATCH] hw/core/loader: allow loading larger ROMs

2024-06-26 Thread Xingtao Yao (Fujitsu)
Hi, Gregor > > The read() syscall is not guaranteed to return all data from a file. The > default ROM loader implementation currently does not take this into account, > instead failing if all bytes are not read at once. This change wraps the > read() syscall in a do/while loop to ensure all bytes

[PATCH] hw/core/loader: allow loading larger ROMs

2024-06-26 Thread Gregor Haas
The read() syscall is not guaranteed to return all data from a file. The default ROM loader implementation currently does not take this into account, instead failing if all bytes are not read at once. This change wraps the read() syscall in a do/while loop to ensure all bytes of the ROM are read.