From patchwork Sat Jun 6 13:15:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 281227 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.7 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 8B34FC433DF for ; Sat, 6 Jun 2020 13:17:08 +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 65F59206A2 for ; Sat, 6 Jun 2020 13:17:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 65F59206A2 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]:59480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhYh9-0007en-Ic for qemu-devel@archiver.kernel.org; Sat, 06 Jun 2020 09:17:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhYfd-00062Y-GX for qemu-devel@nongnu.org; Sat, 06 Jun 2020 09:15:33 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:57249) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhYfZ-0007Zp-W7 for qemu-devel@nongnu.org; Sat, 06 Jun 2020 09:15:33 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mk0FS-1jErg11vJo-00kMKw; Sat, 06 Jun 2020 15:15:21 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v2 02/19] linux-user: return target error codes for socket() and prctl() Date: Sat, 6 Jun 2020 15:15:00 +0200 Message-Id: <20200606131517.1250346-3-laurent@vivier.eu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200606131517.1250346-1-laurent@vivier.eu> References: <20200606131517.1250346-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:vSvE8yzZQ+/jhlqHLs9KtejW7Ampq8TfsPaedVkwpuOrylfQ2ER rGdcECFpZX6PonpreSaje50d1d2A4WTu8o92o4Lv8XRKFe4RQxhoQXxUJ7rdJlhX92IhQ3b l6I6BUtyuZGpSx8jPQvdd6IjKoRY2H+4qdF74hHTvm/4X2ckTfAQfLpQRaaQnHADkFCvkPZ vo7x4MpBUxCS3WwG9xO8g== X-UI-Out-Filterresults: notjunk:1; V03:K0:TdF/lp0OqK0=:0m599vtsLyEnGmlf618jMb bbdk49pW54bCL1VCs4H8GreIAMn3jBPesYGSRMTWcIhoS530hlQEJ+IZcoodKFDXu2DygsEGv bMGeErVTADBvxkkjyP2cOebaod75iv/eWHJpNkPlntpZFd6MyZ++WucQeEQKO2WrOwpL1CEx3 kseDFIXOJbZ2E0k4Qh4EI7dYHdSJUdYa5H9nxgSgWjnZKZvQ1FWwklvzNUOdqpvyhX5uP/Gri 3RHOt4nNfphToquST5KXSE0Sf+5QviTEPHPaAuQmQsUsrBwFWyaVqRBchAW4OfVPL6YdgoXWh +ZLb5R6EV0t90Y8WiheVx5mBqs/7Pi81PdmqQkOsHvg8PUFBv59iqo0DLkb08+enQfU1qOBWf 9mOYzt403yqdZ59QuyBEjFqZqF9VkOg0vlTXMBWgTI28b6SMN6xxXkObFh48zUt0pY6BSqJLe okBuYPg7pUceo92UPpyIDDCKv7+Mmom2l848pbxfzYrdlI2PvcjvKmyxhXOCEGNxdbW3c6SZz gligXTXOxn6XnvPtquUEdjH5FuUF4T0rOlndDZEoPMjqe1rmkhrJZHLjVYkr8qweHwwalXjrK tPjeaONamBwIM+km3HnhfY4hTg1gs84SDXvJFsEAux+Iz7jWxgpYTp4duL6GZfWaTxd1dRvWr 6iwSfX0sdmNFbYcI1DNTQPHttitDXw7qb7H/TupCW2+v2qVJjjmWpsdJ5whhWFSw2DQGaRM7g fSaA+af2bicQ0jDHm7YXjVdkoTbMIl02uTvocQHx5UFIUzNJ9/tFjKwNxxDmUR01rQAzZYE9o mRt78/clmgol9kMg2KN4P1YiuS6Ah8h+aXso2pN+9R/1uId9AFmMcFiOHOoLsh22fb4ZaCQ Received-SPF: none client-ip=212.227.17.13; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/06 09:15:28 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, RCVD_IN_MSPIKE_H2=-0.001, 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 Sat Jun 6 13:15:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 281228 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.7 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 8CEEFC433DF for ; Sat, 6 Jun 2020 13:17:06 +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 5B1D5206A2 for ; Sat, 6 Jun 2020 13:17:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B1D5206A2 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]:59250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhYh7-0007Yg-Dw for qemu-devel@archiver.kernel.org; Sat, 06 Jun 2020 09:17:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38954) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhYfb-00061d-It for qemu-devel@nongnu.org; Sat, 06 Jun 2020 09:15:31 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:34983) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhYfZ-0007ZX-UU for qemu-devel@nongnu.org; Sat, 06 Jun 2020 09:15:31 -0400 Received: from localhost.localdomain ([82.252.135.106]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Macay-1j5Tl204lO-00c8rI; Sat, 06 Jun 2020 15:15:22 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL v2 03/19] linux-user: Add support for /proc/cpuinfo on hppa platform Date: Sat, 6 Jun 2020 15:15:01 +0200 Message-Id: <20200606131517.1250346-4-laurent@vivier.eu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200606131517.1250346-1-laurent@vivier.eu> References: <20200606131517.1250346-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:o+dKIZbsRKlufLowFdEydXySFCUi5viJJfmZ+W6DMnk+ETn8pdh c7mZ+ASSBOAQlG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rUNt+eu1RJEdgSyG+JZ Received-SPF: none client-ip=217.72.192.73; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/06 09:15:24 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, RCVD_IN_MSPIKE_H2=-0.001, 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/ and add TARGET_HPPA to guard is_proc()] Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index fd5c4f1d73e6..9ac3af20c176 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7378,7 +7378,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_M68K) + defined(TARGET_SPARC) || defined(TARGET_M68K) || defined(TARGET_HPPA) static int is_proc(const char *filename, const char *entry) { return strcmp(filename, entry) == 0; @@ -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)