Patchwork qemu: upgrade to 1.6.1

login
register
mail settings
Submitter Chris Patterson
Date Oct. 16, 2013, 12:15 a.m.
Message ID <1381882516-29599-1-git-send-email-cjp256@gmail.com>
Download mbox | patch
Permalink /patch/59971/
State New
Headers show

Comments

Chris Patterson - Oct. 16, 2013, 12:15 a.m.
This update also drops the following patches which appear to have been resolved upstream:
- ftd_header.patch
- target-i386-Fix-aflag-logic-for-CODE64-and-the-0x67-.patch
- target-ppc_fix_bit_extraction.patch

Signed-off-by: Chris Patterson <cjp256@gmail.com>
---
 meta/recipes-devtools/qemu/files/fdt_header.patch  | 39 -----------
 ...-Fix-aflag-logic-for-CODE64-and-the-0x67-.patch | 79 ----------------------
 .../qemu/files/target-ppc_fix_bit_extraction.patch | 70 -------------------
 meta/recipes-devtools/qemu/qemu.inc                |  2 +-
 .../qemu/{qemu_1.5.0.bb => qemu_1.6.1.bb}          | 15 ++--
 5 files changed, 9 insertions(+), 196 deletions(-)
 delete mode 100644 meta/recipes-devtools/qemu/files/fdt_header.patch
 delete mode 100644 meta/recipes-devtools/qemu/files/target-i386-Fix-aflag-logic-for-CODE64-and-the-0x67-.patch
 delete mode 100644 meta/recipes-devtools/qemu/files/target-ppc_fix_bit_extraction.patch
 rename meta/recipes-devtools/qemu/{qemu_1.5.0.bb => qemu_1.6.1.bb} (44%)
Saul Wold - Oct. 24, 2013, 8:48 a.m.
On 10/15/2013 05:15 PM, Chris Patterson wrote:
> This update also drops the following patches which appear to have been resolved upstream:
> - ftd_header.patch
> - target-i386-Fix-aflag-logic-for-CODE64-and-the-0x67-.patch
> - target-ppc_fix_bit_extraction.patch
>
There seems to be a problem with one of the patches when building for 
the nativesdk
> ERROR: Command Error: exit status: 1  Output:
> Applying patch relocatable_sdk.patch
> can't find file to patch at input line 13
> Perhaps you used the wrong -p or --strip option?
> The text leading up to this was:
> --------------------------
> |Upstream-Status: Inappropriate [SDK specific]
> |
> |In order to be able to change the dynamic loader path when relocating
> |binaries, the interp section has to be made big enough to accomodate
> |the new path (4096 is the maximum path length in Linux).
> |
> |Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
> |
> |Index: qemu-1.4.0/ldscripts/i386.ld
> |===================================================================
> |--- qemu-1.4.0.orig/ldscripts/i386.ld	2013-02-15 15:05:35.000000000 -0800
> |+++ qemu-1.4.0/ldscripts/i386.ld	2013-02-28 22:55:36.138816418 -0800
> --------------------------
> No file to patch.  Skipping patch.
> 1 out of 1 hunk ignored
> can't find file to patch at input line 26
> Perhaps you used the wrong -p or --strip option?
> The text leading up to this was:
> --------------------------
> |Index: qemu-1.4.0/ldscripts/x86_64.ld
> |===================================================================
> |--- qemu-1.4.0.orig/ldscripts/x86_64.ld	2013-02-15 15:05:35.000000000 -0800
> |+++ qemu-1.4.0/ldscripts/x86_64.ld	2013-02-28 22:55:36.138816418 -0800
> --------------------------
> No file to patch.  Skipping patch.
> 1 out of 1 hunk ignored
> Patch relocatable_sdk.patch does not apply (enforce with -f)
> ERROR: Function failed: patch_do_patch

Also, since qemu is core to the testing and developmen, can you clarify 
for us what kind of testing you have done across the architectures.

Thanks
	Sau!



