From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F009C433EF for ; Wed, 11 May 2022 09:21:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230000AbiEKJVv (ORCPT ); Wed, 11 May 2022 05:21:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239523AbiEKJVu (ORCPT ); Wed, 11 May 2022 05:21:50 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B23943EF3F for ; Wed, 11 May 2022 02:21:48 -0700 (PDT) Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=[127.0.0.1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1noiWz-0001tq-95; Wed, 11 May 2022 11:21:17 +0200 Message-ID: Date: Wed, 11 May 2022 11:21:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [EXT] [PATCH v9 3/7] crypto: caam - determine whether CAAM supports blob encap/decap Content-Language: en-US To: Pankaj Gupta , Horia Geanta , Herbert Xu , "David S. Miller" Cc: "kernel@pengutronix.de" , Michael Walle , James Bottomley , Jarkko Sakkinen , Mimi Zohar , David Howells , James Morris , Eric Biggers , "Serge E. Hallyn" , Jan Luebbe , David Gstir , Richard Weinberger , Franck Lenormand , Matthias Schiffer , Sumit Garg , "linux-integrity@vger.kernel.org" , "keyrings@vger.kernel.org" , "linux-crypto@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-security-module@vger.kernel.org" References: <20220506062553.1068296-1-a.fatoum@pengutronix.de> <20220506062553.1068296-4-a.fatoum@pengutronix.de> <5e7c0b3c9bc285f1cf9f7b20f055aa376e1688cc.camel@pengutronix.de> From: Ahmad Fatoum In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:900:1d::77 X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hello Pankaj, On 11.05.22 11:16, Pankaj Gupta wrote: >> -----Original Message----- >> From: Ahmad Fatoum >>>> + if (ctrlpriv->era < 10) { >>>> rng_vid = (rd_reg32(&ctrl->perfmon.cha_id_ls) & >>>> CHA_ID_LS_RNG_MASK) >> >>>> CHA_ID_LS_RNG_SHIFT; >>> >>> Check for AES CHAs for Era < 10, should be added. >> >> Do I need this? I only do this check for Era >= 10, because apparently there are >> Layerscape non-E processors that indicate BLOB support via CTPR_LS_BLOB, but >> fail at runtime. Are there any Era < 10 SoCs that are similarly broken? >> > > For non-E variants, it might happen that Blob protocol is enabled, but number of AES CHA are zero. Do you know any SoC where this is the case? (i.e. era < 10 && CTPR_LS_BLOB && AES_CHA == 0) > If the output of below expression is > 0, then only blob_present should be marked present or true. > For era > 10, you handled. But for era < 10, please add the below code. > > (rd_reg32(&priv->ctrl->perfmon.cha_num_ls) & > CHA_ID_LS_AES_MASK) >> CHA_ID_LS_AES_SHIFT; Sorry, I am not fond of adding quirk handling for Hardware that might not even exist. Cheers, Ahmad > >> Cheers, >> Ahmad > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |