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

Re: [Embedded-pv-devel] [PATCH v9] xen: add para-virtual sound interface header files



>>> On 24.11.16 at 15:58, <artem_mygaiev@xxxxxxxx> wrote:
> On 24.11.16 15:31, Jan Beulich wrote:
>>>>> On 24.11.16 at 14:18, <artem_mygaiev@xxxxxxxx> wrote:
>>> On 24.11.16 15:04, Jan Beulich wrote:
>>>>> In my case I need it to at least define Linux specific __packed
>>>>> attribute which is not supported by Win AFAIK.
>>>> ... needs to avoid using platform specific constructs (or making
>>>> other assumptions on the platform). I can only re-iterate: Please
>>>> follow the model other PV protocols already present (without
>>>> repeating their mistakes, if at all possible).
>>> But if we don't pack (or enforce some specific alignment) data
>>> structures used between domains they may have different alignment on
>>> different domains, no?
>> Let me repeat what I've said before: Please take a look at existing
>> interface headers. By properly placing fields and adding explicit
>> padding where needed, you can avoid such layout differences.
> 
> Don't get me wrong - I have checked the i/f headers before. My concern
> is very generic: C standard defines alignment as an
> *implementation-defined* integer, so current implementation is based
> under two assumptions on the guest platforms: a) guest compiler does not
> have "packing" enabled by default and b) alignment follows typical
> values (1 byte for char, 2 bytes for short, ...). While this is true in
> most cases, with some embedded RTOS this may become an issue.

This being true, I think the way existing interfaces have their
header written, there are relatively little extra assumptions: I
think all we require is that types don't have an alignment larger
than their size. In particular point a) can be taken care of by
adding explicit padding fields (as is the case for existing headers).

Jan


_______________________________________________
Embedded-pv-devel mailing list
Embedded-pv-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/cgi-bin/mailman/listinfo/embedded-pv-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.