From patchwork Wed Dec 6 19:43:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 10096991 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1484F60327 for ; Wed, 6 Dec 2017 19:52:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05F7728DD2 for ; Wed, 6 Dec 2017 19:52:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED5D629D9A; Wed, 6 Dec 2017 19:52:45 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 75D3C28DD2 for ; Wed, 6 Dec 2017 19:52:45 +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-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=I/W9gGe6XrzoJ3yyuTc6g52avwtbK480dT25kogO3n0=; b=GAE2Y61SqTu5QqJaeihZ6YOeEE kv+yLjuEcO7jm38BGR34Ea4WQt1/KpdM9uwsaaLEP2eYOpY4ka6rnfQvVQ3p8T6inlX8RJqp4kPdL TVKMNBbV8rxF7FikroIHRXM/Q6vNQSg1Oiqa85p8FSixVNhasN+AroDxcfXmF9bia1/mE56Hs5iIB AVfnxq3ffYjL3dEWAPh6w/OZ1qcyr80/7ipLevNkbw+OQDj2Qh2HCy7xcW9SbafAhIntw0dnf9sMr 06jScWghWuGi6KHwsGiNFFLGpBlNfJuQCnW3yIqMZSgY5xI3Kwoh3zDlWMXBjj4nplR55MzBHzCXJ F6D2s15Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eMfkD-00081M-63; Wed, 06 Dec 2017 19:52:37 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eMfdC-0000Ct-1R for linux-arm-kernel@bombadil.infradead.org; Wed, 06 Dec 2017 19:45:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: 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=Il4jJORApUVG57eL6L3+t7rXYy7wi3t835FS6Fs0UwA=; b=ZE/PZ9exrQ6fzS7cmrJD3uyOt UP4wDqGxUEjQ6sLI1u5EOVp+hIGepq2Xp5HFoLkbsK0fgBqgxuNYYPXL2NW+D/iEIeoG7ne9y5k2X d/wA6DwN9clSsr7/vcx8cBSHx4hQ5O1Q7xEP4JEynTpRYbXH8vYX6vU6yWViiiUB2cW/UUaHX3Fa5 z9gRcwLZviVmWAHP4rb3cIpU9vfNia/lCct81v58bKnDAPrAHPlIXkl3ijdlGVfNr3xAZHdGQJKzF +BWc27zoAyLm1Z4RCgDZGPszIa8057z/n/PuAdu7K+drluRZNbiuZXW/GszbSadlgAr+GtX20g/mC 3ddl2sQVw==; Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eMfd9-0002Nm-BV for linux-arm-kernel@lists.infradead.org; Wed, 06 Dec 2017 19:45:20 +0000 Received: by mail-wm0-x241.google.com with SMTP id i11so9062560wmf.4 for ; Wed, 06 Dec 2017 11:44:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Il4jJORApUVG57eL6L3+t7rXYy7wi3t835FS6Fs0UwA=; b=M8oOMDIB17slUq7gJsRk8VSsW4N5oeUHYntY9ZYq8NQiAXCv0IKwSfwWEBM2MP5mKA 6412scHYrTvFBfq62bKwtPsFeV8jRIFJUe+Fq3+0PeBv+qAjFtJQ3i3bRhy1QlZMrWbc L1nZktK95zYyv8jZ4CKFtovI+Z8lr3xgGVHko= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Il4jJORApUVG57eL6L3+t7rXYy7wi3t835FS6Fs0UwA=; b=igIusYn40y4M54RkuTavRhTBGbKsVMKLmuFKMRpIgMBqJy03+vr9RPm5QuLjCcY8qj Lmr+CCPRg6b7WK20ICjMYPZCIHZERikUe/6wybH42W8Szu31OsJeQREBqrkVnTK/RMAZ anuFalu7bWb1ALBwfeGCF2uZfwsPt6sOzcNc2k5G5WjM4LvXQsaezIhlaG7+FcLpn4Ql zwwdcdw0NS+x8hTQ22tSblUHXooJXQWBBiVU6nn5H5nS/NCCDU0ku+tpo0NkqvmCWbJc OyYjeRv++b8wmhmAOvqELtE6GNvzKS+CiOnDjyS5xyBEV3X6SwBmKpL7Jls6L+QaPqfW KVCg== X-Gm-Message-State: AKGB3mKURuYTY/6jrripdULjLoIbQUBbYAZz8GIS1sY1IXXrSlokmiyO X7gjF+gMUzlQI5wxZzR4vW9xb8MdFlc= X-Google-Smtp-Source: AGs4zMY8ceAA4YxZxWdqwI+lVfV5GVO2o3l9VbU6OxE6d9SgcCB9+8KqX0ZofS9Vzm1Ywd4jzyhFsw== X-Received: by 10.28.107.5 with SMTP id g5mr10082921wmc.125.1512589497585; Wed, 06 Dec 2017 11:44:57 -0800 (PST) Received: from localhost.localdomain ([105.150.171.234]) by smtp.gmail.com with ESMTPSA id b66sm3596594wmh.32.2017.12.06.11.44.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Dec 2017 11:44:55 -0800 (PST) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Subject: [PATCH v3 20/20] DO NOT MERGE Date: Wed, 6 Dec 2017 19:43:46 +0000 Message-Id: <20171206194346.24393-21-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171206194346.24393-1-ard.biesheuvel@linaro.org> References: <20171206194346.24393-1-ard.biesheuvel@linaro.org> 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: Mark Rutland , herbert@gondor.apana.org.au, Ard Biesheuvel , Peter Zijlstra , Catalin Marinas , Sebastian Andrzej Siewior , Will Deacon , Russell King - ARM Linux , Steven Rostedt , Thomas Gleixner , Dave Martin , linux-arm-kernel@lists.infradead.org, linux-rt-users@vger.kernel.org MIME-Version: 1.0 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 Test code to force a kernel_neon_end+begin sequence at every yield point, and wipe the entire NEON state before resuming the algorithm. --- arch/arm64/include/asm/assembler.h | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h index c54e408fd5a7..7072c29b4e83 100644 --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -607,6 +607,7 @@ alternative_else_nop_endif cmp w1, #1 // == PREEMPT_OFFSET csel x0, x0, xzr, eq tbnz x0, #TIF_NEED_RESCHED, 5555f // needs rescheduling? + b 5555f #endif .subsection 1 5555: @@ -615,6 +616,38 @@ alternative_else_nop_endif .macro do_cond_yield_neon bl kernel_neon_end bl kernel_neon_begin + movi v0.16b, #0x55 + movi v1.16b, #0x55 + movi v2.16b, #0x55 + movi v3.16b, #0x55 + movi v4.16b, #0x55 + movi v5.16b, #0x55 + movi v6.16b, #0x55 + movi v7.16b, #0x55 + movi v8.16b, #0x55 + movi v9.16b, #0x55 + movi v10.16b, #0x55 + movi v11.16b, #0x55 + movi v12.16b, #0x55 + movi v13.16b, #0x55 + movi v14.16b, #0x55 + movi v15.16b, #0x55 + movi v16.16b, #0x55 + movi v17.16b, #0x55 + movi v18.16b, #0x55 + movi v19.16b, #0x55 + movi v20.16b, #0x55 + movi v21.16b, #0x55 + movi v22.16b, #0x55 + movi v23.16b, #0x55 + movi v24.16b, #0x55 + movi v25.16b, #0x55 + movi v26.16b, #0x55 + movi v27.16b, #0x55 + movi v28.16b, #0x55 + movi v29.16b, #0x55 + movi v30.16b, #0x55 + movi v31.16b, #0x55 .endm .macro endif_yield_neon, lbl=6666f