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=-8.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 475B0C4363A for ; Thu, 29 Oct 2020 17:01:47 +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 9B8A12072E for ; Thu, 29 Oct 2020 17:01:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="w1tp3bGG"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="zTqh+xkX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9B8A12072E 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=FfDHs0LaHXJXgZbDeK8rhF7DyvQ48+oUjGHx7cNQy/4=; b=w1tp3bGGjitLbKbC0DxsiVxkh dnSe0+duk1Qg0HYe/YKXDKQFMvTND3F6FNbwOyJwRAQN5YKA5V0BLUWpJMfIKRwavrQB7cuP9IPou pZH8I2THj3Y9iMecJt1+miVD/DHHpqJbhe9V1e+CI3jIcN/p6QhUMCdJu5BJFLiR8vasnMlUQ8fI5 RNRxQ5cCN3q4GIZVTc5TzkLDEjOE4qXwwzl22ybAOUVM7RmHgCocpGQ48GjUb155WrtpgfgQXNjgb TZ0j4zS74Mn4sSYSqRoT0+CcO9vmGXtpMai0u2UMnDdpCNu4g29+6WXblKSE3onqoGpdDlydNvLTL Mpo1JDemA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kYBIa-0003WW-IY; Thu, 29 Oct 2020 17:01:16 +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 1kYBIX-0003U6-EO for linux-arm-kernel@lists.infradead.org; Thu, 29 Oct 2020 17:01:14 +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=fFnD5a5/NJu5YGFb7MGcvFBMZjFJaGazSg3oQ/99r3A=; b=zTqh+xkXfxty67YR6polrTISF 6LAN0BwrFtsAx57DXqxtnCcKM+c6mlKlme7SgqlfDsTsdIQOU6aO+RowRBYLv4SwIR4tOErB6xQHe 7JOmpAa4yTQr4zRgdbIb7UPjcUvo4cqGENNy6/tN+gD4v2DFBe5HH0mzefjCx82/itXufU3+dI2Z2 K+FOeKLKZ/J1HUQ/EIM/NQSngC2Nik5q5U0RRfnyqDkBZe5eOhgvdFS1Hpd/qVlz87HFUTe2PPHLP qgMRCT0aXg2FLR6GnIbEGwbo1r38VCy00N/vcBjjMaaf+OjvgDLcXliVkN+Z8N3RMDIA0SaKXGBsw X4VdR9Vpw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:52542) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kYBIV-0004gu-8f; Thu, 29 Oct 2020 17:01:11 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1kYBIU-0006Id-LU; Thu, 29 Oct 2020 17:01:10 +0000 Date: Thu, 29 Oct 2020 17:01:10 +0000 From: Russell King - ARM Linux admin To: Jens Axboe Subject: Re: [PATCH] arm: add support for TIF_NOTIFY_SIGNAL Message-ID: <20201029170110.GY1551@shell.armlinux.org.uk> References: <3c1ebfa5-38d9-e6b2-fcf7-d8b17c0fa515@kernel.dk> <20201029162934.GX1551@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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-20201029_130113_546881_7C62C491 X-CRM114-Status: GOOD ( 27.87 ) 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, Oct 29, 2020 at 10:35:54AM -0600, Jens Axboe wrote: > On 10/29/20 10:29 AM, Russell King - ARM Linux admin wrote: > > On Thu, Oct 29, 2020 at 10:11:07AM -0600, Jens Axboe wrote: > >> Wire up TIF_NOTIFY_SIGNAL handling for arm. > >> > >> Cc: linux-arm-kernel@lists.infradead.org > >> Signed-off-by: Jens Axboe > >> --- > >> > >> 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. > >> > >> This needs a bit of asm help, immediate doesn't like anything outside > >> of 1 byte, it seems. Any clues? > > > > Correct - immediates take an 8 bit value shifted by an even number of > > bits. > > > > I'm tempted to suggest that we simplify things by making TIF bits 0..15 > > invoke do_work_pending() no matter what - which will require a comment > > in thread_info.h that all those bits will have that effect. The > > resulting assembly would be: > > > > ldr r1, [tsk, #TI_FLAGS] @ re-check for syscall tracing > > - tst r1, #_TIF_SYSCALL_WORK | _TIF_WORK_MASK > > + movs r1, r1, lsl #16 > > > > which avoids the additional load caused by "ldr r2, =..." > > > > It's not like we're desperate for bits here. > > So renumber TIF bits that don't need to worry about do_work_pending() > > 15 then? I agree, there's plenty of bits available, so seems reasonable > to me. But probably more work in terms of other bits being tested with > tstcurrently - at least when I looked, I could not find any of them I > could successfully remap from < 8 to > 8. > > Any chance I can talk you into hacking that up? I don't believe that there's any need to do any renumbering. _TIF_WORK_MASK covers bits 0-3. _TIF_SYSCALL_WORK covers bits 4-7. Then we have 17, 18, and 20 which are not used to trigger the do_work_pending(). So, I think it's just a case of changing what you're doing in the assembly to my suggestion, and adding a comment to thread_info.h noting that bits 0-15 will trigger a call into do_work_pending() when returning to userspace. -- 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