2012-07-31 11:51:01 +02:00
|
|
|
From: Alexander Graf <agraf@suse.de>
|
|
|
|
Date: Mon, 23 Jul 2012 10:24:14 +0200
|
2019-01-04 22:08:16 +01:00
|
|
|
Subject: linux-user: Fake /proc/cpuinfo
|
2013-07-30 14:36:48 +02:00
|
|
|
MIME-Version: 1.0
|
|
|
|
Content-Type: text/plain; charset=UTF-8
|
|
|
|
Content-Transfer-Encoding: 8bit
|
2012-07-31 11:51:01 +02:00
|
|
|
|
|
|
|
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>
|
2013-12-08 06:19:09 +01:00
|
|
|
[AF: Rebased for v1.6 and v1.7]
|
2013-07-30 14:36:48 +02:00
|
|
|
Signed-off-by: Andreas Färber <afaerber@suse.de>
|
2012-07-31 11:51:01 +02:00
|
|
|
---
|
2019-09-12 17:54:03 +02:00
|
|
|
linux-user/syscall.c | 24 ++++++++++++++++++++++++
|
|
|
|
1 file changed, 24 insertions(+)
|
2012-07-31 11:51:01 +02:00
|
|
|
|
|
|
|
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
|
2020-08-12 00:53:07 +02:00
|
|
|
index 1a835798d19cc77da8d7ec6bdc7b..5cd29859d6ac5349f04c03996b12 100644
|
2012-07-31 11:51:01 +02:00
|
|
|
--- a/linux-user/syscall.c
|
|
|
|
+++ b/linux-user/syscall.c
|
2020-08-12 00:53:07 +02:00
|
|
|
@@ -7473,6 +7473,27 @@ static int open_self_stat(void *cpu_env, int fd)
|
2012-07-31 11:51:01 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-09-12 17:54:03 +02:00
|
|
|
+#if defined(TARGET_ARM)
|
2012-07-31 11:51:01 +02:00
|
|
|
+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;
|
|
|
|
+}
|
2019-09-12 17:54:03 +02:00
|
|
|
+#endif
|
2012-07-31 11:51:01 +02:00
|
|
|
+
|
|
|
|
static int open_self_auxv(void *cpu_env, int fd)
|
|
|
|
{
|
2019-09-12 17:54:03 +02:00
|
|
|
CPUState *cpu = env_cpu((CPUArchState *)cpu_env);
|
2020-08-12 00:53:07 +02:00
|
|
|
@@ -7627,6 +7648,9 @@ static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags,
|
|
|
|
#if defined(TARGET_SPARC) || defined(TARGET_HPPA)
|
2019-09-12 17:54:03 +02:00
|
|
|
{ "/proc/cpuinfo", open_cpuinfo, is_proc },
|
2013-12-08 06:19:09 +01:00
|
|
|
#endif
|
2019-09-12 17:54:03 +02:00
|
|
|
+#if defined(TARGET_ARM)
|
2013-12-08 06:19:09 +01:00
|
|
|
+ { "cpuinfo", open_cpuinfo, is_proc_myself },
|
2019-09-12 17:54:03 +02:00
|
|
|
+#endif
|
|
|
|
#if defined(TARGET_M68K)
|
|
|
|
{ "/proc/hardware", open_hardware, is_proc },
|
|
|
|
#endif
|