diff options
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-devtools/qemu')
13 files changed, 110 insertions, 575 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb index 51d1c5969..943ca5f89 100644 --- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb +++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb @@ -1,15 +1,16 @@ SUMMARY = "Qemu helper scripts" LICENSE = "GPLv2" -RDEPENDS_${PN} = "nativesdk-qemu" -PR = "r9" +RDEPENDS_${PN} = "nativesdk-qemu nativesdk-python3-subprocess \ + nativesdk-python3-shell nativesdk-python3-fcntl \ + " +PR = "r9" LIC_FILES_CHKSUM = "file://${WORKDIR}/tunctl.c;endline=4;md5=ff3a09996bc5fff6bc5d4e0b4c28f999 \ - file://${COREBASE}/scripts/runqemu;endline=18;md5=77fbe442a88b1bcdc29c3ba67733b21b" + file://${COREBASE}/scripts/runqemu;endline=19;md5=a8ad1905c709a2deaa057608ebaf705a" SRC_URI = "file://${COREBASE}/scripts/runqemu \ - file://${COREBASE}/scripts/runqemu-internal \ file://${COREBASE}/scripts/runqemu-addptable2image \ file://${COREBASE}/scripts/runqemu-gen-tapdevs \ file://${COREBASE}/scripts/runqemu-ifup \ @@ -18,7 +19,6 @@ SRC_URI = "file://${COREBASE}/scripts/runqemu \ file://${COREBASE}/scripts/runqemu-extract-sdk \ file://${COREBASE}/scripts/runqemu-export-rootfs \ file://tunctl.c \ - file://raw2flash.c \ " S = "${WORKDIR}" @@ -27,8 +27,6 @@ inherit nativesdk do_compile() { ${CC} tunctl.c -o tunctl - ${CC} raw2flash.c -o raw2flash.spitz - ${CC} raw2flash.c -o flash2raw.spitz -Dflash2raw } do_install() { @@ -36,12 +34,4 @@ do_install() { install -m 0755 ${WORKDIR}${COREBASE}/scripts/oe-* ${D}${bindir}/ install -m 0755 ${WORKDIR}${COREBASE}/scripts/runqemu* ${D}${bindir}/ install tunctl ${D}${bindir}/ - install raw2flash.spitz ${D}${bindir}/ - install flash2raw.spitz ${D}${bindir}/ - ln -fs raw2flash.spitz ${D}${bindir}/raw2flash.akita - ln -fs raw2flash.spitz ${D}${bindir}/raw2flash.borzoi - ln -fs raw2flash.spitz ${D}${bindir}/raw2flash.terrier - ln -fs flash2raw.spitz ${D}${bindir}/flash2raw.akita - ln -fs flash2raw.spitz ${D}${bindir}/flash2raw.borzoi - ln -fs flash2raw.spitz ${D}${bindir}/flash2raw.terrier } diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper/raw2flash.c b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper/raw2flash.c deleted file mode 100644 index 19faf629b..000000000 --- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu-helper/raw2flash.c +++ /dev/null @@ -1,370 +0,0 @@ -/* - * Copyright (c) 2006 OpenedHand Ltd. - * - * This file is licensed under GNU GPL v2. - */ -#include <string.h> -#include <unistd.h> -#include <stdint.h> -#include <stdio.h> -#include <sys/types.h> -#include <stdlib.h> - -#define TFR(_) _ -#define VERBOSE -#define PBAR_LEN 40 - -#define PARTITION_START 0x00700000 - -static const int ecc_pos8[] = { - 0x0, 0x1, 0x2, -}; - -static const int ecc_pos16[] = { - 0x0, 0x1, 0x2, 0x3, 0x6, 0x7, -}; - -static const int ecc_pos64[] = { - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, -}; - -static const int ecc_akita[] = { - 0x05, 0x01, 0x02, 0x03, 0x06, 0x07, 0x15, 0x11, - 0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23, - 0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37, -}; - -struct jffs_marker_s { - int pos; - uint8_t value; -}; - -static const struct jffs_marker_s free_pos8[] = { - { 0x03, 0xff }, { 0x04, 0xff }, { 0x06, 0x85 }, { 0x07, 0x19 }, - { -1 }, -}; - -static const struct jffs_marker_s free_pos16[] = { - { 0x08, 0x85 }, { 0x09, 0x19 }, { 0x0a, 0x03 }, { 0x0b, 0x20 }, - { 0x0c, 0x08 }, { 0x0d, 0x00 }, { 0x0e, 0x00 }, { 0x0f, 0x00 }, - { -1 }, -}; - -static const struct jffs_marker_s free_pos64[] = { - { 0x02, 0xff }, { 0x03, 0xff }, { 0x04, 0xff }, { 0x05, 0xff }, - { 0x06, 0xff }, { 0x07, 0xff }, { 0x08, 0xff }, { 0x09, 0xff }, - { 0x0a, 0xff }, { 0x0b, 0xff }, { 0x0c, 0xff }, { 0x0d, 0xff }, - { 0x0e, 0xff }, { 0x0f, 0xff }, { 0x10, 0x85 }, { 0x11, 0x19 }, - { 0x12, 0x03 }, { 0x13, 0x20 }, { 0x14, 0x08 }, { 0x15, 0x00 }, - { 0x16, 0x00 }, { 0x17, 0x00 }, { 0x18, 0xff }, { 0x19, 0xff }, - { 0x1a, 0xff }, { 0x1b, 0xff }, { 0x1c, 0xff }, { 0x1d, 0xff }, - { 0x1e, 0xff }, { 0x1f, 0xff }, { 0x20, 0xff }, { 0x21, 0xff }, - { 0x22, 0xff }, { 0x23, 0xff }, { 0x24, 0xff }, { 0x25, 0xff }, - { 0x26, 0xff }, { 0x27, 0xff }, - { -1 }, -}; - -static const struct jffs_marker_s free_akita[] = { - { 0x08, 0x85 }, { 0x09, 0x19 }, { 0x0a, 0x03 }, { 0x0b, 0x20 }, - { 0x0c, 0x08 }, { 0x0d, 0x00 }, { 0x0e, 0x00 }, { 0x0f, 0x00 }, - { 0x10, 0xff }, - { -1 }, -}; - -#define LEN(array) (sizeof(array) / sizeof(*array)) - -static const struct ecc_style_s { - int page_size; - int oob_size; - int eccbytes; - int eccsize; - const int *eccpos; - int romsize; - const struct jffs_marker_s *freepos; -} spitz = { - 0x200, 0x10, 0x100, LEN(ecc_pos16), ecc_pos16, 0x01000000, free_pos16 -}, akita = { - 0x800, 0x40, 0x100, LEN(ecc_akita), ecc_akita, 0x08000000, free_akita -}, borzoi = { - 0x800, 0x40, 0x100, LEN(ecc_akita), ecc_akita, 0x08000000, free_akita -}, terrier = { - 0x800, 0x40, 0x100, LEN(ecc_akita), ecc_akita, 0x08000000, free_akita -}; - -struct ecc_state_s { - int count; - uint8_t cp; - uint8_t lp[2]; - const struct ecc_style_s *style; -}; - -#ifndef flash2raw -/* - * Pre-calculated 256-way 1 byte column parity. Table borrowed from Linux. - */ -static const uint8_t ecc_precalc_table[] = { - 0x00, 0x55, 0x56, 0x03, 0x59, 0x0c, 0x0f, 0x5a, - 0x5a, 0x0f, 0x0c, 0x59, 0x03, 0x56, 0x55, 0x00, - 0x65, 0x30, 0x33, 0x66, 0x3c, 0x69, 0x6a, 0x3f, - 0x3f, 0x6a, 0x69, 0x3c, 0x66, 0x33, 0x30, 0x65, - 0x66, 0x33, 0x30, 0x65, 0x3f, 0x6a, 0x69, 0x3c, - 0x3c, 0x69, 0x6a, 0x3f, 0x65, 0x30, 0x33, 0x66, - 0x03, 0x56, 0x55, 0x00, 0x5a, 0x0f, 0x0c, 0x59, - 0x59, 0x0c, 0x0f, 0x5a, 0x00, 0x55, 0x56, 0x03, - 0x69, 0x3c, 0x3f, 0x6a, 0x30, 0x65, 0x66, 0x33, - 0x33, 0x66, 0x65, 0x30, 0x6a, 0x3f, 0x3c, 0x69, - 0x0c, 0x59, 0x5a, 0x0f, 0x55, 0x00, 0x03, 0x56, - 0x56, 0x03, 0x00, 0x55, 0x0f, 0x5a, 0x59, 0x0c, - 0x0f, 0x5a, 0x59, 0x0c, 0x56, 0x03, 0x00, 0x55, - 0x55, 0x00, 0x03, 0x56, 0x0c, 0x59, 0x5a, 0x0f, - 0x6a, 0x3f, 0x3c, 0x69, 0x33, 0x66, 0x65, 0x30, - 0x30, 0x65, 0x66, 0x33, 0x69, 0x3c, 0x3f, 0x6a, - 0x6a, 0x3f, 0x3c, 0x69, 0x33, 0x66, 0x65, 0x30, - 0x30, 0x65, 0x66, 0x33, 0x69, 0x3c, 0x3f, 0x6a, - 0x0f, 0x5a, 0x59, 0x0c, 0x56, 0x03, 0x00, 0x55, - 0x55, 0x00, 0x03, 0x56, 0x0c, 0x59, 0x5a, 0x0f, - 0x0c, 0x59, 0x5a, 0x0f, 0x55, 0x00, 0x03, 0x56, - 0x56, 0x03, 0x00, 0x55, 0x0f, 0x5a, 0x59, 0x0c, - 0x69, 0x3c, 0x3f, 0x6a, 0x30, 0x65, 0x66, 0x33, - 0x33, 0x66, 0x65, 0x30, 0x6a, 0x3f, 0x3c, 0x69, - 0x03, 0x56, 0x55, 0x00, 0x5a, 0x0f, 0x0c, 0x59, - 0x59, 0x0c, 0x0f, 0x5a, 0x00, 0x55, 0x56, 0x03, - 0x66, 0x33, 0x30, 0x65, 0x3f, 0x6a, 0x69, 0x3c, - 0x3c, 0x69, 0x6a, 0x3f, 0x65, 0x30, 0x33, 0x66, - 0x65, 0x30, 0x33, 0x66, 0x3c, 0x69, 0x6a, 0x3f, - 0x3f, 0x6a, 0x69, 0x3c, 0x66, 0x33, 0x30, 0x65, - 0x00, 0x55, 0x56, 0x03, 0x59, 0x0c, 0x0f, 0x5a, - 0x5a, 0x0f, 0x0c, 0x59, 0x03, 0x56, 0x55, 0x00, -}; - -/* Update ECC parity count */ -static inline uint8_t ecc_digest(struct ecc_state_s *s, uint8_t sample) { - uint8_t idx = ecc_precalc_table[sample]; - - s->cp ^= idx & 0x3f; - if (idx & 0x40) { - s->lp[0] ^= ~(s->count & 0xff); - s->lp[1] ^= s->count & 0xff; - } - s->count ++; - - return sample; -} - -static void buffer_digest(struct ecc_state_s *ecc, - const uint8_t *buf, uint8_t *out) { - int i, lp_a[2]; - - ecc->lp[0] = 0x00; - ecc->lp[1] = 0x00; - ecc->cp = 0x00; - ecc->count = 0; - for (i = 0; i < ecc->style->eccbytes; i ++) - ecc_digest(ecc, buf[i]); - -# define BSHR(byte, from, to) ((ecc->lp[byte] >> (from - to)) & (1 << to)) - lp_a[0] = - BSHR(0, 4, 0) | BSHR(0, 5, 2) | - BSHR(0, 6, 4) | BSHR(0, 7, 6) | - BSHR(1, 4, 1) | BSHR(1, 5, 3) | - BSHR(1, 6, 5) | BSHR(1, 7, 7); - -# define BSHL(byte, from, to) ((ecc->lp[byte] << (to - from)) & (1 << to)) - lp_a[1] = - BSHL(0, 0, 0) | BSHL(0, 1, 2) | - BSHL(0, 2, 4) | BSHL(0, 3, 6) | - BSHL(1, 0, 1) | BSHL(1, 1, 3) | - BSHL(1, 2, 5) | BSHL(1, 3, 7); - - out[0] = ~lp_a[1]; - out[1] = ~lp_a[0]; - out[2] = (~ecc->cp << 2) | 0x03; -} - -static void jffs2_format(const struct ecc_state_s *ecc, uint8_t oob[]) { - const struct jffs_marker_s *byte; - for (byte = ecc->style->freepos; byte->pos >= 0; byte ++) - oob[byte->pos] = byte->value; -} - -static void buffer_fill(const struct ecc_state_s *ecc, uint8_t buffer[], - int *len, int *partition, int count, uint8_t jffs_buffer[]) { - int ret; - - switch (*partition) { - case 0: - if (count < PARTITION_START) { - memcpy(buffer, jffs_buffer + count, - ecc->style->eccbytes); - *len = ecc->style->eccbytes; - break; - } - *partition = 1; - case 1: - if (count - PARTITION_START < PARTITION_START) { - memcpy(buffer, jffs_buffer + count - PARTITION_START, - ecc->style->eccbytes); - *len = ecc->style->eccbytes; - break; - } - - while (*len < ecc->style->eccbytes) { - ret = TFR(read(0, buffer + *len, 0x800 - *len)); - if (ret <= 0) - break; - *len += ret; - } - - if (*len == 0) - *partition = 2; - else if (*len < ecc->style->eccbytes) { - fprintf(stderr, "\nWarning: %i stray bytes\n", *len); - memset(buffer + *len, 0xff, - ecc->style->eccbytes - *len); - *len = ecc->style->eccbytes; - break; - } else - break; - case 2: - memset(buffer, 0xff, ecc->style->eccbytes); - *len = ecc->style->eccbytes; - break; - } -} - -int main(int argc, char *argv[], char *envp[]) { - struct ecc_state_s ecc; - uint8_t buffer[0x1000], ecc_payload[0x40], regs[3], *jffs; - int ret, len, eccbyte, count, partition; - - /* Check if we're called by "raw2flash.spitz" or similar */ - len = strlen(argv[0]); - if (!strcasecmp(argv[0] + len - 5, "akita")) - ecc.style = &akita; - else if (!strcasecmp(argv[0] + len - 6, "borzoi")) - ecc.style = &borzoi; - else if (!strcasecmp(argv[0] + len - 7, "terrier")) - ecc.style = &terrier; - else - ecc.style = &spitz; - -# ifdef VERBOSE - fprintf(stderr, "["); -# endif - - /* Skip first 10 bytes */ - TFR(read(0, buffer, 0x10)); - - len = 0; - jffs = (uint8_t *) malloc(PARTITION_START); - while (len < PARTITION_START) { - ret = TFR(read(0, jffs + len, PARTITION_START - len)); - if (ret <= 0) - break; - len += ret; - } - - /* Convert data from stdin */ - partition = len = eccbyte = count = 0; - memset(ecc_payload, 0xff, ecc.style->oob_size); - jffs2_format(&ecc, ecc_payload); - while (count < ecc.style->romsize) { - buffer_fill(&ecc, buffer, &len, &partition, count, jffs); - buffer_digest(&ecc, buffer, regs); - - ecc_payload[ecc.style->eccpos[eccbyte ++]] = regs[0]; - ecc_payload[ecc.style->eccpos[eccbyte ++]] = regs[1]; - ecc_payload[ecc.style->eccpos[eccbyte ++]] = regs[2]; - - TFR(write(1, buffer, ecc.style->eccbytes)); - count += ecc.style->eccbytes; - len -= ecc.style->eccbytes; - memmove(buffer, buffer + ecc.style->eccbytes, len); - - if (eccbyte >= ecc.style->eccsize) { - TFR(write(1, ecc_payload, ecc.style->oob_size)); - eccbyte = 0; - memset(ecc_payload, 0xff, ecc.style->oob_size); - if (partition < 2) - jffs2_format(&ecc, ecc_payload); - } - -# ifdef VERBOSE - if (count * PBAR_LEN / ecc.style->romsize > - (count - ecc.style->eccbytes) * - PBAR_LEN / ecc.style->romsize) - fprintf(stderr, "#"); -# endif - } - -# ifdef VERBOSE - fprintf(stderr, "]\n"); -# endif - free(jffs); - return 0; -} -#else -int main(int argc, char *argv[], char *envp[]) { - struct ecc_state_s ecc; - uint8_t buffer[0x1000]; - int ret, len, count; - - /* Check if we're called by "flash2raw.spitz" or similar */ - len = strlen(argv[0]); - if (!strcasecmp(argv[0] + len - 5, "akita")) - ecc.style = &akita; - else if (!strcasecmp(argv[0] + len - 6, "borzoi")) - ecc.style = &borzoi; - else if (!strcasecmp(argv[0] + len - 7, "terrier")) - ecc.style = &terrier; - else - ecc.style = &spitz; - -# ifdef VERBOSE - fprintf(stderr, "["); -# endif - - /* Convert data from stdin */ - count = 0; - while (count < ecc.style->romsize) { - len = 0; - while (len < ecc.style->page_size) { - ret = TFR(read(0, buffer + len, - ecc.style->page_size - len)); - if (ret <= 0) - break; - len += ret; - } - if (len == 0) - break; - if (len < ecc.style->page_size) { - fprintf(stderr, "\nWarning: %i stray bytes\n", len); - } - - TFR(write(1, buffer, ecc.style->page_size)); - - count += len; - len = 0; - while (len < ecc.style->oob_size) { - ret = TFR(read(0, buffer, ecc.style->oob_size - len)); - if (ret <= 0) - break; - len += ret; - } - -# ifdef VERBOSE - if (count * PBAR_LEN / ecc.style->romsize > - (count - ecc.style->page_size) * - PBAR_LEN / ecc.style->romsize) - fprintf(stderr, "#"); -# endif - } - -# ifdef VERBOSE - fprintf(stderr, "]\n"); -# endif - return 0; -} -#endif diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu.inc b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu.inc index 269c898c4..b46e7f72e 100644 --- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu.inc +++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu.inc @@ -2,7 +2,7 @@ SUMMARY = "Fast open source processor emulator" HOMEPAGE = "http://qemu.org" LICENSE = "GPLv2 & LGPLv2.1" DEPENDS = "glib-2.0 zlib pixman" -RDEPENDS_${PN}_class-target += "bash python" +RDEPENDS_${PN}_class-target += "bash" RDEPENDS_${PN}-ptest = "bash make" require qemu-targets.inc @@ -21,6 +21,7 @@ SRC_URI = "\ file://wacom.patch \ file://add-ptest-in-makefile.patch \ file://run-ptest \ + file://0001-target-mips-add-24KEc-CPU-definition.patch \ " SRC_URI_append_class-native = "\ @@ -30,8 +31,12 @@ SRC_URI_append_class-native = "\ EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror --disable-bluez --disable-libiscsi --with-system-pixman --extra-cflags='${CFLAGS}'" -EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror \ - " +EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror" + +EXTRA_OEMAKE_append_class-native = " LD='${LD}' AR='${AR}' OBJCOPY='${OBJCOPY}' LDFLAGS='${LDFLAGS}'" + +LDFLAGS_append_class-native = " -fuse-ld=bfd" + export LIBTOOL="${HOST_SYS}-libtool" do_configure_prepend_class-native() { @@ -39,13 +44,12 @@ do_configure_prepend_class-native() { BHOST_PKGCONFIG_PATH=$(PATH=/usr/bin:/bin pkg-config --variable pc_path pkg-config || echo "") if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH - # link with system dbus on Ubuntu 15.10 - # FIXME: remove below 4 lines when oe dbus is upgraded - if [ -r /etc/lsb-release -a "$(lsb_release -is)$(lsb_release -rs)" = "Ubuntu15.10" ] ; then - libs=$(PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_PATH=$BHOST_PKGCONFIG_PATH PATH=/usr/bin:/bin pkg-config --libs dbus-1 || echo "") - [ -n "$libs" ] && export LDFLAGS="$libs $LDFLAGS" - fi fi + + # Alter target makefiles to accept CFLAGS set via env + sed -i -r \ + -e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \ + "${S}"/Makefile "${S}"/Makefile.target } KVMENABLE = "--enable-kvm" @@ -72,7 +76,7 @@ do_install_ptest() { cp -rL ${B}/tests ${D}${PTEST_PATH} find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcod]" | xargs -i rm -rf {} - cp ${S}/tests/Makefile ${D}${PTEST_PATH}/tests + cp ${S}/tests/Makefile.include ${D}${PTEST_PATH}/tests } do_install () { @@ -103,9 +107,8 @@ PACKAGECONFIG ??= " \ " PACKAGECONFIG_class-native ??= "fdt alsa uuid" PACKAGECONFIG_class-nativesdk ??= "fdt sdl" -NATIVEDEPS = "" -NATIVEDEPS_class-native = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'libxext-native', '',d)}" -PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,libsdl ${NATIVEDEPS}," + +PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,libsdl" PACKAGECONFIG[virtfs] = "--enable-virtfs --enable-attr,--disable-virtfs,libcap attr," PACKAGECONFIG[aio] = "--enable-linux-aio,--disable-linux-aio,libaio," PACKAGECONFIG[xfs] = "--enable-xfsctl,--disable-xfsctl,xfsprogs," @@ -117,7 +120,7 @@ PACKAGECONFIG[libcurl] = "--enable-curl,--disable-curl,libcurl," PACKAGECONFIG[nss] = "--enable-smartcard,--disable-smartcard,nss," PACKAGECONFIG[uuid] = "--enable-uuid,--disable-uuid,util-linux," PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses," -PACKAGECONFIG[gtk+] = "--enable-gtk --enable-vte,--disable-gtk --disable-vte,gtk+ libvte," +PACKAGECONFIG[gtk+] = "--enable-gtk --with-gtkabi=3.0 --enable-vte,--disable-gtk --disable-vte,gtk+3 vte" PACKAGECONFIG[libcap-ng] = "--enable-cap-ng,--disable-cap-ng,libcap-ng," PACKAGECONFIG[ssh2] = "--enable-libssh2,--disable-libssh2,libssh2," PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,gcrypt," @@ -129,6 +132,7 @@ PACKAGECONFIG[glx] = "--enable-opengl,--disable-opengl,mesa" PACKAGECONFIG[lzo] = "--enable-lzo,--disable-lzo,lzo" PACKAGECONFIG[numa] = "--enable-numa,--disable-numa,numactl" PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls" +PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2" EXTRA_OECONF += "${@bb.utils.contains('PACKAGECONFIG', 'alsa', '--audio-drv-list=oss,alsa', '', d)}" diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0001-target-mips-add-24KEc-CPU-definition.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0001-target-mips-add-24KEc-CPU-definition.patch new file mode 100644 index 000000000..c4dbee7d7 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/0001-target-mips-add-24KEc-CPU-definition.patch @@ -0,0 +1,54 @@ +From 926bc194f918d46bd93557b15da8153b6a94a1d5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net> +Date: Mon, 25 Jul 2016 23:58:22 +0100 +Subject: [PATCH] target-mips: add 24KEc CPU definition +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Define a new CPU definition supporting 24KEc cores, similar to +the existing 24Kc, but with added support for DSP instructions +and MIPS16e (and without FPU). + +Signed-off-by: André Draszik <git@andred.net> +--- +Upstream-Status: Submitted [http://lists.nongnu.org/archive/html/qemu-devel/2016-07/msg05778.html] + target-mips/translate_init.c | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/target-mips/translate_init.c b/target-mips/translate_init.c +index 39ed5c4..6ae23e4 100644 +--- a/target-mips/translate_init.c ++++ b/target-mips/translate_init.c +@@ -256,6 +256,28 @@ static const mips_def_t mips_defs[] = + .mmu_type = MMU_TYPE_R4000, + }, + { ++ .name = "24KEc", ++ .CP0_PRid = 0x00019600, ++ .CP0_Config0 = MIPS_CONFIG0 | (0x1 << CP0C0_AR) | ++ (MMU_TYPE_R4000 << CP0C0_MT), ++ .CP0_Config1 = MIPS_CONFIG1 | (15 << CP0C1_MMU) | ++ (0 << CP0C1_IS) | (3 << CP0C1_IL) | (1 << CP0C1_IA) | ++ (0 << CP0C1_DS) | (3 << CP0C1_DL) | (1 << CP0C1_DA) | ++ (1 << CP0C1_CA), ++ .CP0_Config2 = MIPS_CONFIG2, ++ .CP0_Config3 = MIPS_CONFIG3 | (1 << CP0C3_DSPP) | (0 << CP0C3_VInt), ++ .CP0_LLAddr_rw_bitmask = 0, ++ .CP0_LLAddr_shift = 4, ++ .SYNCI_Step = 32, ++ .CCRes = 2, ++ /* we have a DSP, but no FPU */ ++ .CP0_Status_rw_bitmask = 0x1378FF1F, ++ .SEGBITS = 32, ++ .PABITS = 32, ++ .insn_flags = CPU_MIPS32R2 | ASE_MIPS16 | ASE_DSP, ++ .mmu_type = MMU_TYPE_R4000, ++ }, ++ { + .name = "24Kf", + .CP0_PRid = 0x00019300, + .CP0_Config0 = MIPS_CONFIG0 | (0x1 << CP0C0_AR) | +-- +2.8.1 + diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-1568.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-1568.patch deleted file mode 100644 index 56fd346ae..000000000 --- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-1568.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 4ab0359a8ae182a7ac5c99609667273167703fab Mon Sep 17 00:00:00 2001 -From: Prasad J Pandit <pjp@fedoraproject.org> -Date: Mon, 11 Jan 2016 14:10:42 -0500 -Subject: [PATCH] ide: ahci: reset ncq object to unused on error - -When processing NCQ commands, AHCI device emulation prepares a -NCQ transfer object; To which an aio control block(aiocb) object -is assigned in 'execute_ncq_command'. In case, when the NCQ -command is invalid, the 'aiocb' object is not assigned, and NCQ -transfer object is left as 'used'. This leads to a use after -free kind of error in 'bdrv_aio_cancel_async' via 'ahci_reset_port'. -Reset NCQ transfer object to 'unused' to avoid it. - -[Maintainer edit: s/ACHI/AHCI/ in the commit message. --js] - -Reported-by: Qinghao Tang <luodalongde@gmail.com> -Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> -Reviewed-by: John Snow <jsnow@redhat.com> -Message-id: 1452282511-4116-1-git-send-email-ppandit@redhat.com -Signed-off-by: John Snow <jsnow@redhat.com> - -Upstream-Status: Backport - -http://git.qemu.org/?p=qemu.git;a=commit;h=4ab0359a8ae182a7ac5c99609667273167703fab - -CVE: CVE-2016-1568 -[Yocto # 9013] - -Signed-off-by: Armin Kuster <akuster@mvista.com> - ---- - hw/ide/ahci.c | 1 + - 1 file changed, 1 insertion(+) - -Index: qemu-2.5.0/hw/ide/ahci.c -=================================================================== ---- qemu-2.5.0.orig/hw/ide/ahci.c -+++ qemu-2.5.0/hw/ide/ahci.c -@@ -910,6 +910,7 @@ static void ncq_err(NCQTransferState *nc - ide_state->error = ABRT_ERR; - ide_state->status = READY_STAT | ERR_STAT; - ncq_tfs->drive->port_regs.scr_err |= (1 << ncq_tfs->tag); -+ ncq_tfs->used = 0; - } - - static void ncq_finish(NCQTransferState *ncq_tfs) diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-2197.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-2197.patch deleted file mode 100644 index 946435c43..000000000 --- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-2197.patch +++ /dev/null @@ -1,59 +0,0 @@ -From: Prasad J Pandit <address@hidden> - -When IDE AHCI emulation uses Frame Information Structures(FIS) -engine for data transfer, the mapped FIS buffer address is stored -in a static 'bounce.buffer'. When a request is made to map another -memory region, address_space_map() returns NULL because -'bounce.buffer' is in_use. It leads to a null pointer dereference -error while doing 'dma_memory_unmap'. Add a check to avoid it. - -Reported-by: Zuozhi fzz <address@hidden> -Signed-off-by: Prasad J Pandit <address@hidden> - -Upstream-Status: Backport -https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg05740.html - -CVE: CVE-2016-2197 -Signed-off-by: Armin Kuster <akuster@mvista.com> - ---- - hw/ide/ahci.c | 16 ++++++++++------ - 1 file changed, 10 insertions(+), 6 deletions(-) - - Update as per review - -> https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg05715.html - -Index: qemu-2.5.0/hw/ide/ahci.c -=================================================================== ---- qemu-2.5.0.orig/hw/ide/ahci.c -+++ qemu-2.5.0/hw/ide/ahci.c -@@ -661,9 +661,11 @@ static bool ahci_map_fis_address(AHCIDev - - static void ahci_unmap_fis_address(AHCIDevice *ad) - { -- dma_memory_unmap(ad->hba->as, ad->res_fis, 256, -- DMA_DIRECTION_FROM_DEVICE, 256); -- ad->res_fis = NULL; -+ if (ad->res_fis) { -+ dma_memory_unmap(ad->hba->as, ad->res_fis, 256, -+ DMA_DIRECTION_FROM_DEVICE, 256); -+ ad->res_fis = NULL; -+ } - } - - static bool ahci_map_clb_address(AHCIDevice *ad) -@@ -677,9 +679,11 @@ static bool ahci_map_clb_address(AHCIDev - - static void ahci_unmap_clb_address(AHCIDevice *ad) - { -- dma_memory_unmap(ad->hba->as, ad->lst, 1024, -- DMA_DIRECTION_FROM_DEVICE, 1024); -- ad->lst = NULL; -+ if (ad->lst) { -+ dma_memory_unmap(ad->hba->as, ad->lst, 1024, -+ DMA_DIRECTION_FROM_DEVICE, 1024); -+ ad->lst = NULL; -+ } - } - - static void ahci_write_fis_sdb(AHCIState *s, NCQTransferState *ncq_tfs) diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-2198.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-2198.patch deleted file mode 100644 index f1201f061..000000000 --- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/CVE-2016-2198.patch +++ /dev/null @@ -1,45 +0,0 @@ -From: Prasad J Pandit <address@hidden> - -USB Ehci emulation supports host controller capability registers. -But its mmio '.write' function was missing, which lead to a null -pointer dereference issue. Add a do nothing 'ehci_caps_write' -definition to avoid it; Do nothing because capability registers -are Read Only(RO). - -Reported-by: Zuozhi Fzz <address@hidden> -Signed-off-by: Prasad J Pandit <address@hidden> - -Upstream-Status: Backport -https://lists.gnu.org/archive/html/qemu-devel/2016-01/msg05899.html - -CVE: CVE-2016-2198 -Signed-off-by: Armin Kuster <akuster@mvista.com> - ---- - hw/usb/hcd-ehci.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -Index: qemu-2.5.0/hw/usb/hcd-ehci.c -=================================================================== ---- qemu-2.5.0.orig/hw/usb/hcd-ehci.c -+++ qemu-2.5.0/hw/usb/hcd-ehci.c -@@ -893,6 +893,11 @@ static uint64_t ehci_caps_read(void *ptr - return s->caps[addr]; - } - -+static void ehci_caps_write(void *ptr, hwaddr addr, -+ uint64_t val, unsigned size) -+{ -+} -+ - static uint64_t ehci_opreg_read(void *ptr, hwaddr addr, - unsigned size) - { -@@ -2310,6 +2315,7 @@ static void ehci_frame_timer(void *opaqu - - static const MemoryRegionOps ehci_mmio_caps_ops = { - .read = ehci_caps_read, -+ .write = ehci_caps_write, - .valid.min_access_size = 1, - .valid.max_access_size = 4, - .impl.min_access_size = 1, diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile.patch index a99f72098..2ce3478e4 100644 --- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile.patch +++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile.patch @@ -4,14 +4,14 @@ Add subpackage -ptest which runs all unit test cases for qemu. Signed-off-by: Kai Kang <kai.kang@windriver.com> --- - tests/Makefile | 10 ++++++++++ - 1 file changed, 10 insertions(+) + tests/Makefile.include | 8 ++++++++ + 1 file changed, 8 insertions(+) -diff --git a/tests/Makefile b/tests/Makefile -index 88f7105..3f40b4b 100644 ---- a/tests/Makefile -+++ b/tests/Makefile -@@ -405,3 +405,12 @@ all: $(QEMU_IOTESTS_HELPERS-y) +diff --git a/tests/Makefile.include b/tests/Makefile.include +index 14be491..0fce37a 100644 +--- a/tests/Makefile.include ++++ b/tests/Makefile.include +@@ -776,3 +776,11 @@ all: $(QEMU_IOTESTS_HELPERS-y) -include $(wildcard tests/*.d) -include $(wildcard tests/libqos/*.d) @@ -23,7 +23,6 @@ index 88f7105..3f40b4b 100644 + nf=$$(echo $$f | sed 's/tests\//\.\//g'); \ + $$nf; \ + done -+ --- -1.7.9.5 +-- +2.9.0 diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/disable-grabs.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/disable-grabs.patch index 41726b1c8..123833f82 100644 --- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/disable-grabs.patch +++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/disable-grabs.patch @@ -29,9 +29,9 @@ index 39a42d6..9b8abe5 100644 --- a/ui/sdl.c +++ b/ui/sdl.c @@ -59,6 +59,10 @@ static SDL_Cursor *guest_sprite = NULL; - static SDL_PixelFormat host_format; static int scaling_active = 0; static Notifier mouse_mode_notifier; + static int idle_counter; +#ifndef True +#define True 1 +#endif @@ -40,7 +40,7 @@ index 39a42d6..9b8abe5 100644 static void sdl_update(DisplayChangeListener *dcl, int x, int y, int w, int h) @@ -384,14 +388,16 @@ static void sdl_grab_start(void) - SDL_WarpMouse(guest_x, guest_y); + } } else sdl_hide_cursor(); - SDL_WM_GrabInput(SDL_GRAB_ON); diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/fix-libcap-header-issue-on-some-distro.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/fix-libcap-header-issue-on-some-distro.patch index 13a6ea23b..cee6a676a 100644 --- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/fix-libcap-header-issue-on-some-distro.patch +++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/fix-libcap-header-issue-on-some-distro.patch @@ -67,9 +67,9 @@ diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c #include <sys/vfs.h> #include <sys/ioctl.h> @@ -26,7 +25,11 @@ - #include "virtio-9p-marshal.h" - #include "hw/9pfs/virtio-9p-proxy.h" - #include "fsdev/virtio-9p-marshal.h" + #include "9p-iov-marshal.h" + #include "hw/9pfs/9p-proxy.h" + #include "fsdev/9p-iov-marshal.h" - +/* + * Include this one last due to some versions of it being buggy: diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch new file mode 100644 index 000000000..173394fd0 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu/qemu-2.5.0-cflags.patch @@ -0,0 +1,13 @@ +--- a/configure ++++ b/configure +@@ -4468,10 +4468,6 @@ fi + if test "$gcov" = "yes" ; then + CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS" + LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS" +-elif test "$fortify_source" = "yes" ; then +- CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS" +-elif test "$debug" = "no"; then +- CFLAGS="-O2 $CFLAGS" + fi + + ########################################## diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.5.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.7.0.bb index e9d9a8dce..619b8ed44 100644 --- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.5.0.bb +++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemu_2.7.0.bb @@ -7,14 +7,13 @@ SRC_URI += "file://configure-fix-Darwin-target-detection.patch \ file://qemu-enlarge-env-entry-size.patch \ file://Qemu-Arm-versatilepb-Add-memory-size-checking.patch \ file://no-valgrind.patch \ - file://CVE-2016-1568.patch \ - file://CVE-2016-2197.patch \ - file://CVE-2016-2198.patch \ file://pathlimit.patch \ - " + file://qemu-2.5.0-cflags.patch \ +" + SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2" -SRC_URI[md5sum] = "f469f2330bbe76e3e39db10e9ac4f8db" -SRC_URI[sha256sum] = "3443887401619fe33bfa5d900a4f2d6a79425ae2b7e43d5b8c36eb7a683772d4" +SRC_URI[md5sum] = "08d4d06d1cb598efecd796137f4844ab" +SRC_URI[sha256sum] = "326e739506ba690daf69fc17bd3913a6c313d9928d743bd8eddb82f403f81e53" COMPATIBLE_HOST_class-target_mips64 = "null" diff --git a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb index 7f4c6d934..53b302d65 100644 --- a/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb +++ b/import-layers/yocto-poky/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb @@ -41,10 +41,6 @@ EOF chmod +x ${D}${bindir_crossscripts}/qemuwrapper } -SYSROOT_PREPROCESS_FUNCS += "qemuwrapper_sysroot_preprocess" - -qemuwrapper_sysroot_preprocess () { - sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts} -} +SYSROOT_DIRS += "${bindir_crossscripts}" INHIBIT_DEFAULT_DEPS = "1" |