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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5A99CC433EF for ; Mon, 13 Dec 2021 15:20:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=ZEmt1LhXlIrU7PNpeQbJjkrzspZHwkf9+wcehksxoz8=; b=S7Oh9qIH/pWNmN aqvIdv4H72e2kU8p3UIb7+TIV2t2sribuSgJ25wxHts2AO7J1czydXlH49GsNiiVfJMN9a8rIaxei /8inJEe2I/P9x6w7IpiaQ5Q3aN3udgsq88qsOJBuvMqfc+LpYKPhK2JXnEcbWvqJpFRRd/MejNPZA c63RpQVGrPYIPHpBRRYQ+m0ocIgqpMY6NWWob/KGUSmN9sa/7uibApRdHSoxFiz4CsJGszguEbAJ7 nF3SYD0Tlg9/j4UKd+E9tVDylTNiuaP6XBuVzMwhhc/jsM6cYDR9wo6u6JtOra6jTxQxUB9tEjXN/ T1kClAhNF4b7QN1e+OZg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mwn66-00AKQ6-NI; Mon, 13 Dec 2021 15:18:39 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mwmtr-00AGSW-UN for linux-arm-kernel@lists.infradead.org; Mon, 13 Dec 2021 15:06:01 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9938BB81136; Mon, 13 Dec 2021 15:05:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59881C34602; Mon, 13 Dec 2021 15:05:56 +0000 (UTC) Date: Mon, 13 Dec 2021 15:05:53 +0000 From: Catalin Marinas To: Ard Biesheuvel Cc: Linux ARM , Will Deacon , Mark Rutland , Peter Zijlstra Subject: Re: [PATCH 2/2] arm64/xor: use EOR3 instructions when available Message-ID: References: <20211109120336.3561463-1-ardb@kernel.org> <20211109120336.3561463-3-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211213_070600_163923_A2BB5AAB X-CRM114-Status: GOOD ( 24.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Mon, Dec 13, 2021 at 02:33:21PM +0100, Ard Biesheuvel wrote: > On Mon, 13 Dec 2021 at 14:25, Catalin Marinas wrote: > > On Tue, Nov 09, 2021 at 01:03:36PM +0100, Ard Biesheuvel wrote: > > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > > > index 6f2d3e31fb54..14354acba5b4 100644 > > > --- a/arch/arm64/Kconfig > > > +++ b/arch/arm64/Kconfig > > > @@ -2034,6 +2034,9 @@ config SYSVIPC_COMPAT > > > def_bool y > > > depends on COMPAT && SYSVIPC > > > > > > +config CC_HAVE_SHA3 > > > + def_bool $(cc-option, -march=armv8.2-a+sha3) > > > > Is it the compiler or the assembler that we need to support this? I > > think it's sufficient to only check the latter. > > > > I'd also move it to the ARMv8.2 section. > > > > > + > > > menu "Power management options" > > > > > > source "kernel/power/Kconfig" > > > diff --git a/arch/arm64/lib/xor-neon.c b/arch/arm64/lib/xor-neon.c > > > index ee4795f3e166..0415cb94c781 100644 > > > --- a/arch/arm64/lib/xor-neon.c > > > +++ b/arch/arm64/lib/xor-neon.c > > > @@ -172,6 +172,135 @@ void xor_arm64_neon_5(unsigned long bytes, unsigned long *p1, > > > } > > > EXPORT_SYMBOL(xor_arm64_neon_5); > > > > > > +static inline uint64x2_t eor3(uint64x2_t p, uint64x2_t q, uint64x2_t r) > > > +{ > > > + uint64x2_t res; > > > + > > > + asm(".arch armv8.2-a+sha3 \n" > > > + "eor3 %0.16b, %1.16b, %2.16b, %3.16b" > > > + : "=w"(res) : "w"(p), "w"(q), "w"(r)); > > > + return res; > > > +} > > > > The .arch here may confuse the compiler/assembler since it overrides any > > other .arch. I think this diff on top would do but I haven't extensively > > tested it. I can fold it in if you give it a try: > > I was going to respin this without the static_call changes, since > those are not going to land anytime soon, I thought the generic implementation still works, though not the most efficient. > and for this code, it > doesn't really matter anyway. I'll fold in your diff and test it as > well. Sounds fine to me. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel