From patchwork Mon Jan 23 14:05:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 92220 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp1233430obz; Mon, 23 Jan 2017 06:05:46 -0800 (PST) X-Received: by 10.99.167.74 with SMTP id w10mr33275420pgo.2.1485180346824; Mon, 23 Jan 2017 06:05:46 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l36si15767527plg.145.2017.01.23.06.05.46; Mon, 23 Jan 2017 06:05:46 -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 S1751226AbdAWOFq (ORCPT + 1 other); Mon, 23 Jan 2017 09:05:46 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:34995 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750828AbdAWOFp (ORCPT ); Mon, 23 Jan 2017 09:05:45 -0500 Received: by mail-wm0-f45.google.com with SMTP id r126so134571186wmr.0 for ; Mon, 23 Jan 2017 06:05:45 -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=gyT2mH5b7Y+c3AHrdUDhHPvkRo8EgNPXx3JE3qIY1t01rhoQeJGqe9gI0Fc2gdzend g+eznoznMNFB2XNF7pxCL0lEW1nnnRDasURqBgRUL6jzWdgD7rdGcq07umrZ+lpaLt8l zzKAWw3t3ZQPZlPSG1eefyU5Iy7wmwPp5GxME= 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=tpbZF0oTkCkwHn5NhEtoXqAECZxiiD2qGGHyn32H+CygB27HCPmhHd1YuDzD5jiRab i72IXRU9f6J0A89aj2yrwW26ZFZMaG6MvuL6HRNZFsVB6jGMi2MUgzWxcHGrfBCd2CGX oYVWWES5FpdFVF/8Db3SkpDEPAQe5MjyaX2soNomQJWHz3rkF+FwjSxz9VARucK7oKVs G6Mfmhq85GrE+mYeq+jeSZznBMDOumXumlrngSUdicpfI0QfEyuWn2PKnQxcNJLHcBWt 34sBIWnPjm9Bal4LAPe+NeDnD9ACqEMfsw4V9lTitPjg6Y/zx4/BgWj2PRvZN0sP/QTi WIVw== X-Gm-Message-State: AIkVDXLKWilylQDUGye4GG2gmbPXvVnI7Ptt/2LF8XeUm8u6Or5Xcl9EbQaE1NHOZ08TLt6d X-Received: by 10.28.221.11 with SMTP id u11mr13172498wmg.75.1485180344269; Mon, 23 Jan 2017 06:05:44 -0800 (PST) Received: from localhost.localdomain ([160.160.111.139]) by smtp.gmail.com with ESMTPSA id y65sm21319790wmb.5.2017.01.23.06.05.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Jan 2017 06:05:43 -0800 (PST) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au Cc: Ard Biesheuvel Subject: [PATCH v2 07/10] crypto: arm64/aes - avoid literals for cross-module symbol references Date: Mon, 23 Jan 2017 14:05:23 +0000 Message-Id: <1485180326-25612-8-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485180326-25612-1-git-send-email-ard.biesheuvel@linaro.org> References: <1485180326-25612-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