qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] hw/block/fdc: floppy command FIFO memory initialization
@ 2019-05-29 18:20 Andrey Shinkevich
  2019-05-29 18:22 ` John Snow
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Andrey Shinkevich @ 2019-05-29 18:20 UTC (permalink / raw)
  To: qemu-devel, qemu-block
  Cc: kwolf, vsementsov, mreitz, andrey.shinkevich, den, jsnow

The uninitialized memory allocated for the command FIFO of the
floppy controller during the VM hardware initialization incurs
many unwanted reports by Valgrind when VM state is being saved.
That verbosity hardens a search for the real memory issues when
the iotests run. Particularly, the patch eliminates 20 unnecessary
reports of the Valgrind tool in the iotest #169.

Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
---
v2:
  01: The pointer unnecessary check 'if (fdctrl->fifo)' was removed
      as suggested by John.

 hw/block/fdc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index 6f19f12..9af762b 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -2647,6 +2647,7 @@ static void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl,
 
     FLOPPY_DPRINTF("init controller\n");
     fdctrl->fifo = qemu_memalign(512, FD_SECTOR_LEN);
+    memset(fdctrl->fifo, 0, FD_SECTOR_LEN);
     fdctrl->fifo_size = 512;
     fdctrl->result_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,
                                              fdctrl_result_timer, fdctrl);
-- 
1.8.3.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH v2] hw/block/fdc: floppy command FIFO memory initialization
  2019-05-29 18:20 [Qemu-devel] [PATCH v2] hw/block/fdc: floppy command FIFO memory initialization Andrey Shinkevich
@ 2019-05-29 18:22 ` John Snow
  2019-05-29 18:34 ` John Snow
  2019-05-29 21:38 ` Max Reitz
  2 siblings, 0 replies; 5+ messages in thread
From: John Snow @ 2019-05-29 18:22 UTC (permalink / raw)
  To: Andrey Shinkevich, qemu-devel, qemu-block; +Cc: kwolf, den, vsementsov, mreitz



On 5/29/19 2:20 PM, Andrey Shinkevich wrote:
> The uninitialized memory allocated for the command FIFO of the
> floppy controller during the VM hardware initialization incurs
> many unwanted reports by Valgrind when VM state is being saved.
> That verbosity hardens a search for the real memory issues when
> the iotests run. Particularly, the patch eliminates 20 unnecessary
> reports of the Valgrind tool in the iotest #169.
> 
> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
> ---
> v2:
>   01: The pointer unnecessary check 'if (fdctrl->fifo)' was removed
>       as suggested by John.
> 
>  hw/block/fdc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/block/fdc.c b/hw/block/fdc.c
> index 6f19f12..9af762b 100644
> --- a/hw/block/fdc.c
> +++ b/hw/block/fdc.c
> @@ -2647,6 +2647,7 @@ static void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl,
>  
>      FLOPPY_DPRINTF("init controller\n");
>      fdctrl->fifo = qemu_memalign(512, FD_SECTOR_LEN);
> +    memset(fdctrl->fifo, 0, FD_SECTOR_LEN);
>      fdctrl->fifo_size = 512;
>      fdctrl->result_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,
>                                               fdctrl_result_timer, fdctrl);
> 

Great, thanks!

