From patchwork Wed Dec 12 10:26:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 30642 Received: (qmail 106257 invoked by alias); 12 Dec 2018 10:26:21 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 106245 invoked by uid 89); 12 Dec 2018 10:26:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qt1-f193.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=to:cc:references:from:openpgp:autocrypt:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=oSlrpJxa9MdkDYlrnGCoWxRRWsVZhOcuNgMCh4YIIKM=; b=Z39EFG6IayIxWtFZrE0X2NOStNZINzlHSyZ4xEhKnRtow/ii68B4CzBrJbrn1fKjqm I8GzHf0MqKHhebwFXSgVdy0ca+ePAqR8kME8GFrAzqZAjGxkdB4nUh2nRsn5H0i1u4Ip 6GslHEjch2/oj/O7TRCqdcuZnv7YrkARquck8= Return-Path: To: Andreas Schwab Cc: libc-alpha@sourceware.org References: <20181211195554.3377-1-adhemerval.zanella@linaro.org> <87y38vlppm.fsf@igel.home> From: Adhemerval Zanella Openpgp: preference=signencrypt Subject: Re: [PATCH 1/5] m68k: Fix sigaction kernel definition (BZ #23960) Message-ID: <55c8ffc0-c2af-4bc8-8377-3c3310213a83@linaro.org> Date: Wed, 12 Dec 2018 08:26:12 -0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <87y38vlppm.fsf@igel.home> On 11/12/2018 19:26, Andreas Schwab wrote: > On Dez 11 2018, Adhemerval Zanella wrote: > >> diff --git a/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h b/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h >> index 54972feb13..eef4bb9b65 100644 >> --- a/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h >> +++ b/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h >> @@ -1,22 +1,8 @@ >> -#ifndef _KERNEL_SIGACTION_H >> -# define _KERNEL_SIGACTION_H >> - >> -#include >> - >> +/* m68k uses the generic Linux UAPI but defines SA_RESTORER. */ >> #define SA_RESTORER 0x04000000 >> - >> -/* This is the sigaction structure from the Linux 3.2 kernel. */ >> -struct kernel_sigaction >> -{ >> - __sighandler_t k_sa_handler; >> - sigset_t sa_mask; >> - unsigned long sa_flags; >> - void (*sa_restorer) (void); >> -}; >> +#include >> >> #define SET_SA_RESTORER(kact, act) \ >> (kact)->sa_restorer = (act)->sa_restorer >> #define RESET_SA_RESTORER(act, kact) \ >> (act)->sa_restorer = (kact)->sa_restorer >> - >> -#endif > > There should be no need to read or set sa_restorer. The kernel does not > use it, and it also doesn't define SA_RESTORER. The m68k kernel does define SA_RESTORER on arch/m68k/include/asm/signal.h (__ARCH_HAS_SA_RESTORER), but the only difference it makes for m68k is at flush_signal_handlers where kernel sets the sa_restorer to NULL. So it indeed should be safe to just use default kernel_sigaction.h (I don't see any signal test issues). Updated patch below. --- James Clarke Adhemerval Zanella [BZ #23960] * sysdeps/unix/sysv/linux/kernel_sigaction.h (kernel_sigaction): Add comment about the difference due glibc definition. * sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h: Remove file. --- diff --git a/sysdeps/unix/sysv/linux/kernel_sigaction.h b/sysdeps/unix/sysv/linux/kernel_sigaction.h index 2dbec08099..b7359054b2 100644 --- a/sysdeps/unix/sysv/linux/kernel_sigaction.h +++ b/sysdeps/unix/sysv/linux/kernel_sigaction.h @@ -9,6 +9,8 @@ struct kernel_sigaction #ifdef SA_RESTORER void (*sa_restorer) (void); #endif + /* glibc sigset is larger than kernel expected one, however sigaction + passes the kernel expected size on rt_sigaction syscall. */ sigset_t sa_mask; }; diff --git a/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h b/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h deleted file mode 100644 index 54972feb13..0000000000 --- a/sysdeps/unix/sysv/linux/m68k/kernel_sigaction.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef _KERNEL_SIGACTION_H -# define _KERNEL_SIGACTION_H - -#include - -#define SA_RESTORER 0x04000000 - -/* This is the sigaction structure from the Linux 3.2 kernel. */ -struct kernel_sigaction -{ - __sighandler_t k_sa_handler; - sigset_t sa_mask; - unsigned long sa_flags; - void (*sa_restorer) (void); -}; - -#define SET_SA_RESTORER(kact, act) \ - (kact)->sa_restorer = (act)->sa_restorer -#define RESET_SA_RESTORER(act, kact) \ - (act)->sa_restorer = (kact)->sa_restorer - -#endif