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: 29508 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f197.google.com (mail-ig0-f197.google.com [209.85.213.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D9957203F3 for ; Thu, 1 May 2014 15:49:58 +0000 (UTC) Received: by mail-ig0-f197.google.com with SMTP id hn18sf1933283igb.4 for ; Thu, 01 May 2014 08:49:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=4EeUKe0UaeKJZ6Pa49JHnMKohGblvw7hhcqyClcQpW8=; b=iaN95eufBj8jDMwLmKdHG2lu7jqUiEXX3Vdq8nxcAILB5alIRJxwTgq/2E9JxIF/wa X/bT990aYIQcQ+GwD7PQ0HiCWCz7JM2ealtKdhWAg86z1z36LQaAuS4xYf/TgUMssjAu iJ4VSZyl3vqBKsZn2iYKxhS+zS4BY55jbObfXTnbuZk0CAkanedGSMzhnFRtU/VjgyTP m/IEcN0j5Fxv5evPURNX/6CDI5JuEvlVwk/xE0IQQjSnSQoHDIDywbOyCyfae8wWRgep +2DgKwlOCTVFwGKCg0DYFH530pf28LYFfSZaEh/NqSRT8J/+Q1tjrG2syd51lkYKbnu9 sOcA== X-Gm-Message-State: ALoCoQnAncSpKtqHBrw5dQ2m+hyp40bPBEjZhk3AQSFX9spamnaMKpy8yWu0QYZ3+N+H7Uqp+S8s X-Received: by 10.42.107.201 with SMTP id e9mr81599icp.13.1398959398234; Thu, 01 May 2014 08:49:58 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.93.11 with SMTP id c11ls1030314qge.55.gmail; Thu, 01 May 2014 08:49:58 -0700 (PDT) X-Received: by 10.52.137.74 with SMTP id qg10mr374622vdb.61.1398959397985; Thu, 01 May 2014 08:49:57 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id kj3si6107724vdb.186.2014.05.01.08.49.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 01 May 2014 08:49:57 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id sa20so4118972veb.1 for ; Thu, 01 May 2014 08:49:57 -0700 (PDT) X-Received: by 10.52.72.4 with SMTP id z4mr366637vdu.71.1398959397692; Thu, 01 May 2014 08:49:57 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp33989vcb; Thu, 1 May 2014 08:49:57 -0700 (PDT) X-Received: by 10.66.146.170 with SMTP id td10mr22572429pab.105.1398959395609; Thu, 01 May 2014 08:49:55 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id to1si17435586pab.240.2014.05.01.08.49.55; Thu, 01 May 2014 08:49:55 -0700 (PDT) Received-SPF: none (google.com: linux-crypto-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754310AbaEAPty (ORCPT ); Thu, 1 May 2014 11:49:54 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:47133 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751009AbaEAPtu (ORCPT ); Thu, 1 May 2014 11:49:50 -0400 Received: by mail-wi0-f179.google.com with SMTP id bs8so951119wib.12 for ; Thu, 01 May 2014 08:49:49 -0700 (PDT) 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 Cc: catalin.marinas@arm.com, will.deacon@arm.com, steve.capper@linaro.org, Ard Biesheuvel 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> Sender: linux-crypto-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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