From patchwork Thu Oct 29 16:11:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 11866747 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.3 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 10D8CC4363A for ; Thu, 29 Oct 2020 16:12:34 +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 565B9206CB for ; Thu, 29 Oct 2020 16:12:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ylWCglUX"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel-dk.20150623.gappssmtp.com header.i=@kernel-dk.20150623.gappssmtp.com header.b="0onjSumz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 565B9206CB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk 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:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:Date:Message-ID:Subject:From:To:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=YJmMXFkvz5CZvfCkeHO1f0UvXnL0MS9OpZpgbVajJ1U=; b=ylWCglUXN8HoT/3jhm824zaxHA UTaNixIxpXaAoV2ibu2OqRF787ofna++XYlGletkQO73Zb6BzjE9Ij7auRIDFzUTslTrARe0XVVOI ia0c0BNFA9QXE69nxcHpbIQSPf02LQSSN3Q08LQ/5m0/ZFfonlUWAr+1O3BMlZucyK92OcFu41KEM HNSWEjmoiUarYhk3UnMQcIG/abK2lDrJwa2d4VkkymRKgj3G6+oZJGIYE8BwhuM+DurkDYtXlSC3l fq3bVQcmd9C5TOpv2oToTxQx8oh8OIPrrdxm88NrklwxQyDbq2dCzC/SDsLkSaynVgkqma+EXTKdW U+si8BsQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kYAWv-0000vJ-PD; Thu, 29 Oct 2020 16:12:01 +0000 Received: from mail-il1-x142.google.com ([2607:f8b0:4864:20::142]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kYAWt-0000uX-0W for linux-arm-kernel@lists.infradead.org; Thu, 29 Oct 2020 16:11:59 +0000 Received: by mail-il1-x142.google.com with SMTP id x7so3605196ili.5 for ; Thu, 29 Oct 2020 09:11:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=Gkvluh/yrl2ZDPXzmxsk4Fb3cRE8eCWuhnjDSyNkmQE=; b=0onjSumzC+ZXUtOKx3MNp2xesJi202yDlIBvQebbtW7sN5J9PmWmCowvueuBefS2N7 aivdDHHkctOrTZ2fw2tor9N5YblXEzPrNupdP/cbceI6eqPHzBVksCPbCEUO8DrL8oed 2z0VvCQVwifHiSySo/3nb1XjE9Ey2TzS89J9xbN764/w6yk8EfQSRy77fi824O0FQxZ7 en4wnBXyKip+Q3lopj09LFxxBQwl35upAtlIvaHoxD1pB8v4RXSTlRmC1XFDMjZgtU/W XFNkrXpeiSrVK3Rh1j6x3EVlIg6a1W3VKykn3XVvuXtXxALCW7tO7CsnvMJ6ffpuCK93 Ci/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=Gkvluh/yrl2ZDPXzmxsk4Fb3cRE8eCWuhnjDSyNkmQE=; b=Eh6Omy7P0Ek7/6ccgn7Am4uDtnDEf6skzrrVo/9TbBAdnjtHOoUYFNKgOPBZy/YaXz /aSvAJstWyVvduXghE3nZyNkrxBv2RnEC4C1ddfMKrCmOKMyupZASG//evqTuhH+bpzJ sKa30Xp4GKFulYMpnxSJkYoM1JYS11HK5AuVEo0mBii3gRkmnzDvcI2foPozW8+VxYFU QlHdo+B+fIG/d2KjXrCrHEhrhgojozta7p6EMQtkMyVrlZes6LporjXiLLG+ZF5BJFdE ry0/HjrOvEZFAfAEPue+mUG6sAIfWFSdVP9tTVOp4qN3Jl6cBluk4yFHmBW49NMRS5V3 H+zQ== X-Gm-Message-State: AOAM530uhipeue+7zQKNng1KJZqbL/vD96F3SMRbPPfosN7K5Hxr5VpQ NICPXltwhq6DxusQnxRQODBUhtgM/i5+/w== X-Google-Smtp-Source: ABdhPJxyA7xOFRfsoz/VPpn8PS2Mc53A+kgaDdoQaVSaNxSmJV7lc6zvFZ5Q6KqKoUyqOiAm8kWeTw== X-Received: by 2002:a92:b610:: with SMTP id s16mr4154397ili.6.1603987916845; Thu, 29 Oct 2020 09:11:56 -0700 (PDT) Received: from [192.168.1.30] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id p66sm3393448ilb.48.2020.10.29.09.11.56 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Oct 2020 09:11:56 -0700 (PDT) To: "linux-arm-kernel@lists.infradead.org" From: Jens Axboe Subject: [PATCH] arm64: add support for TIF_NOTIFY_SIGNAL Message-ID: <111f501e-33e7-ad38-6476-9874f1226ad7@kernel.dk> Date: Thu, 29 Oct 2020 10:11:55 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201029_121159_110659_7F652022 X-CRM114-Status: GOOD ( 18.80 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Jens Axboe Acked-by: Will Deacon Acked-by: Catalin Marinas --- 5.11 has support queued up for TIF_NOTIFY_SIGNAL, see this posting for details: https://lore.kernel.org/io-uring/20201026203230.386348-1-axboe@kernel.dk/ As part of that work, I'm adding TIF_NOTIFY_SIGNAL support to all archs, as that will enable a set of cleanups once all of them support it. I'm happy carrying this patch if need be, or it can be funelled through the arch tree. Let me know. arch/arm64/include/asm/thread_info.h | 5 ++++- arch/arm64/kernel/signal.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h index 1fbab854a51b..cdcf307764aa 100644 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h @@ -68,6 +68,7 @@ void arch_release_task_struct(struct task_struct *tsk); #define TIF_UPROBE 4 /* uprobe breakpoint or singlestep */ #define TIF_FSCHECK 5 /* Check FS is USER_DS on return */ #define TIF_MTE_ASYNC_FAULT 6 /* MTE Asynchronous Tag Check Fault */ +#define TIF_NOTIFY_SIGNAL 7 /* signal notifications exist */ #define TIF_SYSCALL_TRACE 8 /* syscall trace active */ #define TIF_SYSCALL_AUDIT 9 /* syscall auditing */ #define TIF_SYSCALL_TRACEPOINT 10 /* syscall tracepoint for ftrace */ @@ -98,10 +99,12 @@ void arch_release_task_struct(struct task_struct *tsk); #define _TIF_32BIT (1 << TIF_32BIT) #define _TIF_SVE (1 << TIF_SVE) #define _TIF_MTE_ASYNC_FAULT (1 << TIF_MTE_ASYNC_FAULT) +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL) #define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \ _TIF_NOTIFY_RESUME | _TIF_FOREIGN_FPSTATE | \ - _TIF_UPROBE | _TIF_FSCHECK | _TIF_MTE_ASYNC_FAULT) + _TIF_UPROBE | _TIF_FSCHECK | _TIF_MTE_ASYNC_FAULT | \ + _TIF_NOTIFY_SIGNAL) #define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \ _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP | \ diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c index a8184cad8890..bec6ef69704f 100644 --- a/arch/arm64/kernel/signal.c +++ b/arch/arm64/kernel/signal.c @@ -942,7 +942,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, (void __user *)NULL, current); } - if (thread_flags & _TIF_SIGPENDING) + if (thread_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL)) do_signal(regs); if (thread_flags & _TIF_NOTIFY_RESUME) {