aports/main/haveged/fix-cpu-cache-size-detection.patch
Natanael Copa 3cb6d79b93 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.
2018-05-18 14:55:57 +00:00

16 lines
582 B
Diff

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);
}
}