[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/10] linux-user: add pseudo /proc/cpuinfo for sparc
From: |
Laurent Vivier |
Subject: |
[Qemu-devel] [PULL 01/10] linux-user: add pseudo /proc/cpuinfo for sparc |
Date: |
Thu, 23 May 2019 16:43:27 +0200 |
SPARC libc6 debian package wants to check the cpu level to be
installed or not:
WARNING: This machine has a SPARC V8 or earlier class processor.
Debian lenny and later does not support such old hardware
any longer.
To avoid this, it only needs to know if the machine type is sun4u or sun4v,
for that it reads the information from /proc/cpuinfo.
Fixes: 9a93c152fcdb4ab2cd85094487b33578fd693915
("linux-user: fix UNAME_MACHINE for sparc/sparc64")
Signed-off-by: Laurent Vivier <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>
---
linux-user/syscall.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index efa3ec283706..68484a83e69e 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6786,12 +6786,15 @@ static int is_proc_myself(const char *filename, const
char *entry)
return 0;
}
-#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
+#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN) || \
+ defined(TARGET_SPARC)
static int is_proc(const char *filename, const char *entry)
{
return strcmp(filename, entry) == 0;
}
+#endif
+#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
static int open_net_route(void *cpu_env, int fd)
{
FILE *fp;
@@ -6836,6 +6839,14 @@ static int open_net_route(void *cpu_env, int fd)
}
#endif
+#if defined(TARGET_SPARC)
+static int open_cpuinfo(void *cpu_env, int fd)
+{
+ dprintf(fd, "type\t\t: sun4u\n");
+ return 0;
+}
+#endif
+
static int do_openat(void *cpu_env, int dirfd, const char *pathname, int
flags, mode_t mode)
{
struct fake_open {
@@ -6851,6 +6862,9 @@ static int do_openat(void *cpu_env, int dirfd, const char
*pathname, int flags,
{ "cmdline", open_self_cmdline, is_proc_myself },
#if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN)
{ "/proc/net/route", open_net_route, is_proc },
+#endif
+#if defined(TARGET_SPARC)
+ { "/proc/cpuinfo", open_cpuinfo, is_proc },
#endif
{ NULL, NULL, NULL }
};
--
2.20.1
- [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches, Laurent Vivier, 2019/05/23
- [Qemu-devel] [PULL 01/10] linux-user: add pseudo /proc/cpuinfo for sparc,
Laurent Vivier <=
- [Qemu-devel] [PULL 07/10] linux-user: Add support for setsockopt() options IPV6_<ADD|DROP>_MEMBERSHIP, Laurent Vivier, 2019/05/23
- [Qemu-devel] [PULL 04/10] linux-user: Add support for SIOCSPGRP ioctl for all targets, Laurent Vivier, 2019/05/23
- [Qemu-devel] [PULL 02/10] linux-user: add pseudo /proc/hardware for m68k, Laurent Vivier, 2019/05/23
- [Qemu-devel] [PULL 09/10] linux-user: Align mmap_find_vma to host page size, Laurent Vivier, 2019/05/23
- [Qemu-devel] [PULL 05/10] linux-user: Add support for SIOC<G|S>IFPFLAGS ioctls for all targets, Laurent Vivier, 2019/05/23
- [Qemu-devel] [PULL 03/10] linux-user: Fix support for SIOCATMARK and SIOCGPGRP ioctls for xtensa, Laurent Vivier, 2019/05/23
- [Qemu-devel] [PULL 08/10] linux-user: Fix shmat emulation by honoring host SHMLBA, Laurent Vivier, 2019/05/23
- [Qemu-devel] [PULL 06/10] linux-user: Sanitize interp_info and, for mips only, init field fp_abi, Laurent Vivier, 2019/05/23
- [Qemu-devel] [PULL 10/10] linux-user: Pass through nanosecond timestamp components for stat syscalls, Laurent Vivier, 2019/05/23
- Re: [Qemu-devel] [PULL 00/10] Linux user for 4.1 patches, no-reply, 2019/05/23