]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lscpu: read_hypervisor_dmi: only fallback to memory scan on x86/x86_64
authorStewart Smith <stewart@linux.vnet.ibm.com>
Tue, 4 Mar 2014 04:39:41 +0000 (15:39 +1100)
committerKarel Zak <kzak@redhat.com>
Tue, 4 Mar 2014 10:47:27 +0000 (11:47 +0100)
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>
sys-utils/lscpu-dmi.c

index c416f8e8d3b1cec1965f6b5b0b5dccb55b6c6ddb..c82bfc134a00a3f05f4861f66b7d5562df581b5f 100644 (file)
@@ -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;