From patchwork Mon Feb 15 12:45:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1440534 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DfPLn259Pz9rx6 for ; Mon, 15 Feb 2021 23:59:13 +1100 (AEDT) Received: from localhost ([::1]:53158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBdT5-0001YR-Ak for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2021 07:59:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdG9-0004A5-E9 for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:49 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:50949) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdFw-0000iB-G9 for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:47 -0500 Received: from localhost.localdomain ([82.252.134.158]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MQeDw-1lY7vB0R3m-00NkYY; Mon, 15 Feb 2021 13:45:23 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 01/13] linux-user/mips64: Restore setup_frame() for o32 ABI Date: Mon, 15 Feb 2021 13:45:07 +0100 Message-Id: <20210215124519.720265-2-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210215124519.720265-1-laurent@vivier.eu> References: <20210215124519.720265-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:oKph+Z028sM2OW4CDO33cAwK1ohB25Th/DDnAJOSbQEC6lPBU8+ RkleIImUlrL8o+/CUN3I3Nj0zqq0My2XhVvIuvGBmgcuiOrmcmBh/G8SANbQuBRaSbeJ3ps iXYwfHhgm5jObKjcLAzRR7dVduflHkDW8JM5+k/RfPJnOSJP2Z9lQedncDdtN/H115TLN/D E9WczcHpFZYG8QOtS4gMA== X-UI-Out-Filterresults: notjunk:1;V03:K0:ugoxeImQXlI=:njLCyiAEdbiQzXxzQgYUvy crMOzAvB8P/b0rchL5QZDcKkud5A7sgNGjRWgUqQ5owQu1KylxXpJBxG5EM+RqhyeanN7gR+k 5HXLBNviK2u7Tkzz9FWYbPrDwd0++92kXgHNF6E0l0JqyInS9ie8dDkUjqC0rGcdSNfgYsA6g ZywtoEPXZKb0qEex1ghSOUNuhST1+Be84j0t6H+0ED5x2gfqQFWgHzLwE4x4irGPShCX8pWkk Y69n0YD6zxRwqhMkh+nMU0sX+tx9EzuUMXLlpduCPo9UApHiDTWJyc36PfL4YFw8MdwissUUa u9BV6sc4mqC6sFa52Szw/Z+k3KfrZ9KN4es3UIzSO4mk5wbgTf2/bhGiKiX5L+dbER0vheBWj uDudfQx2AJjPS55uyy32wTrqUmUaUuQnIPN8bbnRzgbyfCdnbQOdVyqgnQSxm Received-SPF: none client-ip=212.227.17.13; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de 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, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no 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: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé 64-bit MIPS targets lost setup_frame() during the refactor in commit 8949bef18b9. Restore it declaring TARGET_ARCH_HAS_SETUP_FRAME, to be able to build the o32 ABI target. Fixes: 8949bef18b9 ("linux-user: move mips/mips64 signal.c parts to mips directory") Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20201119161710.1985083-2-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- linux-user/mips64/target_signal.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linux-user/mips64/target_signal.h b/linux-user/mips64/target_signal.h index 799f7a668cd0..f1f0ed7f7067 100644 --- a/linux-user/mips64/target_signal.h +++ b/linux-user/mips64/target_signal.h @@ -67,4 +67,8 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 2048 #define TARGET_SIGSTKSZ 8192 +#if defined(TARGET_ABI_MIPSO32) +/* compare linux/arch/mips/kernel/signal.c:setup_frame() */ +#define TARGET_ARCH_HAS_SETUP_FRAME +#endif #endif /* MIPS64_TARGET_SIGNAL_H */ From patchwork Mon Feb 15 12:45:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1440537 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DfPQX15Y8z9rx6 for ; Tue, 16 Feb 2021 00:02:28 +1100 (AEDT) Received: from localhost ([::1]:57624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBdWE-0003QB-1w for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2021 08:02:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52826) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdG9-00049m-Bi for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:49 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:47651) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdFu-0000hz-GS for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:43 -0500 Received: from localhost.localdomain ([82.252.134.158]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mate1-1liUES2L19-00cMUN; Mon, 15 Feb 2021 13:45:23 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 02/13] linux-user/mips64: Support o32 ABI syscalls Date: Mon, 15 Feb 2021 13:45:08 +0100 Message-Id: <20210215124519.720265-3-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210215124519.720265-1-laurent@vivier.eu> References: <20210215124519.720265-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:md/47WpyKCdM6dnnVw2++Cs81+LfKx1pKur4U3C+wz3zUK3DAuC BJLfAqVTSFt6V3US61lIQ0AB/Kj/1tK+3nIi/IeIXCY+1oN6scqVr2rKg1lCdAiwqFIRv6x qn0eO5auHrZjKHl7lDOEo14if+ngRVhyDbMwevRMsgyytFi+fVUeM+gkiEj58BHhN0bxtZH wzQG8pgcvAYHam0Lejgjg== X-UI-Out-Filterresults: notjunk:1;V03:K0:eKVbUzaUxqE=:GGC3PvovuVTO5TaTqCA3xV /PnuqLVuqpAbKKyJemTGkC8G3sNUzcDCuCAQ6I9O4SoT/Xa+wlccFBt4mZpIn58nU83QefFoe ZiCMlp21cSS8vA5Pk4GEDKMm/xSG3wUMpnMillZtglRv9/a3T8ZbFuOXrrhfCTTJTQAE3ApUe i9bAzaoAOuozwxEBtCwcYEsIxARuG/0CWL69fxO2b5fi5oLssAebp3aJOMx5ySDgFIcGi06Gx 5w5vEsvggqL9c8ePqp8FhHbLfdUWhKkkYA6/4xDfRsUEO2lsvVpEVcFqw+xe3NZlWnI2c5enf f+/T1JmHYR0mA7qCyKQZYcuS/PUspQFnAd67dnYfSQ/yG0QGpIfTbiX6qAuvM8vQpWrYY6spj TAHgA7cdpZM19vCCtkmZtDZbDfOVToobiLbNM2jWRZTeYFnByq3P+Qbpa3BX37DwSFFz9uD9t phm6+56ITw== Received-SPF: none client-ip=217.72.192.74; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de 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, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no 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: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé o32 ABI syscalls start at offset 4000. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Message-Id: <20201119161710.1985083-3-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- linux-user/mips64/syscall_nr.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/linux-user/mips64/syscall_nr.h b/linux-user/mips64/syscall_nr.h index 672f2fa51cba..6579421fa639 100644 --- a/linux-user/mips64/syscall_nr.h +++ b/linux-user/mips64/syscall_nr.h @@ -1,4 +1,7 @@ -#ifdef TARGET_ABI_MIPSN32 +#if defined(TARGET_ABI_MIPSO32) +#define TARGET_SYSCALL_OFFSET 4000 +#include "syscall_o32_nr.h" +#elif defined(TARGET_ABI_MIPSN32) #define TARGET_SYSCALL_OFFSET 6000 #include "syscall_n32_nr.h" #else From patchwork Mon Feb 15 12:45:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1440526 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DfP9n6q9yz9rx8 for ; Mon, 15 Feb 2021 23:51:25 +1100 (AEDT) Received: from localhost ([::1]:58882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBdLX-0000T4-Ji for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2021 07:51:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdGA-0004BA-1m for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:51 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:59365) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdFz-0000j5-Mm for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:49 -0500 Received: from localhost.localdomain ([82.252.134.158]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Md6ZB-1lkh9j27tb-00aAdH; Mon, 15 Feb 2021 13:45:24 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 03/13] linux-user/signal: Decode waitid si_code Date: Mon, 15 Feb 2021 13:45:09 +0100 Message-Id: <20210215124519.720265-4-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210215124519.720265-1-laurent@vivier.eu> References: <20210215124519.720265-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:aNd3FKayuVLgCsMObiLexFk29QyHeWVgSFkQ/onLx4VBSVc+/9/ WWSoKUaVLeBKmxmo3bZutNybuFB1C7M4mfaKN5eDlb6aDHCMr5WKCk/Bxr66JjSDiEMxbV3 QzdPoOmefepdhG9s3mDlUzp488j8OrXMoUfSxpYvEQSidn84OIcpF+xR26OZKYpKWSph+CN R6K7waq7A9OMWcSHSw2xw== X-UI-Out-Filterresults: notjunk:1;V03:K0:feIV5dC12ZM=:/OAt6iGI6s4ykEkyOy+Yqa gw3Lw9n2uxt87YsZfxEPZWOitqIoJzzeFDv1tFuWI2VD30/RjqtFtdhSBjcbf57jCNDaws3w+ r/qpIw1vLXUoKulpWuHaadIpuREDI+W9qe9958Ka3UmpGAghrhUy80pDC83L7nbuePwBv/oBF ecDeGWX6XZmz+SKLSMjH5F4KRAYbMWOZPnweYk+INe/U49PvABAOVEokKYQalkZ3SA2XBeytR +aEz2enou/qUG/QvqFQLGHkAPQ+mDR2MFlB2k4CeyiyfDr1OPLIkoGXrI/Rv/ZQrIDSXSBPk8 6/uqj7MfZ79uApLRo4+o2BoP8j0NZsDZq8NCee7n9uV6/R/fM6A89PVP5IYgzyOnNQWHhoLe1 Pygb1UwkUx8qdvjN7Lc+S54QB7jBhxxgooOeUIvCjSysK1Vzt+X3UTG9yVxzw Received-SPF: none client-ip=217.72.192.74; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de 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, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no 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: =?utf-8?q?Andreas_K_=2E_H=C3=BCttel?= , Alistair Francis , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Alistair Francis When mapping the host waitid status to the target status we previously just used decoding information in the status value. This doesn't follow what the waitid documentation describes, which instead suggests using the si_code value for the decoding. This results in the incorrect values seen when calling waitid. This is especially apparent on RV32 where all wait calls use waitid (see the bug case). This patch just passes the waitid status directly back to the guest. Buglink: https://bugs.launchpad.net/qemu/+bug/1906193 Signed-off-by: Alistair Francis Tested-by: Andreas K. Hüttel Reviewed-by: Laurent Vivier Message-Id: <1fb2d56aa23a81f4473e638abe9e2d78c09a3d5b.1611080607.git.alistair.francis@wdc.com> Signed-off-by: Laurent Vivier --- linux-user/signal.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index 73de934c6511..7eecec46c407 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -349,8 +349,7 @@ static inline void host_to_target_siginfo_noswap(target_siginfo_t *tinfo, case TARGET_SIGCHLD: tinfo->_sifields._sigchld._pid = info->si_pid; tinfo->_sifields._sigchld._uid = info->si_uid; - tinfo->_sifields._sigchld._status - = host_to_target_waitstatus(info->si_status); + tinfo->_sifields._sigchld._status = info->si_status; tinfo->_sifields._sigchld._utime = info->si_utime; tinfo->_sifields._sigchld._stime = info->si_stime; si_type = QEMU_SI_CHLD; From patchwork Mon Feb 15 12:45:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1440527 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DfPBy1hWGz9sBy for ; Mon, 15 Feb 2021 23:52:26 +1100 (AEDT) Received: from localhost ([::1]:33596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBdMW-0001lQ-8Z for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2021 07:52:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdFu-00046l-MR for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:35 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:33581) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdFm-0000fh-LM for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:33 -0500 Received: from localhost.localdomain ([82.252.134.158]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MQMqN-1lXr4X3ndp-00MMqP; Mon, 15 Feb 2021 13:45:25 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 04/13] linux-user: Add missing TARGET___O_TMPFILE for hppa and alpha Date: Mon, 15 Feb 2021 13:45:10 +0100 Message-Id: <20210215124519.720265-5-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210215124519.720265-1-laurent@vivier.eu> References: <20210215124519.720265-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:Js7in6gK8aAOzL2AY+rsXNEGdm9OXejg39NF2XcOp7KRz7Y/Xce ZEPvZ/Xtvmx/HiLu5O3OuszdIPSvsfC9m7ubcFiX3n0DcOs8fFUwZEhcC2cIFt/3dx1nl4f pNSwV6NAgp0+qIze+Id5BC7KoxM1wET3IBv74Fq/q97OayqKrptCdX/SjVcJh1cfnRB7eVO sgU3k7y8CaHC6R08aJvtQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:agyGsgrcf3w=:n1tti4B0/Az7Pv3TxKzNny ouDIHM7lezquCMjLzBwlltPHqUp+Wm3s/7nxYgnWbCBem4v0oPxHNvTDYCrxp1jiva5Nmsqe4 tLF9OlHRZzj8z4FOPXk13ns0DGfY97zAkjabdp/w63W0KDPM33sqYSLzZ2hvj9TBE07juS2Y8 xRDjjKjnLsfMXIAXwauPYJhE7ncL7iOaqEv41ZOnzov0ltfdcnwyVLuCzO5TvvLQv7vR5KW6y QttotAxdCAxnChIWlIyFOADl+r6g9OH406RA3aKo/YuUjaiQ7uLkTjNY0iNNTswML8JFGOqdj 4d8/Wun8kFtHEvqjhaNj9aO46n8g5/vUlwCBJgomdPAzskVHT/orxrwwYLaC2vrOYJIGNEw3S KgOfRuQsmJF5lVaVL5XXoQvIgQSkaX2w9qiMPJIM1ZLyq/VVACTpUF0JI312i Received-SPF: none client-ip=217.72.192.73; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de 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, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no 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 , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Helge Deller The hppa and alpha targets miss the #define of the TARGET___O_TMPFILE and as such fail to run a trivial symlink command like ln -s /bin/bash /tmp which results in an -EINVAL return code. Adding the define fixes the problem. Signed-off-by: Helge Deller Reviewed-by: Laurent Vivier Message-Id: <20210201155922.GA18291@ls3530.fritz.box> Signed-off-by: Laurent Vivier --- linux-user/alpha/target_fcntl.h | 1 + linux-user/hppa/target_fcntl.h | 1 + 2 files changed, 2 insertions(+) diff --git a/linux-user/alpha/target_fcntl.h b/linux-user/alpha/target_fcntl.h index e16ed1d4157f..99774d731727 100644 --- a/linux-user/alpha/target_fcntl.h +++ b/linux-user/alpha/target_fcntl.h @@ -23,6 +23,7 @@ #define TARGET_O_CLOEXEC 010000000 #define TARGET___O_SYNC 020000000 #define TARGET_O_PATH 040000000 +#define TARGET___O_TMPFILE 0100000000 #define TARGET_F_GETLK 7 #define TARGET_F_SETLK 8 diff --git a/linux-user/hppa/target_fcntl.h b/linux-user/hppa/target_fcntl.h index bd966a59b8d4..9eaeef9d8e7b 100644 --- a/linux-user/hppa/target_fcntl.h +++ b/linux-user/hppa/target_fcntl.h @@ -21,6 +21,7 @@ #define TARGET_O_CLOEXEC 010000000 #define TARGET___O_SYNC 000100000 #define TARGET_O_PATH 020000000 +#define TARGET___O_TMPFILE 040000000 #define TARGET_F_RDLCK 1 #define TARGET_F_WRLCK 2 From patchwork Mon Feb 15 12:45:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1440519 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DfP5X4zg7z9rx6 for ; Mon, 15 Feb 2021 23:47:42 +1100 (AEDT) Received: from localhost ([::1]:49528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBdHv-0004ze-9N for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2021 07:47:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdFr-00041e-7E for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:31 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:57407) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdFn-0000fq-VS for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:30 -0500 Received: from localhost.localdomain ([82.252.134.158]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MPGNn-1lWk4u1ZK1-00PfAD; Mon, 15 Feb 2021 13:45:25 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 05/13] linux-user: fix O_NONBLOCK usage for hppa target Date: Mon, 15 Feb 2021 13:45:11 +0100 Message-Id: <20210215124519.720265-6-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210215124519.720265-1-laurent@vivier.eu> References: <20210215124519.720265-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:EzY8OY8vIkdi38FGaibpVXauhPAkY8FXX1qRSMW5bzIFnAm3Z8G gepABBiP9Kd0rh/qVVYFkkgS38E7GYDpAJGU+6N8HH8V8Db2JMF5HnvfXksnnCakHAyJasL /6r0vd/YLY5+Vr4y+S+4e6jRe+80YpDoocqJ60n1u1Q0I3myMFJdbGKa3pFsClclK1gydpZ HWodlhbuEeWdtBHMoh6Kw== X-UI-Out-Filterresults: notjunk:1;V03:K0:X1g62lQpgh8=:n1uLvePFhm0QV8/Fn9aCwn qlAjWjTj86hG66WTk9SDKv+v70rONI8nQT15vTzcsGoq9HOH8AeAjxqgFNAs8RVOSCIP9en3h p03VhHbu8AM7Nn+qcRRxP22R+gzNY/SBEUwGFw+aQm5BDFJHopF3mUD1TuSMAO2WX6mXjqQrm PzN+oIu6IwNGb1+LjxLOCFjEJKxwgJ+KIL9i3o/n6RxA+ZYzrzsLPSI/0ApAp7Zn+1kHy3gNR Rt4d4m99pfRWSDwaFLIDiuUYBvyxLcWi/nd0ivOVvx5qVo6TDF5efxi5+vU5Mziah3L7vYI7N G1+OTpdpP66ffXvPjsb1teP+GnacLALLC+fNeHk8PydRx1FtOw/H0CsmR+3+urAxteSsCFNln yqMHkU9fS2hbsJZOYnvQufklfCMuWB3urKE6UpMwWtsQ4jPszIvngSweiTTjD Received-SPF: none client-ip=217.72.192.75; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de 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, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no 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 , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Helge Deller Historically the parisc linux port tried to be compatible with HP-UX userspace and as such defined the O_NONBLOCK constant to 0200004 to emulate separate NDELAY & NONBLOCK values. Since parisc was the only Linux platform which had two bits set, this produced various userspace issues. Finally it was decided to drop the (never completed) HP-UX compatibilty, which is why O_NONBLOCK was changed upstream to only have one bit set in future with this commit: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=75ae04206a4d0e4f541c1d692b7febd1c0fdb814 This patch simply adjusts the value for qemu-user too. Signed-off-by: Helge Deller Reviewed-by: Laurent Vivier Message-Id: <20210201220551.GA8015@ls3530.fritz.box> Signed-off-by: Laurent Vivier --- linux-user/hppa/target_fcntl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/hppa/target_fcntl.h b/linux-user/hppa/target_fcntl.h index 9eaeef9d8e7b..08e3a4fcb0b7 100644 --- a/linux-user/hppa/target_fcntl.h +++ b/linux-user/hppa/target_fcntl.h @@ -8,7 +8,7 @@ #ifndef HPPA_TARGET_FCNTL_H #define HPPA_TARGET_FCNTL_H -#define TARGET_O_NONBLOCK 000200004 /* HPUX has separate NDELAY & NONBLOCK */ +#define TARGET_O_NONBLOCK 000200000 #define TARGET_O_APPEND 000000010 #define TARGET_O_CREAT 000000400 /* not fcntl */ #define TARGET_O_EXCL 000002000 /* not fcntl */ From patchwork Mon Feb 15 12:45:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1440524 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DfP996dcKz9rx6 for ; Mon, 15 Feb 2021 23:50:53 +1100 (AEDT) Received: from localhost ([::1]:57784 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBdL1-0008SE-UT for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2021 07:50:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdFr-00041p-Ao for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:31 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:41773) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdFo-0000ft-Ip for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:31 -0500 Received: from localhost.localdomain ([82.252.134.158]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MxUjv-1m4ytw3ERl-00xtWD; Mon, 15 Feb 2021 13:45:25 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 06/13] linux-user: fix O_NONBLOCK in signalfd4() and eventfd2() syscalls Date: Mon, 15 Feb 2021 13:45:12 +0100 Message-Id: <20210215124519.720265-7-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210215124519.720265-1-laurent@vivier.eu> References: <20210215124519.720265-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:R8W9g1c7SMwiFb4bOtiGk8DvV5+1OoW1LchfPEqW66n9LoNhatI sh91SDECtrQAcExHxheAkOTaLqYaif0jY4niywwrSwo2s3ydM4wspMfIY70HMYk/Wsq4G/T Fvv8GhJzsTCsZRXxLwWfTt2kqylT+CFPg7bfSrhOnI6dQWyL+XHsyU4kL1WiT/QXzdig4HZ 7Z16H9Eku92sjYse8RkoQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:Egw1e/QQ/YQ=:q6p1mLgiaQmxu+SwAbNFET yyLsAY1q3sCNjvgG4BAVQTKc7qzq7yiO1IpVk57W17OrxG3eZ87tK5wrLpBASCaAjIOMJUj0i PmYYPmT1DhejOQAl5nEih1xAQBWwcQudxBcV6MSbJchsJcoZsdySUW/qcqN2xYMN7d6fkdPFY XgzUmteB9KNsOa6zvVI2twFcbMjdgucKj1J3eOhLnTKZwkarGUhuFyrpN/rmOuY2ZC0FIVpl4 M8QbN8uisYlrEeiAIStkPpIW8BY9h09kYwiJDOtqi9AQ9VBaeEy/1EQdGjUdSKHmE7uuLEhHi G7GaJCPgB6RKbjBKhlqY5f3O08rNonh375+Xyh4KyRY4wn56Wcj2zwzuOwxZacN8UkApGA1b2 Aj3SPh2k8mHDViC7QSMrLPiYVLtkTuO4o9H9Eg+Ng30kimjLv2FBmWdOTVuGm Received-SPF: none client-ip=212.227.17.10; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de 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, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no 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 , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Helge Deller On the hppa target userspace binaries may call signalfd4() and eventfd2() with an old TARGET_O_NONBLOCK value of 000200004 instead of 000200000 for the "mask" syscall parameter, in which case the current emulation doesn't handle the translation to the native O_NONBLOCK value correctly. The 0x04 bit is not masked out before the new O_NONBLOCK bit is set and as such when calling the native syscall errors out with EINVAL. Fix this by introducing TARGET_O_NONBLOCK_MASK which is used to mask off all possible bits. This define defaults to TARGET_O_NONBLOCK when not defined otherwise, so for all other targets the implementation will behave as before. This patch needs to be applied on top of my previous two patches. Bug was found and patch was verified by using qemu-hppa as debian buildd server on x86_64. Signed-off-by: Helge Deller Reviewed-by: Laurent Vivier Message-Id: <20210210061214.GA221322@ls3530.fritz.box> Signed-off-by: Laurent Vivier --- linux-user/hppa/target_fcntl.h | 1 + linux-user/syscall.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/linux-user/hppa/target_fcntl.h b/linux-user/hppa/target_fcntl.h index 08e3a4fcb0b7..4eb0ec98e259 100644 --- a/linux-user/hppa/target_fcntl.h +++ b/linux-user/hppa/target_fcntl.h @@ -9,6 +9,7 @@ #define HPPA_TARGET_FCNTL_H #define TARGET_O_NONBLOCK 000200000 +#define TARGET_O_NONBLOCK_MASK 000200004 /* includes old HP-UX NDELAY flag */ #define TARGET_O_APPEND 000000010 #define TARGET_O_CREAT 000000400 /* not fcntl */ #define TARGET_O_EXCL 000002000 /* not fcntl */ diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 34760779c8ec..dcb4009e2f17 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -277,6 +277,11 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, \ #define TARGET_NR__llseek TARGET_NR_llseek #endif +/* some platforms need to mask more bits than just TARGET_O_NONBLOCK */ +#ifndef TARGET_O_NONBLOCK_MASK +#define TARGET_O_NONBLOCK_MASK TARGET_O_NONBLOCK +#endif + #define __NR_sys_gettid __NR_gettid _syscall0(int, sys_gettid) @@ -7777,7 +7782,7 @@ static abi_long do_signalfd4(int fd, abi_long mask, int flags) sigset_t host_mask; abi_long ret; - if (flags & ~(TARGET_O_NONBLOCK | TARGET_O_CLOEXEC)) { + if (flags & ~(TARGET_O_NONBLOCK_MASK | TARGET_O_CLOEXEC)) { return -TARGET_EINVAL; } if (!lock_user_struct(VERIFY_READ, target_mask, mask, 1)) { @@ -12566,7 +12571,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, #if defined(TARGET_NR_eventfd2) case TARGET_NR_eventfd2: { - int host_flags = arg2 & (~(TARGET_O_NONBLOCK | TARGET_O_CLOEXEC)); + int host_flags = arg2 & (~(TARGET_O_NONBLOCK_MASK | TARGET_O_CLOEXEC)); if (arg2 & TARGET_O_NONBLOCK) { host_flags |= O_NONBLOCK; } From patchwork Mon Feb 15 12:45:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1440529 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DfPDw1QKqz9sBJ for ; Mon, 15 Feb 2021 23:54:08 +1100 (AEDT) Received: from localhost ([::1]:37870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBdOA-0003Yy-6S for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2021 07:54:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52724) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdFs-00045v-PO for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:33 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:34125) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdFo-0000fy-Jd for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:32 -0500 Received: from localhost.localdomain ([82.252.134.158]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MmlbE-1lcgGO0i86-00jpok; Mon, 15 Feb 2021 13:45:26 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 07/13] linux-user: Fix loading of BSS segments Date: Mon, 15 Feb 2021 13:45:13 +0100 Message-Id: <20210215124519.720265-8-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210215124519.720265-1-laurent@vivier.eu> References: <20210215124519.720265-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:15vBzcTUJZyrdXzM1s6zbG8IVaz1RZwT7C1jG7mFqQR6efA3ZZp sLVR8querciUvreHWJ/ZzJ6enRAlRe61L2p45bUarZ4mgCH0KuRxBwohplGRKdOH0Zz3L+S /w76R4asi1blJEzEExR8+YUY1agkQYrWSgbGAAqDxMmUT8vkN8J4Fo9ijDlV1Bse4AbxDRd 0nmYzzbs2g+4FhtxlYvwA== X-UI-Out-Filterresults: notjunk:1;V03:K0:xpjC7WNSSF4=:NyrFZf4VCTS2P2sbKkwy6j 2nLIh/Tv41YcN0gQsJZ9MrgZA0MDL4NBumnaYj10s+KPV0H4HpSwrrmjphDCTR/EokWe/Ie7D 7t5tewrw8imFfXukmj75k4sEcaSxAat+v7NL5rS6pLTO0uAatjOC/m3lcOqLs8jvHM+ZkxcV8 bi/43mh2g0DEQdFgqKWb0rqdunTaNNiat4GrN8dpfhFFpVRzF3phOxN9mWjTKxhinSny/LUnP veUaf1BGTFpBO/oPygZT8l7Yc2HVWaZDn/2z/cY6NXWwd6izwx0fNUUud5v4QQqOx9yrjc8o1 zm/4YgPqX6i/5HyKWsqtwg5RCGjaXm3aifGyAgVJELjy5jDTi3+J2Ed8vlNPFbU9YWf767L7d GfctJSDsjY4LA4aE4OdkOEnikDVzMQKMc7d1DWSA5Ok6MoUYmYhxa2kBs43UDLXsIc8Bafky3 wokU4s1WmA== Received-SPF: none client-ip=212.227.17.10; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de 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, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no 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: Giuseppe Musacchio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Giuseppe Musacchio Some ELF binaries encode the .bss section as an extension of the data ones by setting the segment p_memsz > p_filesz. Some other binaries take a different route and encode it as a stand-alone PT_LOAD segment with p_filesz = 0 and p_memsz > 0. Both the encodings are actually correct per ELF specification but the ELF loader had some troubles in handling the former: with the old logic it was very likely to get Qemu to crash in zero_bss when trying to access unmapped memory. zero_bss isn't meant to allocate whole zero-filled segments but to "complete" a previously mapped segment with the needed zero bits. The fix is pretty simple, if the segment is completely zero-filled we simply allocate one or more pages (according to p_memsz) and avoid calling zero_bss altogether. Signed-off-by: Giuseppe Musacchio Message-Id: Signed-off-by: Laurent Vivier --- linux-user/elfload.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index a64050713f28..f5bd4076fcf5 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -2805,14 +2805,16 @@ static void load_elf_image(const char *image_name, int image_fd, vaddr = load_bias + eppnt->p_vaddr; vaddr_po = TARGET_ELF_PAGEOFFSET(vaddr); vaddr_ps = TARGET_ELF_PAGESTART(vaddr); - vaddr_len = TARGET_ELF_PAGELENGTH(eppnt->p_filesz + vaddr_po); + + vaddr_ef = vaddr + eppnt->p_filesz; + vaddr_em = vaddr + eppnt->p_memsz; /* - * Some segments may be completely empty without any backing file - * segment, in that case just let zero_bss allocate an empty buffer - * for it. + * Some segments may be completely empty, with a non-zero p_memsz + * but no backing file segment. */ if (eppnt->p_filesz != 0) { + vaddr_len = TARGET_ELF_PAGELENGTH(eppnt->p_filesz + vaddr_po); error = target_mmap(vaddr_ps, vaddr_len, elf_prot, MAP_PRIVATE | MAP_FIXED, image_fd, eppnt->p_offset - vaddr_po); @@ -2820,14 +2822,22 @@ static void load_elf_image(const char *image_name, int image_fd, if (error == -1) { goto exit_mmap; } - } - vaddr_ef = vaddr + eppnt->p_filesz; - vaddr_em = vaddr + eppnt->p_memsz; + /* + * If the load segment requests extra zeros (e.g. bss), map it. + */ + if (eppnt->p_filesz < eppnt->p_memsz) { + zero_bss(vaddr_ef, vaddr_em, elf_prot); + } + } else if (eppnt->p_memsz != 0) { + vaddr_len = TARGET_ELF_PAGELENGTH(eppnt->p_memsz + vaddr_po); + error = target_mmap(vaddr_ps, vaddr_len, elf_prot, + MAP_PRIVATE | MAP_FIXED | MAP_ANONYMOUS, + -1, 0); - /* If the load segment requests extra zeros (e.g. bss), map it. */ - if (vaddr_ef < vaddr_em) { - zero_bss(vaddr_ef, vaddr_em, elf_prot); + if (error == -1) { + goto exit_mmap; + } } /* Find the full program boundaries. */ From patchwork Mon Feb 15 12:45:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1440528 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DfPCB5JFlz9rx8 for ; Mon, 15 Feb 2021 23:52:38 +1100 (AEDT) Received: from localhost ([::1]:34668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBdMh-0002CK-F4 for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2021 07:52:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdFs-00044J-An for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:32 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:49563) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdFo-0000g3-O6 for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:32 -0500 Received: from localhost.localdomain ([82.252.134.158]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MjSDU-1lZNPg2TcI-00kvD8; Mon, 15 Feb 2021 13:45:26 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 08/13] linux-user/mmap: Avoid asserts for out of range mremap calls Date: Mon, 15 Feb 2021 13:45:14 +0100 Message-Id: <20210215124519.720265-9-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210215124519.720265-1-laurent@vivier.eu> References: <20210215124519.720265-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:wLK9PnbttRlOqs1KYkoxkHb02FdEF56FFqOC3w6OLXUEBuq11RR H5p8iCxHAbQyYc0Ls+RSjmEf3z+BgA0+apUJlUrXhqOkluE3aEXnurbTRmjeue0J7yVhLUA FHFL5xqUrdAd28r0vRfmdIz/ZgkCZ1l1EbRvnw3pe4M+88zmF912djD43Agbf+c/flc5Y7v HtRYWkSa7Q387T8jfeFDw== X-UI-Out-Filterresults: notjunk:1;V03:K0:mMlOVXykinE=:AXU4WZ1+lyE6/Cn9SpHAhP uTtbYYtB4Fo/pHabwPdnc+wfbWy/wjmbC8/TmWD2LJB1LuN9a8JJG0vTIdj7Zr/uScViBhIcz lEA99BH0AkKuxAfgmwCFqtDmuE2L5B8CPwu2t42O4ZkJ7Se1FOZM0Tt5KYxBux0cxkHJnuAGv pqy6fkrjYeKQnft35oITH3e4SDvOUNhqE//vcEKbO/AnCw3lrQX8NzwUnPIRpcWEBT4IaLuki Ylf4VYmQhhHl7UWONogwVdODilqeipGHmIeM+6NO+2idt1HJIrH+BqODnd1Ne4tx6rxdppMZJ CON3D/rBLhkpjTN5J3dtvJvISW8lqxPVatYKY2BtQQCiPz0GlPVbzZFIvqURbIni/Qs1R2nN2 vsWWzqSS+iN3NB2zR7p0w40di4doyO3QDMDDBSVeJ8Vevb1S3lfWRFjzMy8Bqf1t1aIF/cHYc C5Zvo5dXew== Received-SPF: none client-ip=212.227.17.10; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de 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, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no 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: Richard Purdie , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Richard Purdie If mremap() is called without the MREMAP_MAYMOVE flag with a start address just before the end of memory (reserved_va) where new_size would exceed it (and GUEST_ADDR_MAX), the assert(end - 1 <= GUEST_ADDR_MAX) in  page_set_flags() would trigger. Add an extra guard to the guest_range_valid() checks to prevent this and avoid asserting binaries when reserved_va is set. This meant a bug I was seeing locally now gives the same behaviour  regardless of whether reserved_va is set or not. Signed-off-by: Richard Purdie Message-Id: <70c46e7b999bafbb01d54bfafd44b420d0b782e9.camel@linuxfoundation.org> Signed-off-by: Laurent Vivier --- linux-user/mmap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 810653c50357..1c9faef47699 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -724,7 +724,9 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size, if (!guest_range_valid(old_addr, old_size) || ((flags & MREMAP_FIXED) && - !guest_range_valid(new_addr, new_size))) { + !guest_range_valid(new_addr, new_size)) || + ((flags & MREMAP_MAYMOVE) == 0 && + !guest_range_valid(old_addr, new_size))) { errno = ENOMEM; return -1; } From patchwork Mon Feb 15 12:45:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1440533 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DfPKF1BcCz9rx6 for ; Mon, 15 Feb 2021 23:57:53 +1100 (AEDT) Received: from localhost ([::1]:50668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBdRn-0000Yc-48 for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2021 07:57:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdFw-00047l-Oy for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:37 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:55601) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdFt-0000hZ-Eo for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:36 -0500 Received: from localhost.localdomain ([82.252.134.158]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N2E5Q-1ls0C1003q-013h5C; Mon, 15 Feb 2021 13:45:27 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 09/13] linux-user/syscall: Fix do_ioctl_ifconf() for 64 bit targets. Date: Mon, 15 Feb 2021 13:45:15 +0100 Message-Id: <20210215124519.720265-10-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210215124519.720265-1-laurent@vivier.eu> References: <20210215124519.720265-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:s5wCz8lgPDtujfRo8saj+r5HMMpfiynPGa7ljIKaWYUwwC4PMMw YwwxzbekKSHcIIRSrkHbCbHpRXxJg5I9DeVfP6xMQPeXN+lo/xNFUzdFx7jOA7YcQl9jKAX VzyDKAimf9G+a0xGhJJxDzZovzp+W8neyyaHaO4v81Atdy/LN+CaKV2nlkyD9iOV5ox7COm P7W+AdQinD6GxOlTVw+EQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:GpZC7dElTV4=:j6YoJe0oSFPnyAjFW8h3LT +4CrWD/DgDl1mp/sCQWmmvunquMmEK4cohArFGBMtK5Q2KUmdyS1pIkJjIi9J3uZL2z8IWEbS UnLaDk8p3nVSJcXWESNIcOQVhTuQ5A8kSGBwYsO6LzNHRlEulDLOCMKK5MbYTNofKjBCsNIM8 gXXTXkKZkhfwLuZLTq++rN64IeoROfEKeAODuhlbsCM7RQTVyATYd1cJX5aoB2H49I55qYhWL ZWe2CcyvIoCwpqZHpgyCVXPLRYB0NlUxNgL6dm76yxIZEJ3qPQfBhQbt1E+i+4ntoMtwlfAN5 NpeeWDr3k5gTOmrDn90X1BWPbb29w133rQOfw+QGdZPwuwOThUzrhyXAfnePFC0l/Q2RrWRJ1 8Z8X88vf6o3XdXGdGswJuanMQE5B9La03sLb5fkXJA0Rbb33ZPGjPliTlRtelLsOKepZSxRYe pg4GNjJRWg== Received-SPF: none client-ip=217.72.192.74; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de 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, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no 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: Stefan , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Stefan The sizeof(struct ifreq) is 40 for 64 bit and 32 for 32 bit architectures. This structure contains a union of other structures, of which struct ifmap is the biggest for 64 bit architectures. Calling ioclt(…, SIOCGIFCONF, …) fills a struct sockaddr of that union, and do_ioctl_ifconf() only considered that struct sockaddr for the size of the union, which has the same size as struct ifmap on 32 bit architectures. So do_ioctl_ifconf() assumed a wrong size of 32 for struct ifreq instead of the correct size of 40 on 64 bit architectures. The fix makes do_ioctl_ifconf() handle struct ifmap as the biggest part of the union, treating struct ifreq with the correct size. Signed-off-by: Stefan Message-Id: <60AA0765-53DD-43D1-A3D2-75F1778526F6@vodafonemail.de> Signed-off-by: Laurent Vivier --- linux-user/syscall.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index dcb4009e2f17..6fea00869e6b 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4914,6 +4914,7 @@ static abi_long do_ioctl_ifconf(const IOCTLEntry *ie, uint8_t *buf_temp, struct ifconf *host_ifconf; uint32_t outbufsz; const argtype ifreq_arg_type[] = { MK_STRUCT(STRUCT_sockaddr_ifreq) }; + const argtype ifreq_max_type[] = { MK_STRUCT(STRUCT_ifmap_ifreq) }; int target_ifreq_size; int nb_ifreq; int free_buf = 0; @@ -4937,7 +4938,7 @@ static abi_long do_ioctl_ifconf(const IOCTLEntry *ie, uint8_t *buf_temp, host_ifconf = (struct ifconf *)(unsigned long)buf_temp; target_ifc_buf = (abi_long)(unsigned long)host_ifconf->ifc_buf; - target_ifreq_size = thunk_type_size(ifreq_arg_type, 0); + target_ifreq_size = thunk_type_size(ifreq_max_type, 0); if (target_ifc_buf != 0) { target_ifc_len = host_ifconf->ifc_len; From patchwork Mon Feb 15 12:45:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1440531 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DfPGj1scfz9rx6 for ; Mon, 15 Feb 2021 23:55:41 +1100 (AEDT) Received: from localhost ([::1]:42974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBdPf-0005oo-8u for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2021 07:55:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdFu-00046m-Oj for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:35 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:45939) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdFs-0000h7-9V for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:34 -0500 Received: from localhost.localdomain ([82.252.134.158]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M7JrG-1lEw712H7s-007ilw; Mon, 15 Feb 2021 13:45:27 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 10/13] linux-user: add TARGET_SO_{DOMAIN,PROTOCOL} Date: Mon, 15 Feb 2021 13:45:16 +0100 Message-Id: <20210215124519.720265-11-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210215124519.720265-1-laurent@vivier.eu> References: <20210215124519.720265-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:GwU5AIfnjXwqiQnRUu01L9zbf2sUn+yNm7ljvRd5+3JegSBRu1q kZ9fP5PTTi0LaCnGuPdqlMVxjacTTvW3+HxKhaRomC4Cn/7h/kETQhDDBjZP7x2hfomLzZQ 7ztt6slPiAZaNx6pPfIi4G98utRGSk1vLgWHOp5Okz7jNd5hB4OICiU7PYYAeM1cfqcqw1v lANe+k8MqaSwqaiQ098Vg== X-UI-Out-Filterresults: notjunk:1;V03:K0:LgA0ZQtHN1M=:66bebjpOYbFqkW3svWk1tw Q4NFRcy0T8OHt3z2kINiWER1R/Y9ui8IOAPCm946eWhb0+XvAlDNSl2bG58E4oOVZHGHUgff3 y0cXcyn+NZakUv+KkA8dJg7przAkhbwOywiFxCCvQI2miuC8525BvvygM9vMIn7RCOxF06on4 w9J9H/NSm49Qru2EPg3lvDQrwg1h+mu2w8l9XzzyNw3Eicrp4eE/WtGQObKWuX35xCWbj3ZBn kAEXS18s3RwRkEF6Q26welt3KF3b9mmtV0LZhWsFaRSErCZlw3v3lLaj9Bu+89nfxGlX3s8Is P2HWsiPuEOFVf6/f7kp3SR1MWqqSmF7DM/uV/ux3Shq3YN/B42PNApNwBwJXpDd0zQ9myPEV8 Ma8whs8jIWBGW5bniOZ8F7cW32XjyZJdH+AxNwSOjOLZjwBOIzxNnS30vJXQOkrz+Ir12fEoZ XE5KZclU6w== Received-SPF: none client-ip=217.72.192.74; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de 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, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no 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: "Jason A. Donenfeld" , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: "Jason A. Donenfeld" These were defined for other platforms but mistakenly left out of mips and generic, so this commit adds them to the places missing. Then it makes them be translated in getsockopt. Signed-off-by: Jason A. Donenfeld Reviewed-by: Laurent Vivier Message-Id: <20210204153925.2030606-1-Jason@zx2c4.com> Signed-off-by: Laurent Vivier --- linux-user/generic/sockbits.h | 3 +++ linux-user/mips/sockbits.h | 2 ++ linux-user/syscall.c | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/linux-user/generic/sockbits.h b/linux-user/generic/sockbits.h index e44733c601a4..b3b4a8e44c6d 100644 --- a/linux-user/generic/sockbits.h +++ b/linux-user/generic/sockbits.h @@ -55,4 +55,7 @@ #define TARGET_SO_ACCEPTCONN 30 #define TARGET_SO_PEERSEC 31 + +#define TARGET_SO_PROTOCOL 38 +#define TARGET_SO_DOMAIN 39 #endif diff --git a/linux-user/mips/sockbits.h b/linux-user/mips/sockbits.h index 0f022cd598a9..562cad88e2f8 100644 --- a/linux-user/mips/sockbits.h +++ b/linux-user/mips/sockbits.h @@ -40,6 +40,8 @@ #define TARGET_SO_SNDTIMEO 0x1005 /* send timeout */ #define TARGET_SO_RCVTIMEO 0x1006 /* receive timeout */ #define TARGET_SO_ACCEPTCONN 0x1009 +#define TARGET_SO_PROTOCOL 0x1028 /* protocol type */ +#define TARGET_SO_DOMAIN 0x1029 /* domain/socket family */ /* linux-specific, might as well be the same as on i386 */ #define TARGET_SO_NO_CHECK 11 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 6fea00869e6b..36b090105522 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2837,6 +2837,12 @@ get_timeout: case TARGET_SO_ACCEPTCONN: optname = SO_ACCEPTCONN; goto int_case; + case TARGET_SO_PROTOCOL: + optname = SO_PROTOCOL; + goto int_case; + case TARGET_SO_DOMAIN: + optname = SO_DOMAIN; + goto int_case; default: goto int_case; } From patchwork Mon Feb 15 12:45:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1440520 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DfP646GB8z9rx6 for ; Mon, 15 Feb 2021 23:48:12 +1100 (AEDT) Received: from localhost ([::1]:50528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBdIQ-0005Oc-SP for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2021 07:48:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdG9-0004A2-Dc for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:49 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:39693) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdFx-0000iv-5y for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:47 -0500 Received: from localhost.localdomain ([82.252.134.158]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mdvua-1llVyI466Q-00b074; Mon, 15 Feb 2021 13:45:29 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 11/13] linux-user: target: signal: Support TARGET_SS_AUTODISARM Date: Mon, 15 Feb 2021 13:45:17 +0100 Message-Id: <20210215124519.720265-12-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210215124519.720265-1-laurent@vivier.eu> References: <20210215124519.720265-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:nbW9whSTUythC6Igf4bFpsnN8/XOjMOXVOfaKkDIQYA+BPKIXS+ 64WrigwZqaaSZLz/hQJLpAG25VpUxXFf7Y5H+lp3Div4QspDQcAikZE/AXARdf0QD+44Wb+ XulU5mQ5z0fD1vEDOpW5XCYQjCnX+AOOvadpXSnVdBbDYlJnMTi0muFniIHaxJHGeIIrBD2 BqhPh3ySnCHd6QdoXnSdw== X-UI-Out-Filterresults: notjunk:1;V03:K0:EwwJxFSnhrw=:/E94WKhgFhCsSxSH+iuGRp Fu5eFyPSeOOwSB22kHrYJCUzDqov7xrmg7Qt7jw6sQWa5y9G647Ms16hVvoIVEYwZSCV3Ycdg mUodDMXXX43ezKt9GO6xQWE5bUZaw3QXli6BO+ktSOwvogUnR0ETxijI/CYAWdQRDlnoqwpEO qF6BZLIHpxoFrET1AUf7sUPWq0TOtrK3ZouMWSnNkDUr4gA2iDOxxDcwPc1f9rJZmCXo9GVMt 0IWlz1pfRldXinC4IRm0sR4DGotM9+vG+9q+F5H5W9gAD4KmHZ+FJdI3UC3ZjjeUd/ydG7Pvo 1AUgC/SLTBeaaIrAWp/a+ykJNleWMOeECSA5zy4nlIxod25U4eEOPsi8TK1+klEeK7yRnxDGt PBzcOKmYWs+6TRU/g77ox2DNa5Ez6YTCr61lZj3+LtATseVn/0YXH4+16vOujxL1Y/AGM0DfD 8Rcm8/dWOQ== Received-SPF: none client-ip=217.72.192.73; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de 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, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no 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: Chen Gang , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Chen Gang Add definitions to pass building. Signed-off-by: Chen Gang Message-Id: <20201008043105.21058-1-chengang@emindsoft.com.cn> [lv: added the definitions in linux-user/generic/signal.h too] Signed-off-by: Laurent Vivier --- linux-user/alpha/target_signal.h | 6 ++++++ linux-user/generic/signal.h | 6 ++++++ linux-user/hppa/target_signal.h | 5 +++++ linux-user/mips/target_signal.h | 6 ++++++ linux-user/mips64/target_signal.h | 5 +++++ linux-user/sparc/target_signal.h | 6 ++++++ 6 files changed, 34 insertions(+) diff --git a/linux-user/alpha/target_signal.h b/linux-user/alpha/target_signal.h index b83797281c32..0b90d3a89701 100644 --- a/linux-user/alpha/target_signal.h +++ b/linux-user/alpha/target_signal.h @@ -92,4 +92,10 @@ typedef struct target_sigaltstack { #define TARGET_GEN_SUBRNG7 -25 #define TARGET_ARCH_HAS_SETUP_FRAME + +/* bit-flags */ +#define TARGET_SS_AUTODISARM (1U << 31) /* disable sas during sighandling */ +/* mask for all SS_xxx flags */ +#define TARGET_SS_FLAG_BITS TARGET_SS_AUTODISARM + #endif /* ALPHA_TARGET_SIGNAL_H */ diff --git a/linux-user/generic/signal.h b/linux-user/generic/signal.h index e1083f8fba07..943bc1a1e220 100644 --- a/linux-user/generic/signal.h +++ b/linux-user/generic/signal.h @@ -54,4 +54,10 @@ #define TARGET_SIG_BLOCK 0 /* for blocking signals */ #define TARGET_SIG_UNBLOCK 1 /* for unblocking signals */ #define TARGET_SIG_SETMASK 2 /* for setting the signal mask */ + +/* bit-flags */ +#define TARGET_SS_AUTODISARM (1U << 31) /* disable sas during sighandling */ +/* mask for all SS_xxx flags */ +#define TARGET_SS_FLAG_BITS TARGET_SS_AUTODISARM + #endif diff --git a/linux-user/hppa/target_signal.h b/linux-user/hppa/target_signal.h index c52a3ea5794b..7f525362e91a 100644 --- a/linux-user/hppa/target_signal.h +++ b/linux-user/hppa/target_signal.h @@ -66,4 +66,9 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 2048 #define TARGET_SIGSTKSZ 8192 +/* bit-flags */ +#define TARGET_SS_AUTODISARM (1U << 31) /* disable sas during sighandling */ +/* mask for all SS_xxx flags */ +#define TARGET_SS_FLAG_BITS TARGET_SS_AUTODISARM + #endif /* HPPA_TARGET_SIGNAL_H */ diff --git a/linux-user/mips/target_signal.h b/linux-user/mips/target_signal.h index fa4084a99dcd..d521765f6b2c 100644 --- a/linux-user/mips/target_signal.h +++ b/linux-user/mips/target_signal.h @@ -73,4 +73,10 @@ typedef struct target_sigaltstack { /* compare linux/arch/mips/kernel/signal.c:setup_frame() */ #define TARGET_ARCH_HAS_SETUP_FRAME #endif + +/* bit-flags */ +#define TARGET_SS_AUTODISARM (1U << 31) /* disable sas during sighandling */ +/* mask for all SS_xxx flags */ +#define TARGET_SS_FLAG_BITS TARGET_SS_AUTODISARM + #endif /* MIPS_TARGET_SIGNAL_H */ diff --git a/linux-user/mips64/target_signal.h b/linux-user/mips64/target_signal.h index f1f0ed7f7067..d857c55e4c6c 100644 --- a/linux-user/mips64/target_signal.h +++ b/linux-user/mips64/target_signal.h @@ -67,6 +67,11 @@ typedef struct target_sigaltstack { #define TARGET_MINSIGSTKSZ 2048 #define TARGET_SIGSTKSZ 8192 +/* bit-flags */ +#define TARGET_SS_AUTODISARM (1U << 31) /* disable sas during sighandling */ +/* mask for all SS_xxx flags */ +#define TARGET_SS_FLAG_BITS TARGET_SS_AUTODISARM + #if defined(TARGET_ABI_MIPSO32) /* compare linux/arch/mips/kernel/signal.c:setup_frame() */ #define TARGET_ARCH_HAS_SETUP_FRAME diff --git a/linux-user/sparc/target_signal.h b/linux-user/sparc/target_signal.h index 1b10d1490fc9..911a3f5af55e 100644 --- a/linux-user/sparc/target_signal.h +++ b/linux-user/sparc/target_signal.h @@ -68,4 +68,10 @@ typedef struct target_sigaltstack { #define TARGET_SIGSTKSZ 16384 #define TARGET_ARCH_HAS_SETUP_FRAME + +/* bit-flags */ +#define TARGET_SS_AUTODISARM (1U << 31) /* disable sas during sighandling */ +/* mask for all SS_xxx flags */ +#define TARGET_SS_FLAG_BITS TARGET_SS_AUTODISARM + #endif /* SPARC_TARGET_SIGNAL_H */ From patchwork Mon Feb 15 12:45:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1440532 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DfPHb057lz9sBJ for ; Mon, 15 Feb 2021 23:56:27 +1100 (AEDT) Received: from localhost ([::1]:46296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBdQO-0007EO-Vt for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2021 07:56:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdFx-00048G-Fw for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:37 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:42653) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdFr-0000gy-MM for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:37 -0500 Received: from localhost.localdomain ([82.252.134.158]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1M593i-1lCjBV1oPs-001740; Mon, 15 Feb 2021 13:45:29 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 12/13] docs/user: Remove outdated 'Quick Start' section Date: Mon, 15 Feb 2021 13:45:18 +0100 Message-Id: <20210215124519.720265-13-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210215124519.720265-1-laurent@vivier.eu> References: <20210215124519.720265-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:6JmhkBcIZLNPBn5cQjoXcxgzYkCgWEsbXlKbj5wtk1wH130ruv5 mhhYbg+vg5aSa5uzBdM+hPcA/TUiYN+lrpQPbZPNW/NEstmYhHN/4ZpZ5LaZ0XXn6WuV7xu LOEOgLjwS1ji9CrgL6KkcjyNDdirny7l+J8tbCKwQ1M1gLSg2FSMe+86HFgrNr2S/ju/U6B s/R22SKI5hOS0XK4tdzlw== X-UI-Out-Filterresults: notjunk:1;V03:K0:Mvn1i4mtv0Q=:AePhWnZLnLpth0GIZiM6u5 mYtLW9o4uX7VGT2l7slKv+cpVWqD5UEh2KRO/PY7VUQwb7+AofC9TyYWUCGv8aaHwc4Vnzkzm PCnFPwQU0+Pp60vKAbT01sB7I8uTE2IHEOW3jZmxt0pDGzA9xvBC7etKS89cwI94A1Sdcr0FD GlPKMJVNL7EKKnMhHnpqeMFFIUybRyIb0ZxF0MAfCtqQAQW3o9VFZzhdnwe9JdWMC3OwCbtHV wHq/T7X+QdN5xI22/uviPC3lvy8iLFDY+cmuLZhgiYRZLAMY5bSGvT6OEEn/nb2tVukH5s54z xY0gakNtF/8gxkVLrCiGGwAJV2zjeYJPdUEqIRhR5LtR+ETUw9vDyHcoeEX3wbW9A1yrSTDD+ ev1qj4QtBfhLokJ8rQtWaQFJ9ruUOZpFy0eFWcvGHoSl5zpwDyplAZkLfMBms4jF6B0z9RiTG od60lp5YGw== Received-SPF: none client-ip=217.72.192.74; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de 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, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no 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: Peter Maydell , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell The 'Quick Start' section of the userspace emulator documentation is very old and outdated. In particular: - it suggests running x86-on-x86 emulation, which is the least interesting possible use case - it recommends that users download tarballs of guest binaries from the QEMU web page which we no longer provide there There's nothing salvageable here; delete it all. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Acked-by: Laurent Vivier Message-Id: <20201122000131.18487-1-peter.maydell@linaro.org> Signed-off-by: Laurent Vivier --- docs/user/main.rst | 61 ---------------------------------------------- 1 file changed, 61 deletions(-) diff --git a/docs/user/main.rst b/docs/user/main.rst index 8dfe232a3af1..e08d4be63b71 100644 --- a/docs/user/main.rst +++ b/docs/user/main.rst @@ -45,67 +45,6 @@ emulator. Linux User space emulator ------------------------- -Quick Start -~~~~~~~~~~~ - -In order to launch a Linux process, QEMU needs the process executable -itself and all the target (x86) dynamic libraries used by it. - -- On x86, you can just try to launch any process by using the native - libraries:: - - qemu-i386 -L / /bin/ls - - ``-L /`` tells that the x86 dynamic linker must be searched with a - ``/`` prefix. - -- Since QEMU is also a linux process, you can launch QEMU with QEMU - (NOTE: you can only do that if you compiled QEMU from the sources):: - - qemu-i386 -L / qemu-i386 -L / /bin/ls - -- On non x86 CPUs, you need first to download at least an x86 glibc - (``qemu-runtime-i386-XXX-.tar.gz`` on the QEMU web page). Ensure that - ``LD_LIBRARY_PATH`` is not set:: - - unset LD_LIBRARY_PATH - - Then you can launch the precompiled ``ls`` x86 executable:: - - qemu-i386 tests/i386/ls - - You can look at ``scripts/qemu-binfmt-conf.sh`` so that QEMU is - automatically launched by the Linux kernel when you try to launch x86 - executables. It requires the ``binfmt_misc`` module in the Linux - kernel. - -- The x86 version of QEMU is also included. You can try weird things - such as:: - - qemu-i386 /usr/local/qemu-i386/bin/qemu-i386 \ - /usr/local/qemu-i386/bin/ls-i386 - -Wine launch -~~~~~~~~~~~ - -- Ensure that you have a working QEMU with the x86 glibc distribution - (see previous section). In order to verify it, you must be able to - do:: - - qemu-i386 /usr/local/qemu-i386/bin/ls-i386 - -- Download the binary x86 Wine install (``qemu-XXX-i386-wine.tar.gz`` - on the QEMU web page). - -- Configure Wine on your account. Look at the provided script - ``/usr/local/qemu-i386/bin/wine-conf.sh``. Your previous - ``${HOME}/.wine`` directory is saved to ``${HOME}/.wine.org``. - -- Then you can try the example ``putty.exe``:: - - qemu-i386 /usr/local/qemu-i386/wine/bin/wine \ - /usr/local/qemu-i386/wine/c/Program\ Files/putty.exe - Command line options ~~~~~~~~~~~~~~~~~~~~ From patchwork Mon Feb 15 12:45:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1440530 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4DfPFB0Prdz9rx6 for ; Mon, 15 Feb 2021 23:54:22 +1100 (AEDT) Received: from localhost ([::1]:38952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBdOO-00040W-2F for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2021 07:54:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdGC-0004Bv-68 for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:59 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:46845) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBdG7-0000jJ-2E for qemu-devel@nongnu.org; Mon, 15 Feb 2021 07:45:51 -0500 Received: from localhost.localdomain ([82.252.134.158]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MzQXu-1m6ui20AJE-00vQgC; Mon, 15 Feb 2021 13:45:30 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 13/13] linux-user/mips: Support the n32 ABI for the R5900 Date: Mon, 15 Feb 2021 13:45:19 +0100 Message-Id: <20210215124519.720265-14-laurent@vivier.eu> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210215124519.720265-1-laurent@vivier.eu> References: <20210215124519.720265-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:OWVUR9QOaknYTL1YGHgI5udPBlz8uHTPzJcluLpV5yclvebKg2f y3D4SaJdoxSbuRtpImxr8DcDSXgAp3rT2iPeefeZeNlxDfE1JqCdBCc46q5cZjBpuxD93bW de6sGBQJoqX2J7bGw+MsSIaHP4gGxMmpoA5tN7GjQE0alUkF+FGJicjafgPSUQqcQEfGQcw nn1dh3OaQc+euoRRnXUfA== X-UI-Out-Filterresults: notjunk:1;V03:K0:ckf8rSexkjk=:Svn75acuRA2iSzKk2GSClc 1kaEbZkZJT2py5h5p9GGAYXGYfX7GmXMJYxXN/CzyVUqrL9ws4vZ/r08qR9vJVvqlEVhQfmaE Bf6gfTFt5POqDP5rQ85ymlQnB6zwBw9EIX1QeJDmj8C8netKFO7Qo9nlqyyi7eX4rlNPqvG61 scvPWBSa3Z4tZh1tpJ5thdzeoXm+Ch9ZpbOGnpfyJ1A9sKrvZKYJdDBWH4OdsNDknsoSoF4Ip /9MNUmLVqWgodYGBdfi1jF1KgOAklFUhplQHpQSHyw6gB0NVxACxsyO3FrJ0Ek3trbzvfuSNN didX9N8li0tkIdHNvovlWq43zxxXWeritVn/O1F30vK/ppUY1765qxRA/xSUrbVuP3paiFOFl 6vJ+05PiHAPepIZ5vXZQb+U7VIM0VGMXVs4TIYpX3NqIS522m1OrmqIm5D5zdnuGFTDCuebv1 YAthveqjjw== Received-SPF: none client-ip=217.72.192.73; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de 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, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no 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: Fredrik Noring , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Fredrik Noring Recognise the R5900, which reports itself as MIPS III, as a 64-bit CPU supporting the n32 ABI. Signed-off-by: Fredrik Noring Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-Id: <5bea109f0c140da6a821aa7f9705d4b3717e86dc.1541701393.git.noring@nocrew.org> Signed-off-by: Laurent Vivier --- linux-user/mips64/target_elf.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-user/mips64/target_elf.h b/linux-user/mips64/target_elf.h index ec55d8542ae1..5f2f2df29f7f 100644 --- a/linux-user/mips64/target_elf.h +++ b/linux-user/mips64/target_elf.h @@ -12,6 +12,9 @@ static inline const char *cpu_get_model(uint32_t eflags) if ((eflags & EF_MIPS_ARCH) == EF_MIPS_ARCH_64R6) { return "I6400"; } + if ((eflags & EF_MIPS_MACH) == EF_MIPS_MACH_5900) { + return "R5900"; + } return "5KEf"; } #endif