From patchwork Thu May 9 15:01:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hillf Danton X-Patchwork-Id: 10937273 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D6FF71390 for ; Thu, 9 May 2019 15:02:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7F42285B7 for ; Thu, 9 May 2019 15:02:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A5C9E28747; Thu, 9 May 2019 15:02:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 67714285B7 for ; Thu, 9 May 2019 15:02:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:Date:Subject:To:From:Message-ID:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=EDFZ3A6BAoxiEdfZToBebrJBOrS+og+czhAV/Uo+SOc=; b=cNe sbLjRDdy4vs/LMenK+cChsWvshhpMCyPuugM74R+rVwH4GMDbB4BFzge/SqRTOzjfrJRXfOxqE+kJ D64FL2s6Ueqbs3PYtallIOsIV3HKM2MUsolJ9+K5vFKgxXMimGHGKYOGfCDIWn0uw0MXiT+7TjBgO O0uhCgekB2fvpHcLbs23rHgz1SOGUcaviXHlnOj9k1+d/306gJBuk/6SUEVVlL6OU/d8gHzp/Qfk4 S159k0x08+hFuXlXLKjDYrdPk0GPgWomF/80o43vIEMWQwczhTlmb9rcwDsBgrl2oY512u5OVZqj7 LKAXwUgs2p7QJgGMOGK21aIm62Svzrw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOkYe-0002uC-P8; Thu, 09 May 2019 15:02:04 +0000 Received: from mail3-164.sinamail.sina.com.cn ([202.108.3.164]) by bombadil.infradead.org with smtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hOkYZ-0002sw-G4 for linux-arm-kernel@lists.infradead.org; Thu, 09 May 2019 15:02:03 +0000 Received: from unknown (HELO laptop-0p1i5f25)([114.246.225.250]) by sina.com with ESMTP id 5CD440DA000068C5; Thu, 9 May 2019 23:01:47 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 142192395186 Message-ID: <177247.865216003-sendEmail@laptop-0p1i5f25> From: "Hillf Danton" To: "Ard Biesheuvel" Subject: [patch] arm64: assembler: Update the yield NEON comment Date: Thu, 9 May 2019 15:01:43 +0000 X-Mailer: sendEmail-1.56 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190509_080159_725277_6F8B5D58 X-CRM114-Status: UNSURE ( 9.92 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Zijlstra , Hillf Danton , Will Deacon , Dave Martin , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The comment was a bit misleading when it was created in commit 24534b3511, and deserves a tweak like, - * - Check whether the preempt count is exactly 1, in which case disabling - * preemption once will make the task preemptible. If this is not the case, + * - Check whether the preempt count is exactly 1, in which case decrementing + * preempt count once will make the task preemptible. If this is not the case, then code fix was added in commit 7faa313f05 with the comment left behind untouched. It no longer matches the code now, so fix it. It is changed along the original direction as much as I can, though simply deleting the relevant block looks fine. And finally a question remains: is it needed to decrement preempt count before invoking kernel_neon_end() in which preempt_enable() is put at the end? Cc: Ard Biesheuvel Cc: Dave Martin Cc: Will Deacon Cc: Peter Zijlstra Signed-off-by: Hillf Danton --- arch/arm64/include/asm/assembler.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) -- diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h index c5308d0..8518a7b 100644 --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -713,13 +713,9 @@ USER(\label, ic ivau, \tmp2) // invalidate I line PoU * Note that the patchup code does not support assembler directives that change * the output section, any use of such directives is undefined. * - * The yield itself consists of the following: - * - Check whether the preempt count is exactly 1, in which case disabling - * preemption once will make the task preemptible. If this is not the case, - * yielding is pointless. - * - Check whether TIF_NEED_RESCHED is set, and if so, disable and re-enable - * kernel mode NEON (which will trigger a reschedule), and branch to the - * yield fixup code. + * The yield itself decrements the preempt count and if count hits zero, disable + * and re-enable kernel mode NEON (which will trigger a reschedule), and branch + * to the yield fixup code. * * This macro sequence may clobber all CPU state that is not guaranteed by the * AAPCS to be preserved across an ordinary function call.