Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-04-21 Thread Xiang Zheng
Ping? On 2019/4/15 10:39, Xiang Zheng wrote: > On 2019/4/12 18:57, Kevin Wolf wrote: >> Am 12.04.2019 um 11:50 hat Xiang Zheng geschrieben: >>> >>> On 2019/4/12 9:52, Xiang Zheng wrote: On 2019/4/11 20:22, Kevin Wolf wrote: > Okay, so your problem is that blk_pread() writes to the whole

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-04-14 Thread Xiang Zheng
On 2019/4/12 18:57, Kevin Wolf wrote: > Am 12.04.2019 um 11:50 hat Xiang Zheng geschrieben: >> >> On 2019/4/12 9:52, Xiang Zheng wrote: >>> On 2019/4/11 20:22, Kevin Wolf wrote: Okay, so your problem is that blk_pread() writes to the whole buffer, writing explicit zeroes for unallocated

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-04-12 Thread Kevin Wolf
Am 12.04.2019 um 11:50 hat Xiang Zheng geschrieben: > > On 2019/4/12 9:52, Xiang Zheng wrote: > > On 2019/4/11 20:22, Kevin Wolf wrote: > >> Okay, so your problem is that blk_pread() writes to the whole buffer, > >> writing explicit zeroes for unallocated parts of the image, while you > >> would

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-04-12 Thread Xiang Zheng
On 2019/4/12 9:52, Xiang Zheng wrote: > On 2019/4/11 20:22, Kevin Wolf wrote: >> Okay, so your problem is that blk_pread() writes to the whole buffer, >> writing explicit zeroes for unallocated parts of the image, while you >> would like to leave those parts of the buffer untouched so that we

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-04-12 Thread Xiang Zheng
On 2019/4/11 15:15, Markus Armbruster wrote: >> For some historical reasons such as compatibility and extensibility[2], we >> restrict both their size to 64MB -- both UEFI and qemu have cold hard >> constants. > These reasons aren't historical. But they're valid, and that's all that > matters

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-04-11 Thread Xiang Zheng
On 2019/4/11 20:22, Kevin Wolf wrote: > Okay, so your problem is that blk_pread() writes to the whole buffer, > writing explicit zeroes for unallocated parts of the image, while you > would like to leave those parts of the buffer untouched so that we don't > actually allocate the memory, but can

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-04-11 Thread Kevin Wolf
Am 10.04.2019 um 10:36 hat Xiang Zheng geschrieben: > Hi Kevin, > > On 2019/4/9 16:28, Kevin Wolf wrote: > > Am 09.04.2019 um 08:01 hat Markus Armbruster geschrieben: > >> László's last sentence below is "This really needs the attention of the > >> block people." Cc'ing some. > >> > >> Laszlo

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-04-11 Thread Markus Armbruster
Xiang Zheng writes: > Hi Kevin, > > On 2019/4/9 16:28, Kevin Wolf wrote: >> Am 09.04.2019 um 08:01 hat Markus Armbruster geschrieben: >>> László's last sentence below is "This really needs the attention of the >>> block people." Cc'ing some. >>> >>> Laszlo Ersek writes: >>> On 04/08/19

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-04-10 Thread Xiang Zheng
Hi Kevin, On 2019/4/9 16:28, Kevin Wolf wrote: > Am 09.04.2019 um 08:01 hat Markus Armbruster geschrieben: >> László's last sentence below is "This really needs the attention of the >> block people." Cc'ing some. >> >> Laszlo Ersek writes: >> >>> On 04/08/19 15:43, Xiang Zheng wrote:

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-04-09 Thread Kevin Wolf
Am 09.04.2019 um 08:01 hat Markus Armbruster geschrieben: > László's last sentence below is "This really needs the attention of the > block people." Cc'ing some. > > Laszlo Ersek writes: > > > On 04/08/19 15:43, Xiang Zheng wrote: > >> > >> On 2019/4/3 23:35, Laszlo Ersek wrote: > I

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-04-09 Thread Markus Armbruster
László's last sentence below is "This really needs the attention of the block people." Cc'ing some. Laszlo Ersek writes: > On 04/08/19 15:43, Xiang Zheng wrote: >> >> On 2019/4/3 23:35, Laszlo Ersek wrote: I thought about your comments and wrote the following patch (just for test)

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-04-08 Thread Xiang Zheng
On 2019/4/9 0:14, Laszlo Ersek wrote: > On 04/08/19 15:43, Xiang Zheng wrote: >> >> On 2019/4/3 23:35, Laszlo Ersek wrote: I thought about your comments and wrote the following patch (just for test) which uses a file mapping to replace the anonymous mapping. UEFI seems to work

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-04-08 Thread Laszlo Ersek
On 04/08/19 15:43, Xiang Zheng wrote: > > On 2019/4/3 23:35, Laszlo Ersek wrote: >>> I thought about your comments and wrote the following patch (just for test) >>> which uses a file mapping to replace the anonymous mapping. UEFI seems to >>> work >>> fine. So why not use a file mapping to read

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-04-08 Thread Xiang Zheng
On 2019/4/3 23:35, Laszlo Ersek wrote: >> I thought about your comments and wrote the following patch (just for test) >> which uses a file mapping to replace the anonymous mapping. UEFI seems to >> work >> fine. So why not use a file mapping to read or write a pflash device? > Honestly I can't

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-04-03 Thread Laszlo Ersek
On 04/03/19 16:12, Xiang Zheng wrote: > Hi Laszlo and Markus, > > Thanks for your useful suggestions and comments! :) > > On 2019/3/27 2:36, Markus Armbruster wrote: >> Laszlo Ersek writes: >> >>> On 03/26/19 17:39, Markus Armbruster wrote: Laszlo Ersek writes: >>> > With the dynamic

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-04-03 Thread Xiang Zheng
Hi Laszlo and Markus, Thanks for your useful suggestions and comments! :) On 2019/3/27 2:36, Markus Armbruster wrote: > Laszlo Ersek writes: > >> On 03/26/19 17:39, Markus Armbruster wrote: >>> Laszlo Ersek writes: >> With the dynamic sizing in QEMU (which, IIRC, I had originally

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-03-26 Thread Markus Armbruster
Laszlo Ersek writes: > On 03/26/19 17:39, Markus Armbruster wrote: >> Laszlo Ersek writes: > >>> With the dynamic sizing in QEMU (which, IIRC, I had originally >>> introduced still in the 1MB times, due to the split between the >>> executable and varstore parts), both the 1MB->2MB switch, and

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-03-26 Thread Laszlo Ersek
On 03/26/19 17:39, Markus Armbruster wrote: > Laszlo Ersek writes: >> With the dynamic sizing in QEMU (which, IIRC, I had originally >> introduced still in the 1MB times, due to the split between the >> executable and varstore parts), both the 1MB->2MB switch, and the >> 2MB->4MB switch in the

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-03-26 Thread Markus Armbruster
Laszlo Ersek writes: > On 03/26/19 07:17, Markus Armbruster wrote: >> Zheng Xiang writes: >> >>> Hi Peter, >>> >>> Thanks for your reply! >>> >>> On 2019/3/25 21:11, Peter Maydell wrote: On Mon, 25 Mar 2019 at 12:53, Xiang Zheng wrote: > > Currently we fill the VIRT_FLASH space

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-03-26 Thread Laszlo Ersek
On 03/26/19 07:17, Markus Armbruster wrote: > Zheng Xiang writes: > >> Hi Peter, >> >> Thanks for your reply! >> >> On 2019/3/25 21:11, Peter Maydell wrote: >>> On Mon, 25 Mar 2019 at 12:53, Xiang Zheng wrote: Currently we fill the VIRT_FLASH space with two 64MB NOR images when

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-03-26 Thread Markus Armbruster
Zheng Xiang writes: > Hi Peter, > > Thanks for your reply! > > On 2019/3/25 21:11, Peter Maydell wrote: >> On Mon, 25 Mar 2019 at 12:53, Xiang Zheng wrote: >>> >>> Currently we fill the VIRT_FLASH space with two 64MB NOR images when >>> using persistent UEFI variables on QEMU. Actually we only

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-03-25 Thread Zheng Xiang
Hi Peter, Thanks for your reply! On 2019/3/25 21:11, Peter Maydell wrote: > On Mon, 25 Mar 2019 at 12:53, Xiang Zheng wrote: >> >> Currently we fill the VIRT_FLASH space with two 64MB NOR images when >> using persistent UEFI variables on QEMU. Actually we only use a very >> small part of the

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-03-25 Thread Laszlo Ersek
On 03/25/19 14:11, Peter Maydell wrote: > On Mon, 25 Mar 2019 at 12:53, Xiang Zheng wrote: >> >> Currently we fill the VIRT_FLASH space with two 64MB NOR images when >> using persistent UEFI variables on QEMU. Actually we only use a very >> small part of the memory while the rest significant

Re: [Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-03-25 Thread Peter Maydell
On Mon, 25 Mar 2019 at 12:53, Xiang Zheng wrote: > > Currently we fill the VIRT_FLASH space with two 64MB NOR images when > using persistent UEFI variables on QEMU. Actually we only use a very > small part of the memory while the rest significant large part of > memory is wasted. > > This patch

[Qemu-devel] [RFC PATCH] hw/arm/virt: use variable size of flash device to save memory

2019-03-25 Thread Xiang Zheng
Currently we fill the VIRT_FLASH space with two 64MB NOR images when using persistent UEFI variables on QEMU. Actually we only use a very small part of the memory while the rest significant large part of memory is wasted. This patch creates and maps a variable size of flash device instead of a