From patchwork Fri Jun 5 11:41:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 281305 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41D8CC433E0 for ; Fri, 5 Jun 2020 11:42:38 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 16BC6206E6 for ; Fri, 5 Jun 2020 11:42:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 16BC6206E6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhAk9-0003Vc-0C for qemu-devel@archiver.kernel.org; Fri, 05 Jun 2020 07:42:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhAj9-0002CT-SZ for qemu-devel@nongnu.org; Fri, 05 Jun 2020 07:41:35 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:53979) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhAj9-0005f3-1J for qemu-devel@nongnu.org; Fri, 05 Jun 2020 07:41:35 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1Md76B-1j7pm12Y4J-00a9wI; Fri, 05 Jun 2020 13:41:26 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 02/19] linux-user: return target error codes for socket() and prctl() Date: Fri, 5 Jun 2020 13:41:03 +0200 Message-Id: <20200605114120.1051236-3-laurent@vivier.eu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200605114120.1051236-1-laurent@vivier.eu> References: <20200605114120.1051236-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:yd6XIaELBsx2mJxCyYJBS6LYBEOtFTzmsw8aLpEKsBJJvBen0cF bqyOCkKtGuBSm2W17n45c/reIH3z7of1vubvPAjs83Z8+Fh7FjraDP0dfWrqYMm9AssX1DC OpGJNX6S2zfHAoINTtBSDTMBXKP68RNtdGn5fGTCRjg4UmaT93LxO2/T8cOxYkWDlQBG6AX aQhaDqxhYf2OHgyic+e0w== X-UI-Out-Filterresults: notjunk:1; V03:K0:dDCu5qbq0l0=:TFrkawL/Nz3420iuWd8P3F mpwfFlAP6KPLQmz3ERW1H/iBYmMoWe7Db9eit+MqdLbi/Ji7fNUvF7aN82xEa681VYSt6DFTL TTVh8JlblOly6Tv+TG+ERIp5d6ajYQnvUDIY+bPzcBjxzFu6isKAH0aVxulMilFWARBbx9DrG lb4iAMFWlAEzq0O9E2s0IGrqoJrd+kcL0niNsSYlK0lIVB1FfE4UkAgDGv4vXSnmLjRf+D2z2 z+9UueT+ABeZ2cWjQxlH4dGNVw3s02BKjLklcV61J5Be52kL10ChYyvvdt60j+FwQaUmpvE30 CnjPTtMmfjnLJyy3+uli0hJCk8Ra2ovIyXP/bczY7BXHzjAIlW4Vz9MoqWzlh8K30v+/l2v4I UjJASO1PTm19dYgRcucReyg3nGZraVAqXVLUqarjRHsLyGb9IGmbBdlk3Ux4mOP+li/ix35xJ ABDBMLQ25vUFWNbRnfh0HmmB/r/2uu7UYr81OoG87UONb9FjDdrsWHrXoXB4fL64iWdXB4dtw 4IE2vAjAo34YM7HVNAdQWkCHJQrD5pSxEUPVjNpMZCo9TIfUHsnBWL8tW+m6BspRcpupqtEeU W/ge9gy9hNOkv04MT+h6/5czZmsDUFhGW96YidfNApt/e+v/JesPSzWCZp0Hr1PvwDgrZKwL1 KWHZ84/SXXtTTjRJbn7mYBkRJ/fW7gjo4RP7bL30mjynmvEKkXSmhPX2SpWPYqCHcMyfOqCBB 32Fc4Eo6Ax3DCjbJEPxOrsFlH9ZCpAIHg4ZAcVj/IM6Bmlvpc+g4Iy8W4718FpCw2QLWe551r 9pK00fqm4bmSn2IndbG2w4WuYB2mansXookdqjEMZsLu/2q24NVS4pB11qq5cWyTxPUh/U+ Received-SPF: none client-ip=212.227.126.134; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/05 07:41:33 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Helge Deller , Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Helge Deller Return target error codes instead of host error codes. Signed-off-by: Helge Deller Reviewed-by: Laurent Vivier Message-Id: <20200424220033.GA28140@ls3530.fritz.box> Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index e89b815ce983..fd5c4f1d73e6 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2987,7 +2987,7 @@ static abi_long do_socket(int domain, int type, int protocol) #endif protocol == NETLINK_KOBJECT_UEVENT || protocol == NETLINK_AUDIT)) { - return -EPFNOSUPPORT; + return -TARGET_EPFNOSUPPORT; } if (domain == AF_PACKET || @@ -5856,7 +5856,7 @@ static abi_long do_get_thread_area(CPUX86State *env, abi_ulong ptr) abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr) { - return -ENOSYS; + return -TARGET_ENOSYS; } #else abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr) From patchwork Fri Jun 5 11:41:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 281306 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E370C433E0 for ; Fri, 5 Jun 2020 11:42:31 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 243C6206E6 for ; Fri, 5 Jun 2020 11:42:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 243C6206E6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=vivier.eu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhAk2-0003Kl-Cl for qemu-devel@archiver.kernel.org; Fri, 05 Jun 2020 07:42:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhAj6-0002A5-At for qemu-devel@nongnu.org; Fri, 05 Jun 2020 07:41:32 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:38477) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhAj5-0005el-B4 for qemu-devel@nongnu.org; Fri, 05 Jun 2020 07:41:32 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MIbzB-1jmvLe0kpZ-00EdE4; Fri, 05 Jun 2020 13:41:27 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 03/19] linux-user: Add support for /proc/cpuinfo on hppa platform Date: Fri, 5 Jun 2020 13:41:04 +0200 Message-Id: <20200605114120.1051236-4-laurent@vivier.eu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200605114120.1051236-1-laurent@vivier.eu> References: <20200605114120.1051236-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:Ktzu7gJSUVZNNv1Qs1OpSvAJ4zNi8z02hVt7F4Jc4dhN1rmHGdZ YVvTzQUYJFcIIjGC14EYvrx5G72G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gv19ctebHS5HxVxd Received-SPF: none client-ip=212.227.126.130; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/05 07:41:29 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Helge Deller , Riku Voipio , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Helge Deller Provide our own /proc/cpuinfo file for the hppa (parisc) platform. Signed-off-by: Helge Deller Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20200424210648.GA26715@ls3530.fritz.box> [lv: s/an/our/] Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index fd5c4f1d73e6..63c40c48e31f 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7438,6 +7438,18 @@ static int open_cpuinfo(void *cpu_env, int fd) } #endif +#if defined(TARGET_HPPA) +static int open_cpuinfo(void *cpu_env, int fd) +{ + dprintf(fd, "cpu family\t: PA-RISC 1.1e\n"); + dprintf(fd, "cpu\t\t: PA7300LC (PCX-L2)\n"); + dprintf(fd, "capabilities\t: os32\n"); + dprintf(fd, "model\t\t: 9000/778/B160L\n"); + dprintf(fd, "model name\t: Merlin L2 160 QEMU (9000/778/B160L)\n"); + return 0; +} +#endif + #if defined(TARGET_M68K) static int open_hardware(void *cpu_env, int fd) { @@ -7462,7 +7474,7 @@ static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags, #if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN) { "/proc/net/route", open_net_route, is_proc }, #endif -#if defined(TARGET_SPARC) +#if defined(TARGET_SPARC) || defined(TARGET_HPPA) { "/proc/cpuinfo", open_cpuinfo, is_proc }, #endif #if defined(TARGET_M68K)