From patchwork Wed Apr 5 09:07:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Meenakshi Aggarwal X-Patchwork-Id: 670514 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 21BDAC76188 for ; Wed, 5 Apr 2023 09:08:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237283AbjDEJI2 (ORCPT ); Wed, 5 Apr 2023 05:08:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230059AbjDEJI1 (ORCPT ); Wed, 5 Apr 2023 05:08:27 -0400 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2074.outbound.protection.outlook.com [40.107.15.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED74746B4; Wed, 5 Apr 2023 02:08:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aKR/vqdsZNWU15xXYqmhkea1bKiAs+hv6rZ2sJaX6gLJFrpo/jS3FuDc6VASnqmeURm8a2lmNjqk61L56a99Gau7iyEiLcUeNUi5kK/7e+a0zkg/Gwk5iUievhAZW2RwM389PP57iLDah8y/cAp9a5qQ7lERX6+l7W0Mm1uPM4ywX/hMJQxJnP+CqKw9ATSeqgDDUfHvQ551JfcIMnAgzgCu/mUWtUWVj05phjCHQiFQf5VkKhvgHdPizc+i8XpiNSYng97mbZ9gBYhxouIMJNSPYoVGIm2wBMUbG9vnVY2VAz+zjMuElXALBoQa7uVB++YMDQvU1oceXlh4dOy4zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=j7yUjWgkB0NAQF3UETfqSD2xW+qLQSy5RTB4DQXmyE8=; b=UypYeAFGInVc68tfb5txS+j/HrBBJeRsaq6LQbYS1zAwJwf/uhlsYpqIboaQXw6J8xSC57OjaMNY4qA7klSFyJN60Mn7ISCjKefUeQ5dDPyai70YyHEQMKaXU6jO+oWXhTL9M5mwzKQCsTJZNDz33ZFSH3OWVhD4wk3owB1WiMG0gFMarF/5ay5ssGx8ubNx29M6Dvh0koVCtX1U4H91+doiv5wr668TrHnNI6YsEoWUr4y685LtZ2f+ZMBUWVrXFIBMI0zvt/mOrrzWt7vv7AYJyc1lVwSz0JAAHlMi7/TGvszFO8GXBXI7dLbOYwPjQvj9zbZ08VWMl+OIb1NXlQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j7yUjWgkB0NAQF3UETfqSD2xW+qLQSy5RTB4DQXmyE8=; b=AI5wBOEqfQ0lAxiQu3UpbXs0BuqzGqX4nItZtdcuMyabZjdVNpEAJoemdbvBkzFekOs8Yz2wk5EwH0YVIkbjmthS8hTVy7QvZSnalMhjw3J1LHXY0g/MAgmI8rJNu97dgUXhcyiiuCcDAExMI+t7uuJvvv+Wz29kXrSbdlzh4yc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU0PR04MB9563.eurprd04.prod.outlook.com (2603:10a6:10:314::7) by AS1PR04MB9285.eurprd04.prod.outlook.com (2603:10a6:20b:4df::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.35; Wed, 5 Apr 2023 09:08:14 +0000 Received: from DU0PR04MB9563.eurprd04.prod.outlook.com ([fe80::dca6:e1e8:f142:2bc5]) by DU0PR04MB9563.eurprd04.prod.outlook.com ([fe80::dca6:e1e8:f142:2bc5%8]) with mapi id 15.20.6254.033; Wed, 5 Apr 2023 09:08:14 +0000 From: meenakshi.aggarwal@nxp.com To: horia.geanta@nxp.com, V.sethi@nxp.com, pankaj.gupta@nxp.com, gaurav.jain@nxp.com, herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Meenakshi Aggarwal Subject: [PATCH v3 0/2] No access to CAAM page 0 registers Date: Wed, 5 Apr 2023 11:07:50 +0200 Message-Id: <20230405090752.1708455-1-meenakshi.aggarwal@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230322061716.3195841-3-meenakshi.aggarwal@nxp.com> References: <20230322061716.3195841-3-meenakshi.aggarwal@nxp.com> X-ClientProxiedBy: AM8P251CA0029.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:21b::34) To DU0PR04MB9563.eurprd04.prod.outlook.com (2603:10a6:10:314::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9563:EE_|AS1PR04MB9285:EE_ X-MS-Office365-Filtering-Correlation-Id: 0d1c16de-24bb-43e4-c9bc-08db35b54933 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dhpcV0tojm8RAVXAUjJ5x9eWxtuuz6Ne7K//TzTN+pmCHFuQ0ZXmR1OLIcpfjj+Zkb3z7yuGUGdX6nSDR9oE/jwnCTGPxr0U5pc3m9mRH0RoTcuZyxg8jXTNJOHR7c9yX2U7hCPmrAfIfnRXFC++J/JGPg4KUI9UL2BmCY579nj2t6QMmosxo1qJXb3O8MufDf0DZPjBL2ctlsQsGMyvHZaMkGCa/1dsGbHp5WvVy900eHqZi3u9jHm9wFSds1zcR/VK4FV+F2OIjknaBKvocyvQB4pm7iljo4i2Icq5+dmg5+G54IYlUXptrGMMkOXm6QBCIw1Fil6oRNbCR11ce5y1IlIuDqR/r6K8ZxG9IG1Qyqf39ueRZJKJ/Sj1ccBh5hr7fKkcD+UBUbkiJqvsDYe8w+qaIaJjFQ0bj+BFeyMlCLxnfLQ8OZRBtBYIaoXDuxssjwg4v1RPbf2IJc2df8FnXmRP4v7kr2P4bXLCQ2mwodiJsYZEjGiNIHw0bSMipcyEf/WbxIr1uZxgFeKvQKhscZMNPFeI6hNhxolmI3OE+x8s0yIa1JZv0+VBfe8t5WGgwKdOhM4kTsDa54k6aSW9LaZrx5NVzsN/jXcQBMwVQptcBGvdmWteywMJO1qw X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0PR04MB9563.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(376002)(346002)(366004)(396003)(39860400002)(136003)(451199021)(6486002)(38350700002)(1076003)(2616005)(6512007)(9686003)(6666004)(4743002)(6506007)(186003)(38100700002)(8936002)(26005)(2906002)(5660300002)(83380400001)(478600001)(36756003)(66476007)(66946007)(66556008)(41300700001)(8676002)(86362001)(4326008)(316002)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RQeT3Ttbkc+aqGKCRwOETCdRfRBXIF62an5+4x9ZMZ7IcA80osqmT1Im3ikduyMAceQFntV7LE9tLy10bOnlyx4rxzxJja7h4BfnWHM+aV0EvmqKaeAO2XsOd+6FZCDTFjfji0gtkllbU1xpvoKbVES6AYhiEEwjTXkh5zNBCxsWMWUKMKT9RW09Kmh09rrBn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qQvgg8p6dvufrdEiAss1VwQNt7rPAD7pCk4SABMZs8L3vckr7e3R3E031pCIHJLP3+XkClRjqgILrA1nun1+ZwzbVikYbK6sGp8Am49+EzeQOAgDDN9oECfytL/G2lXlBny1Bi/m1CxtcLLeYwPl7I5kMXACTiqZewI+9CFOYWNnYKLJOcP/lHgRX8YwyyO4VZu58mxCeWWDO5QfKLGSmovfiB1O1wxUJDIn/fPhjzJa11ZY0Ou3fbhIHYN5bejfeGCKMdLVvp/u2cU0RLloW+l3RG+MLLyhmsCk38mfA5uChGhqHSwvnZkXLaLBCPwXNbKVaDPqfYGwIeKr1vfmjHdHg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0d1c16de-24bb-43e4-c9bc-08db35b54933 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9563.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2023 09:08:13.9809 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1ACw9vumuaZiihiizTeMRDega7alEMHbytrwgmMH9GbbvKMby8oIAJGMBA3jm2W6J9YoloFVgrp3o5s3XBwwQwGH7FZZQPtEEEWHGLDsq/U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9285 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Meenakshi Aggarwal This series includes patches to reduce access to page 0 registers of CAAM from non-secure world. In non-secure world, access to page 0 registers of CAAM is forbidden, so we are using alias registers available in Job Ring's register address space. Allow CAAM's page 0 access to OPTEE, as OPTEE runs in secure world. changes in v3: - Fixed compile time warnings reported by kernel test robot - incorporated review comments changes in v2: - Fixed compile time warnings coming with compilation flag W=1 Horia GeantA (2): crypto: caam - reduce page 0 regs access to minimum crypto: caam - OP-TEE firmware support drivers/crypto/caam/caamalg.c | 21 +++---- drivers/crypto/caam/caamhash.c | 10 ++-- drivers/crypto/caam/caampkc.c | 6 +- drivers/crypto/caam/caamrng.c | 6 +- drivers/crypto/caam/ctrl.c | 106 +++++++++++++++++++++++---------- drivers/crypto/caam/debugfs.c | 12 ++-- drivers/crypto/caam/debugfs.h | 7 ++- drivers/crypto/caam/intern.h | 1 + 8 files changed, 110 insertions(+), 59 deletions(-) Reviewed-by: Gaurav Jain