Reviewed-by: John Snow <jsnow@redhat.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH v2] hw/block/fdc: floppy command FIFO memory initialization
  2019-05-29 18:20 [Qemu-devel] [PATCH v2] hw/block/fdc: floppy command FIFO memory initialization Andrey Shinkevich
  2019-05-29 18:22 ` John Snow
@ 2019-05-29 18:34 ` John Snow
  2019-05-29 21:38 ` Max Reitz
  2 siblings, 0 replies; 5+ messages in thread
From: John Snow @ 2019-05-29 18:34 UTC (permalink / raw)
  To: kwolf, mreitz; +Cc: Andrey Shinkevich, vsementsov, qemu-devel, qemu-block, den



On 5/29/19 2:20 PM, Andrey Shinkevich wrote:
> The uninitialized memory allocated for the command FIFO of the
> floppy controller during the VM hardware initialization incurs
> many unwanted reports by Valgrind when VM state is being saved.
> That verbosity hardens a search for the real memory issues when
> the iotests run. Particularly, the patch eliminates 20 unnecessary
> reports of the Valgrind tool in the iotest #169.
> 
> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
> ---
> v2:
>   01: The pointer unnecessary check 'if (fdctrl->fifo)' was removed
>       as suggested by John.
> 
>  hw/block/fdc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/block/fdc.c b/hw/block/fdc.c
> index 6f19f12..9af762b 100644
> --- a/hw/block/fdc.c
> +++ b/hw/block/fdc.c
> @@ -2647,6 +2647,7 @@ static void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl,
>  
>      FLOPPY_DPRINTF("init controller\n");
>      fdctrl->fifo = qemu_memalign(512, FD_SECTOR_LEN);
> +    memset(fdctrl->fifo, 0, FD_SECTOR_LEN);
>      fdctrl->fifo_size = 512;
>      fdctrl->result_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,
>                                               fdctrl_result_timer, fdctrl);
> 

I guess technically I would send a PR for this but it's just a single
patch, so it'd be nice if it can just get staged in the next block
roundup by whomever.

Max/Kevin, if you would be so kind?

--js


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH v2] hw/block/fdc: floppy command FIFO memory initialization
  2019-05-29 18:20 [Qemu-devel] [PATCH v2] hw/block/fdc: floppy command FIFO memory initialization Andrey Shinkevich
  2019-05-29 18:22 ` John Snow
  2019-05-29 18:34 ` John Snow
@ 2019-05-29 21:38 ` Max Reitz
  2019-05-30  6:47   ` Andrey Shinkevich
  2 siblings, 1 reply; 5+ messages in thread
From: Max Reitz @ 2019-05-29 21:38 UTC (permalink / raw)
  To: Andrey Shinkevich, qemu-devel, qemu-block; +Cc: kwolf, den, vsementsov, jsnow

[-- Attachment #1: Type: text/plain, Size: 883 bytes --]

On 29.05.19 20:20, Andrey Shinkevich wrote:
> The uninitialized memory allocated for the command FIFO of the
> floppy controller during the VM hardware initialization incurs
> many unwanted reports by Valgrind when VM state is being saved.
> That verbosity hardens a search for the real memory issues when
> the iotests run. Particularly, the patch eliminates 20 unnecessary
> reports of the Valgrind tool in the iotest #169.
> 
> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
> ---
> v2:
>   01: The pointer unnecessary check 'if (fdctrl->fifo)' was removed
>       as suggested by John.
> 
>  hw/block/fdc.c | 1 +
>  1 file changed, 1 insertion(+)

Thanks, applied to my block-on-kevin branch:

https://git.xanclic.moe/XanClic/qemu/commits/branch/block-on-kevin

(To become my block branch when my current pull request is done.)

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH v2] hw/block/fdc: floppy command FIFO memory initialization
  2019-05-29 21:38 ` Max Reitz
@ 2019-05-30  6:47   ` Andrey Shinkevich
  0 siblings, 0 replies; 5+ messages in thread
From: Andrey Shinkevich @ 2019-05-30  6:47 UTC (permalink / raw)
  To: Max Reitz, qemu-devel, qemu-block
  Cc: kwolf, Vladimir Sementsov-Ogievskiy, jsnow, Denis Lunev

On 30/05/2019 00:38, Max Reitz wrote:
> On 29.05.19 20:20, Andrey Shinkevich wrote:
>> The uninitialized memory allocated for the command FIFO of the
>> floppy controller during the VM hardware initialization incurs
>> many unwanted reports by Valgrind when VM state is being saved.
>> That verbosity hardens a search for the real memory issues when
>> the iotests run. Particularly, the patch eliminates 20 unnecessary
>> reports of the Valgrind tool in the iotest #169.
>>
>> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
>> ---
>> v2:
>>    01: The pointer unnecessary check 'if (fdctrl->fifo)' was removed
>>        as suggested by John.
>>
>>   hw/block/fdc.c | 1 +
>>   1 file changed, 1 insertion(+)
> 
> Thanks, applied to my block-on-kevin branch:
> 
> https://git.xanclic.moe/XanClic/qemu/commits/branch/block-on-kevin
> 
> (To become my block branch when my current pull request is done.)
> 
> Max
> 

Thank you very much.
Andrey

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-30  6:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-29 18:20 [Qemu-devel] [PATCH v2] hw/block/fdc: floppy command FIFO memory initialization Andrey Shinkevich
2019-05-29 18:22 ` John Snow
2019-05-29 18:34 ` John Snow
2019-05-29 21:38 ` Max Reitz
2019-05-30  6:47   ` Andrey Shinkevich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).