From patchwork Mon Apr 2 10:24:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 894151 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu 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 40F7k64JCnz9s28 for ; Mon, 2 Apr 2018 20:29:02 +1000 (AEST) Received: from localhost ([::1]:50531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2whw-00015M-5n for incoming@patchwork.ozlabs.org; Mon, 02 Apr 2018 06:29:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59641) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2weK-00071f-T0 for qemu-devel@nongnu.org; Mon, 02 Apr 2018 06:25:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f2weH-0001jM-MA for qemu-devel@nongnu.org; Mon, 02 Apr 2018 06:25:16 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:58277) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f2weH-0001iW-CD for qemu-devel@nongnu.org; Mon, 02 Apr 2018 06:25:13 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.167]) with ESMTPSA (Nemesis) id 0Me7fW-1esaUT2hFW-00PrMc; Mon, 02 Apr 2018 12:25:03 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 2 Apr 2018 12:24:52 +0200 Message-Id: <20180402102453.9883-2-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180402102453.9883-1-laurent@vivier.eu> References: <20180402102453.9883-1-laurent@vivier.eu> X-Provags-ID: V03:K0:5RCS495dhrc3aKNrvxNz8pIssA/fAxizD/kylt/NaqQzOjmA5mc VwOqsm0rM0fMsooZPCFKh34JQVliAAz+w1taIHYX4waRQkWMJq7v5eaNRwnxaCQYi+DUoej aRou/fr1SCRMGOS4Zrkge3+7w9PPvwZn5KNPvNHrerqISMW9Chp8ntbWT8vhopX8TVzfI3j n24eHMByD+E8h5WO2JbIA== X-UI-Out-Filterresults: notjunk:1; V01:K0:Gg6BSbJy998=:N2EDwS2YTg0k834Odi60Iz 4+HVkjLLRbnitmD+qm1hPNhzcAo8V6m5dyv4Aa8UydFi9KVqtczW759Lp/Mj91w5/Gv7CaBnx suq77KZMesfzAQFv1c4CIO/K/gzWqj9cAjn46Jm6PbsRyW/LaL1jHv2pDJrj+jnPfC1BEVCyJ 8vGjbCq2YrHSMGb89S5oL/Ft6pv1C90EmRSoX0A7a6YXt6Pq/f2ErrMQLZaIK2QSkljzxlYks /PPzW5vMlu1ropR5pQmYmbo0bCSa/MvKvOT9VcJ4JySvIyquXc1X5R8nCcWdARSLizxSKRKcL sRkRcT7Fpmbbrp0mAFIzlhd1Xnk0OEjAdRHsUs7YwvVEpV2xAdUrjpf8Q4yMjOufJErizrpCp zbjqe88ygWa3Y38gF8pXhNgFX3YB8f5P7UkJC6838xRrlEWY0fMSCeV8JtuHliwt7VY6l4Lbh EWgpjLckFtpNxfOKDnab730oBgeFYquxIQskdve4gbvnia2qJWjtbDHpibnz6FD/pFcRU3Lvx dxTHydGqFNmwbEGKFymAHxRw9ONB9fUeMqTr+bWLIRX+IVAVORBEnhMUHw7ci1nZmCWTpDqMO xaOSjkcb2Z1qdP62KxdJm4CKcVQhz3/iruTiws3ObjRsBRul1OioSNkrQ86Oxl70fYpGcioEZ 7TZ9TjvEmTARUF5NJDjJIfxGdXy8IL9zUBxnZumxSKwiIx3yLdCADQCafCV4G5Rwc6sQ+wM2b XSS56gIO4y2X7/y6T1XL1WnTSObHYGrtYDcQ+w== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.134 Subject: [Qemu-devel] [PATCH 1/2] linux-user: define TARGET_ARCH_HAS_KA_RESTORER 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: Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Sparc as an extended sigaction structure containing the field ka_restorer used in place of sa_restorer. Define TARGET_ARCH_HAS_KA_RESTORER and use it with sparc. Signed-off-by: Laurent Vivier --- linux-user/signal.c | 4 ++-- linux-user/syscall.c | 7 +++++-- linux-user/syscall_defs.h | 4 ++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index 2ea3e0321f..2b9752b40b 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -2920,8 +2920,8 @@ static void setup_frame(int sig, struct target_sigaction *ka, env->pc = ka->_sa_handler; env->npc = (env->pc + 4); /* 5. return to kernel instructions */ - if (ka->sa_restorer) { - env->regwptr[UREG_I7] = ka->sa_restorer; + if (ka->ka_restorer) { + env->regwptr[UREG_I7] = ka->ka_restorer; } else { uint32_t val32; diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 889abbda1e..b8353d8f13 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8699,6 +8699,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, target_siginitset(&act.sa_mask, old_act->sa_mask); act.sa_flags = old_act->sa_flags; act.sa_restorer = old_act->sa_restorer; +#ifdef TARGET_ARCH_HAS_KA_RESTORER + act.ka_restorer = 0; +#endif unlock_user_struct(old_act, arg2, 0); pact = &act; } else { @@ -8773,8 +8776,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, if (!lock_user_struct(VERIFY_READ, act, arg2, 1)) { goto efault; } -#ifdef TARGET_SPARC - act->sa_restorer = restorer; +#ifdef TARGET_ARCH_HAS_KA_RESTORER + act->ka_restorer = restorer; #endif } else { act = NULL; diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 13fe840239..7473be518b 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -435,6 +435,7 @@ int do_sigaction(int sig, const struct target_sigaction *act, #define TARGET_SA_NODEFER 0x20u #define TARGET_SA_RESETHAND 4u #define TARGET_ARCH_HAS_SA_RESTORER 1 +#define TARGET_ARCH_HAS_KA_RESTORER 1 #elif defined(TARGET_MIPS) #define TARGET_SA_NOCLDSTOP 0x00000001 #define TARGET_SA_NOCLDWAIT 0x00010000 @@ -742,6 +743,9 @@ struct target_sigaction { abi_ulong sa_restorer; #endif target_sigset_t sa_mask; +#ifdef TARGET_ARCH_HAS_KA_RESTORER + abi_ulong ka_restorer; +#endif }; #endif