All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: Aleksandar Rikalo <arikalo@wavecomp.com>,
	Riku Voipio <riku.voipio@iki.fi>,
	Richard Henderson <richard.henderson@linaro.org>,
	Laurent Vivier <laurent@vivier.eu>,
	Aleksandar Markovic <amarkovic@wavecomp.com>,
	Aurelien Jarno <aurelien@aurel32.net>
Subject: [Qemu-devel] [PULL v2 1/9] linux-user: add pseudo /proc/cpuinfo for sparc
Date: Fri, 24 May 2019 13:25:12 +0200	[thread overview]
Message-ID: <20190524112520.17684-2-laurent@vivier.eu> (raw)
In-Reply-To: <20190524112520.17684-1-laurent@vivier.eu>

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 <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20190517133149.19593-2-laurent@vivier.eu>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 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



  reply	other threads:[~2019-05-24 11:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-24 11:25 [Qemu-devel] [PULL v2 0/9] Linux user for 4.1 patches Laurent Vivier
2019-05-24 11:25 ` Laurent Vivier [this message]
2019-05-24 11:25 ` [Qemu-devel] [PULL v2 2/9] linux-user: add pseudo /proc/hardware for m68k Laurent Vivier
2019-05-24 11:25 ` [Qemu-devel] [PULL v2 3/9] linux-user: Fix support for SIOCATMARK and SIOCGPGRP ioctls for xtensa Laurent Vivier
2019-05-24 11:25 ` [Qemu-devel] [PULL v2 4/9] linux-user: Add support for SIOCSPGRP ioctl for all targets Laurent Vivier
2019-05-24 11:25 ` [Qemu-devel] [PULL v2 5/9] linux-user: Add support for SIOC<G|S>IFPFLAGS ioctls " Laurent Vivier
2019-05-24 11:25 ` [Qemu-devel] [PULL v2 6/9] linux-user: Sanitize interp_info and, for mips only, init field fp_abi Laurent Vivier
2019-05-24 11:25 ` [Qemu-devel] [PULL v2 7/9] linux-user: Fix shmat emulation by honoring host SHMLBA Laurent Vivier
2019-05-24 11:25 ` [Qemu-devel] [PULL v2 8/9] linux-user: Align mmap_find_vma to host page size Laurent Vivier
2019-05-24 11:25 ` [Qemu-devel] [PULL v2 9/9] linux-user: Pass through nanosecond timestamp components for stat syscalls Laurent Vivier
2019-05-24 12:27 ` [Qemu-devel] [PULL v2 0/9] Linux user for 4.1 patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190524112520.17684-2-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=amarkovic@wavecomp.com \
    --cc=arikalo@wavecomp.com \
    --cc=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=riku.voipio@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.