summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2012-07-23 10:24:14 +0200
committerSoonKyu Park <sk7.park@samsung.com>2021-11-23 13:45:50 +0900
commitb054fd457e28435fbdc73a31cbde071492d14950 (patch)
treef259948fd74e7bf4681f9482ee528e16f473456f
parentf9b74412d4979ae954ec0fd65c93cdd2c9dac6a9 (diff)
downloadqemu-b054fd457e28435fbdc73a31cbde071492d14950.tar.gz
qemu-b054fd457e28435fbdc73a31cbde071492d14950.tar.bz2
qemu-b054fd457e28435fbdc73a31cbde071492d14950.zip
linux-user: Fake /proc/cpuinfo
Fedora 17 for ARM reads /proc/cpuinfo and fails if it doesn't contain ARM related contents. This patch implements a quick hack to expose real /proc/cpuinfo data taken from a real world machine. The real fix would be to generate at least the flags automatically based on the selected CPU. Please do not submit this patch upstream until this has happened. Signed-off-by: Alexander Graf <agraf@suse.de> [AF: Rebased for v1.6 and v1.7] Signed-off-by: Andreas Färber <afaerber@suse.de>
-rw-r--r--linux-user/syscall.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 2839a2c5e..e1341c9d3 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7887,6 +7887,27 @@ static int open_self_stat(void *cpu_env, int fd)
return 0;
}
+#if defined(TARGET_ARM)
+static int open_cpuinfo(void *cpu_env, int fd)
+{
+ dprintf(fd,
+"Processor : ARMv7 Processor rev 5 (v7l)\n"
+"BogoMIPS : 799.53\n"
+"Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3\n"
+"CPU implementer : 0x41\n"
+"CPU architecture: 7\n"
+"CPU variant : 0x2\n"
+"CPU part : 0xc08\n"
+"CPU revision : 5\n"
+"\n"
+"Hardware : Genesi Efika MX (Smarttop)\n"
+"Revision : 51030\n"
+"Serial : 0000000000000000\n");
+
+ return 0;
+}
+#endif
+
static int open_self_auxv(void *cpu_env, int fd)
{
CPUState *cpu = env_cpu((CPUArchState *)cpu_env);
@@ -8041,6 +8062,9 @@ static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags,
#if defined(TARGET_SPARC) || defined(TARGET_HPPA)
{ "/proc/cpuinfo", open_cpuinfo, is_proc },
#endif
+#if defined(TARGET_ARM)
+ { "cpuinfo", open_cpuinfo, is_proc_myself },
+#endif
#if defined(TARGET_M68K)
{ "/proc/hardware", open_hardware, is_proc },
#endif