From patchwork Fri Jun 24 09:53:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 640122 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rbYtL0rPSz9t0r for ; Fri, 24 Jun 2016 20:07:54 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b=AR6EmnZ6; dkim-atps=neutral Received: from localhost ([::1]:42313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGO1f-0000jf-QN for incoming@patchwork.ozlabs.org; Fri, 24 Jun 2016 06:07:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGNo3-0000vD-5G for qemu-devel@nongnu.org; Fri, 24 Jun 2016 05:53:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGNnz-0003Qo-8A for qemu-devel@nongnu.org; Fri, 24 Jun 2016 05:53:47 -0400 Received: from mail-lf0-x22b.google.com ([2a00:1450:4010:c07::22b]:35426) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGNny-0003Qd-WA for qemu-devel@nongnu.org; Fri, 24 Jun 2016 05:53:43 -0400 Received: by mail-lf0-x22b.google.com with SMTP id l188so111653927lfe.2 for ; Fri, 24 Jun 2016 02:53:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TAPEB/ZZ6BeGabbfzFeVgldicXlTvFn7ZPSGvtzP/RQ=; b=AR6EmnZ6W4b1sgzRNnJIM48fo8dzUb6A8CCd8GPzp/UFl/eLFGZdniLQE7V/e5i5hR FGzPfrr6vf7lBIRfPCNi12IGiYEFbI89Cgip7BYD17Vpk2Ap6mwPrxo1zUnAuRd92NUQ HnjlwXFRwdrDA2rCHvHMSL7GiEdpJC4IB7ZOQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TAPEB/ZZ6BeGabbfzFeVgldicXlTvFn7ZPSGvtzP/RQ=; b=dsA13NeOUoomzGopXabjV8L+YUrDiIaE8/acfKwixz69asDxgsU+t+OWtVxVAEgXvL fK33yKRDsNDHcKKLyEN87FkM7wn9tLNd6OWGKq0/jAXhZQaI8ouxKPnTwoV30UPR6Ewh /hHkNt+Pc2YJzWyR0Kdgv6ddh14c+fqmk9lv8jzdVV+WpFt6KHVkJP15qbnFNieRdsnm +uysxKg6DGLIZFfVHK4UV7Giyd7HMjzaMINXPYlwfh0p2pE16bkcO7LN2vmVPdPP+kw6 jWP9WZ0ggh6hOnmJ+G9ckcbiSzoqYP7Mgl50lajz8AHq5gCqNgGzWqIq3QV574S3JQqH YlZg== X-Gm-Message-State: ALyK8tKf5Ha1L/41D99TWDqHrIJw0EQUZcGP8tc+Ww4sY71LZ4Qzqu+/hZaIMWjWYnwB1Jr2 X-Received: by 10.25.87.130 with SMTP id l124mr1058476lfb.170.1466762022192; Fri, 24 Jun 2016 02:53:42 -0700 (PDT) Received: from beaming.home (85-76-80-69-nat.elisa-mobile.fi. [85.76.80.69]) by smtp.gmail.com with ESMTPSA id o137sm798203lfe.2.2016.06.24.02.53.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Jun 2016 02:53:41 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Fri, 24 Jun 2016 12:53:09 +0300 Message-Id: <6b35201c365e1eebddf99c97b20176ac9ef7f080.1466760944.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::22b Subject: [Qemu-devel] [PULL 14/24] linux-user: fix clone() strace X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Laurent Vivier Signed-off-by: Laurent Vivier Signed-off-by: Riku Voipio Reviewed-by: Peter Maydell --- linux-user/strace.c | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 95f4338..cc10dc4 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -957,33 +957,31 @@ print_chmod(const struct syscallname *name, #endif #ifdef TARGET_NR_clone +static void do_print_clone(unsigned int flags, abi_ulong newsp, + abi_ulong parent_tidptr, target_ulong newtls, + abi_ulong child_tidptr) +{ + print_flags(clone_flags, flags, 0); + print_raw_param("child_stack=0x" TARGET_ABI_FMT_lx, newsp, 0); + print_raw_param("parent_tidptr=0x" TARGET_ABI_FMT_lx, parent_tidptr, 0); + print_raw_param("tls=0x" TARGET_ABI_FMT_lx, newtls, 0); + print_raw_param("child_tidptr=0x" TARGET_ABI_FMT_lx, child_tidptr, 1); +} + static void print_clone(const struct syscallname *name, - abi_long arg0, abi_long arg1, abi_long arg2, - abi_long arg3, abi_long arg4, abi_long arg5) + abi_long arg1, abi_long arg2, abi_long arg3, + abi_long arg4, abi_long arg5, abi_long arg6) { print_syscall_prologue(name); -#if defined(TARGET_M68K) - print_flags(clone_flags, arg0, 0); - print_raw_param("newsp=0x" TARGET_ABI_FMT_lx, arg1, 1); -#elif defined(TARGET_SH4) || defined(TARGET_ALPHA) - print_flags(clone_flags, arg0, 0); - print_raw_param("child_stack=0x" TARGET_ABI_FMT_lx, arg1, 0); - print_raw_param("parent_tidptr=0x" TARGET_ABI_FMT_lx, arg2, 0); - print_raw_param("child_tidptr=0x" TARGET_ABI_FMT_lx, arg3, 0); - print_raw_param("tls=0x" TARGET_ABI_FMT_lx, arg4, 1); -#elif defined(TARGET_CRIS) - print_raw_param("child_stack=0x" TARGET_ABI_FMT_lx, arg0, 0); - print_flags(clone_flags, arg1, 0); - print_raw_param("parent_tidptr=0x" TARGET_ABI_FMT_lx, arg2, 0); - print_raw_param("tls=0x" TARGET_ABI_FMT_lx, arg3, 0); - print_raw_param("child_tidptr=0x" TARGET_ABI_FMT_lx, arg4, 1); +#if defined(TARGET_MICROBLAZE) + do_print_clone(arg1, arg2, arg4, arg6, arg5); +#elif defined(TARGET_CLONE_BACKWARDS) + do_print_clone(arg1, arg2, arg3, arg4, arg5); +#elif defined(TARGET_CLONE_BACKWARDS2) + do_print_clone(arg2, arg1, arg3, arg5, arg4); #else - print_flags(clone_flags, arg0, 0); - print_raw_param("child_stack=0x" TARGET_ABI_FMT_lx, arg1, 0); - print_raw_param("parent_tidptr=0x" TARGET_ABI_FMT_lx, arg2, 0); - print_raw_param("tls=0x" TARGET_ABI_FMT_lx, arg3, 0); - print_raw_param("child_tidptr=0x" TARGET_ABI_FMT_lx, arg4, 1); + do_print_clone(arg1, arg2, arg3, arg5, arg4); #endif print_syscall_epilogue(name); }