SHA256
1
0
forked from pool/qemu
qemu/linux-user-Fake-proc-cpuinfo.patch
Bruce Rogers 64435eabdc Accepting request 730437 from Virtualization:Staging
Update to v4.1.0. Also includes other major packaging changes as follows:
There is a new package maintenance workflow - see README.PACKAGING for details.
The sibling packages qemu-linux-user and qemu-testsuite are now created with the Build Service's MultiBuild feature. This also necessitates combining the qemu-linux-user changelog content back into qemu's. Luckily the delta there is quite small. Note that the qemu spec file is now that much busier, but added section markers should help reduce the confusion. Also qemu is being enabled for RISCV host compatibility, so some changes are related to that as well.

OBS-URL: https://build.opensuse.org/request/show/730437
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=487
2019-09-12 15:54:03 +00:00

65 lines
2.0 KiB
Diff

From: Alexander Graf <agraf@suse.de>
Date: Mon, 23 Jul 2012 10:24:14 +0200
Subject: linux-user: Fake /proc/cpuinfo
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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>
---
linux-user/syscall.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index cf5de07a09235e6d92735332dc7f..3bb2c8921fc203264bbc0a37fe1d 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6958,6 +6958,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);
@@ -7100,6 +7121,9 @@ static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags,
#if defined(TARGET_SPARC)
{ "/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