qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 1/8] device_tree: Add qemu_devtree_setprop_si


From: Peter Crosthwaite
Subject: Re: [Qemu-devel] [PATCH v2 1/8] device_tree: Add qemu_devtree_setprop_sized_cells() utility functions
Date: Mon, 15 Jul 2013 20:24:17 +1000

Hi Peter,

On Mon, Jul 15, 2013 at 7:44 PM, Peter Maydell <address@hidden> wrote:
> On 15 July 2013 01:30, Peter Crosthwaite <address@hidden> wrote:
>> I have patches on list converting the other "setprop" APIs to Error ** based
>> reporting (as per your suggestion). Once that change happens we will have
>> two separate error schemes for the one fn.
>>
>> For sanity checking user specified values (e.g. command line args) cant it
>> just be done explicitly as required? It seems to me that this will be the
>> exception not the rule, as for DTB generation from machine model a fail
>> here will be a fatal anyway (better handled by Error **).
>>
>> if (acells < 2 && addr >= (1ull << 32)) {
>>    fprintf("your address is too big for this dtb");
>> }
>>
>> LOC looks to be similar and this API gets a little cleaner.
>
> It's trying to allow the arm/boot code to continue to distinguish
> the two error cases it does currently:
>  * RAM start address doesn't fit [a board model error]
>  * RAM size doesn't fit [a user error for which a specific
>    error message is more friendly and helpful]
>
> It's a fatal error in both cases, but the text is different.
>
> I guess I could put a special purpose "if scells is 1 and
> ram_size > 4GB then fail early" check in boot.c...
>

That was what I thinking with the above snippet. It goes with the
caller in this case arm/boot.c. You still need to switch on the return
code in the caller for your multiple error messages so I dont think
you save too much save over just sanity checking args beforehand in
boot.c

Regards,
Peter

> I wanted to catch "user is using a DTB with only 32 bit
> addresses but tried a big fat RAM size", because some earlier
> versions of vexpress DTBs did only use 32 bit cells.
>
> -- PMM
>



reply via email to

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