Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3878506pxb; Tue, 17 Nov 2020 06:03:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJyjGUu4STCkIoEYEzFE1ByTvx3D8bMlvYUHuMz4lKJXp7tVe6mf2C0S8NHYtpKaa+MZV+j0 X-Received: by 2002:a50:a689:: with SMTP id e9mr20787005edc.233.1605621829992; Tue, 17 Nov 2020 06:03:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605621829; cv=none; d=google.com; s=arc-20160816; b=kgRpu04x5RW2h2R5lvGdPDJGZd2lr/m4eT3Szvlqha0R403ZoKU1zcKtnxz3KVbjh4 kpyQeURMW1GzG5UqnYYFCAQZcYckf1vfDlpB6/BzZt6DUnXhDXLn+V8uoDnZav/UcK1q /yNRVjkeJoolWt+JiUQl5iV66tUCg7S+FxuCaH6NxDxI22ZfwCbrdiTaNed9iYwLBBok nqxMPNjyLyj/mLg4unCBhW4Rjhv0Zt7hUYoDEXobnsPMYfXudDRbYwIXd6++4TJW9KQf WIBEdGU3BrQJaYM8BAx7MKyVj5bNEwvJT0Ku4Xeor10YhCD0Xp1n9h49RV+CV4AYgRgi fu3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GebFlNE+8EruzsG+K/ebrWnaolsSVI2uVW9VhVLBB7g=; b=s+mdPZ9Zfu8yg8nbRm50+E3hbHgsnFs6MPbxaW72ixypP1TKl4G3VZFdRX9RNuW/vI uYp9sb7OD/YceFpdNn2GKGCQR59C9lKIU8QDzLGc4XwYQ3oIKHbk5VGOyJ3YDgEjebsP +EpZrbA9W+JMYYxXZW2lCcEcynXKpwovymFhSEn/q160NgPhJFOjz7vt/Rbp6EMWYGr1 7FypKnMpSXiQnO846ozR19jwX0fhx4Eiiiosmgpfz0u5Xb8yF0MmxZuyzbkbZR5x2kSZ t7TRGM2cNEk8Wij2QOsOcedDuIBBkp3XRWPjmp1DtweCOp53mJFMfPa+vV2b3evohpat +ixg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qfgn3Nbv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r26si11711094ejb.597.2020.11.17.06.03.26; Tue, 17 Nov 2020 06:03:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qfgn3Nbv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731091AbgKQN7J (ORCPT + 99 others); Tue, 17 Nov 2020 08:59:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:51058 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730670AbgKQNS0 (ORCPT ); Tue, 17 Nov 2020 08:18:26 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 52B5B24654; Tue, 17 Nov 2020 13:18:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605619105; bh=O8sN/Fj7w+5g61Gjf9SEq4lrUkuxb/eAuuxjUzW77+s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qfgn3NbvhhyTc8spwsyTYbNl+XWrzkULpLIt/vN31h3pUKD3Ayzfuwh+s4oRFhj6F Tyj8SknAex9ICLU1tygWOiO7IcgpGUzFcMQpacyIOyJhJBM6/XXN7V3mdPHwKyOhJT 7sUPGFlzNxu0USkQH0OHBXQG23b85Yx3Tq9aTfak= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nick Desaulniers , Ard Biesheuvel , Herbert Xu Subject: [PATCH 4.19 029/101] crypto: arm64/aes-modes - get rid of literal load of addend vector Date: Tue, 17 Nov 2020 14:04:56 +0100 Message-Id: <20201117122114.510330023@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122113.128215851@linuxfoundation.org> References: <20201117122113.128215851@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ard Biesheuvel commit ed6ed11830a9ded520db31a6e2b69b6b0a1eb0e2 upstream. Replace the literal load of the addend vector with a sequence that performs each add individually. This sequence is only 2 instructions longer than the original, and 2% faster on Cortex-A53. This is an improvement by itself, but also works around a Clang issue, whose integrated assembler does not implement the GNU ARM asm syntax completely, and does not support the =literal notation for FP registers (more info at https://bugs.llvm.org/show_bug.cgi?id=38642) Cc: Nick Desaulniers Signed-off-by: Ard Biesheuvel Reviewed-by: Nick Desaulniers Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- arch/arm64/crypto/aes-modes.S | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) --- a/arch/arm64/crypto/aes-modes.S +++ b/arch/arm64/crypto/aes-modes.S @@ -232,17 +232,19 @@ AES_ENTRY(aes_ctr_encrypt) bmi .Lctr1x cmn w6, #4 /* 32 bit overflow? */ bcs .Lctr1x - ldr q8, =0x30000000200000001 /* addends 1,2,3[,0] */ - dup v7.4s, w6 + add w7, w6, #1 mov v0.16b, v4.16b - add v7.4s, v7.4s, v8.4s + add w8, w6, #2 mov v1.16b, v4.16b - rev32 v8.16b, v7.16b + add w9, w6, #3 mov v2.16b, v4.16b + rev w7, w7 mov v3.16b, v4.16b - mov v1.s[3], v8.s[0] - mov v2.s[3], v8.s[1] - mov v3.s[3], v8.s[2] + rev w8, w8 + mov v1.s[3], w7 + rev w9, w9 + mov v2.s[3], w8 + mov v3.s[3], w9 ld1 {v5.16b-v7.16b}, [x20], #48 /* get 3 input blocks */ bl aes_encrypt_block4x eor v0.16b, v5.16b, v0.16b