From patchwork Sun Jun 19 00:15:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy Pearson X-Patchwork-Id: 9185927 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 95B226075F for ; Sun, 19 Jun 2016 00:25:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8606C1FE7B for ; Sun, 19 Jun 2016 00:25:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 792D3264F4; Sun, 19 Jun 2016 00:25:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 171B51FE7B for ; Sun, 19 Jun 2016 00:25:07 +0000 (UTC) Received: from localhost ([::1]:36938 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEQXy-0002PG-87 for patchwork-qemu-devel@patchwork.kernel.org; Sat, 18 Jun 2016 20:25:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEQOd-0001LF-8n for qemu-devel@nongnu.org; Sat, 18 Jun 2016 20:15:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bEQOY-0004Zm-TB for qemu-devel@nongnu.org; Sat, 18 Jun 2016 20:15:26 -0400 Received: from pearsoncomputing.net ([192.119.205.242]:25911 helo=mail.pearsoncomputing.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEQOY-0004Zh-NI for qemu-devel@nongnu.org; Sat, 18 Jun 2016 20:15:22 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.pearsoncomputing.net (Postfix) with ESMTP id 744AF640CB6 for ; Sat, 18 Jun 2016 19:15:22 -0500 (CDT) Received: from mail.pearsoncomputing.net ([127.0.0.1]) by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id wfMOO8D7u7mN for ; Sat, 18 Jun 2016 19:15:22 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by mail.pearsoncomputing.net (Postfix) with ESMTP id EC107641014 for ; Sat, 18 Jun 2016 19:15:21 -0500 (CDT) DKIM-Filter: OpenDKIM Filter v2.9.2 mail.pearsoncomputing.net EC107641014 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD; t=1466295322; bh=cpkqbtrXSs1ORU3IVoq2ISIl/ImZ5HjnowBiA/5BecY=; h=Date:From:To:Message-ID:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding; b=Oi9vwmVqYLHRFAFQ7dS96+9PUxA1GdpYijuAQYfvKlkeNs3pNJoYXP1aPakxae5Xe Pb9kIfwip/A4+0YxIiEAYTEPFnwfEBZOb91Z93umQaGhn4tjZP3D6jmHUL6GQJ2sp+ /LOXY+kLLZw6g200RKIUXfbAq09ZKGVuGBGRu+d4= X-Virus-Scanned: amavisd-new at pearsoncomputing.net Received: from mail.pearsoncomputing.net ([127.0.0.1]) by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id rvOszbmgXRG7 for ; Sat, 18 Jun 2016 19:15:21 -0500 (CDT) Received: from vali.starlink.edu (localhost [127.0.0.1]) by mail.pearsoncomputing.net (Postfix) with ESMTP id B430A640CB6 for ; Sat, 18 Jun 2016 19:15:21 -0500 (CDT) Date: Sat, 18 Jun 2016 19:15:21 -0500 (CDT) From: Timothy Pearson To: qemu-devel@nongnu.org Message-ID: <914642975.1359462.1466295321636.JavaMail.zimbra@raptorengineeringinc.com> MIME-Version: 1.0 X-Originating-IP: [192.168.3.54] X-Mailer: Zimbra 8.5.0_GA_3042 (ZimbraWebClient - FF3.6 (Linux)/8.5.0_GA_3042) Thread-Topic: Pass select() arguments directly to do_select() on x86 platforms Thread-Index: blqU04F1KkiPwpkjEP8P56sn0C6H8Q== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 192.119.205.242 Subject: [Qemu-devel] [PATCH 3/7] Pass select() arguments directly to do_select() on x86 platforms 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: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This matches the calling conventions in the Linux kernel and resolves select() hangs on i386/x86_64 guests. Signed-off-by: Timothy Pearson --- 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 2968b57..644a490 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4785,6 +4785,7 @@ static abi_long do_ioctl(int fd, int cmd, abi_long arg) void *argptr; ie = ioctl_entries; + for(;;) { if (ie->target_cmd == 0) { gemu_log("Unsupported ioctl: cmd=0x%04lx\n", (long)cmd); @@ -7899,7 +7900,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, break; #if defined(TARGET_NR_select) case TARGET_NR_select: -#if defined(TARGET_S390X) || defined(TARGET_ALPHA) +#if defined(TARGET_S390X) || defined(TARGET_ALPHA) || defined(TARGET_I386) || defined(TARGET_X86_64) ret = do_select(arg1, arg2, arg3, arg4, arg5); #else {