From patchwork Tue Aug 14 19:45:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 957716 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41qjlp23xLz9sBq for ; Wed, 15 Aug 2018 05:46:44 +1000 (AEST) Received: from localhost ([::1]:46091 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpfH7-00029o-Jd for incoming@patchwork.ozlabs.org; Tue, 14 Aug 2018 15:46:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpfGR-00028K-Kk for qemu-devel@nongnu.org; Tue, 14 Aug 2018 15:46:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fpfGC-0007L0-2R for qemu-devel@nongnu.org; Tue, 14 Aug 2018 15:45:59 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:43433) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fpfGB-0007JQ-Li for qemu-devel@nongnu.org; Tue, 14 Aug 2018 15:45:43 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.183]) with ESMTPSA (Nemesis) id 0MYekE-1fKKro0O4Q-00VSe6; Tue, 14 Aug 2018 21:45:30 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 14 Aug 2018 21:45:19 +0200 Message-Id: <20180814194520.22458-1-laurent@vivier.eu> X-Mailer: git-send-email 2.17.1 X-Provags-ID: V03:K1:XIogc7fqhEula/O9ON51XArDIgRUWFoIvIivqdSJaMQkuXqXLtk ycjzjWs2MbysPZKX/MY1ksGM6Ptj1c7Eje6z5WsrXY3XiQoyRKTs3qIO0jRC9x7KbHxWqbG pha2+P8MQO3P3KBvqXRmZ6kvNBI7AqU/rEbBuzECa/CBgDXmlE3mlXrbRgWzXP0gEnI9TKD iVxKSZ3wmZuMyQO1QdFtA== X-UI-Out-Filterresults: notjunk:1; V01:K0:UUt1swWRnPA=:jsEQiRPy/2qmKTmg13m9k9 lAuhuCuwr4pw5tSA9iuNICdk4IOAktVKUSiqoZSmu6Y4EhtBwgivO0zGtLlrzfKgK6bz0Nf50 44IxEris9btiPVvFsIEIM7ED/p9JAZx01IjQ82FZC476br6QP7rIU7mNx60CI3+oCerkYeLAR tOI6Rc55pcdxQ/Zbyw+8/KGohkECoA8ZSlbyi69vhnTtOPRxtgcOZy+lyT6KhphqMqqQZlqVH +q8UYAsW7I3CMS9AqIBtVJF/2twyuA7W1udlfSVnf6NsdgCHCB67clW/9HhU2p8We2hWYdyzM G2kQkDbAGn50e2RU5WCV0IGycltuKAsZfAFR/p2NcFpvLlPIUfIsNAVZoyj3irUzm827KgAH2 U6lvMRU1FKM5bAzEG5+UiXDydUR34hcEH0cl6bqgi1LBRd59RiI4vHj93GJ5bez8kh6SdCl80 uxS6+DZn1csb2FmWrs16Z/ScINjmCHhZC+uIXnTFADCS+Kj2VbxuMiNu5HtgssUycpcKw3ebm TNjgrMpTJNdk6C+fe4wEtPwcUZro4McG5H/2LMYFXFoGHNp6ku8d/PQrQoNTKBllO2ZuM89/3 SZveCoYMa81iTY7Y7HzlpaArOhJ/fwAYwHNFzdOKUJm2EJrx8f2747MKI43oc/wex+lzVWrU8 OHvMAsqx0gsaPTJ4FCFADsIV2jpwG61xpKa4l2mgTRI5FMbMGkyrUjD2fft2xa+vjbUo= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.10 Subject: [Qemu-devel] [PATCH 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 --- 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 dfc851cc35..5850aba5be 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7745,12 +7745,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; @@ -7789,6 +7792,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 { @@ -7804,6 +7815,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 } }; From patchwork Tue Aug 14 19:45:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 957717 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41qjmY36Kgz9sBq for ; Wed, 15 Aug 2018 05:47:25 +1000 (AEST) Received: from localhost ([::1]:46092 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpfHn-0002OK-34 for incoming@patchwork.ozlabs.org; Tue, 14 Aug 2018 15:47:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpfGt-0002DJ-J7 for qemu-devel@nongnu.org; Tue, 14 Aug 2018 15:46:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fpfGe-0007eb-9e for qemu-devel@nongnu.org; Tue, 14 Aug 2018 15:46:27 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:54427) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fpfGd-0007db-Qf for qemu-devel@nongnu.org; Tue, 14 Aug 2018 15:46:12 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.183]) with ESMTPSA (Nemesis) id 0M1Wqf-1g9Ozr2Dm5-00tUmr; Tue, 14 Aug 2018 21:45:30 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 14 Aug 2018 21:45:20 +0200 Message-Id: <20180814194520.22458-2-laurent@vivier.eu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180814194520.22458-1-laurent@vivier.eu> References: <20180814194520.22458-1-laurent@vivier.eu> X-Provags-ID: V03:K1:DG/oubvngm7QGnWuBhWM8n1KSaSsiJoNW4ZzjYej6nQFUWTjb2F AZl8nLe0mvJsZnmGX/UfrpZ9EQy6lr2YXdwJUFaK8xHLjgo8JLJeuz4smjPdxTqP1fjLdIy Lz/ZgypsuRhBcJiYY9q4JiVwlB1hnyycD05stmkiKYRV5KKqZBEY2JhhVJRf70lFLG8/mYo 1k4vwdpOwg9pf4V9rwzRg== X-UI-Out-Filterresults: notjunk:1; V01:K0:nmh6QjS4kkA=:HxxAUurPGTu08SgZ3Yy6PQ sidufuZxq83pVANspK3FPG99McPE5SbLgVAoPJV/SgAvH2CxSK7EBz5awRt7ZNQ7LyLOuXfAl ajhGGKMOuWq/slCjfStF7TFq3sCSY/B4xQgMzlaMEE/36qdolYOwdamkF2oD8OIB4E5210DSA qUfjgRbSOY+ygJLNGS7ZsNXH/uz52oqCHA6y7qAedjrFNn/4gJyAvZvjOhmeuj35a3q2ODJlE 5Qi5HM5Zw4TwNLOif8f/gl0DIi/hTCV+fyy8Ao0YYYyV1+bYmTzIQriszD/3jh1uIN0bHZGUN Tys3vRoJCFGtzNQeweVpqqScBOtV1lSl8Np3cPwbUCpFyXSnZO0SmRh4IkCSqB51P+zEhT3JX QsEzdOCyu2xOtyvUiduzGls0y7UF3uy24mpYPaKFUXcg6D8MXuS6LLnraEyPFo6hdKkFpb9Vk OcF1fzKwUbLuVpUD1z9vWWEmvTTcKlr7jrDm3iurNgjILv55Qooh/X4kEMRiD37j1MGHGNlr1 KfN9+B1OFadbAc7AuOkTpkaBLBFU8Wm/WJe7GbmtKp4RdJml6lNn86wPfgbnZt1v3ApI17lDt raZnQNVI/lw2UV3U0ce9hjfP4Kp815TrKATrWhKA0TwO/xTanl2dLRGc7nzAxbDHIc1X29hX7 GFJhOMBxpC2cmsGwgzHehBXdp7bh39IorDjeGBhGQdzajtmWkTWWpIUPB6a48u4brQaw= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.72.192.73 Subject: [Qemu-devel] [PATCH 2/2] linux-user: add pseudo /proc/hardware for m68k 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Debian console-setup uses /proc/hardware to guess the keyboard layout. If the file /proc/hardware cannot be opened, the installation fails. This patch adds a pseudo /proc/hardware file to report the model of the machine. Instead of reporting a known and fake model, it reports "qemu-m68k", which is true, and avoids to set the configuration for an Amiga/Apple/Atari and let the user to chose the good one. Bug: https://github.com/vivier/qemu-m68k/issues/34 Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 5850aba5be..f9a6ada611 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7746,7 +7746,7 @@ static int is_proc_myself(const char *filename, const char *entry) } #if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN) || \ - defined(TARGET_SPARC) + defined(TARGET_SPARC) || defined(TARGET_M68K) static int is_proc(const char *filename, const char *entry) { return strcmp(filename, entry) == 0; @@ -7800,6 +7800,14 @@ static int open_cpuinfo(void *cpu_env, int fd) } #endif +#if defined(TARGET_M68K) +static int open_hardware(void *cpu_env, int fd) +{ + dprintf(fd, "Model:\t\tqemu-m68k\n"); + return 0; +} +#endif + static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags, mode_t mode) { struct fake_open { @@ -7818,6 +7826,9 @@ static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags, #endif #if defined(TARGET_SPARC) { "/proc/cpuinfo", open_cpuinfo, is_proc }, +#endif +#if defined(TARGET_M68K) + { "/proc/hardware", open_hardware, is_proc }, #endif { NULL, NULL, NULL } };