qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] generic-loader: remove the ram_size limit when a loading bin


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] generic-loader: remove the ram_size limit when a loading binary file
Date: Thu, 7 Oct 2021 13:01:03 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0

On 10/7/21 12:12, Damien Hedde wrote:
> 
> 
> On 10/7/21 09:54, Philippe Mathieu-Daudé wrote:
>> On 10/6/21 17:40, Alex Bennée wrote:
>>>
>>> Damien Hedde <damien.hedde@greensocs.com> writes:
>>>
>>>> On 10/6/21 13:49, Philippe Mathieu-Daudé wrote:
>>>>> On 10/6/21 13:37, Damien Hedde wrote:
>>>>>> Right now, we cannot load some binary file if it is bigger than the
>>>>>> machine's ram size. This limitation only occurs when loading a
>>>>>> binary file: we can load a corresponding elf file without this
>>>>>> limitation.
>>>>>>
>>>>>> This is an issue for machines that have small ram or do not use the
>>>>>> ram_size feature at all.
>>>>>>
>>>>>> Also get rid of "hw/boards.h" include, since we needed it only
>>>>>> to access `current_machine`.
>>>>>>
>>>>>> Fixes: e481a1f63c9 ("generic-loader: Add a generic loader")
>>>>>> Signed-off-by: Damien Hedde <damien.hedde@greensocs.com>
>>>>>> ---
>>>>>>
>>>>>> Hi Alistair,
>>>>>>
>>>>>> I found this while experimenting with a ram_size=0 machine.
>>>>
>>>>
>>>>
>>>>> Where are you loading your file?
>>>>>
>>>>
>>>> In a rom.
>>>>
>>>> The loader does not check at all that we are loading to the machine's
>>>> ram. It just check the size for the raw binary file format.
>>>
>>> It does beg the question of why you don't just construct your ROM file
>>> with the image in place there? Is this just a development convenience?
>>
>> generic-loader is designed from a CPU perspective, it uses the CPU AS
>> to load the image.
>>
>> If your image is in ROM, I'm not sure this is the correct API. I'd try
>> to do this without considering any CPU in the picture. The rom_add_*()
>> API might be more appropriate.
>>
>> My 2 cents anyway...
>>
> 
> I was looking for a user way of loading data in a memory-mapped area so
> I cannot use rom_add_*().
> I though the loader goal was to load something to any memory. But maybe
> I am mistaken.

I don't think you are mistaken, you likely found a design limitation
with this device, which isn't as generic as it aims to be.




reply via email to

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