From patchwork Tue Jan 17 15:22:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 91681 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp543302qgi; Tue, 17 Jan 2017 07:24:05 -0800 (PST) X-Received: by 10.84.217.216 with SMTP id d24mr59356895plj.101.1484666645555; Tue, 17 Jan 2017 07:24:05 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e13si25201758pgf.220.2017.01.17.07.24.05; Tue, 17 Jan 2017 07:24:05 -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 S1750920AbdAQPYD (ORCPT + 1 other); Tue, 17 Jan 2017 10:24:03 -0500 Received: from mail-wm0-f41.google.com ([74.125.82.41]:36937 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750892AbdAQPX4 (ORCPT ); Tue, 17 Jan 2017 10:23:56 -0500 Received: by mail-wm0-f41.google.com with SMTP id c206so227927090wme.0 for ; Tue, 17 Jan 2017 07:23:06 -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=HjZ79z2W6jeuwLydyhGdg4E+nVzqWr3k5v1es0wm3vwlkfxLwQsZwaICVUDsUvheXp 5byI7oJ4lghae6+RZQqZssl3K1y7wycaGFPpEcyLEAaST0lJ0zVLeVyNCZJSu6VDEPSB 8cF7T3Cb4icnFBFuKMpuu5gKoenycD2v8Cknw= 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=dwyAmwY9jWVE85SjNNAQ6Zzzmk1G1oEsFY90JGLpB0xFTG5UN5d0z753sALbhI/txE P3lk0ZfcNfLb3Y1EjqWMA1Hbzlnc2/gm9Jvw2qHbVL9HgZe0Y/CiLUp2gsbHaAlGSfx2 1VizgxlQ28QLNniffem2wdtTipnEE7MwQUzKCNlehI2Qf5unkkMJcwoiyr2x2fqz8N1l EbmPbhoPsMJEXNkX+M8hBpUytSlQRflRuoFlB/miKTZwc+ikiBXigHIM9c3vOPD0rHo5 axrFRzn22nH1vJN5k/ofD1VVB6Q/wQPuCZKhCk3n0kxjtGjSX7gjGAuaYizD7JDnMMPt nr0Q== X-Gm-Message-State: AIkVDXLDR9p3RUURldh9IYCDGOJEpF9gbql5XyTKJ+A9mZskoXlqckzjwWhGRLK8T+L3HwB1 X-Received: by 10.223.150.183 with SMTP id u52mr27157274wrb.180.1484666585839; Tue, 17 Jan 2017 07:23:05 -0800 (PST) Received: from localhost.localdomain ([160.167.203.25]) by smtp.gmail.com with ESMTPSA id y127sm37590359wmg.12.2017.01.17.07.23.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 07:23:04 -0800 (PST) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au Cc: linux-arm-kernel@lists.infradead.org, Ard Biesheuvel Subject: [PATCH 07/10] crypto: arm64/aes - avoid literals for cross-module symbol references Date: Tue, 17 Jan 2017 15:22:34 +0000 Message-Id: <1484666557-31458-8-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484666557-31458-1-git-send-email-ard.biesheuvel@linaro.org> References: <1484666557-31458-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