[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 1/3] s390-ccw.img: Fix sporadic reboot hangs: Ini
From: |
Christian Borntraeger |
Subject: |
Re: [Qemu-devel] [PULL 1/3] s390-ccw.img: Fix sporadic reboot hangs: Initialize next_idx |
Date: |
Thu, 13 Feb 2014 20:39:49 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
On 13/02/14 16:15, Richard Henderson wrote:
> On 02/13/2014 01:17 AM, Christian Borntraeger wrote:
>> The current code does not initialize next_idx as the qemu
>> elf loader does not zero the bss section.
>> Make the initialization explicit.
>>
>> Signed-off-by: Christian Borntraeger <address@hidden>
>> ---
>> pc-bios/s390-ccw/virtio.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c
>> index 4d6e48f..a46914d 100644
>> --- a/pc-bios/s390-ccw/virtio.c
>> +++ b/pc-bios/s390-ccw/virtio.c
>> @@ -124,6 +124,7 @@ static void vring_init(struct vring *vr, unsigned int
>> num, void *p,
>> vr->used->flags = VRING_USED_F_NO_NOTIFY;
>> vr->used->idx = 0;
>> vr->used_idx = 0;
>> + vr->next_idx = 0;
>>
>> debug_print_addr("init vr", vr);
>> }
>>
>
> FWIW, I believe that rom_reset needs to do this re-zeroing of the bss.
> That seems to be the only place we don't take care for datasize != romsize.
>
Indeed, initializing the data as in my patches isnt wrong (and allows to move
that structures around e.g. from a global variable to stack), so it still makes
sense to apply both patches, but the main problem was that the bss section is
not cleared on reset.
So we need to memset from rom->data+rom->datasize to rom->data+rom->romsize
to avoid more of these kind of problems in an add-on patch.
Christian
- [Qemu-devel] [PULL 3/3] s390-ccw.img: new binary rom to match latest fixes, (continued)
[Qemu-devel] [PULL 1/3] s390-ccw.img: Fix sporadic reboot hangs: Initialize next_idx, Christian Borntraeger, 2014/02/13
Re: [Qemu-devel] [PULL 0/3] s390-ccw.img: fix sporadic boot errors, Peter Maydell, 2014/02/13