aboutsummaryrefslogtreecommitdiffstats
path: root/main/haveged/fix-cpu-cache-size-detection.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-05-18 14:39:26 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2018-05-18 14:55:57 +0000
commit3cb6d79b93130a0354875ea95d32e0495bf41b81 (patch)
treea1cf700b0adea5bba4204625ac4ce6c702e42331 /main/haveged/fix-cpu-cache-size-detection.patch
parent5db9c7d1de44edb12f18ad0ce7c3a54b37bfdc56 (diff)
downloadaports-3cb6d79b93130a0354875ea95d32e0495bf41b81.tar.bz2
aports-3cb6d79b93130a0354875ea95d32e0495bf41b81.tar.xz
main/haveged: fix for armhf and aarch64
armhf and aarch64 apparently does not expose the cpu cache size via sysfs. It set it to -1 and that confuses haveged. Make it fallback to default cache size when sysfs reports -1.
Diffstat (limited to 'main/haveged/fix-cpu-cache-size-detection.patch')
-rw-r--r--main/haveged/fix-cpu-cache-size-detection.patch15
1 files changed, 15 insertions, 0 deletions
diff --git a/main/haveged/fix-cpu-cache-size-detection.patch b/main/haveged/fix-cpu-cache-size-detection.patch
new file mode 100644
index 0000000000..07da2b46d9
--- /dev/null
+++ b/main/haveged/fix-cpu-cache-size-detection.patch
@@ -0,0 +1,15 @@
+Some ARM cpus does not report the cache size or say it is -1
+
+diff --git a/src/havegetune.c b/src/havegetune.c
+index f1a99f2..de39c53 100644
+--- a/src/havegetune.c
++++ b/src/havegetune.c
+@@ -795,6 +795,8 @@ static int vfs_configInfoCache(
+ ctype = vfs_configFile(pAnchor, path, vfs_configType);
+ strcpy(path+plen, "size");
+ size = vfs_configFile(pAnchor, path, vfs_configInt);
++ if (size == -1)
++ size = ctype == 'I' ? GENERIC_ICACHE : GENERIC_DCACHE;
+ cfg_cacheAdd(pAnchor, SRC_VFS_INDEX, pArgs[1], level, ctype, size);
+ }
+ }