termux-packages/x11-packages/qemu-common/0011-no-cacheinfo.patch
Leonid Pliushch 64ee9557fd
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.
2022-04-18 14:35:52 +05:30

18 lines
586 B
Diff

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;