From 64ee9557fddec5b86977da6f740e94bbb928f7a1 Mon Sep 17 00:00:00 2001 From: Leonid Pliushch Date: Mon, 27 May 2019 19:03:02 +0300 Subject: [PATCH] qemu-common: set icache/dcache line size to 0 From Bionic's sysconf.cpp: // We do not have actual implementations for cache queries. // It's valid to return 0 as the result is unknown. case _SC_LEVEL1_ICACHE_SIZE: return 0; case _SC_LEVEL1_ICACHE_ASSOC: return 0; case _SC_LEVEL1_ICACHE_LINESIZE: return 0; case _SC_LEVEL1_DCACHE_SIZE: return 0; case _SC_LEVEL1_DCACHE_ASSOC: return 0; case _SC_LEVEL1_DCACHE_LINESIZE: return 0; So actually it already should be set to 0, but it appears some devices set it to -1 which triggers assertion error. --- .../qemu-common/0011-no-cacheinfo.patch | 17 +++++++++++++++++ x11-packages/qemu-common/build.sh | 1 + 2 files changed, 18 insertions(+) create mode 100644 x11-packages/qemu-common/0011-no-cacheinfo.patch diff --git a/x11-packages/qemu-common/0011-no-cacheinfo.patch b/x11-packages/qemu-common/0011-no-cacheinfo.patch new file mode 100644 index 000000000..16f1775d1 --- /dev/null +++ b/x11-packages/qemu-common/0011-no-cacheinfo.patch @@ -0,0 +1,17 @@ +diff -uNr qemu-4.0.0/util/cacheinfo.c qemu-4.0.0.mod/util/cacheinfo.c +--- qemu-4.0.0/util/cacheinfo.c 2019-04-23 21:14:46.000000000 +0300 ++++ qemu-4.0.0.mod/util/cacheinfo.c 2019-05-27 18:52:53.357425925 +0300 +@@ -172,13 +172,6 @@ + { + int isize = 0, dsize = 0; + +- sys_cache_info(&isize, &dsize); +- arch_cache_info(&isize, &dsize); +- fallback_cache_info(&isize, &dsize); +- +- assert((isize & (isize - 1)) == 0); +- assert((dsize & (dsize - 1)) == 0); +- + qemu_icache_linesize = isize; + qemu_icache_linesize_log = ctz32(isize); + qemu_dcache_linesize = dsize; diff --git a/x11-packages/qemu-common/build.sh b/x11-packages/qemu-common/build.sh index 494f07a9b..702220204 100644 --- a/x11-packages/qemu-common/build.sh +++ b/x11-packages/qemu-common/build.sh @@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="A set common files for the QEMU emulators" TERMUX_PKG_LICENSE="LGPL-2.1" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=4.0.0 +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://download.qemu.org/qemu-$TERMUX_PKG_VERSION.tar.xz TERMUX_PKG_SHA256=13a93dfe75b86734326f8d5b475fde82ec692d5b5a338b4262aeeb6b0fa4e469 TERMUX_PKG_DEPENDS="capstone, dtc, glib, libandroid-shmem, libbz2, libc++, libcap, libcurl, libffi, libgnutls, libjpeg-turbo, liblzo, libnettle, libnfs, libpixman, libpng, libsasl, libssh2, libxml2, ncurses, openssl, pcre, sdl2, zlib"