From patchwork Mon Dec 16 21:04:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 3356901 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 156FEC0D4A for ; Mon, 16 Dec 2013 21:06:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 431C72024D for ; Mon, 16 Dec 2013 21:06:55 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (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 4AC5D2024C for ; Mon, 16 Dec 2013 21:06:54 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VsfMZ-00024w-Iu; Mon, 16 Dec 2013 21:06:03 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VsfMO-0006So-V3; Mon, 16 Dec 2013 21:05:52 +0000 Received: from mail-wg0-f47.google.com ([74.125.82.47]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VsfLz-0006P9-BS for linux-arm-kernel@lists.infradead.org; Mon, 16 Dec 2013 21:05:29 +0000 Received: by mail-wg0-f47.google.com with SMTP id n12so5220351wgh.14 for ; Mon, 16 Dec 2013 13:05:05 -0800 (PST) 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=LTnNYNv4wmmyhy3qUoNT9osxk1XWTaHcj4K+qbcVBqI=; b=AWy3iKlwNChFkZJ+rB7kwNVra8xrIDisy26hanaUMeZZCReUsXljYvt3bKSJXjm+7J qMK7aAlb83/9Lj5I45v7JJ44XFJbYlBx3CpXtyxJnr/LBohkM43ghWVxI+Adr+cXEsML CsRcG7OKhR+4u1s70vHIjI1IKfX2/C/akpFGGGldOSZN9sQRHM4oVqC2xrvXjKCF1v62 W8PpHa2zD4Q5CLJgLR1fJYO+0Oy9m1AIv35aEyp61+pVcQ4cQca41cnPDw42SUIeBkWp t0hNDzwUyS04py8HBGNsK7sPoKHktl+ek6efc4tZTCARKLAXSplzmpiYS67OzZp4Sxrp PFHQ== X-Gm-Message-State: ALoCoQkTv5Cli1rCDrdZzVkxUyIEREgluFFAbxpxNSdG2JMihy45CvSXDCH/O8XXzzeDEvtzT1+C X-Received: by 10.180.77.49 with SMTP id p17mr15359908wiw.30.1387227905667; Mon, 16 Dec 2013 13:05:05 -0800 (PST) Received: from localhost.localdomain (82-169-5-66.ip.telfort.nl. [82.169.5.66]) by mx.google.com with ESMTPSA id fj8sm46381851wib.1.2013.12.16.13.05.03 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Dec 2013 13:05:04 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux@arm.linux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com, steve.capper@linaro.org Subject: [PATCH 3/4] ARM: allocate hwcaps bits for v8 crypto extensions Date: Mon, 16 Dec 2013 22:04:37 +0100 Message-Id: <1387227878-30438-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1387227878-30438-1-git-send-email-ard.biesheuvel@linaro.org> References: <1387227878-30438-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131216_160527_563282_D2642B17 X-CRM114-Status: GOOD ( 10.94 ) X-Spam-Score: -2.6 (--) Cc: 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=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 ARM binaries running under an arm64 kernel are able to use the special 32 bit versions of the v8 Crypto Extensions. Even if the ARM port itself does not cover systems with such capabilities, the allocation of 32-bit hwcaps bits should be aligned between ARM and arm64 so a 32-bit userland does not need to care about the difference. This patch allocates bits 22-26 for the Crypto Extensions AES, PMULL.64, SHA1, SHA2 and CRC32 respectively. Signed-off-by: Ard Biesheuvel --- arch/arm/include/uapi/asm/hwcap.h | 5 +++++ arch/arm/kernel/setup.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/arch/arm/include/uapi/asm/hwcap.h b/arch/arm/include/uapi/asm/hwcap.h index 7dcc10d..0726024 100644 --- a/arch/arm/include/uapi/asm/hwcap.h +++ b/arch/arm/include/uapi/asm/hwcap.h @@ -27,5 +27,10 @@ #define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT) #define HWCAP_LPAE (1 << 20) #define HWCAP_EVTSTRM (1 << 21) +#define HWCAP_AES (1 << 22) +#define HWCAP_PMULL (1 << 23) +#define HWCAP_SHA1 (1 << 24) +#define HWCAP_SHA2 (1 << 25) +#define HWCAP_CRC32 (1 << 26) #endif /* _UAPI__ASMARM_HWCAP_H */ diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 6a1b8a8..57e6b5e 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -990,6 +990,11 @@ static const char *hwcap_str[] = { "vfpd32", "lpae", "evtstrm", + "aes", + "pmull", + "sha1", + "sha2", + "crc32", NULL };