From patchwork Sat Jan 28 23:25:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 92770 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp847281qgi; Sat, 28 Jan 2017 15:26:30 -0800 (PST) X-Received: by 10.84.211.11 with SMTP id b11mr21891407pli.83.1485645990809; Sat, 28 Jan 2017 15:26:30 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d65si8383902pfl.73.2017.01.28.15.26.30; Sat, 28 Jan 2017 15:26:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751947AbdA1X0M (ORCPT + 1 other); Sat, 28 Jan 2017 18:26:12 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:38092 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752710AbdA1X0I (ORCPT ); Sat, 28 Jan 2017 18:26:08 -0500 Received: by mail-wm0-f44.google.com with SMTP id r126so35381295wmr.1 for ; Sat, 28 Jan 2017 15:26:07 -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=i8PTGdBLEln38Rqn6mFXAiQkiYiMzfbJpCdlXeMJ1E4=; b=VlgkLeDm7HbLVpKvgzQ9Tu5ttKUCVD0OSkPzujKY915qAWQIebFL5L8kLQgvFFR/GS uMeFArGeuL4nOrLhhm7doCwZgez2pyw36JSkp0VOQ8tRl2cMeUDZApawtZK8/tdDLUHo /M5JexHjIVLdPwVK23GHjh45GZmhm2UheAtbE= 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=i8PTGdBLEln38Rqn6mFXAiQkiYiMzfbJpCdlXeMJ1E4=; b=FTpssxBhAiAbnuuhG0BN16h/QygbV9DvBycIxHprOJKodTqLpRFFAczOBxtnR106yp JyNpimSVjNYYUfrdv5OzQVkkkxi3BPVtL2OOecJIRo7U9rpGQaP3C23K+O9k1G143h59 qi2Wo/eCU2+pX2w6BXXBTtQCKI0klILn+76rIEkNUQ/rAv6lYxfS35yglznx6GJztUfa lCGeCUElC+O+xDz37ifova5NHYI/hSLazCYXKLFlMVrJUshsDxv5yz9ZpoWsZ1inCDyh qOaUA4+70zCNCQ8XJMJXl8ImbqJbxSuSYfZxtRNTbOhInCjqxdTFY+UlThrCTvD5yqhN Ik6Q== X-Gm-Message-State: AIkVDXLa9QB3rGqOafxLdS1nqd+Q7M0Q02WnXtnBloUb3sQctWw13Z0El8xe9qzhx614ls3O X-Received: by 10.28.95.87 with SMTP id t84mr7893674wmb.135.1485645966782; Sat, 28 Jan 2017 15:26:06 -0800 (PST) Received: from localhost.localdomain ([160.163.215.165]) by smtp.gmail.com with ESMTPSA id 33sm14992064wrd.34.2017.01.28.15.26.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 28 Jan 2017 15:26:06 -0800 (PST) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, herbert@gondor.apana.org.au, Ard Biesheuvel Subject: [PATCH v3 07/10] crypto: arm64/aes - avoid literals for cross-module symbol references Date: Sat, 28 Jan 2017 23:25:36 +0000 Message-Id: <1485645939-17126-8-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485645939-17126-1-git-send-email-ard.biesheuvel@linaro.org> References: <1485645939-17126-1-git-send-email-ard.biesheuvel@linaro.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Using simple adrp/add pairs to refer to the AES lookup tables exposed by the generic AES driver (which could be loaded far away from this driver when KASLR is in effect) was unreliable at module load time before commit 41c066f2c4d4 ("arm64: assembler: make adr_l work in modules under KASLR"), which is why the AES code used literals instead. So now we can get rid of the literals, and switch to the adr_l macro. Signed-off-by: Ard Biesheuvel --- arch/arm64/crypto/aes-cipher-core.S | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm64/crypto/aes-cipher-core.S b/arch/arm64/crypto/aes-cipher-core.S index 37590ab8121a..cd58c61e6677 100644 --- a/arch/arm64/crypto/aes-cipher-core.S +++ b/arch/arm64/crypto/aes-cipher-core.S @@ -89,8 +89,8 @@ CPU_BE( rev w8, w8 ) eor w7, w7, w11 eor w8, w8, w12 - ldr tt, =\ttab - ldr lt, =\ltab + adr_l tt, \ttab + adr_l lt, \ltab tbnz rounds, #1, 1f @@ -111,9 +111,6 @@ CPU_BE( rev w8, w8 ) stp w5, w6, [out] stp w7, w8, [out, #8] ret - - .align 4 - .ltorg .endm .align 5