> Signed-off-by: Chris Patterson <cjp256@gmail.com>
> ---
>   meta/recipes-devtools/qemu/files/fdt_header.patch  | 39 -----------
>   ...-Fix-aflag-logic-for-CODE64-and-the-0x67-.patch | 79 ----------------------
>   .../qemu/files/target-ppc_fix_bit_extraction.patch | 70 -------------------
>   meta/recipes-devtools/qemu/qemu.inc                |  2 +-
>   .../qemu/{qemu_1.5.0.bb => qemu_1.6.1.bb}          | 15 ++--
>   5 files changed, 9 insertions(+), 196 deletions(-)
>   delete mode 100644 meta/recipes-devtools/qemu/files/fdt_header.patch
>   delete mode 100644 meta/recipes-devtools/qemu/files/target-i386-Fix-aflag-logic-for-CODE64-and-the-0x67-.patch
>   delete mode 100644 meta/recipes-devtools/qemu/files/target-ppc_fix_bit_extraction.patch
>   rename meta/recipes-devtools/qemu/{qemu_1.5.0.bb => qemu_1.6.1.bb} (44%)
>
> diff --git a/meta/recipes-devtools/qemu/files/fdt_header.patch b/meta/recipes-devtools/qemu/files/fdt_header.patch
> deleted file mode 100644
> index dccfe53..0000000
> --- a/meta/recipes-devtools/qemu/files/fdt_header.patch
> +++ /dev/null
> @@ -1,39 +0,0 @@
> -Upstream-Status: Pending
> -
> -qemu: define fdt types in libfdt_env.h from qemu
> -
> -    * fixes
> -    In file included from /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/libfdt.h:55:0,
> -                     from /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/work/x86_64-linux/qemu-native/1.4.0-r0/qemu-1.4.0/hw/arm/../../device_tree.c:28:
> -    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:58:2: error: unknown type name 'fdt32_t'
> -    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:59:2: error: unknown type name 'fdt32_t'
> -    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:60:2: error: unknown type name 'fdt32_t'
> -    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:61:2: error: unknown type name 'fdt32_t'
> -    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:62:2: error: unknown type name 'fdt32_t'
> -    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:63:2: error: unknown type name 'fdt32_t'
> -    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:64:2: error: unknown type name 'fdt32_t'
> -    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:67:2: error: unknown type name 'fdt32_t'
> -    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:70:2: error: unknown type name 'fdt32_t'
> -    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:73:2: error: unknown type name 'fdt32_t'
> -    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:77:2: error: unknown type name 'fdt64_t'
> -    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:78:2: error: unknown type name 'fdt64_t'
> -    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:82:2: error: unknown type name 'fdt32_t'
> -    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:87:2: error: unknown type name 'fdt32_t'
> -    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:88:2: error: unknown type name 'fdt32_t'
> -    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:89:2: error: unknown type name 'fdt32_t'
> -
> -Index: qemu-1.4.0/include/libfdt_env.h
> -===================================================================
> ---- qemu-1.4.0.orig/include/libfdt_env.h	2013-02-15 23:05:35.000000000 +0000
> -+++ qemu-1.4.0/include/libfdt_env.h	2013-04-13 14:17:27.918885225 +0000
> -@@ -21,6 +21,10 @@
> -
> - #include "qemu/bswap.h"
> -
> -+typedef uint16_t fdt16_t;
> -+typedef uint32_t fdt32_t;
> -+typedef uint64_t fdt64_t;
> -+
> - #ifdef HOST_WORDS_BIGENDIAN
> - #define fdt32_to_cpu(x)  (x)
> - #define cpu_to_fdt32(x)  (x)
> diff --git a/meta/recipes-devtools/qemu/files/target-i386-Fix-aflag-logic-for-CODE64-and-the-0x67-.patch b/meta/recipes-devtools/qemu/files/target-i386-Fix-aflag-logic-for-CODE64-and-the-0x67-.patch
> deleted file mode 100644
> index 852efd1..0000000
> --- a/meta/recipes-devtools/qemu/files/target-i386-Fix-aflag-logic-for-CODE64-and-the-0x67-.patch
> +++ /dev/null
> @@ -1,79 +0,0 @@
> -Upstream-Status: Backported
> -
> -From dec3fc9657e0682637de4d5a29d947284d01985c Mon Sep 17 00:00:00 2001
> -From: Richard Henderson <rth@twiddle.net>
> -Date: Wed, 29 May 2013 12:30:51 -0700
> -Subject: [PATCH] target-i386: Fix aflag logic for CODE64 and the 0x67 prefix
> -
> -The code reorganization in commit 4a6fd938 broke handling of PREFIX_ADR.
> -While fixing this, tidy and comment the code so that it's more obvious
> -what's going on in setting both aflag and dflag.
> -
> -The TARGET_X86_64 ifdef can be eliminated because CODE64 expands to the
> -constant zero when TARGET_X86_64 is undefined.
> -
> -Cc: Paolo Bonzini <pbonzini@redhat.com>
> -Reported-by: Laszlo Ersek <lersek@redhat.com>
> -Signed-off-by: Richard Henderson <rth@twiddle.net>
> -Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> -Message-id: 1369855851-21400-1-git-send-email-rth@twiddle.net
> -Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
> ----
> - target-i386/translate.c |   30 +++++++++++++++---------------
> - 1 file changed, 15 insertions(+), 15 deletions(-)
> -
> -diff --git a/target-i386/translate.c b/target-i386/translate.c
> -index 0aeccdb..14b0298 100644
> ---- a/target-i386/translate.c
> -+++ b/target-i386/translate.c
> -@@ -4677,8 +4677,6 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
> -     }
> -     s->pc = pc_start;
> -     prefixes = 0;
> --    aflag = s->code32;
> --    dflag = s->code32;
> -     s->override = -1;
> -     rex_w = -1;
> -     rex_r = 0;
> -@@ -4801,23 +4799,25 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
> -     }
> -
> -     /* Post-process prefixes.  */
> --    if (prefixes & PREFIX_DATA) {
> --        dflag ^= 1;
> --    }
> --    if (prefixes & PREFIX_ADR) {
> --        aflag ^= 1;
> --    }
> --#ifdef TARGET_X86_64
> -     if (CODE64(s)) {
> --        if (rex_w == 1) {
> --            /* 0x66 is ignored if rex.w is set */
> --            dflag = 2;
> -+        /* In 64-bit mode, the default data size is 32-bit.  Select 64-bit
> -+           data with rex_w, and 16-bit data with 0x66; rex_w takes precedence
> -+           over 0x66 if both are present.  */
> -+        dflag = (rex_w > 0 ? 2 : prefixes & PREFIX_DATA ? 0 : 1);
> -+        /* In 64-bit mode, 0x67 selects 32-bit addressing.  */
> -+        aflag = (prefixes & PREFIX_ADR ? 1 : 2);
> -+    } else {
> -+        /* In 16/32-bit mode, 0x66 selects the opposite data size.  */
> -+        dflag = s->code32;
> -+        if (prefixes & PREFIX_DATA) {
> -+            dflag ^= 1;
> -         }
> --        if (!(prefixes & PREFIX_ADR)) {
> --            aflag = 2;
> -+        /* In 16/32-bit mode, 0x67 selects the opposite addressing.  */
> -+        aflag = s->code32;
> -+        if (prefixes & PREFIX_ADR) {
> -+            aflag ^= 1;
> -         }
> -     }
> --#endif
> -
> -     s->prefix = prefixes;
> -     s->aflag = aflag;
> ---
> -1.7.9.5
> -
> diff --git a/meta/recipes-devtools/qemu/files/target-ppc_fix_bit_extraction.patch b/meta/recipes-devtools/qemu/files/target-ppc_fix_bit_extraction.patch
> deleted file mode 100644
> index 631d23b..0000000
> --- a/meta/recipes-devtools/qemu/files/target-ppc_fix_bit_extraction.patch
> +++ /dev/null
> @@ -1,70 +0,0 @@
> -Delivered-To: raj.khem@gmail.com
> -Received: by 10.50.216.195 with SMTP id os3csp11191igc;
> -        Thu, 15 Aug 2013 04:32:45 -0700 (PDT)
> -X-Received: by 10.180.98.3 with SMTP id ee3mr1508103wib.48.1376566364872;
> -        Thu, 15 Aug 2013 04:32:44 -0700 (PDT)
> -Return-Path: <aurelien@aurel32.net>
> -Received: from hall.aurel32.net (hall.aurel32.net. [2001:470:1f0b:4a8::1])
> -        by mx.google.com with ESMTPS id vv5si15578100wjc.49.2013.08.15.04.32.44
> -        for <raj.khem@gmail.com>
> -        (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
> -        Thu, 15 Aug 2013 04:32:44 -0700 (PDT)
> -Received-SPF: pass (google.com: best guess record for domain of aurelien@aurel32.net designates 2001:470:1f0b:4a8::1 as permitted sender) client-ip=2001:470:1f0b:4a8::1;
> -Authentication-Results: mx.google.com;
> -       spf=pass (google.com: best guess record for domain of aurelien@aurel32.net designates 2001:470:1f0b:4a8::1 as permitted sender) smtp.mail=aurelien@aurel32.net
> -Received: from [2001:470:d4ed:1:2db:dfff:fe14:52d] (helo=ohm.aurel32.net)
> -	by hall.aurel32.net with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128)
> -	(Exim 4.80)
> -	(envelope-from <aurelien@aurel32.net>)
> -	id 1V9vnG-0006cO-NN; Thu, 15 Aug 2013 13:32:42 +0200
> -Received: from aurel32 by ohm.aurel32.net with local (Exim 4.80)
> -	(envelope-from <aurelien@aurel32.net>)
> -	id 1V9vnF-0002Lw-7L; Thu, 15 Aug 2013 13:32:41 +0200
> -From: Aurelien Jarno <aurelien@aurel32.net>
> -To: qemu-devel@nongnu.org
> -Cc: Khem Raj <raj.khem@gmail.com>,
> -	Alexander Graf <agraf@suse.de> ,
> -	qemu-stable@nongnu.org,
> -	qemu-ppc@nongnu.org,
> -	Aurelien Jarno <aurelien@aurel32.net>
> -Subject: [PATCH] target-ppc: fix bit extraction for FPBF and FPL
> -Date: Thu, 15 Aug 2013 13:32:38 +0200
> -Message-Id: <1376566358-8989-1-git-send-email-aurelien@aurel32.net>
> -X-Mailer: git-send-email 1.7.10.4
> -
> -Bit extraction for the FP BF and L field of the MTFSFI and MTFSF
> -instructions is wrong and doesn't match the reference manual (which
> -explain the bit number in big endian format). It has been broken in
> -commit 7d08d85645def18eac2a9d672c1868a35e0bcf79.
> -
> -This patch fixes this, which in turn fixes the problem reported by
> -Khem Raj about the floor() function of libm.
> -
> -Reported-by: Khem Raj <raj.khem@gmail.com>
> -Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> -
> -Upstream-Status: Backport
> -
> ----
> - target-ppc/translate.c |    4 ++--
> - 1 file changed, 2 insertions(+), 2 deletions(-)
> -
> -I don't know if we still have time to get this into 1.6, hence the Cc:
> -to stable. In anycase it also needs to be fixed in 1.5.
> -
> -Index: qemu-1.5.0/target-ppc/translate.c
> -===================================================================
> ---- qemu-1.5.0.orig/target-ppc/translate.c	2013-05-20 08:34:40.000000000 -0700
> -+++ qemu-1.5.0/target-ppc/translate.c	2013-08-15 06:49:25.028144352 -0700
> -@@ -428,9 +428,9 @@
> - EXTRACT_HELPER(SR, 16, 4);
> -
> - /* mtfsf/mtfsfi */
> --EXTRACT_HELPER(FPBF, 19, 3);
> -+EXTRACT_HELPER(FPBF, 23, 3);
> - EXTRACT_HELPER(FPIMM, 12, 4);
> --EXTRACT_HELPER(FPL, 21, 1);
> -+EXTRACT_HELPER(FPL, 25, 1);
> - EXTRACT_HELPER(FPFLM, 17, 8);
> - EXTRACT_HELPER(FPW, 16, 1);
> -
> diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
> index 1b861d7..e533a84 100644
> --- a/meta/recipes-devtools/qemu/qemu.inc
> +++ b/meta/recipes-devtools/qemu/qemu.inc
> @@ -55,7 +55,7 @@ do_configure() {
>          KVMOPTS="--enable-kvm"
>       fi
>
> -    ${S}/configure --prefix=${prefix} --sysconfdir=${sysconfdir} --libexecdir=${libexecdir} --disable-strip ${EXTRA_OECONF} $KVMOPTS
> +    ${S}/configure --prefix=${prefix} --sysconfdir=${sysconfdir} --libexecdir=${libexecdir} --localstatedir=${localstatedir} --disable-strip ${EXTRA_OECONF} $KVMOPTS
>       test ! -e ${S}/target-i386/beginend_funcs.sh || chmod a+x ${S}/target-i386/beginend_funcs.sh
>   }
>
> diff --git a/meta/recipes-devtools/qemu/qemu_1.5.0.bb b/meta/recipes-devtools/qemu/qemu_1.6.1.bb
> similarity index 44%
> rename from meta/recipes-devtools/qemu/qemu_1.5.0.bb
> rename to meta/recipes-devtools/qemu/qemu_1.6.1.bb
> index 06c2cdb..03e28a0 100644
> --- a/meta/recipes-devtools/qemu/qemu_1.5.0.bb
> +++ b/meta/recipes-devtools/qemu/qemu_1.6.1.bb
> @@ -3,14 +3,15 @@ require qemu.inc
>   LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
>                       file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913"
>
> -SRC_URI += "file://fdt_header.patch \
> -            file://target-i386-Fix-aflag-logic-for-CODE64-and-the-0x67-.patch \
> -            file://target-ppc_fix_bit_extraction.patch \
> -            file://fxrstorssefix.patch \
> -           "
> +SRC_URI += "file://fxrstorssefix.patch"
>
>   SRC_URI_prepend = "http://wiki.qemu.org/download/qemu-${PV}.tar.bz2"
> -SRC_URI[md5sum] = "b6f3265b8ed39d77e8f354f35cc26e16"
> -SRC_URI[sha256sum] = "b22b30ee9712568dfb4eedf76783f4a76546e1cbc41659b909646bcf0b4867bb"
> +SRC_URI[md5sum] = "3a897d722457c5a895cd6ac79a28fda0"
> +SRC_URI[sha256sum] = "fc736f44aa10478223c881310a7e40fc8386547e9cadf7d01ca4685951605294"
>
>   COMPATIBLE_HOST_class-target_mips64 = "null"
> +
> +do_install_append() {
> +    # Prevent QA warnings about installed ${localstatedir}/run
> +    if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi
> +}
>
Chris Patterson - Oct. 28, 2013, 11:54 p.m.
Hey Saul,

My tests built qemu-native, qemu-helper-native, qemuwrapper-cross, and qemu
for MACHINE_LIST="qemuarm qemumips qemuppc qemux86 qemux86-64 qemux86
sugarbay".  For each machine, I tested running core-image-minimal in the
qemu instance using runqemu.  I should add that my tests were all on a
x86-64 build system.

I'm not terribly familiar with the nativesdk, and (foolishly) neglected to
test that.  However, I looked into it, and it looks like the
relocatable_sdk.patch affects a linker script that is no longer available.
 I dropped the patch and tested installing an oe-core sdk sysroot (via
bitbake -c populate_sdk core-image-minimal) and qemu appears to work fine
from within the sdk environment.

I'm open to suggestions for further testing this upgrade (particularly a
case to cover what relocatable_sdk.patch was originally intended to
resolve). I'm certainly not the expert here, but am willing to help out.

Other notes:

- I did notice that qemu-native should possibly depend on libsdl for the
qemu-native instance.  For users of qemu-native (such as myself), you do
not necessarily get an automatic (SDL) video window unless libsdl
development libraries are installed on the build system. This is perhaps
because there does not appear to be a libsdl-native dependency available
for qemu, but from my testing seemingly pretty straightforward to add.
 However, from docs I've seen online ("getting started - openembedded")
imply you should install libsdl-dev for the build environemnt, and this
does enable SDL support (assuming libsdl is available).  In short,
nativesdk does specify nativesdk-libsdl as a dependency and native does not
(in fact, there is no libsdl-native), and as a result, user may see
differences in behavior.  I assume this is intended...?

- I'm using bitbake from master and have a missing fcntl python module
dependency in my sdk in order to use runqemu wrapper from within the sdk
environment.  I assume that this is not supposed to work and running
qemu-system-* directly within the sdk environment bypasses this issue.

Cheers,
Chris


On Thu, Oct 24, 2013 at 4:48 AM, Saul Wold <sgw@linux.intel.com> wrote:

> On 10/15/2013 05:15 PM, Chris Patterson wrote:
>
>> This update also drops the following patches which appear to have been
>> resolved upstream:
>> - ftd_header.patch
>> - target-i386-Fix-aflag-logic-**for-CODE64-and-the-0x67-.patch
>> - target-ppc_fix_bit_extraction.**patch
>>
>>  There seems to be a problem with one of the patches when building for
> the nativesdk
>
>> ERROR: Command Error: exit status: 1  Output:
>> Applying patch relocatable_sdk.patch
>> can't find file to patch at input line 13
>> Perhaps you used the wrong -p or --strip option?
>> The text leading up to this was:
>> --------------------------
>> |Upstream-Status: Inappropriate [SDK specific]
>> |
>> |In order to be able to change the dynamic loader path when relocating
>> |binaries, the interp section has to be made big enough to accomodate
>> |the new path (4096 is the maximum path length in Linux).
>> |
>> |Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
>> |
>> |Index: qemu-1.4.0/ldscripts/i386.ld
>> |=============================**==============================**========
>> |--- qemu-1.4.0.orig/ldscripts/**i386.ld  2013-02-15 15:05:35.000000000
>> -0800
>> |+++ qemu-1.4.0/ldscripts/i386.ld       2013-02-28 22:55:36.138816418
>> -0800
>> --------------------------
>> No file to patch.  Skipping patch.
>> 1 out of 1 hunk ignored
>> can't find file to patch at input line 26
>> Perhaps you used the wrong -p or --strip option?
>> The text leading up to this was:
>> --------------------------
>> |Index: qemu-1.4.0/ldscripts/x86_64.ld
>> |=============================**==============================**========
>> |--- qemu-1.4.0.orig/ldscripts/x86_**64.ld        2013-02-15
>> 15:05:35.000000000 -0800
>> |+++ qemu-1.4.0/ldscripts/x86_64.ld     2013-02-28 22:55:36.138816418
>> -0800
>> --------------------------
>> No file to patch.  Skipping patch.
>> 1 out of 1 hunk ignored
>> Patch relocatable_sdk.patch does not apply (enforce with -f)
>> ERROR: Function failed: patch_do_patch
>>
>
> Also, since qemu is core to the testing and developmen, can you clarify
> for us what kind of testing you have done across the architectures.
>
> Thanks
>         Sau!
>
>
>
>
>  Signed-off-by: Chris Patterson <cjp256@gmail.com>
>> ---
>>   meta/recipes-devtools/qemu/**files/fdt_header.patch  | 39 -----------
>>   ...-Fix-aflag-logic-for-**CODE64-and-the-0x67-.patch | 79
>> ----------------------
>>   .../qemu/files/target-ppc_fix_**bit_extraction.patch | 70
>> -------------------
>>   meta/recipes-devtools/qemu/**qemu.inc                |  2 +-
>>   .../qemu/{qemu_1.5.0.bb => qemu_1.6.1.bb}          | 15 ++--
>>   5 files changed, 9 insertions(+), 196 deletions(-)
>>   delete mode 100644 meta/recipes-devtools/qemu/**files/fdt_header.patch
>>   delete mode 100644 meta/recipes-devtools/qemu/**
>> files/target-i386-Fix-aflag-**logic-for-CODE64-and-the-0x67-**.patch
>>   delete mode 100644 meta/recipes-devtools/qemu/**
>> files/target-ppc_fix_bit_**extraction.patch
>>   rename meta/recipes-devtools/qemu/{qe**mu_1.5.0.bb<http://qemu_1.5.0.bb>=>
>> qemu_1.6.1.bb} (44%)
>>
>> diff --git a/meta/recipes-devtools/qemu/**files/fdt_header.patch
>> b/meta/recipes-devtools/qemu/**files/fdt_header.patch
>> deleted file mode 100644
>> index dccfe53..0000000
>> --- a/meta/recipes-devtools/qemu/**files/fdt_header.patch
>> +++ /dev/null
>> @@ -1,39 +0,0 @@
>> -Upstream-Status: Pending
>> -
>> -qemu: define fdt types in libfdt_env.h from qemu
>> -
>> -    * fixes
>> -    In file included from /home/oe/setup-scripts/build/**
>> tmp-angstrom_next-uclibc/**sysroots/x86_64-linux/usr/**
>> include/libfdt.h:55:0,
>> -                     from /home/oe/setup-scripts/build/**
>> tmp-angstrom_next-uclibc/work/**x86_64-linux/qemu-native/1.4.**
>> 0-r0/qemu-1.4.0/hw/arm/../../**device_tree.c:28:
>> -    /home/oe/setup-scripts/build/**tmp-angstrom_next-uclibc/**
>> sysroots/x86_64-linux/usr/**include/fdt.h:58:2: error: unknown type name
>> 'fdt32_t'
>> -    /home/oe/setup-scripts/build/**tmp-angstrom_next-uclibc/**
>> sysroots/x86_64-linux/usr/**include/fdt.h:59:2: error: unknown type name
>> 'fdt32_t'
>> -    /home/oe/setup-scripts/build/**tmp-angstrom_next-uclibc/**
>> sysroots/x86_64-linux/usr/**include/fdt.h:60:2: error: unknown type name
>> 'fdt32_t'
>> -    /home/oe/setup-scripts/build/**tmp-angstrom_next-uclibc/**
>> sysroots/x86_64-linux/usr/**include/fdt.h:61:2: error: unknown type name
>> 'fdt32_t'
>> -    /home/oe/setup-scripts/build/**tmp-angstrom_next-uclibc/**
>> sysroots/x86_64-linux/usr/**include/fdt.h:62:2: error: unknown type name
>> 'fdt32_t'
>> -    /home/oe/setup-scripts/build/**tmp-angstrom_next-uclibc/**
>> sysroots/x86_64-linux/usr/**include/fdt.h:63:2: error: unknown type name
>> 'fdt32_t'
>> -    /home/oe/setup-scripts/build/**tmp-angstrom_next-uclibc/**
>> sysroots/x86_64-linux/usr/**include/fdt.h:64:2: error: unknown type name
>> 'fdt32_t'
>> -    /home/oe/setup-scripts/build/**tmp-angstrom_next-uclibc/**
>> sysroots/x86_64-linux/usr/**include/fdt.h:67:2: error: unknown type name
>> 'fdt32_t'
>> -    /home/oe/setup-scripts/build/**tmp-angstrom_next-uclibc/**
>> sysroots/x86_64-linux/usr/**include/fdt.h:70:2: error: unknown type name
>> 'fdt32_t'
>> -    /home/oe/setup-scripts/build/**tmp-angstrom_next-uclibc/**
>> sysroots/x86_64-linux/usr/**include/fdt.h:73:2: error: unknown type name
>> 'fdt32_t'
>> -    /home/oe/setup-scripts/build/**tmp-angstrom_next-uclibc/**
>> sysroots/x86_64-linux/usr/**include/fdt.h:77:2: error: unknown type name
>> 'fdt64_t'
>> -    /home/oe/setup-scripts/build/**tmp-angstrom_next-uclibc/**
>> sysroots/x86_64-linux/usr/**include/fdt.h:78:2: error: unknown type name
>> 'fdt64_t'
>> -    /home/oe/setup-scripts/build/**tmp-angstrom_next-uclibc/**
>> sysroots/x86_64-linux/usr/**include/fdt.h:82:2: error: unknown type name
>> 'fdt32_t'
>> -    /home/oe/setup-scripts/build/**tmp-angstrom_next-uclibc/**
>> sysroots/x86_64-linux/usr/**include/fdt.h:87:2: error: unknown type name
>> 'fdt32_t'
>> -    /home/oe/setup-scripts/build/**tmp-angstrom_next-uclibc/**
>> sysroots/x86_64-linux/usr/**include/fdt.h:88:2: error: unknown type name
>> 'fdt32_t'
>> -    /home/oe/setup-scripts/build/**tmp-angstrom_next-uclibc/**
>> sysroots/x86_64-linux/usr/**include/fdt.h:89:2: error: unknown type name
>> 'fdt32_t'
>> -
>> -Index: qemu-1.4.0/include/libfdt_env.**h
>> -=============================**==============================**========
>> ---- qemu-1.4.0.orig/include/**libfdt_env.h       2013-02-15
>> 23:05:35.000000000 +0000
>> -+++ qemu-1.4.0/include/libfdt_env.**h    2013-04-13 14:17:27.918885225
>> +0000
>> -@@ -21,6 +21,10 @@
>> -
>> - #include "qemu/bswap.h"
>> -
>> -+typedef uint16_t fdt16_t;
>> -+typedef uint32_t fdt32_t;
>> -+typedef uint64_t fdt64_t;
>> -+
>> - #ifdef HOST_WORDS_BIGENDIAN
>> - #define fdt32_to_cpu(x)  (x)
>> - #define cpu_to_fdt32(x)  (x)
>> diff --git a/meta/recipes-devtools/qemu/**files/target-i386-Fix-aflag-**
>> logic-for-CODE64-and-the-0x67-**.patch b/meta/recipes-devtools/qemu/**
>> files/target-i386-Fix-aflag-**logic-for-CODE64-and-the-0x67-**.patch
>> deleted file mode 100644
>> index 852efd1..0000000
>> --- a/meta/recipes-devtools/qemu/**files/target-i386-Fix-aflag-**
>> logic-for-CODE64-and-the-0x67-**.patch
>> +++ /dev/null
>> @@ -1,79 +0,0 @@
>> -Upstream-Status: Backported
>> -
>> -From dec3fc9657e0682637de4d5a29d947**284d01985c Mon Sep 17 00:00:00 2001
>> -From: Richard Henderson <rth@twiddle.net>
>> -Date: Wed, 29 May 2013 12:30:51 -0700
>> -Subject: [PATCH] target-i386: Fix aflag logic for CODE64 and the 0x67
>> prefix
>> -
>> -The code reorganization in commit 4a6fd938 broke handling of PREFIX_ADR.
>> -While fixing this, tidy and comment the code so that it's more obvious
>> -what's going on in setting both aflag and dflag.
>> -
>> -The TARGET_X86_64 ifdef can be eliminated because CODE64 expands to the
>> -constant zero when TARGET_X86_64 is undefined.
>> -
>> -Cc: Paolo Bonzini <pbonzini@redhat.com>
>> -Reported-by: Laszlo Ersek <lersek@redhat.com>
>> -Signed-off-by: Richard Henderson <rth@twiddle.net>
>> -Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
>> -Message-id: 1369855851-21400-1-git-send-**email-rth@twiddle.net<1369855851-21400-1-git-send-email-rth@twiddle.net>
>> -Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>> ----
>> - target-i386/translate.c |   30 +++++++++++++++---------------
>> - 1 file changed, 15 insertions(+), 15 deletions(-)
>> -
>> -diff --git a/target-i386/translate.c b/target-i386/translate.c
>> -index 0aeccdb..14b0298 100644
>> ---- a/target-i386/translate.c
>> -+++ b/target-i386/translate.c
>> -@@ -4677,8 +4677,6 @@ static target_ulong disas_insn(CPUX86State *env,
>> DisasContext *s,
>> -     }
>> -     s->pc = pc_start;
>> -     prefixes = 0;
>> --    aflag = s->code32;
>> --    dflag = s->code32;
>> -     s->override = -1;
>> -     rex_w = -1;
>> -     rex_r = 0;
>> -@@ -4801,23 +4799,25 @@ static target_ulong disas_insn(CPUX86State *env,
>> DisasContext *s,
>> -     }
>> -
>> -     /* Post-process prefixes.  */
>> --    if (prefixes & PREFIX_DATA) {
>> --        dflag ^= 1;
>> --    }
>> --    if (prefixes & PREFIX_ADR) {
>> --        aflag ^= 1;
>> --    }
>> --#ifdef TARGET_X86_64
>> -     if (CODE64(s)) {
>> --        if (rex_w == 1) {
>> --            /* 0x66 is ignored if rex.w is set */
>> --            dflag = 2;
>> -+        /* In 64-bit mode, the default data size is 32-bit.  Select
>> 64-bit
>> -+           data with rex_w, and 16-bit data with 0x66; rex_w takes
>> precedence
>> -+           over 0x66 if both are present.  */
>> -+        dflag = (rex_w > 0 ? 2 : prefixes & PREFIX_DATA ? 0 : 1);
>> -+        /* In 64-bit mode, 0x67 selects 32-bit addressing.  */
>> -+        aflag = (prefixes & PREFIX_ADR ? 1 : 2);
>> -+    } else {
>> -+        /* In 16/32-bit mode, 0x66 selects the opposite data size.  */
>> -+        dflag = s->code32;
>> -+        if (prefixes & PREFIX_DATA) {
>> -+            dflag ^= 1;
>> -         }
>> --        if (!(prefixes & PREFIX_ADR)) {
>> --            aflag = 2;
>> -+        /* In 16/32-bit mode, 0x67 selects the opposite addressing.  */
>> -+        aflag = s->code32;
>> -+        if (prefixes & PREFIX_ADR) {
>> -+            aflag ^= 1;
>> -         }
>> -     }
>> --#endif
>> -
>> -     s->prefix = prefixes;
>> -     s->aflag = aflag;
>> ---
>> -1.7.9.5
>> -
>> diff --git a/meta/recipes-devtools/qemu/**files/target-ppc_fix_bit_**extraction.patch
>> b/meta/recipes-devtools/qemu/**files/target-ppc_fix_bit_**
>> extraction.patch
>> deleted file mode 100644
>> index 631d23b..0000000
>> --- a/meta/recipes-devtools/qemu/**files/target-ppc_fix_bit_**
>> extraction.patch
>> +++ /dev/null
>> @@ -1,70 +0,0 @@
>> -Delivered-To: raj.khem@gmail.com
>> -Received: by 10.50.216.195 with SMTP id os3csp11191igc;
>> -        Thu, 15 Aug 2013 04:32:45 -0700 (PDT)
>> -X-Received: by 10.180.98.3 with SMTP id ee3mr1508103wib.48.**
>> 1376566364872;
>> -        Thu, 15 Aug 2013 04:32:44 -0700 (PDT)
>> -Return-Path: <aurelien@aurel32.net>
>> -Received: from hall.aurel32.net (hall.aurel32.net.
>> [2001:470:1f0b:4a8::1])
>> -        by mx.google.com with ESMTPS id vv5si15578100wjc.49.2013.08.**
>> 15.04.32.44
>> -        for <raj.khem@gmail.com>
>> -        (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
>> -        Thu, 15 Aug 2013 04:32:44 -0700 (PDT)
>> -Received-SPF: pass (google.com: best guess record for domain of
>> aurelien@aurel32.net designates 2001:470:1f0b:4a8::1 as permitted
>> sender) client-ip=2001:470:1f0b:4a8::**1;
>> -Authentication-Results: mx.google.com;
>> -       spf=pass (google.com: best guess record for domain of
>> aurelien@aurel32.net designates 2001:470:1f0b:4a8::1 as permitted
>> sender) smtp.mail=aurelien@aurel32.net
>> -Received: from [2001:470:d4ed:1:2db:dfff:**fe14:52d] (helo=
>> ohm.aurel32.net)
>> -       by hall.aurel32.net with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_**
>> SHA1:128)
>> -       (Exim 4.80)
>> -       (envelope-from <aurelien@aurel32.net>)
>> -       id 1V9vnG-0006cO-NN; Thu, 15 Aug 2013 13:32:42 +0200
>> -Received: from aurel32 by ohm.aurel32.net with local (Exim 4.80)
>> -       (envelope-from <aurelien@aurel32.net>)
>> -       id 1V9vnF-0002Lw-7L; Thu, 15 Aug 2013 13:32:41 +0200
>> -From: Aurelien Jarno <aurelien@aurel32.net>
>> -To: qemu-devel@nongnu.org
>> -Cc: Khem Raj <raj.khem@gmail.com>,
>> -       Alexander Graf <agraf@suse.de> ,
>> -       qemu-stable@nongnu.org,
>> -       qemu-ppc@nongnu.org,
>> -       Aurelien Jarno <aurelien@aurel32.net>
>> -Subject: [PATCH] target-ppc: fix bit extraction for FPBF and FPL
>> -Date: Thu, 15 Aug 2013 13:32:38 +0200
>> -Message-Id: <1376566358-8989-1-git-send-**email-aurelien@aurel32.net<1376566358-8989-1-git-send-email-aurelien@aurel32.net>
>> >
>> -X-Mailer: git-send-email 1.7.10.4
>> -
>> -Bit extraction for the FP BF and L field of the MTFSFI and MTFSF
>> -instructions is wrong and doesn't match the reference manual (which
>> -explain the bit number in big endian format). It has been broken in
>> -commit 7d08d85645def18eac2a9d672c1868**a35e0bcf79.
>> -
>> -This patch fixes this, which in turn fixes the problem reported by
>> -Khem Raj about the floor() function of libm.
>> -
>> -Reported-by: Khem Raj <raj.khem@gmail.com>
>> -Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
>> -
>> -Upstream-Status: Backport
>> -
>> ----
>> - target-ppc/translate.c |    4 ++--
>> - 1 file changed, 2 insertions(+), 2 deletions(-)
>> -
>> -I don't know if we still have time to get this into 1.6, hence the Cc:
>> -to stable. In anycase it also needs to be fixed in 1.5.
>> -
>> -Index: qemu-1.5.0/target-ppc/**translate.c
>> -=============================**==============================**========
>> ---- qemu-1.5.0.orig/target-ppc/**translate.c     2013-05-20
>> 08:34:40.000000000 -0700
>> -+++ qemu-1.5.0/target-ppc/**translate.c  2013-08-15 06:49:25.028144352
>> -0700
>> -@@ -428,9 +428,9 @@
>> - EXTRACT_HELPER(SR, 16, 4);
>> -
>> - /* mtfsf/mtfsfi */
>> --EXTRACT_HELPER(FPBF, 19, 3);
>> -+EXTRACT_HELPER(FPBF, 23, 3);
>> - EXTRACT_HELPER(FPIMM, 12, 4);
>> --EXTRACT_HELPER(FPL, 21, 1);
>> -+EXTRACT_HELPER(FPL, 25, 1);
>> - EXTRACT_HELPER(FPFLM, 17, 8);
>> - EXTRACT_HELPER(FPW, 16, 1);
>> -
>> diff --git a/meta/recipes-devtools/qemu/**qemu.inc
>> b/meta/recipes-devtools/qemu/**qemu.inc
>> index 1b861d7..e533a84 100644
>> --- a/meta/recipes-devtools/qemu/**qemu.inc
>> +++ b/meta/recipes-devtools/qemu/**qemu.inc
>> @@ -55,7 +55,7 @@ do_configure() {
>>          KVMOPTS="--enable-kvm"
>>       fi
>>
>> -    ${S}/configure --prefix=${prefix} --sysconfdir=${sysconfdir}
>> --libexecdir=${libexecdir} --disable-strip ${EXTRA_OECONF} $KVMOPTS
>> +    ${S}/configure --prefix=${prefix} --sysconfdir=${sysconfdir}
>> --libexecdir=${libexecdir} --localstatedir=${**localstatedir}
>> --disable-strip ${EXTRA_OECONF} $KVMOPTS
>>       test ! -e ${S}/target-i386/beginend_**funcs.sh || chmod a+x
>> ${S}/target-i386/beginend_**funcs.sh
>>   }
>>
>> diff --git a/meta/recipes-devtools/qemu/q**emu_1.5.0.bb<http://qemu_1.5.0.bb>b/meta/recipes-devtools/qemu/
>> q**emu_1.6.1.bb <http://qemu_1.6.1.bb>
>> similarity index 44%
>> rename from meta/recipes-devtools/qemu/qem**u_1.5.0.bb<http://qemu_1.5.0.bb>
>> rename to meta/recipes-devtools/qemu/qem**u_1.6.1.bb<http://qemu_1.6.1.bb>
>> index 06c2cdb..03e28a0 100644
>> --- a/meta/recipes-devtools/qemu/q**emu_1.5.0.bb <http://qemu_1.5.0.bb>
>> +++ b/meta/recipes-devtools/qemu/q**emu_1.6.1.bb <http://qemu_1.6.1.bb>
>> @@ -3,14 +3,15 @@ require qemu.inc
>>   LIC_FILES_CHKSUM = "file://COPYING;md5=**441c28d2cf86e15a37fa47e15a72fb
>> **ac \
>>                       file://COPYING.LIB;endline=24;**md5=**
>> c04def7ae38850e7d3ef5485881599**13"
>>
>> -SRC_URI += "file://fdt_header.patch \
>> -            file://target-i386-Fix-aflag-**
>> logic-for-CODE64-and-the-0x67-**.patch \
>> -            file://target-ppc_fix_bit_**extraction.patch \
>> -            file://fxrstorssefix.patch \
>> -           "
>> +SRC_URI += "file://fxrstorssefix.patch"
>>
>>   SRC_URI_prepend = "http://wiki.qemu.org/**download/qemu-${PV}.tar.bz2<http://wiki.qemu.org/download/qemu-$%7BPV%7D.tar.bz2>
>> "
>> -SRC_URI[md5sum] = "**b6f3265b8ed39d77e8f354f35cc26e**16"
>> -SRC_URI[sha256sum] = "**b22b30ee9712568dfb4eedf76783f4**
>> a76546e1cbc41659b909646bcf0b48**67bb"
>> +SRC_URI[md5sum] = "**3a897d722457c5a895cd6ac79a28fd**a0"
>> +SRC_URI[sha256sum] = "**fc736f44aa10478223c881310a7e40**
>> fc8386547e9cadf7d01ca468595160**5294"
>>
>>   COMPATIBLE_HOST_class-target_**mips64 = "null"
>> +
>> +do_install_append() {
>> +    # Prevent QA warnings about installed ${localstatedir}/run
>> +    if [ -d ${D}${localstatedir}/run ]; then rmdir
>> ${D}${localstatedir}/run; fi
>> +}
>>
>>
Laurentiu Palcu - Oct. 29, 2013, 7:27 a.m.
Hi Chris,

On Mon, Oct 28, 2013 at 07:54:51PM -0400, Chris Patterson wrote:
> 
> I'm not terribly familiar with the nativesdk, and (foolishly) neglected to test
> that.  However, I looked into it, and it looks like the relocatable_sdk.patch
> affects a linker script that is no longer available.  I dropped the patch and
> tested installing an oe-core sdk sysroot (via bitbake -c populate_sdk
> core-image-minimal) and qemu appears to work fine from within the sdk
> environment.
> 
> I'm open to suggestions for further testing this upgrade (particularly a case
> to cover what relocatable_sdk.patch was originally intended to resolve). I'm
> certainly not the expert here, but am willing to help out.
> 
To test this particular case, build meta-toolchain and install it in a
different location than the default one. Then, just do a 'readelf -s"
on any qemu binary and make sure the .interp section has a size of 0x1000 bytes.

If it does, then it's ok to drop the patch. That patch was needed
because qemu happened to use their own linker scripts and, in order to
have the SDK relocatable, we needed to reseve space in the .interp
section to squeeze the new path.

Laurentiu
Chris Patterson - Oct. 29, 2013, 8:20 p.m.
On Tue, Oct 29, 2013 at 3:27 AM, Laurentiu Palcu
<laurentiu.palcu@intel.com>wrote:

> Hi Chris,
>
> On Mon, Oct 28, 2013 at 07:54:51PM -0400, Chris Patterson wrote:
> >
> > I'm not terribly familiar with the nativesdk, and (foolishly) neglected
> to test
> > that.  However, I looked into it, and it looks like the
> relocatable_sdk.patch
> > affects a linker script that is no longer available.  I dropped the
> patch and
> > tested installing an oe-core sdk sysroot (via bitbake -c populate_sdk
> > core-image-minimal) and qemu appears to work fine from within the sdk
> > environment.
> >
> > I'm open to suggestions for further testing this upgrade (particularly a
> case
> > to cover what relocatable_sdk.patch was originally intended to resolve).
> I'm
> > certainly not the expert here, but am willing to help out.
> >
> To test this particular case, build meta-toolchain and install it in a
> different location than the default one. Then, just do a 'readelf -s"
> on any qemu binary and make sure the .interp section has a size of 0x1000
> bytes.
>
> If it does, then it's ok to drop the patch. That patch was needed
> because qemu happened to use their own linker scripts and, in order to
> have the SDK relocatable, we needed to reseve space in the .interp
> section to squeeze the new path.


Thanks Laurentiu - I did validate that the interp section looks to be
0x1000 bytes for the qemu-* binaries:

$
/usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/bin/qemu-system-arm
--version
QEMU emulator version 1.6.1, Copyright (c) 2003-2008 Fabrice Bellard

$ readelf -S
/usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/bin/qemu-system-arm

There are 29 section headers, starting at offset 0x5a14b8:

Section Headers:
  [Nr] Name              Type             Address           Offset
       Size              EntSize          Flags  Link  Info  Align
  [ 0]                   NULL             0000000000000000  00000000
       0000000000000000  0000000000000000           0     0     0
  [ 1] .interp           PROGBITS         0000000000000270  00000270
       0000000000001000  0000000000000000   A       0     0     1
  [ 2] .note.ABI-tag     NOTE             0000000000001270  00001270
       0000000000000020  0000000000000000   A       0     0     4
  [ 3] .note.gnu.build-i NOTE             0000000000001290  00001290
...

If anyone has any other suggestions to test, I will gladly attempt them
before posting a v2.

Cheers!
-Chris
Saul Wold - Oct. 29, 2013, 8:30 p.m.
On 10/29/2013 01:20 PM, Chris Patterson wrote:
>
>
>
> On Tue, Oct 29, 2013 at 3:27 AM, Laurentiu Palcu
> <laurentiu.palcu@intel.com <mailto:laurentiu.palcu@intel.com>> wrote:
>
>     Hi Chris,
>
>     On Mon, Oct 28, 2013 at 07:54:51PM -0400, Chris Patterson wrote:
>      >
>      > I'm not terribly familiar with the nativesdk, and (foolishly)
>     neglected to test
>      > that.  However, I looked into it, and it looks like the
>     relocatable_sdk.patch
>      > affects a linker script that is no longer available.  I dropped
>     the patch and
>      > tested installing an oe-core sdk sysroot (via bitbake -c populate_sdk
>      > core-image-minimal) and qemu appears to work fine from within the sdk
>      > environment.
>      >
>      > I'm open to suggestions for further testing this upgrade
>     (particularly a case
>      > to cover what relocatable_sdk.patch was originally intended to
>     resolve). I'm
>      > certainly not the expert here, but am willing to help out.
>      >
>     To test this particular case, build meta-toolchain and install it in a
>     different location than the default one. Then, just do a 'readelf -s"
>     on any qemu binary and make sure the .interp section has a size of
>     0x1000 bytes.
>
>     If it does, then it's ok to drop the patch. That patch was needed
>     because qemu happened to use their own linker scripts and, in order to
>     have the SDK relocatable, we needed to reseve space in the .interp
>     section to squeeze the new path.
>
>
> Thanks Laurentiu - I did validate that the interp section looks to be
> 0x1000 bytes for the qemu-* binaries:
>
> $
> /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/bin/qemu-system-arm
> --version
> QEMU emulator version 1.6.1, Copyright (c) 2003-2008 Fabrice Bellard
>
> $ readelf -S
> /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/bin/qemu-system-arm
>
> There are 29 section headers, starting at offset 0x5a14b8:
>
> Section Headers:
>    [Nr] Name              Type             Address           Offset
>         Size              EntSize          Flags  Link  Info  Align
>    [ 0]                   NULL             0000000000000000  00000000
>         0000000000000000  0000000000000000           0     0     0
>    [ 1] .interp           PROGBITS         0000000000000270  00000270
>         0000000000001000  0000000000000000   A       0     0     1
>    [ 2] .note.ABI-tag     NOTE             0000000000001270  00001270
>         0000000000000020  0000000000000000   A       0     0     4
>    [ 3] .note.gnu.build-i NOTE             0000000000001290  00001290
> ...
>
> If anyone has any other suggestions to test, I will gladly attempt them
> before posting a v2.
>

Your last message said you tested core-image-minimal, did you do any 
testing with a graphical image like core-image sato?  We really 
apperciate the work you put in here.

Thanks
	Sau!

> Cheers!
> -Chris
Chris Patterson - Oct. 30, 2013, 11:49 a.m.
On Tue, Oct 29, 2013 at 4:30 PM, Saul Wold <sgw@linux.intel.com> wrote:

> On 10/29/2013 01:20 PM, Chris Patterson wrote:
>
>>
>>
>>
>> On Tue, Oct 29, 2013 at 3:27 AM, Laurentiu Palcu
>> <laurentiu.palcu@intel.com <mailto:laurentiu.palcu@intel.**com<laurentiu.palcu@intel.com>>>
>> wrote:
>>
>>     Hi Chris,
>>
>>     On Mon, Oct 28, 2013 at 07:54:51PM -0400, Chris Patterson wrote:
>>      >
>>      > I'm not terribly familiar with the nativesdk, and (foolishly)
>>     neglected to test
>>      > that.  However, I looked into it, and it looks like the
>>     relocatable_sdk.patch
>>      > affects a linker script that is no longer available.  I dropped
>>     the patch and
>>      > tested installing an oe-core sdk sysroot (via bitbake -c
>> populate_sdk
>>      > core-image-minimal) and qemu appears to work fine from within the
>> sdk
>>      > environment.
>>      >
>>      > I'm open to suggestions for further testing this upgrade
>>     (particularly a case
>>      > to cover what relocatable_sdk.patch was originally intended to
>>     resolve). I'm
>>      > certainly not the expert here, but am willing to help out.
>>      >
>>     To test this particular case, build meta-toolchain and install it in a
>>     different location than the default one. Then, just do a 'readelf -s"
>>     on any qemu binary and make sure the .interp section has a size of
>>     0x1000 bytes.
>>
>>     If it does, then it's ok to drop the patch. That patch was needed
>>     because qemu happened to use their own linker scripts and, in order to
>>     have the SDK relocatable, we needed to reseve space in the .interp
>>     section to squeeze the new path.
>>
>>
>> Thanks Laurentiu - I did validate that the interp section looks to be
>> 0x1000 bytes for the qemu-* binaries:
>>
>> $
>> /usr/local/oecore-x86_64/**sysroots/x86_64-oesdk-linux/**
>> usr/bin/qemu-system-arm
>> --version
>> QEMU emulator version 1.6.1, Copyright (c) 2003-2008 Fabrice Bellard
>>
>> $ readelf -S
>> /usr/local/oecore-x86_64/**sysroots/x86_64-oesdk-linux/**
>> usr/bin/qemu-system-arm
>>
>> There are 29 section headers, starting at offset 0x5a14b8:
>>
>> Section Headers:
>>    [Nr] Name              Type             Address           Offset
>>         Size              EntSize          Flags  Link  Info  Align
>>    [ 0]                   NULL             0000000000000000  00000000
>>         0000000000000000  0000000000000000           0     0     0
>>    [ 1] .interp           PROGBITS         0000000000000270  00000270
>>         0000000000001000  0000000000000000   A       0     0     1
>>    [ 2] .note.ABI-tag     NOTE             0000000000001270  00001270
>>         0000000000000020  0000000000000000   A       0     0     4
>>    [ 3] .note.gnu.build-i NOTE             0000000000001290  00001290
>> ...
>>
>> If anyone has any other suggestions to test, I will gladly attempt them
>> before posting a v2.
>>
>>
> Your last message said you tested core-image-minimal, did you do any
> testing with a graphical image like core-image sato?  We really apperciate
> the work you put in here.
>
>
I built core-image-sato for qemuarm and it appears to work fine.  Are there
any other typical methods/scripts which invoke nativesdk-qemu or
qemu-native besides runqemu?  runqemu works fine for qemu-native, but
runqemu doesn't work for me within the sdk (missing python fnctl module
dependency).  Instead I have tested nativesdk-qemu by directly invoking
qemu-*.

Thanks


> Thanks
>         Sau!
>
>  Cheers!
>> -Chris
>>
>

Patch

diff --git a/meta/recipes-devtools/qemu/files/fdt_header.patch b/meta/recipes-devtools/qemu/files/fdt_header.patch
deleted file mode 100644
index dccfe53..0000000
--- a/meta/recipes-devtools/qemu/files/fdt_header.patch
+++ /dev/null
@@ -1,39 +0,0 @@ 
-Upstream-Status: Pending 
-
-qemu: define fdt types in libfdt_env.h from qemu
-    
-    * fixes
-    In file included from /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/libfdt.h:55:0,
-                     from /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/work/x86_64-linux/qemu-native/1.4.0-r0/qemu-1.4.0/hw/arm/../../device_tree.c:28:
-    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:58:2: error: unknown type name 'fdt32_t'
-    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:59:2: error: unknown type name 'fdt32_t'
-    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:60:2: error: unknown type name 'fdt32_t'
-    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:61:2: error: unknown type name 'fdt32_t'
-    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:62:2: error: unknown type name 'fdt32_t'
-    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:63:2: error: unknown type name 'fdt32_t'
-    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:64:2: error: unknown type name 'fdt32_t'
-    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:67:2: error: unknown type name 'fdt32_t'
-    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:70:2: error: unknown type name 'fdt32_t'
-    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:73:2: error: unknown type name 'fdt32_t'
-    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:77:2: error: unknown type name 'fdt64_t'
-    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:78:2: error: unknown type name 'fdt64_t'
-    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:82:2: error: unknown type name 'fdt32_t'
-    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:87:2: error: unknown type name 'fdt32_t'
-    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:88:2: error: unknown type name 'fdt32_t'
-    /home/oe/setup-scripts/build/tmp-angstrom_next-uclibc/sysroots/x86_64-linux/usr/include/fdt.h:89:2: error: unknown type name 'fdt32_t'
-
-Index: qemu-1.4.0/include/libfdt_env.h
-===================================================================
---- qemu-1.4.0.orig/include/libfdt_env.h	2013-02-15 23:05:35.000000000 +0000
-+++ qemu-1.4.0/include/libfdt_env.h	2013-04-13 14:17:27.918885225 +0000
-@@ -21,6 +21,10 @@
- 
- #include "qemu/bswap.h"
- 
-+typedef uint16_t fdt16_t;
-+typedef uint32_t fdt32_t;
-+typedef uint64_t fdt64_t;
-+
- #ifdef HOST_WORDS_BIGENDIAN
- #define fdt32_to_cpu(x)  (x)
- #define cpu_to_fdt32(x)  (x)
diff --git a/meta/recipes-devtools/qemu/files/target-i386-Fix-aflag-logic-for-CODE64-and-the-0x67-.patch b/meta/recipes-devtools/qemu/files/target-i386-Fix-aflag-logic-for-CODE64-and-the-0x67-.patch
deleted file mode 100644
index 852efd1..0000000
--- a/meta/recipes-devtools/qemu/files/target-i386-Fix-aflag-logic-for-CODE64-and-the-0x67-.patch
+++ /dev/null
@@ -1,79 +0,0 @@ 
-Upstream-Status: Backported
-
-From dec3fc9657e0682637de4d5a29d947284d01985c Mon Sep 17 00:00:00 2001
-From: Richard Henderson <rth@twiddle.net>
-Date: Wed, 29 May 2013 12:30:51 -0700
-Subject: [PATCH] target-i386: Fix aflag logic for CODE64 and the 0x67 prefix
-
-The code reorganization in commit 4a6fd938 broke handling of PREFIX_ADR.
-While fixing this, tidy and comment the code so that it's more obvious
-what's going on in setting both aflag and dflag.
-
-The TARGET_X86_64 ifdef can be eliminated because CODE64 expands to the
-constant zero when TARGET_X86_64 is undefined.
-
-Cc: Paolo Bonzini <pbonzini@redhat.com>
-Reported-by: Laszlo Ersek <lersek@redhat.com>
-Signed-off-by: Richard Henderson <rth@twiddle.net>
-Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
-Message-id: 1369855851-21400-1-git-send-email-rth@twiddle.net
-Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
----
- target-i386/translate.c |   30 +++++++++++++++---------------
- 1 file changed, 15 insertions(+), 15 deletions(-)
-
-diff --git a/target-i386/translate.c b/target-i386/translate.c
-index 0aeccdb..14b0298 100644
---- a/target-i386/translate.c
-+++ b/target-i386/translate.c
-@@ -4677,8 +4677,6 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
-     }
-     s->pc = pc_start;
-     prefixes = 0;
--    aflag = s->code32;
--    dflag = s->code32;
-     s->override = -1;
-     rex_w = -1;
-     rex_r = 0;
-@@ -4801,23 +4799,25 @@ static target_ulong disas_insn(CPUX86State *env, DisasContext *s,
-     }
- 
-     /* Post-process prefixes.  */
--    if (prefixes & PREFIX_DATA) {
--        dflag ^= 1;
--    }
--    if (prefixes & PREFIX_ADR) {
--        aflag ^= 1;
--    }
--#ifdef TARGET_X86_64
-     if (CODE64(s)) {
--        if (rex_w == 1) {
--            /* 0x66 is ignored if rex.w is set */
--            dflag = 2;
-+        /* In 64-bit mode, the default data size is 32-bit.  Select 64-bit
-+           data with rex_w, and 16-bit data with 0x66; rex_w takes precedence
-+           over 0x66 if both are present.  */
-+        dflag = (rex_w > 0 ? 2 : prefixes & PREFIX_DATA ? 0 : 1);
-+        /* In 64-bit mode, 0x67 selects 32-bit addressing.  */
-+        aflag = (prefixes & PREFIX_ADR ? 1 : 2);
-+    } else {
-+        /* In 16/32-bit mode, 0x66 selects the opposite data size.  */
-+        dflag = s->code32;
-+        if (prefixes & PREFIX_DATA) {
-+            dflag ^= 1;
-         }
--        if (!(prefixes & PREFIX_ADR)) {
--            aflag = 2;
-+        /* In 16/32-bit mode, 0x67 selects the opposite addressing.  */
-+        aflag = s->code32;
-+        if (prefixes & PREFIX_ADR) {
-+            aflag ^= 1;
-         }
-     }
--#endif
- 
-     s->prefix = prefixes;
-     s->aflag = aflag;
--- 
-1.7.9.5
-
diff --git a/meta/recipes-devtools/qemu/files/target-ppc_fix_bit_extraction.patch b/meta/recipes-devtools/qemu/files/target-ppc_fix_bit_extraction.patch
deleted file mode 100644
index 631d23b..0000000
--- a/meta/recipes-devtools/qemu/files/target-ppc_fix_bit_extraction.patch
+++ /dev/null
@@ -1,70 +0,0 @@ 
-Delivered-To: raj.khem@gmail.com
-Received: by 10.50.216.195 with SMTP id os3csp11191igc;
-        Thu, 15 Aug 2013 04:32:45 -0700 (PDT)
-X-Received: by 10.180.98.3 with SMTP id ee3mr1508103wib.48.1376566364872;
-        Thu, 15 Aug 2013 04:32:44 -0700 (PDT)
-Return-Path: <aurelien@aurel32.net>
-Received: from hall.aurel32.net (hall.aurel32.net. [2001:470:1f0b:4a8::1])
-        by mx.google.com with ESMTPS id vv5si15578100wjc.49.2013.08.15.04.32.44
-        for <raj.khem@gmail.com>
-        (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
-        Thu, 15 Aug 2013 04:32:44 -0700 (PDT)
-Received-SPF: pass (google.com: best guess record for domain of aurelien@aurel32.net designates 2001:470:1f0b:4a8::1 as permitted sender) client-ip=2001:470:1f0b:4a8::1;
-Authentication-Results: mx.google.com;
-       spf=pass (google.com: best guess record for domain of aurelien@aurel32.net designates 2001:470:1f0b:4a8::1 as permitted sender) smtp.mail=aurelien@aurel32.net
-Received: from [2001:470:d4ed:1:2db:dfff:fe14:52d] (helo=ohm.aurel32.net)
-	by hall.aurel32.net with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128)
-	(Exim 4.80)
-	(envelope-from <aurelien@aurel32.net>)
-	id 1V9vnG-0006cO-NN; Thu, 15 Aug 2013 13:32:42 +0200
-Received: from aurel32 by ohm.aurel32.net with local (Exim 4.80)
-	(envelope-from <aurelien@aurel32.net>)
-	id 1V9vnF-0002Lw-7L; Thu, 15 Aug 2013 13:32:41 +0200
-From: Aurelien Jarno <aurelien@aurel32.net>
-To: qemu-devel@nongnu.org
-Cc: Khem Raj <raj.khem@gmail.com>,
-	Alexander Graf <agraf@suse.de> ,
-	qemu-stable@nongnu.org,
-	qemu-ppc@nongnu.org,
-	Aurelien Jarno <aurelien@aurel32.net>
-Subject: [PATCH] target-ppc: fix bit extraction for FPBF and FPL
-Date: Thu, 15 Aug 2013 13:32:38 +0200
-Message-Id: <1376566358-8989-1-git-send-email-aurelien@aurel32.net>
-X-Mailer: git-send-email 1.7.10.4
-
-Bit extraction for the FP BF and L field of the MTFSFI and MTFSF
-instructions is wrong and doesn't match the reference manual (which
-explain the bit number in big endian format). It has been broken in
-commit 7d08d85645def18eac2a9d672c1868a35e0bcf79.
-
-This patch fixes this, which in turn fixes the problem reported by
-Khem Raj about the floor() function of libm.
-
-Reported-by: Khem Raj <raj.khem@gmail.com>
-Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
-
-Upstream-Status: Backport
-
----
- target-ppc/translate.c |    4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-I don't know if we still have time to get this into 1.6, hence the Cc:
-to stable. In anycase it also needs to be fixed in 1.5.
-
-Index: qemu-1.5.0/target-ppc/translate.c
-===================================================================
---- qemu-1.5.0.orig/target-ppc/translate.c	2013-05-20 08:34:40.000000000 -0700
-+++ qemu-1.5.0/target-ppc/translate.c	2013-08-15 06:49:25.028144352 -0700
-@@ -428,9 +428,9 @@
- EXTRACT_HELPER(SR, 16, 4);
- 
- /* mtfsf/mtfsfi */
--EXTRACT_HELPER(FPBF, 19, 3);
-+EXTRACT_HELPER(FPBF, 23, 3);
- EXTRACT_HELPER(FPIMM, 12, 4);
--EXTRACT_HELPER(FPL, 21, 1);
-+EXTRACT_HELPER(FPL, 25, 1);
- EXTRACT_HELPER(FPFLM, 17, 8);
- EXTRACT_HELPER(FPW, 16, 1);
- 
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index 1b861d7..e533a84 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -55,7 +55,7 @@  do_configure() {
        KVMOPTS="--enable-kvm"
     fi
 
-    ${S}/configure --prefix=${prefix} --sysconfdir=${sysconfdir} --libexecdir=${libexecdir} --disable-strip ${EXTRA_OECONF} $KVMOPTS
+    ${S}/configure --prefix=${prefix} --sysconfdir=${sysconfdir} --libexecdir=${libexecdir} --localstatedir=${localstatedir} --disable-strip ${EXTRA_OECONF} $KVMOPTS
     test ! -e ${S}/target-i386/beginend_funcs.sh || chmod a+x ${S}/target-i386/beginend_funcs.sh
 }
 
diff --git a/meta/recipes-devtools/qemu/qemu_1.5.0.bb b/meta/recipes-devtools/qemu/qemu_1.6.1.bb
similarity index 44%
rename from meta/recipes-devtools/qemu/qemu_1.5.0.bb
rename to meta/recipes-devtools/qemu/qemu_1.6.1.bb
index 06c2cdb..03e28a0 100644
--- a/meta/recipes-devtools/qemu/qemu_1.5.0.bb
+++ b/meta/recipes-devtools/qemu/qemu_1.6.1.bb
@@ -3,14 +3,15 @@  require qemu.inc
 LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
                     file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913"
 
-SRC_URI += "file://fdt_header.patch \
-            file://target-i386-Fix-aflag-logic-for-CODE64-and-the-0x67-.patch \
-            file://target-ppc_fix_bit_extraction.patch \
-            file://fxrstorssefix.patch \
-           "
+SRC_URI += "file://fxrstorssefix.patch"
 
 SRC_URI_prepend = "http://wiki.qemu.org/download/qemu-${PV}.tar.bz2"
-SRC_URI[md5sum] = "b6f3265b8ed39d77e8f354f35cc26e16"
-SRC_URI[sha256sum] = "b22b30ee9712568dfb4eedf76783f4a76546e1cbc41659b909646bcf0b4867bb"
+SRC_URI[md5sum] = "3a897d722457c5a895cd6ac79a28fda0"
+SRC_URI[sha256sum] = "fc736f44aa10478223c881310a7e40fc8386547e9cadf7d01ca4685951605294"
 
 COMPATIBLE_HOST_class-target_mips64 = "null"
+
+do_install_append() {
+    # Prevent QA warnings about installed ${localstatedir}/run
+    if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi
+}