summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStewart Smith2014-03-04 05:39:41 +0100
committerKarel Zak2014-03-04 11:47:27 +0100
commit6f7234f68aca50ebbdc89fae0b107215edafb04a (patch)
tree774542cb19558be7ef1dc1a1bbc34b07736c8f4b
parentlscpu: don't assume filesystem supports d_type when searching for NUMA nodes (diff)
downloadkernel-qcow2-util-linux-6f7234f68aca50ebbdc89fae0b107215edafb04a.tar.gz
kernel-qcow2-util-linux-6f7234f68aca50ebbdc89fae0b107215edafb04a.tar.xz
kernel-qcow2-util-linux-6f7234f68aca50ebbdc89fae0b107215edafb04a.zip
lscpu: read_hypervisor_dmi: only fallback to memory scan on x86/x86_64
As the comment in the code says, this method is really only valid on x86 and x86_64, so add a #ifdef for those architectures around that code block. This was causing "Program lscpu tried to access /dev/mem between f0000->100000." warnings on some ppc64 machines. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--sys-utils/lscpu-dmi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys-utils/lscpu-dmi.c b/sys-utils/lscpu-dmi.c
index c416f8e8d..c82bfc134 100644
--- a/sys-utils/lscpu-dmi.c
+++ b/sys-utils/lscpu-dmi.c
@@ -258,6 +258,7 @@ int read_hypervisor_dmi(void)
free(buf);
memory_scan:
+#if defined(__x86_64__) || defined(__i386__)
/* Fallback to memory scan (x86, x86_64) */
buf = get_mem_chunk(0xF0000, 0x10000, _PATH_DEV_MEM);
if (!buf)
@@ -275,7 +276,7 @@ memory_scan:
if (rc >= 0)
break;
}
-
+#endif
done:
free(buf);
return rc;