summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2012-07-23 10:24:14 +0200
committerYury Usishchev <y.usishchev@samsung.com>2014-12-10 13:48:35 +0300
commite72ea7ed095ac2b118654c60ace62598f77a9195 (patch)
tree682e5dd50031c250f07d51771a5f261a5a3ae17f
parent1620533b485efd43de632aa04c0cab1bb040275c (diff)
downloadqemu-e72ea7ed095ac2b118654c60ace62598f77a9195.tar.gz
qemu-e72ea7ed095ac2b118654c60ace62598f77a9195.tar.bz2
qemu-e72ea7ed095ac2b118654c60ace62598f77a9195.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.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 6fc55b41c..de930eb9d 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5344,6 +5344,25 @@ static int open_self_stat(void *cpu_env, int fd)
return 0;
}
+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;
+}
+
static int open_self_auxv(void *cpu_env, int fd)
{
CPUState *cpu = ENV_GET_CPU((CPUArchState *)cpu_env);
@@ -5458,6 +5477,7 @@ static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags,
#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
{ "/proc/net/route", open_net_route, is_proc },
#endif
+ { "cpuinfo", open_cpuinfo, is_proc_myself },
{ NULL, NULL, NULL }
};