From patchwork Mon Dec 5 07:58:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolaus Voss X-Patchwork-Id: 29579 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2120947wrr; Mon, 5 Dec 2022 00:05:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf73VX7NWelkGGAq2zkXUbAEVrcTOQG1w5pN0Aa9YVT1/5GADJqW2EbKJHYVZRJah9sbvWj/ X-Received: by 2002:a17:906:ee2:b0:78d:3f96:b7aa with SMTP id x2-20020a1709060ee200b0078d3f96b7aamr53765743eji.74.1670227537555; Mon, 05 Dec 2022 00:05:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670227537; cv=none; d=google.com; s=arc-20160816; b=YC1npvtJzk8GOJNINPj+/kSBT+WltJswca6hY+CqGBvtdhML84oPmxnubZKLuEuPvW regpwX9g348PJ8qlbSe4BSiPMO5xl4U/Ly/Grptdvx8VLMLTG8HAUzYWCmYBOhRFEMfW EH52GIi6AUVUWov4Djz8RXX/1wSkntJKmzSqYfkxXBxFgnhIoAnXJIzlDGhwtn9XtZNQ ZSZt6jo03mbnyXUYGlRVbp9urKC8W9i4eMbHlQs+LWQ64a55m7NHeJHKhv0siqIOfT1K aAIdKkK9aN795bEEqpqJVckbTkQVThcc13q6eI1Ry6B5YWBumDYTnFbqYwyFBPCputu+ z5+A== 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=1meAFBmICfiUcTikbaPbrbBJs8+Poh6Xwe+SM2Z+zs4=; b=nBj73IaBgaDw2PFBCsw/RO+P9/TXiU9v4zdHuFqdb3TNzeEOa7ql+5eGfpTpXbAYo7 GOZ4no/oZ1OlGcRbDgQXczn9KdR3duB/6OVmFZzLWcoyZhD0V+04nDkGfrnwzZS9AXKR MWKeQBbCnLZW/l5uWMrXS/Z8RmJFBuVhuvAkEAYFvpA+3S4T8vMUDOqP8LAB5/33wq0z 39QHTrpcMqDtqv4DLfXxSagppFV7atSQwI2OBetdIRIe/ykb9BXIoXpCxcNvqWep43oC ChV7etdjQvPgPkJyCmiR3mzFVvoWJjACtIss6nhsCo/PJ4OvaVZ3EU4PQhRQppEh9pDG HLAA== 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 g10-20020a056402090a00b0044f1b7b8713si12023613edz.281.2022.12.05.00.05.14; Mon, 05 Dec 2022 00:05:37 -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 S231816AbiLEH6w (ORCPT + 99 others); Mon, 5 Dec 2022 02:58:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231186AbiLEH6u (ORCPT ); Mon, 5 Dec 2022 02:58:50 -0500 Received: from mail.steuer-voss.de (mail.steuer-voss.de [85.183.69.95]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34E05101C4; Sun, 4 Dec 2022 23:58:46 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at mail.steuer-voss.de Received: by mail.steuer-voss.de (Postfix, from userid 1000) id 050FF27BD; Mon, 5 Dec 2022 08:58:39 +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] crypto: caam: blob_gen.c: fix CAAM io mem access Message-Id: <20221205075839.050FF27BD@mail.steuer-voss.de> Date: Mon, 5 Dec 2022 08:58:39 +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?1751360510463430693?= X-GMAIL-MSGID: =?utf-8?q?1751360510463430693?= 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 ("crypto: caam: blob_gen.c: warn if key is insecure") Signed-off-by: Nikolaus Voss Reviewed-by: Ahmad Fatoum --- 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 1f65df489847..f46b161d2cda 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");