From patchwork Tue May 18 05:31:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 441158 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1804817jac; Mon, 17 May 2021 23:23:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJ1wvXXP4Is2bTf7grRl8b2b1m11nbAbOGH/mLpM1rHzmiyVOWc1lrjCKMCdevgYQYUVy+ X-Received: by 2002:a25:4246:: with SMTP id p67mr2293308yba.519.1621319018356; Mon, 17 May 2021 23:23:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621319018; cv=none; d=google.com; s=arc-20160816; b=JzfMBEsK6vR5RtoJmYbK+oxuNDVVoY2izMYdlWVca9//eMwFkA7yALYZrnY7uSvFh1 Us4lBcBrcO5mnoLXMGf+fhS8jiszPlDIaS7w7lSEjYR3RcahSJYHK0PkJxbVrOFPBkbt Oj0Z31tug5io7jeZ53YwEmXBfR8H9MmlVIFcewPQRnrR7Igx4tvLhhQkvMQon/aX6ohS MSQ9Mr3hH20hcHjpBLQ9CcNrT77TwLlE0IDrCW6YfyjO/9YbC8KeYJLRYrOOOinFRLK3 NDuWd0HsKiBB4h++FC+8rWupjr8/fXidNcEkOHiIDKT47JEqURevzA8hiLr+r4t3s33I U2mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=6GGDUGC4+EPVab1541Yf4IgduBHvJOxhmCKUjVUX+Uo=; b=A/lJl/uRnqDZ2c/HXnjW1kMCJtrJiWAQhb9laTV7YPgdc5kxn0ONmHQZC5ue62LPjo sWX2P0gOOMXEgvuBkPO0XJ82kMNpLqPYPEo1wfbwfnZICKHtkXIeoaNJw6Lrhr2B1etS 8Inba59uYVO+IIkPfSdVl+YLF9nJjuLOOkRKyBGwqK5hs+Fy32sck9tnGUnbOVDJsh3Y KTu+oVdDXpqa1vQSRH/RfVDh4ZdxxFN858+OirMpmih+N4xIqLCjsrBlAHMVP8xIeA6/ MaPA5F8sTGDEvwAeb6xAyY5OtWSUVW0zaYKOP5ta009Cc1ABtBKXOxih6tcyiykUg5ub hzdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g72si21664462ybf.140.2021.05.17.23.23.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 May 2021 23:23:38 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:52418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lit8j-0000HJ-MY for patch@linaro.org; Tue, 18 May 2021 02:23:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lisKw-000841-0G for qemu-devel@nongnu.org; Tue, 18 May 2021 01:32:10 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:46019) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lisKp-0007CS-Dy for qemu-devel@nongnu.org; Tue, 18 May 2021 01:32:09 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MfL5v-1lFaBu1ZL1-00gmLF; Tue, 18 May 2021 07:32:01 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 55/59] linux-user/alpha: Define TARGET_ARCH_HAS_KA_RESTORER Date: Tue, 18 May 2021 07:31:27 +0200 Message-Id: <20210518053131.87212-56-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210518053131.87212-1-laurent@vivier.eu> References: <20210518053131.87212-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:Fqsxo95B62MFNOBM4N3vYpdEHIqIfN5zeCw5/MK1IWn1XSNgGhI RiXI/bCSCXY0x+3J/U/xkGuZT7xf+D3hh5ts/KHM9g9+TEwFg8gGVVx/06YevU6S3g6jeBL RDqG1okDWj5JE1QB4uKeb1aoA/+brIu019qo9OZCX0l3j4xiYi38ObvBMpl1bECpUgVnKfX 1KwEchLgqDKkMgzi+ZrWg== X-UI-Out-Filterresults: notjunk:1; V03:K0:BHKz87otMNo=:hirpCJuzHZ75PiXdXoZGbh 6ssCb1/EbkCY78mftXGYo1iaacmBDvFxRr+536QtbXAj9qohnfzpK3Cdwq1pr6jSuvX1A5fIu 7pCb8g2/V0E5mzm3NQCrGzKtVg4/RXulXw4wEbo7IeKXRJRuh3PEk4hNMU1/S5a+MAp2AbY1G L8fq1mn9H+KXif3QtViyeK+b8HsTC1/Bju1GU0kXNdYzDkEJtbKcaS+K9XABrJ2ROGulmNVE5 DvM+AqEVdOHQ+tc+r9UxgpX7KrBeyj4glbzugzTFB5kNfpvk8ppMwKnKLVAJeZM8ST1FaG+/M GRpObhphB6xyhv8zSJW4GPWOxhT+beNmW7DefEyGhTTFNIgK7jYYpKqsnks+zsuyKouGjQ9Cr Zo0k15LXtUX3rTSIwHSoT+ZzgT+UT9LF6x041xT7YOO1lqz2Cd6CRMawWKZHA3smsgTmtDS/5 o7pbsB6Ks3rmeUMYqlSSw1J/oHhVwPTwSzmsbYJl17G7qICVnnWSCaW5tI7cSS2CCivMM85fc 7MbOc3OlZheI5TgpbfUJ5Y= Received-SPF: none client-ip=212.227.126.135; 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, 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?Alex_Benn=C3=A9e?= , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson This means that we can share the TARGET_NR_rt_sigaction code, and the target_rt_sigaction structure is unused. Untangling the ifdefs so that target_sigaction can be shared will wait until the next patch. Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée Message-Id: <20210422230227.314751-6-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/alpha/target_signal.h | 1 + linux-user/syscall.c | 37 ++++++-------------------------- linux-user/syscall_defs.h | 6 ------ 3 files changed, 7 insertions(+), 37 deletions(-) -- 2.31.1 diff --git a/linux-user/alpha/target_signal.h b/linux-user/alpha/target_signal.h index 0b90d3a89701..250642913e2a 100644 --- a/linux-user/alpha/target_signal.h +++ b/linux-user/alpha/target_signal.h @@ -92,6 +92,7 @@ typedef struct target_sigaltstack { #define TARGET_GEN_SUBRNG7 -25 #define TARGET_ARCH_HAS_SETUP_FRAME +#define TARGET_ARCH_HAS_KA_RESTORER /* bit-flags */ #define TARGET_SS_AUTODISARM (1U << 31) /* disable sas during sighandling */ diff --git a/linux-user/syscall.c b/linux-user/syscall.c index a2e18b06c6d0..048056ba2bf2 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -9064,41 +9064,17 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, #endif case TARGET_NR_rt_sigaction: { -#if defined(TARGET_ALPHA) - /* For Alpha and SPARC this is a 5 argument syscall, with + /* + * For Alpha and SPARC this is a 5 argument syscall, with * a 'restorer' parameter which must be copied into the * sa_restorer field of the sigaction struct. * For Alpha that 'restorer' is arg5; for SPARC it is arg4, * and arg5 is the sigsetsize. - * Alpha also has a separate rt_sigaction struct that it uses - * here; SPARC uses the usual sigaction struct. */ - struct target_rt_sigaction *rt_act; - struct target_sigaction act, oact, *pact = 0; - - if (arg4 != sizeof(target_sigset_t)) { - return -TARGET_EINVAL; - } - if (arg2) { - if (!lock_user_struct(VERIFY_READ, rt_act, arg2, 1)) - return -TARGET_EFAULT; - act._sa_handler = rt_act->_sa_handler; - act.sa_mask = rt_act->sa_mask; - act.sa_flags = rt_act->sa_flags; - unlock_user_struct(rt_act, arg2, 0); - pact = &act; - } - ret = get_errno(do_sigaction(arg1, pact, &oact, arg5)); - if (!is_error(ret) && arg3) { - if (!lock_user_struct(VERIFY_WRITE, rt_act, arg3, 0)) - return -TARGET_EFAULT; - rt_act->_sa_handler = oact._sa_handler; - rt_act->sa_mask = oact.sa_mask; - rt_act->sa_flags = oact.sa_flags; - unlock_user_struct(rt_act, arg3, 1); - } -#else -#ifdef TARGET_SPARC +#if defined(TARGET_ALPHA) + target_ulong sigsetsize = arg4; + target_ulong restorer = arg5; +#elif defined(TARGET_SPARC) target_ulong restorer = arg4; target_ulong sigsetsize = arg5; #else @@ -9131,7 +9107,6 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, unlock_user_struct(act, arg2, 0); if (oact) unlock_user_struct(oact, arg3, 1); -#endif } return ret; #ifdef TARGET_NR_sgetmask /* not on alpha */ diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index e4aaf8412f56..7a1d3b239c02 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -507,12 +507,6 @@ struct target_old_sigaction { int32_t sa_flags; }; -struct target_rt_sigaction { - abi_ulong _sa_handler; - abi_ulong sa_flags; - target_sigset_t sa_mask; -}; - /* This is the struct used inside the kernel. The ka_restorer field comes from the 5th argument to sys_rt_sigaction. */ struct target_sigaction {