[PATCH v3 0/3] hw/elf_ops: clear uninitialized segment space

Laurent Vivier posted 3 patches 3 years ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210429141326.69245-1-laurent@vivier.eu
Test checkpatch passed
include/exec/memory.h | 16 ++++++++++++++++
include/hw/elf_ops.h  | 13 +++++++++++++
hw/core/loader.c      |  4 ++++
softmmu/dma-helpers.c | 16 +---------------
softmmu/physmem.c     | 19 +++++++++++++++++++
5 files changed, 53 insertions(+), 15 deletions(-)
[PATCH v3 0/3] hw/elf_ops: clear uninitialized segment space
Posted by Laurent Vivier 3 years ago
When the mem_size of the segment is bigger than the file_size,
and if this space doesn't overlap another segment, it needs
to be cleared.

When the file is loaded in RAM, it is cleared by the loader (PATCH 2),
when the file is loaded in a ROM, the space is cleared on reset,
when the data of the file is copied from the data buffer to
the machine memory space (PATCH 3).

This series a new function address_space_set() to clear the memory.

v3: add a patch to clear the uninitialized space of the ROM
v2: PMD introduces address_space_set() function

Laurent Vivier (2):
  hw/elf_ops: clear uninitialized segment space
  hw/core/loader: clear uninitialized ROM space

Philippe Mathieu-Daudé (1):
  exec/memory: Extract address_space_set() from dma_memory_set()

 include/exec/memory.h | 16 ++++++++++++++++
 include/hw/elf_ops.h  | 13 +++++++++++++
 hw/core/loader.c      |  4 ++++
 softmmu/dma-helpers.c | 16 +---------------
 softmmu/physmem.c     | 19 +++++++++++++++++++
 5 files changed, 53 insertions(+), 15 deletions(-)

-- 
2.31.1


Re: [PATCH v3 0/3] hw/elf_ops: clear uninitialized segment space
Posted by Laurent Vivier 2 years, 11 months ago
Le 29/04/2021 à 16:13, Laurent Vivier a écrit :
> When the mem_size of the segment is bigger than the file_size,
> and if this space doesn't overlap another segment, it needs
> to be cleared.
> 
> When the file is loaded in RAM, it is cleared by the loader (PATCH 2),
> when the file is loaded in a ROM, the space is cleared on reset,
> when the data of the file is copied from the data buffer to
> the machine memory space (PATCH 3).
> 
> This series a new function address_space_set() to clear the memory.
> 
> v3: add a patch to clear the uninitialized space of the ROM
> v2: PMD introduces address_space_set() function
> 
> Laurent Vivier (2):
>   hw/elf_ops: clear uninitialized segment space
>   hw/core/loader: clear uninitialized ROM space
> 
> Philippe Mathieu-Daudé (1):
>   exec/memory: Extract address_space_set() from dma_memory_set()
> 
>  include/exec/memory.h | 16 ++++++++++++++++
>  include/hw/elf_ops.h  | 13 +++++++++++++
>  hw/core/loader.c      |  4 ++++
>  softmmu/dma-helpers.c | 16 +---------------
>  softmmu/physmem.c     | 19 +++++++++++++++++++
>  5 files changed, 53 insertions(+), 15 deletions(-)
> 

Anyone to merge the series?

Thanks,
Laurent