qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/3] change int len to uin32_t len


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 3/3] change int len to uin32_t len
Date: Thu, 8 Nov 2018 11:14:37 +0000

On 8 November 2018 at 10:59, Li Zhijian <address@hidden> wrote:
> In order to support >= 2G initrd, we need to change len type from int to
> uin32_t.
>
> Below is the flow sample to show how qemu copy initrd from qemu
> side to VM when using optionroms bootlinux_dma.bin:
> dma_memory_read(uint32_t len)
>   -> dma_memory_rw(uint32_t len)
>     -> dma_memory_rw_relaxed(uint32_t len)
>       -> address_space_rw(int len) # len overflow
>         -> address_space_read_full(int len)
>
> CC: Paolo Bonzini <address@hidden>
> CC: Peter Crosthwaite <address@hidden>
> CC: Richard Henderson <address@hidden>
> CC: Philip Li <address@hidden>
> Signed-off-by: Li Zhijian <address@hidden>

If we change this, then "uint32_t" is not the right type. If we
want to allow writes of large chunks of memory through this API
then the right type for the length of a chunk of guest memory
is "hwaddr".

The other way to approach this would be to say that devices
doing DMA mustn't try to do it in enormous chunks like this,
but need to split it up. If we had a coherent story for how
to avoid dma-engine device emulations from sitting in a loop
forever doing guest-requested DMA this would probably tie in
with that, as part of saying "don't do more than X amount of
work at a time without yielding control back to QEMU".

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]