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

Re: [Xen-devel] [PATCH RFC 09/23] lz4: add support for OSes that don't have asm/unaligned.h



On 23/04/14 11:09, Ian Campbell wrote:
> On Wed, 2014-04-23 at 11:06 +0200, Roger Pau Monnà wrote:
>> On 23/04/14 10:53, Ian Campbell wrote:
>>> On Tue, 2014-04-22 at 18:40 +0200, Roger Pau Monnà wrote:
>>>> On 22/04/14 17:55, Ian Campbell wrote:
>>>>> On Tue, 2014-04-22 at 16:46 +0200, Roger Pau Monnà wrote:
>>>>>> Anyway, I think this patch and the preceding one are plain wrong, what
>>>>>> we should do is completely remove the bogus dependence on
>>>>>> asm/unaligned.h, which is a Linux specific header file, and open-code
>>>>>> what we need.
>>>>>
>>>>> Am I right that for libxc's lz4 support we are using the Linux kernel's
>>>>> built in decompression code, instead of the relevant userspace library
>>>>> as we do for most other compression algorithms?
>>>>
>>>> No, I don't think we are using Linux kernel's built in decompression
>>>> code,
>>>
>>> Which library provides lz4_decompress_unknownoutputsize then?
>>>
>>> It looks to me like xc_dom_decompress_lz4 gets it from #include
>>> "../../xen/common/lz4/decompress.c" even in the !__MINIOS__ case and:
>>>         $ head -n2 xen/common/lz4/decompress.c
>>>         /*
>>>          * LZ4 Decompressor for Linux kernel
>>>
>>> i.e. this is Linux code (which Linux uses to decompress itself on boot)
>>> copied into the hypervisor.
>>>
>>> Since this is imported code we don't really want to rewrite it so we can
>>> resync easily in the future. It's up to Xen and libxc to provide the
>>> necessary scaffolding (in terms of helpers the unaligned accessors) to
>>> make this code compile.
>>
>> Yes, sorry I misunderstood you, I though you were saying that somehow
>> Xen (or the tools), were relying on the Linux kernel to perform the
>> decompression
> 
> Ah yes, I can see how that was confusing, sorry!
> 
>>  (which makes no sense).
> 
> Indeed.
> 
>> That's my plan, but instead of adding some crappy hack for OSes that
>> don't have asm/unaligned.h, I would like to get rid of that dependency
>> and code the helpers that we need.
> 
> In the scaffolding and not by modifying the imported code I pressume? In
> which case, good thanks!

While working around this issue, I've noticed that xen/common/lz4/defs.h
has one branch for little endian and another one for big endian, but
while compiling libxc, "__LITTLE_ENDIAN" is not defined and we fall into
big endian, which seems wrong, because we don't have support for any big
endian arch.

Would it be OK to get rid of the big endian case, and only support
little endian by default?

Roger.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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