From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D438EC5519F for ; Thu, 12 Nov 2020 15:46:14 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6116820A8B for ; Thu, 12 Nov 2020 15:46:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="upVvkskM"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="HSejpmYa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6116820A8B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iPUTXee9j9ODAMTvdpjypn7dbLRXPCBiQomoZWeMduA=; b=upVvkskMX+8yUGVLrV6HS8mKk va23Z6yQQgQC4zaiW6iIyEVirSzmzdwbzrmG08fxU1+SWspoRR67LXQ31WjyAq/WdF7ToND+Be+s1 trLzGP/e7uWGqOp464D1w/iwzRFAFfD3RR4PXPBLWjAnDYkXU+EgAWXrenQm//QC1FhUzdar6pxMV 8aJmJ1qir0AD8Y7hYyM0h49zxBCwO/6Z1aDxCNUXuorgC1if/QDnLhayd0SBv7BoF81Nz5OLjVC1z q/Mj0EFYuj0kWGswGZP+OjRfBttUWa61ODMXdeu4x+QxAIL21koDRqqoWGs6qI5Bg7lW9gLQwwaJ7 ors8N1f6w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdEmT-0006cz-Nc; Thu, 12 Nov 2020 15:45:01 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdEmR-0006c5-1X for linux-arm-kernel@lists.infradead.org; Thu, 12 Nov 2020 15:45:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=wPkXkNtx9zXavk3AiuYRjySY9813lIbPdIcdBgYmtKs=; b=HSejpmYa8DpRV1xUOwdphk+41 0yIvpVhCNLgPOvo3GZJ/6nzcVXyuiu2Epd39XvnS8AESnwTrx5ullbLGX7dSkqSCvrMB4ta6dN4Ec RRz543Q8Qylb+ddWRfrlVzowLebTSZOr46RMDbbWKpKtKRsBy1rapDIu9AhPJ2f0vFrw+ILhdIJZ+ trqrUQorPtoPA8fFvY8QQnVgwFnCgdPPcboLi2HgGNgmsXsV4WzFV64SeJTQ24UNbmOjxpgXqtZ81 ziAWat7RYpDr/FhsFazGuM0V3W50FxNXXbo5fr3nViMA6YWCgIbWmjbsoMym+8onnLP2eA/XQjR6W 3AorAWJIQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:58808) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kdEmP-0003hj-RB; Thu, 12 Nov 2020 15:44:57 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1kdEmP-0003Z4-Jr; Thu, 12 Nov 2020 15:44:57 +0000 Date: Thu, 12 Nov 2020 15:44:57 +0000 From: Russell King - ARM Linux admin To: Jens Axboe Subject: Re: [PATCH] arm: add support for TIF_NOTIFY_SIGNAL Message-ID: <20201112154457.GC1551@shell.armlinux.org.uk> References: <20201029162934.GX1551@shell.armlinux.org.uk> <20201029170110.GY1551@shell.armlinux.org.uk> <3a512c06-8387-e989-af5c-d9698d42cb11@kernel.dk> <20201029171738.GZ1551@shell.armlinux.org.uk> <20201029174236.GA1551@shell.armlinux.org.uk> <06f3c4cc-0cf7-b57e-acb4-d4fc8ea2fc25@kernel.dk> <20201112153213.GB1551@shell.armlinux.org.uk> <7039abd3-8d28-2e06-7eba-07e763b0ec5d@kernel.dk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <7039abd3-8d28-2e06-7eba-07e763b0ec5d@kernel.dk> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201112_104459_220036_88451350 X-CRM114-Status: GOOD ( 30.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Nov 12, 2020 at 08:42:55AM -0700, Jens Axboe wrote: > On 11/12/20 8:32 AM, Russell King - ARM Linux admin wrote: > > On Tue, Nov 03, 2020 at 08:11:49AM -0700, Jens Axboe wrote: > >> On 10/29/20 11:42 AM, Russell King - ARM Linux admin wrote: > >>> On Thu, Oct 29, 2020 at 11:20:07AM -0600, Jens Axboe wrote: > >>>> On 10/29/20 11:17 AM, Russell King - ARM Linux admin wrote: > >>>>> On Thu, Oct 29, 2020 at 11:15:37AM -0600, Jens Axboe wrote: > >>>>>> How about this? > >>>>>> > >>>>>> commit c03932936d8f99ff7c1c6c7d984e7a457284396c > >>>>>> Author: Jens Axboe > >>>>>> Date: Fri Oct 9 16:00:49 2020 -0600 > >>>>>> > >>>>>> arm: add support for TIF_NOTIFY_SIGNAL > >>>>>> > >>>>>> Wire up TIF_NOTIFY_SIGNAL handling for arm. > >>>>>> > >>>>>> Cc: linux-arm-kernel@lists.infradead.org > >>>>>> Signed-off-by: Jens Axboe > >>>>>> > >>>>>> diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h > >>>>>> index 536b6b979f63..eb7ce2747eb0 100644 > >>>>>> --- a/arch/arm/include/asm/thread_info.h > >>>>>> +++ b/arch/arm/include/asm/thread_info.h > >>>>>> @@ -126,6 +126,8 @@ extern int vfp_restore_user_hwstate(struct user_vfp *, > >>>>>> * thread information flags: > >>>>>> * TIF_USEDFPU - FPU was used by this task this quantum (SMP) > >>>>>> * TIF_POLLING_NRFLAG - true if poll_idle() is polling TIF_NEED_RESCHED > >>>>>> + * > >>>>>> + * Any bit in the range of 0..15 will cause do_work_pending() to be invoked. > >>>>>> */ > >>>>>> #define TIF_SIGPENDING 0 /* signal pending */ > >>>>>> #define TIF_NEED_RESCHED 1 /* rescheduling necessary */ > >>>>>> @@ -135,6 +137,7 @@ extern int vfp_restore_user_hwstate(struct user_vfp *, > >>>>>> #define TIF_SYSCALL_AUDIT 5 /* syscall auditing active */ > >>>>>> #define TIF_SYSCALL_TRACEPOINT 6 /* syscall tracepoint instrumentation */ > >>>>>> #define TIF_SECCOMP 7 /* seccomp syscall filtering active */ > >>>>>> +#define TIF_NOTIFY_SIGNAL 8 /* signal notifications exist */ > >>>>>> > >>>>>> #define TIF_USING_IWMMXT 17 > >>>>>> #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ > >>>>>> @@ -148,6 +151,7 @@ extern int vfp_restore_user_hwstate(struct user_vfp *, > >>>>>> #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) > >>>>>> #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) > >>>>>> #define _TIF_SECCOMP (1 << TIF_SECCOMP) > >>>>>> +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL) > >>>>>> #define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT) > >>>>>> > >>>>>> /* Checks for any syscall work in entry-common.S */ > >>>>>> @@ -158,7 +162,8 @@ extern int vfp_restore_user_hwstate(struct user_vfp *, > >>>>>> * Change these and you break ASM code in entry-common.S > >>>>>> */ > >>>>>> #define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \ > >>>>>> - _TIF_NOTIFY_RESUME | _TIF_UPROBE) > >>>>>> + _TIF_NOTIFY_RESUME | _TIF_UPROBE | \ > >>>>>> + _TIF_NOTIFY_SIGNAL) > >>>>>> > >>>>>> #endif /* __KERNEL__ */ > >>>>>> #endif /* __ASM_ARM_THREAD_INFO_H */ > >>>>>> diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S > >>>>>> index 271cb8a1eba1..77d16390a524 100644 > >>>>>> --- a/arch/arm/kernel/entry-common.S > >>>>>> +++ b/arch/arm/kernel/entry-common.S > >>>>>> @@ -53,7 +53,7 @@ __ret_fast_syscall: > >>>>>> cmp r2, #TASK_SIZE > >>>>>> blne addr_limit_check_failed > >>>>>> ldr r1, [tsk, #TI_FLAGS] @ re-check for syscall tracing > >>>>>> - tst r1, #_TIF_SYSCALL_WORK | _TIF_WORK_MASK > >>>>>> + movs r1, r1, lsl #16 > >>>>>> bne fast_work_pending > >>>>>> > >>>>>> > >>>>>> @@ -90,7 +90,7 @@ __ret_fast_syscall: > >>>>>> cmp r2, #TASK_SIZE > >>>>>> blne addr_limit_check_failed > >>>>>> ldr r1, [tsk, #TI_FLAGS] @ re-check for syscall tracing > >>>>>> - tst r1, #_TIF_SYSCALL_WORK | _TIF_WORK_MASK > >>>>>> + movs r1, r1, lsl #16 > >>>>>> beq no_work_pending > >>>>>> UNWIND(.fnend ) > >>>>>> ENDPROC(ret_fast_syscall) > >>>>>> @@ -131,7 +131,7 @@ ENTRY(ret_to_user_from_irq) > >>>>>> cmp r2, #TASK_SIZE > >>>>>> blne addr_limit_check_failed > >>>>>> ldr r1, [tsk, #TI_FLAGS] > >>>>>> - tst r1, #_TIF_WORK_MASK > >>>>>> + movs r1, r1, lsl #16 > >>>>>> bne slow_work_pending > >>>>>> no_work_pending: > >>>>>> asm_trace_hardirqs_on save = 0 > >>>>>> diff --git a/arch/arm/kernel/entry-v7m.S b/arch/arm/kernel/entry-v7m.S > >>>>>> index de1f20624be1..d0e898608d30 100644 > >>>>>> --- a/arch/arm/kernel/entry-v7m.S > >>>>>> +++ b/arch/arm/kernel/entry-v7m.S > >>>>>> @@ -59,7 +59,7 @@ __irq_entry: > >>>>>> > >>>>>> get_thread_info tsk > >>>>>> ldr r2, [tsk, #TI_FLAGS] > >>>>>> - tst r2, #_TIF_WORK_MASK > >>>>>> + movs r2, r2, lsl #16 > >>>>>> beq 2f @ no work pending > >>>>>> mov r0, #V7M_SCB_ICSR_PENDSVSET > >>>>>> str r0, [r1, V7M_SCB_ICSR] @ raise PendSV > >>>>>> diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c > >>>>>> index 585edbfccf6d..9d2e916121be 100644 > >>>>>> --- a/arch/arm/kernel/signal.c > >>>>>> +++ b/arch/arm/kernel/signal.c > >>>>>> @@ -655,7 +655,7 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall) > >>>>>> if (unlikely(!user_mode(regs))) > >>>>>> return 0; > >>>>>> local_irq_enable(); > >>>>>> - if (thread_flags & _TIF_SIGPENDING) { > >>>>>> + if (thread_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL)) { > >>>>>> int restart = do_signal(regs, syscall); > >>>>>> if (unlikely(restart)) { > >>>>>> /* > >>>>>> > >>>>> > >>>>> Looks perfect to me, thanks! I assume the pre-requisits for this are > >>>>> already in mainline or linux-next? > >>>> > >>>> Great! Thanks for your expedient attention and help. > >>>> > >>>> The bits using this are queued in tip for 5.11, so not in mainline yet, > >>>> but should be in linux-next tomorrow I guess. But it was done such that > >>>> arch patches could be queued up independently, so we didn't have weird > >>>> cross dependencies. > >>> > >>> Okay, I'll wait a few days and see about temporarily dumping it in > >>> my for-next branch so it gets a spin through kernelci next week. > >>> I'm not anticipating any breakage, so (if I remember) I'll give you > >>> a reviewed-by next week once it seems good. As I say, if I remember. > >> > >> Russell, did you have a chance to run it through the machinery? > > > > I threw the patch on top of my for-next branch, and let the various > > autobuilders chew on it for a few days. I haven't had any reports > > back, not even of any breakage through me adding it to my tree. > > > > I guess that's a positive indication. > > Good enough to add your acked-by? I guess. Acked-by: Russell King Thanks. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel