From patchwork Mon Jun 8 23:30:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 6568631 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 18E98C0020 for ; Mon, 8 Jun 2015 23:30:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 45F9D2042B for ; Mon, 8 Jun 2015 23:30:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5C92220382 for ; Mon, 8 Jun 2015 23:30:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932182AbbFHXaa (ORCPT ); Mon, 8 Jun 2015 19:30:30 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:33438 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932149AbbFHXa0 (ORCPT ); Mon, 8 Jun 2015 19:30:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=XLgxORwoE4OZy7eHTmxTNjWVMyWe6c9/uWvvKOdAQQ8=; b=BoB8mRIrY44XQI60w6PlAjDAge3R3mrg+LBGfvgvAuWNxPHcco1sCzzWf/ekHKuQnhEKXIeN1Vb4uliTnM6dOEfQkpKOnhgNdfkf9kT+QUIFMTV7AP7tDnr5m3Tqnelt6wqVu0aw//NAuWjd9fFM1FUiHzS2sY19cb68pTHjRe8=; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:32985 helo=server.roeck-us.net) by bh-25.webhostbox.net with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.85) (envelope-from ) id 1Z26Ud-000l3M-Br; Mon, 08 Jun 2015 23:30:11 +0000 Message-ID: <55762581.6070809@roeck-us.net> Date: Mon, 08 Jun 2015 16:30:09 -0700 From: Guenter Roeck User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Stephan Mueller CC: Andy Shevchenko , Jim Davis , Stephen Rothwell , linux-next , linux-kernel , Herbert Xu , "David S. Miller" , linux-crypto Subject: Re: randconfig build error with next-20150529, in crypto/jitterentropy.c References: <20150608195412.GA2792@roeck-us.net> <2802354.BKbRJQHDPP@tauon.atsec.com> In-Reply-To: <2802354.BKbRJQHDPP@tauon.atsec.com> X-Authenticated_sender: linux@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: linux@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_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 On 06/08/2015 03:36 PM, Stephan Mueller wrote: > Am Monday 08 June 2015, 12:54:12 schrieb Guenter Roeck: > > Hi Guenter, > > Thanks for the note. > > ... >> >> --- >> >> openrisc:defconfig: >> >> In file included from ./arch/openrisc/include/asm/timex.h:23:0, >> ... >> from crypto/jitterentropy.c:52: >> ./arch/openrisc/include/asm/spr.h: In function 'jent_loop_shuffle': >> ./arch/openrisc/include/asm/spr.h:30:2: warning: asm operand 1 probably >> doesn't match constraints >> ./arch/openrisc/include/asm/spr.h:30:2: error: impossible constraint in 'asm' > > I received this one also before. But that seems to be an error on the OpenRISC > platform as the random_get_entropy() function or the get_cycles function is > not implemented as defined. > > The crypto code uses the following which triggers the issue: > > __u64 tmp = 0; > > tmp = random_get_entropy(); > > That one seems to be an appropriate use of random_get_entropy() which on > almost all arches is an alias for get_cycles(). Yes and no. I suspect it may have something to do with the compiler options. The code compiles with the following patch applied. --- --- get_cycles is implemented as static inline which executes mfspr(SPR_TTCR). SPR_TTCR is a constant. Normally that information seems to be passed on, but not when get_cycles() is compiled through jitterentropy. Any idea what might cause this ? Thanks, Guenter -- 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/openrisc/include/asm/spr.h b/arch/openrisc/include/asm/spr.h index 1cccb42dd477..373532cc41f4 100644 --- a/arch/openrisc/include/asm/spr.h +++ b/arch/openrisc/include/asm/spr.h @@ -24,7 +24,7 @@ "l.mtspr %0,%1,%2" \ : : "r" (_off), "r" (_val), "K" (_spr)) -static inline unsigned long mfspr(unsigned long add) +static inline unsigned long mfspr(const unsigned long add) { unsigned long ret; __asm__ __volatile__ ("l.mfspr %0,r0,%1" : "=r" (ret) : "K" (add));