[SLOF] [PATCH v2] boot: do not use catpad to concatenate strings

Nikunj A Dadhania nikunj at linux.vnet.ibm.com
Thu Dec 7 21:24:45 AEDT 2017


Thomas Huth <thuth at redhat.com> writes:

> On 01.12.2017 11:29, Nikunj A Dadhania wrote:
>> The catpad size is 1K size, which can be hit easily hit with around 20 devices
>> with bootindex.
>> 
>> Open code EVALUATE such that concatenation is not required. Replace usage of
>> $cat with a 16K buffer allocated here.
>> 
>> Reported here: https://github.com/qemu/SLOF/issues/3
>> 
>> Signed-off-by: Nikunj A Dadhania <nikunj at linux.vnet.ibm.com>
>> 
>> ---
>> 
>> qemu-system-ppc64 -nographic -nodefaults -serial stdio -monitor pty -m 2G \
>> -device virtio-scsi-pci    \
>> `for ((i=2;i<=50;i++)) ; \
>> do echo -n "  -drive file=/tmp/storage$i.qcow2,if=none,id=drive$i,format=qcow2 \
>> -device
>> scsi-hd,drive=drive$i,id=disk$i,channel=0,scsi-id=0,lun=$i,bootindex=$i"; \
>> done;` \
>> -drive file=guest.disk,if=none,id=drv1,format=qcow2,cache=none \
>> -device scsi-hd,drive=drv1,bootindex=1 -boot menu=on,splash-time=3000,strict=on
>> ---
>>  slof/fs/boot.fs | 30 +++++++++++++++++++++++++-----
>>  1 file changed, 25 insertions(+), 5 deletions(-)
>> 
>> diff --git a/slof/fs/boot.fs b/slof/fs/boot.fs
>> index 1fd7439..8a30195 100644
>> --- a/slof/fs/boot.fs
>> +++ b/slof/fs/boot.fs
>> @@ -15,6 +15,9 @@
>>  VARIABLE state-valid false state-valid !
>>  CREATE go-args 2 cells allot go-args 2 cells erase
>>  
>> +4000 CONSTANT BOOT_DEV_SIZE
>> +CREATE bootdev-buf BOOT_DEV_SIZE allot
>
> I somehow dislike the idea that we statically reserve such big arrays
> ... would it be feasible to do this with alloc-mem on the fly instead?

Let me try that out

Regards
Nikunj



More information about the SLOF mailing list