From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= Subject: Re: [PATCH RFC 09/23] lz4: add support for OSes that don't have asm/unaligned.h Date: Tue, 22 Apr 2014 16:46:51 +0200 Message-ID: <535680DB.3010206@citrix.com> References: <1397657612-57277-1-git-send-email-roger.pau@citrix.com> <1397657612-57277-10-git-send-email-roger.pau@citrix.com> <21328.2212.347963.413355@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wcby7-0001Y1-T1 for xen-devel@lists.xenproject.org; Tue, 22 Apr 2014 14:46:44 +0000 In-Reply-To: <21328.2212.347963.413355@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: yann.collet.73@gmail.com, xen-devel@lists.xenproject.org, "jbeulich@suse.com" , Ian Campbell , kyungsik.lee@lge.com List-Id: xen-devel@lists.xenproject.org On 17/04/14 19:00, Ian Jackson wrote: > Roger Pau Monne writes ("[PATCH RFC 09/23] lz4: add support for OSes that don't have asm/unaligned.h"): >> Add a configure check for asm/unaligned.h presence, and if it's not >> available open-code the necessary functions for lz4. > > Where did this code come from ? This came from the Linux kernel, see: http://lxr.free-electrons.com/source/include/asm-generic/unaligned.h?v=2.6.25#L80 > > Is there nothing in the FreeBSD environment that we could reuse ? I think there's nothing in FreeBSD that we could use to replace this functions. > >> +struct __una_u32 { uint32_t x __attribute__((packed)); }; >> +struct __una_u16 { uint16_t x __attribute__((packed)); }; > > Are you sure this actually works ? I can't see anything in the GCC > 4.4 docs which requires the compiler to generate special code to > access such a variable. 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. I'm CCing the people that added the LZ4 support to Xen, let's see if they can shed some light on this. Roger.