[Skiboot] [PATCH 09/11] hdat: Parse hostboot memory reservations from HDAT
hegdevasant at linux.vnet.ibm.com
Thu Sep 29 15:27:03 AEST 2016
On 09/29/2016 07:58 AM, Oliver O'Halloran wrote:
> On Wed, Sep 28, 2016 at 10:05 PM, Vasant Hegde
> <hegdevasant at linux.vnet.ibm.com> wrote:
>> +#if !defined(TEST)
>> + mem_reserve_hw(hb_resv_mem->label, hb_resv_mem->start_addr,
> I'm not sure it's safe to use hb_res_mem->label directly as a string.
> The spec doesn't say it needs to be NUL terminated and expects you to
> parse it based on the length field.
Ah! I assumed it will terminate with NULL :-) I agree that its not safe to
assume specially on someone else is passing data :-) Will fix in V2.
>> + (hb_resv_mem->end_addr - hb_resv_mem->start_addr));
> Most of the existing parsing code uses be*_to_cpu() rather than
> reading the values directly. That said I don't think we have any plans
> to make skiboot run little endian so I'm not sure I care...
Its always BE. So many a time we forget to use converters .. But its good to use.
will fix in v2.
More information about the Skiboot