From patchwork Tue Dec 20 08:17:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolaus Voss X-Patchwork-Id: 34988 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2841593wrn; Tue, 20 Dec 2022 00:26:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf5wxyuprnkYyOnaQoQJv5AOW2a+rHHm6dwUwhVQ+QGl2FuxWtFM+OOFc2s8dpv09H+UyZAi X-Received: by 2002:a17:906:5f97:b0:7c0:e0d7:b73a with SMTP id a23-20020a1709065f9700b007c0e0d7b73amr40971195eju.68.1671524816178; Tue, 20 Dec 2022 00:26:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671524816; cv=none; d=google.com; s=arc-20160816; b=aCkkz9S2ZN4R/zVV0CXAwc5rsB18Z9DkGKicX0bnQQyd39Pyiv2eu+bw9+jzgrWp3l Yd7Kr4Hj+0PgAc0pu3DGp+kfIOTv1ABWxE9KW3MglNKS7qMmLi5ZZUAuQHASTJT7aXMD +0GU5kjx2cguvNJERq+ZbtUkCsHYvL5AEmn0Wfgsb9CtqvH1/S4eGJeFjNeoubHcivt8 BJ4je1reTEF9OS9eqavvyvYivxccuq9bKqCKwBDWy53NCDzkGubtmTMSj4khQE6qagL5 SrycpWQSbCfuLCmf0P0OR8qa/5Nlv80FzngRFfrlaRIMmKHZ/pa62iVDdG0uO4XCac+a Rxow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:message-id:subject:cc:to:from; bh=KxqTpbRry2e7W+ZgkT+ktWQZWvBm4/302YsxMGo+PvQ=; b=pejmVgyKGr3vVv7WNV3Er844iZ6FTTscLdgw7gXGHeKN8d6IPib42zYM7X6xtHvBdk cVGzEXuG/+pEPa/gkc74WC8vWSd2YY0+5/areCoYmNasPJ7Wf4jzLANwf6knXDvlIsEe +rG2R0v0BDpuKA56iFenbuNwFE5Pucw2ibvq6QXAboOihLeTM/YUZbGLZGA+E9YBOkud GCKgzk1EwrHGT+pEe1NuCJSRgZXMakob13PtOtHOT8/Vqxnel/ApinHCGsQiQuU76FH/ Yw0CACNRiV0rLY9ktDtOEHw6ClebOTM4FZxosNI89n1SzxI603VWS97XAYgK02hOS/UI T19A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=haag-streit.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv15-20020a17090760cf00b0078dcee0cf13si11127520ejc.561.2022.12.20.00.26.28; Tue, 20 Dec 2022 00:26:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=haag-streit.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233121AbiLTISD (ORCPT + 99 others); Tue, 20 Dec 2022 03:18:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbiLTISB (ORCPT ); Tue, 20 Dec 2022 03:18:01 -0500 Received: from mail.steuer-voss.de (mail.steuer-voss.de [85.183.69.95]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3508F1658E; Tue, 20 Dec 2022 00:17:57 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at mail.steuer-voss.de Received: by mail.steuer-voss.de (Postfix, from userid 1000) id 2D0183BDB; Tue, 20 Dec 2022 09:17:50 +0100 (CET) From: Nikolaus Voss To: "Horia Geanta" , Pankaj Gupta , Gaurav Jain , Herbert Xu , "David S. Miller" , Ahmad Fatoum , David Gstir , Steffen Trumtrar , Nikolaus Voss Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] crypto: caam: blob_gen.c: fix CAAM io mem access Message-Id: <20221220081750.2D0183BDB@mail.steuer-voss.de> Date: Tue, 20 Dec 2022 09:17:50 +0100 (CET) X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752720805571831141?= X-GMAIL-MSGID: =?utf-8?q?1752720805571831141?= IO memory access has to be done with accessors defined in caam/regs.h as there are little-endian architectures with a big-endian CAAM unit. Fixes: 6a83830f649a ("crypto: caam - warn if blob_gen key is insecure") Signed-off-by: Nikolaus Voss Reviewed-by: Ahmad Fatoum --- v2: added upstream commit ref and reviewed-by line drivers/crypto/caam/blob_gen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/caam/blob_gen.c b/drivers/crypto/caam/blob_gen.c index 1f65df4898478..f46b161d2cda6 100644 --- a/drivers/crypto/caam/blob_gen.c +++ b/drivers/crypto/caam/blob_gen.c @@ -104,7 +104,7 @@ int caam_process_blob(struct caam_blob_priv *priv, } ctrlpriv = dev_get_drvdata(jrdev->parent); - moo = FIELD_GET(CSTA_MOO, ioread32(&ctrlpriv->ctrl->perfmon.status)); + moo = FIELD_GET(CSTA_MOO, rd_reg32(&ctrlpriv->ctrl->perfmon.status)); if (moo != CSTA_MOO_SECURE && moo != CSTA_MOO_TRUSTED) dev_warn(jrdev, "using insecure test key, enable HAB to use unique device key!\n");