From nobody Mon Nov 10 19:14:00 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1558100202; cv=none; d=zoho.com; s=zohoarc; b=b6Zxb0w96RSFw0iJVUH63h9off4NtfrvzcoqE7vcRKeDcpk9F9f9mPe6Vba/KebbiIeqmOImRIMEpn/AjxaicCP5NRkF0F3hdUmn4lcth1qyB/tZZWhuEiy/S9XONZtPeYrRZ5sKenKEtBLHAJrKG9SpK9l6Tq/z4PuLC5/FKV0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558100202; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Hb/1JGZIBcOMeRz1vLsSOjnieWTlBkGJm+q0JEg82qU=; b=jOvcdvIqTQOVsvLZDmmBTobZWIwd48uDab5BwisXvwQLH/jA3bJVBerRGs+dnxiQDbdugCSg6plizG23qNPGnsshCa4BDnNPpJ7bAnzLU6OBF8NqWruEqfJVszVH7n9NP4mRQmrFrZMChgNr1WfY+0mcPJIjm6EPsSzMi0iOT0I= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558100202639492.9675125247711; Fri, 17 May 2019 06:36:42 -0700 (PDT) Received: from localhost ([127.0.0.1]:48764 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRd2G-0001B2-2m for importer@patchew.org; Fri, 17 May 2019 09:36:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRcy3-0007Aw-9o for qemu-devel@nongnu.org; Fri, 17 May 2019 09:32:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRcy2-0000XA-Bw for qemu-devel@nongnu.org; Fri, 17 May 2019 09:32:11 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:39407) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hRcy2-0000VP-2x for qemu-devel@nongnu.org; Fri, 17 May 2019 09:32:10 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Mr8zO-1guz3B4Bi2-00oDg1; Fri, 17 May 2019 15:32:00 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Fri, 17 May 2019 15:31:48 +0200 Message-Id: <20190517133149.19593-2-laurent@vivier.eu> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190517133149.19593-1-laurent@vivier.eu> References: <20190517133149.19593-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Nnc41dw8F/dFUZKrbCJ9ZgA3Q2Glc6oel3h6CJGGMhh1WLawAZq PQONU5xstz6jGsaaSReiLi7sTfH/liz8d9Gd2PIq4vbFg0Pjj3T+3woaZuJ4ZciTxdrhefl 3DyKIQhnuD+lhFwp5H6+TaUuQYF0K29Yw0P/1qBJYinOVeJpd6i6y/+ULr0kJijEiHPavTQ wCsdUQMBqz2kKigr3DkjA== X-UI-Out-Filterresults: notjunk:1;V03:K0:QwPFyUSlt2c=:3pn9pxOKH7gZdOIuDKnKlG xT3UAFOdAzd2H5GfkZp/QugTXqvJa75c9R4mUgTJGTwkrM9j363XODsvGvcH52GcNE5aJqbj/ eXlHB0MtoT/YY29VDJRuyvcq0S6/1hQG842oPguO281iU2r7xS2mvHJJZ9GVhr8gPQHLI8Jnd ZMAIOtQ38UpCSgrhY7VsSyO/25PUmpl44UimuIUbteOeU2zIyeHyuSiBvZDUxSdYOzrgh4v8u FVVv6cwLTOnFGTCUFs6jOLwwWUqkGAtOMr5IXJJ7PRwn7ja2BhBsBSgU4boksN9ry8dKVI6I5 CXwaFP5mleQdW8jTWfSo//gjgMsDPDkq+w0QyGfYbG2qUised8vPvOzpHO+/iis82uktOw6GZ pgTpE4r/p3eg79KaW5FUbYcFt0Nx74Uz7l9bO/lxSdaC/uLiC7c9q5DIB6oo1+cd7dCvdopho 0nqGabVsKrDFQcH9QHRuaRTtxHZJYAx04S1n4V8kmtEdXVEB00EgGS796F+Ac1ohCeZ91sH/E MoQKRrdK+S+F9E93I62+hs/YQ+7U35pnA71yUr3uUfCPK/u/r36nXSrsmTk61WDr5p2+EmyFO amXyqqoYyBk6ixzgwyP38MKhvF6XzAY+R8gpRmW81Aw4kG4ol4ao9AFKOSiwQ/3/iWcOMMiVT AB+HQvxb+owt0zTgTk7HrcOhUe6OUeqrg1oV9ilT/g1pbF148ufpDY+Z334lYlZSlWzzB39pB dhAVgkRgr9Ba8J2nF8CMmYzdvSNtRvec5Fl7AQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.131 Subject: [Qemu-devel] [PATCH v2 1/2] linux-user: add pseudo /proc/cpuinfo for sparc X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Richard Henderson --- 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 f5ff6f5dc8a8..43b1b106765c 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6786,12 +6786,15 @@ static int is_proc_myself(const char *filename, con= st char *entry) return 0; } =20 -#if defined(HOST_WORDS_BIGENDIAN) !=3D defined(TARGET_WORDS_BIGENDIAN) +#if defined(HOST_WORDS_BIGENDIAN) !=3D defined(TARGET_WORDS_BIGENDIAN) || \ + defined(TARGET_SPARC) static int is_proc(const char *filename, const char *entry) { return strcmp(filename, entry) =3D=3D 0; } +#endif =20 +#if defined(HOST_WORDS_BIGENDIAN) !=3D 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 =20 +#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 f= lags, 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) !=3D 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 } }; --=20 2.20.1