From: Thomas Garnier <thgarnie@google.com>
To: Russell King <linux@armlinux.org.uk>,
Thomas Garnier <thgarnie@google.com>,
Thomas Gleixner <tglx@linutronix.de>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
Dave Martin <Dave.Martin@arm.com>,
Chris Metcalf <cmetcalf@mellanox.com>,
Pratyush Anand <panand@redhat.com>,
leonard.crestez@nxp.com
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
kernel-hardening@lists.openwall.com
Subject: [PATCH 2/3] arm/syscalls: Optimize work flags assembly check
Date: Wed, 19 Jul 2017 10:58:59 -0700 [thread overview]
Message-ID: <20170719175900.124074-2-thgarnie@google.com> (raw)
In-Reply-To: <20170719175900.124074-1-thgarnie@google.com>
Remove the double branch and use tsteq instead.
Suggested-by: Russell King <linux@armlinux.org.uk>
Signed-off-by: Thomas Garnier <thgarnie@google.com>
---
arch/arm/kernel/entry-common.S | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index e33c32d56193..6e094b639d83 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -42,8 +42,7 @@ ret_fast_syscall:
disable_irq_notrace @ disable interrupts
ldr r1, [tsk, #TI_FLAGS] @ re-check for syscall tracing
tst r1, #_TIF_SYSCALL_WORK
- bne fast_work_pending
- tst r1, #_TIF_WORK_MASK
+ tsteq r1, #_TIF_WORK_MASK
bne fast_work_pending
/* perform architecture specific actions before user return */
@@ -70,14 +69,12 @@ ret_fast_syscall:
disable_irq_notrace @ disable interrupts
ldr r1, [tsk, #TI_FLAGS] @ re-check for syscall tracing
tst r1, #_TIF_SYSCALL_WORK
- bne fast_work_pending
- tst r1, #_TIF_WORK_MASK
+ tsteq r1, #_TIF_WORK_MASK
beq no_work_pending
UNWIND(.fnend )
ENDPROC(ret_fast_syscall)
/* Slower path - fall through to work_pending */
-fast_work_pending:
#endif
tst r1, #_TIF_SYSCALL_WORK
--
2.14.0.rc0.284.gd933b75aa4-goog
next prev parent reply other threads:[~2017-07-19 17:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-19 17:58 [PATCH 1/3] arm/syscalls: Move address limit check in loop Thomas Garnier
2017-07-19 17:58 ` Thomas Garnier [this message]
2017-07-19 17:59 ` [PATCH 3/3] arm64/syscalls: " Thomas Garnier
2017-07-24 17:07 ` [PATCH 1/3] arm/syscalls: " Thomas Garnier
2017-07-25 10:28 ` Leonard Crestez
2017-07-25 10:38 ` Russell King - ARM Linux
2017-07-25 20:01 ` Thomas Garnier
2017-07-26 12:02 ` Will Deacon
2017-07-26 14:20 ` Thomas Garnier
2017-07-26 18:25 ` Russell King - ARM Linux
2017-07-26 18:29 ` Thomas Garnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170719175900.124074-2-thgarnie@google.com \
--to=thgarnie@google.com \
--cc=Dave.Martin@arm.com \
--cc=catalin.marinas@arm.com \
--cc=cmetcalf@mellanox.com \
--cc=kernel-hardening@lists.openwall.com \
--cc=leonard.crestez@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=panand@redhat.com \
--cc=tglx@linutronix.de \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome