From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQldx-0000Tk-Ds for qemu-devel@nongnu.org; Thu, 20 Mar 2014 18:41:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQldr-0003uM-F9 for qemu-devel@nongnu.org; Thu, 20 Mar 2014 18:40:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50244) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQldr-0003uI-66 for qemu-devel@nongnu.org; Thu, 20 Mar 2014 18:40:51 -0400 Message-ID: <1395355269.21800.19.camel@localhost.localdomain> From: Marcel Apfelbaum Date: Fri, 21 Mar 2014 00:41:09 +0200 In-Reply-To: References: <1395350099-14664-1-git-send-email-marcel.a@redhat.com> <532B645B.5020507@redhat.com> <1395353214.21800.6.camel@localhost.localdomain> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.0 V3] tests/acpi-test: do not run iasl on big endian machines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: "Michael S. Tsirkin" , Alexey Kardashevskiy , Michael Tokarev , QEMU Developers , Stefan Hajnoczi , Paolo Bonzini , Andreas =?ISO-8859-1?Q?F=E4rber?= , Richard Henderson On Thu, 2014-03-20 at 22:17 +0000, Peter Maydell wrote: > On 20 March 2014 22:06, Marcel Apfelbaum wrote: > > On Thu, 2014-03-20 at 22:57 +0100, Paolo Bonzini wrote: > >> Il 20/03/2014 22:14, Marcel Apfelbaum ha scritto: > >> > +# All known versions of iasl on BE machines are broken. > >> > +# TODO: add detection code once a non-broken version makes an appearance. > >> > +if ($iasl -h > /dev/null 2>&1) && > >> > + (lscpu | grep "Byte Order" | grep --quiet "Little Endian" ); then > >> > >> lscpu is not portable. > > I am open to suggestions... > > echo "trivial iasl source" | iasl --compile-options | iasl > --disassemble-options | grep "error" > > Fill in the handwaving with actual syntax ;-) Thanks Peter! Problem with this solution is that if we start from the source, it will compile into a *wrong* AML (e.g header length will be BE and not LE), then the disassemble will *succeed* (!!!). However, the expected AML file will be in the right format and fail :(. I can use one of the expected AML files, but it would not be elegant to use a test file in the configuration script. What about Laszlo's idea? Would something like: X=$(printf '\336\255\276\357' | od -A n -t x4) be acceptable ? Thanks, Marcel > > thanks > -- PMM