From patchwork Sun Oct 13 12:14:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 3033231 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B6FB7BF924 for ; Sun, 13 Oct 2013 12:17:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ACBBE2015B for ; Sun, 13 Oct 2013 12:16:59 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7D6F62017D for ; Sun, 13 Oct 2013 12:16:54 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VVKag-0003Pt-NB; Sun, 13 Oct 2013 12:16:10 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VVKaV-0000yy-JJ; Sun, 13 Oct 2013 12:15:59 +0000 Received: from mail-wi0-f173.google.com ([209.85.212.173]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VVKa9-0000vA-AM for linux-arm-kernel@lists.infradead.org; Sun, 13 Oct 2013 12:15:38 +0000 Received: by mail-wi0-f173.google.com with SMTP id h11so1012371wiv.12 for ; Sun, 13 Oct 2013 05:15:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ugfK6PutGE/9XmoHZV9K8CFaMwoX52BY0d7XPtVqrtk=; b=OeQDQ+aZ3O3SK6vLgY8M+w+Mrxg7CeHwgNdgkNLkXrd5KmcaEmeTdfvoRadcRewDcE Sk+cB58KlshPLHL0ZxqC98fzqzEOY08v6013G7oRcEPK1Yp1apJEAf7L2N6zmSdCB5am jUHaqz3HwnY8b4QTRRIqz06ZyPbDGe0bAT+djgpgS6N1HrrdaMuXp5BZbYrVhAR/wUPP nTgFBUGef/m7jQ/7szNbFWRDYGoTUzDIKVx6sh/nU42LPDnHe93WPZxknZ90ZDBeMVjz 0YX1X5PtknfDqb/FltkGHKcj1UDhDW1kGX5oaqKk/PY6odMOpOvdpp7koltcA9XRCn+e IUkA== X-Gm-Message-State: ALoCoQnkr3TY4d2BR8zpAKonANz4VWQSi09sVUmX0o1yXDRSMta/hVnOxqmeFAOZYj3C6hdFt722 X-Received: by 10.194.219.1 with SMTP id pk1mr1281907wjc.36.1381666515572; Sun, 13 Oct 2013 05:15:15 -0700 (PDT) Received: from ards-mac-mini.local (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id bs15sm13032515wib.10.2013.10.13.05.15.14 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 13 Oct 2013 05:15:15 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Subject: [RFC v3 PATCH 2/7] ARM: port NEON version of xor_blocks() to new kmode NEON api Date: Sun, 13 Oct 2013 14:14:58 +0200 Message-Id: <1381666503-23726-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1381666503-23726-1-git-send-email-ard.biesheuvel@linaro.org> References: <1381666503-23726-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131013_081537_473442_591C4B94 X-CRM114-Status: UNSURE ( 9.34 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) Cc: catalin.marinas@arm.com, Ard Biesheuvel , linux@arm.linux.org.uk, nico@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It is now permissible to use the NEON in non-process context, so update the XOR code so it uses the NEON version even in non-process context. Signed-off-by: Ard Biesheuvel --- arch/arm/include/asm/xor.h | 48 +++++++++++++++++++--------------------------- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/arch/arm/include/asm/xor.h b/arch/arm/include/asm/xor.h index 4ffb26d..1bda8b5 100644 --- a/arch/arm/include/asm/xor.h +++ b/arch/arm/include/asm/xor.h @@ -151,52 +151,44 @@ extern struct xor_block_template const xor_block_neon_inner; static void xor_neon_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) { - if (in_interrupt()) { - xor_arm4regs_2(bytes, p1, p2); - } else { - kernel_neon_begin(); - xor_block_neon_inner.do_2(bytes, p1, p2); - kernel_neon_end(); - } + DEFINE_NEON_REGSTACK(s); + + kernel_neon_begin(s); + xor_block_neon_inner.do_2(bytes, p1, p2); + kernel_neon_end(s); } static void xor_neon_3(unsigned long bytes, unsigned long *p1, unsigned long *p2, unsigned long *p3) { - if (in_interrupt()) { - xor_arm4regs_3(bytes, p1, p2, p3); - } else { - kernel_neon_begin(); - xor_block_neon_inner.do_3(bytes, p1, p2, p3); - kernel_neon_end(); - } + DEFINE_NEON_REGSTACK(s); + + kernel_neon_begin(s); + xor_block_neon_inner.do_3(bytes, p1, p2, p3); + kernel_neon_end(s); } static void xor_neon_4(unsigned long bytes, unsigned long *p1, unsigned long *p2, unsigned long *p3, unsigned long *p4) { - if (in_interrupt()) { - xor_arm4regs_4(bytes, p1, p2, p3, p4); - } else { - kernel_neon_begin(); - xor_block_neon_inner.do_4(bytes, p1, p2, p3, p4); - kernel_neon_end(); - } + DEFINE_NEON_REGSTACK(s); + + kernel_neon_begin(s); + xor_block_neon_inner.do_4(bytes, p1, p2, p3, p4); + kernel_neon_end(s); } static void xor_neon_5(unsigned long bytes, unsigned long *p1, unsigned long *p2, unsigned long *p3, unsigned long *p4, unsigned long *p5) { - if (in_interrupt()) { - xor_arm4regs_5(bytes, p1, p2, p3, p4, p5); - } else { - kernel_neon_begin(); - xor_block_neon_inner.do_5(bytes, p1, p2, p3, p4, p5); - kernel_neon_end(); - } + DEFINE_NEON_REGSTACK(s); + + kernel_neon_begin(s); + xor_block_neon_inner.do_5(bytes, p1, p2, p3, p4, p5); + kernel_neon_end(s); } static struct xor_block_template xor_block_neon = {