From patchwork Thu May 1 15:49:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 4099411 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BF031BFF02 for ; Thu, 1 May 2014 15:52:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0807D20357 for ; Thu, 1 May 2014 15:52:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1970520328 for ; Thu, 1 May 2014 15:52:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WftFe-0007V4-VL; Thu, 01 May 2014 15:50:22 +0000 Received: from mail-wi0-f181.google.com ([209.85.212.181]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WftFT-0006A7-Qy for linux-arm-kernel@lists.infradead.org; Thu, 01 May 2014 15:50:14 +0000 Received: by mail-wi0-f181.google.com with SMTP id f8so964026wiw.14 for ; Thu, 01 May 2014 08:49:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CUL4CE7Xk7XzZq90LLpVXXjXttFAvoux5JEpjnKfyuI=; b=l7w84XtYgBHyZZ3V6Bcug2Rhb5N2iu/YQHy0Hv8tKtA5D4gYwls+fRDTOImGC5VvLn DbRDbwpDTt5bkvOSWRBlQw04RxZLPR9ULrE5TQSi7O6peOFfmXl6YeO/y0pm92/RqlMd IgdJmfYkM0sHUWzp5HTm9Pr1bGaPuWKUKaZ6O9dfmszuQaNzV20UGjh5LB/rwOKy5h/W 5ITAygaRmeeNiRSrOHIhZiis+6FkWYwkYzBBD3kpDsvucJa/JSyKBVhPbEN0trtVJnnl MeCaQyD/615666oBX/ra1CbRjDdgBGJdegmvt1fuiPAwnuZymzax5dS2UPYxvpAPryFB lElA== X-Gm-Message-State: ALoCoQljNJfs/2MiMChbT2Ce0T0dqnOybZD8UVpS92aRyvIgwL120cdzWmWuFSChgV7jLwkYAPCO X-Received: by 10.180.104.197 with SMTP id gg5mr2779018wib.2.1398959389551; Thu, 01 May 2014 08:49:49 -0700 (PDT) Received: from ards-macbook-pro.local (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id jd2sm4457326wic.9.2014.05.01.08.49.48 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 01 May 2014 08:49:48 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org Subject: [PATCH resend 01/15] asm-generic: allow generic unaligned access if the arch supports it Date: Thu, 1 May 2014 17:49:33 +0200 Message-Id: <1398959381-8126-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1398959381-8126-1-git-send-email-ard.biesheuvel@linaro.org> References: <1398959381-8126-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140501_085012_060745_C91FBB14 X-CRM114-Status: GOOD ( 10.29 ) X-Spam-Score: -0.7 (/) Cc: catalin.marinas@arm.com, will.deacon@arm.com, steve.capper@linaro.org, Ard Biesheuvel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Switch the default unaligned access method to 'hardware implemented' if HAVE_EFFICIENT_UNALIGNED_ACCESS is set. Signed-off-by: Ard Biesheuvel Acked-by: Arnd Bergmann --- include/asm-generic/unaligned.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/include/asm-generic/unaligned.h b/include/asm-generic/unaligned.h index 03cf5936bad6..1ac097279db1 100644 --- a/include/asm-generic/unaligned.h +++ b/include/asm-generic/unaligned.h @@ -4,22 +4,27 @@ /* * This is the most generic implementation of unaligned accesses * and should work almost anywhere. - * - * If an architecture can handle unaligned accesses in hardware, - * it may want to use the linux/unaligned/access_ok.h implementation - * instead. */ #include +/* Set by the arch if it can handle unaligned accesses in hardware. */ +#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS +# include +#endif + #if defined(__LITTLE_ENDIAN) -# include -# include +# ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS +# include +# include +# endif # include # define get_unaligned __get_unaligned_le # define put_unaligned __put_unaligned_le #elif defined(__BIG_ENDIAN) -# include -# include +# ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS +# include +# include +# endif # include # define get_unaligned __get_unaligned_be # define put_unaligned __put_unaligned_be