From 6f7234f68aca50ebbdc89fae0b107215edafb04a Mon Sep 17 00:00:00 2001 From: Stewart Smith Date: Tue, 4 Mar 2014 15:39:41 +1100 Subject: 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 --- sys-utils/lscpu-dmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3-55-g7522