Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1332411ybt; Tue, 7 Jul 2020 13:06:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwn8vjHolLx3CuVoTzP2Ih9WBWT/WID62zb7dVoGbhwq6MXAE8q8RFRHKF97Ke15apvK3Xe X-Received: by 2002:a50:afa2:: with SMTP id h31mr10469930edd.303.1594152419653; Tue, 07 Jul 2020 13:06:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1594152419; cv=pass; d=google.com; s=arc-20160816; b=mNAZephyzZkVWFLTCcAa6wdYdjzK0ife+cxO4CvG1jjPJfTYJ9YrqyGcQ1QaXAsfDf F/0IrqmPLetVilSOcnR8Hdn1iRjjyYY4lngROSiEul/qmLeoF22dw+mqasqjsXVbQcqE ZHsPBR+YGMehDNn3Hhn+8x34HadVNe8D65x1OQHdOjE+1Bu8UE6Wf3bq2mcqK9I7AzNZ WCDxq99yNA6cCh9jfczWTGfKFHJPSfvRnfQFCiuLsRgKOWZfu3JZp7a8o7xe7gQz6Dd9 AW1mVehAVJ7Hmy/pJEnpeAI35UyQBWDa0nt2EgZRuB9euXyqbifc0otDrv/xK6JWm/Mv rqTA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:in-reply-to :content-disposition:references:message-id:subject:cc:to:from:date :dkim-signature; bh=RQWNGQ2dJvXojFQN6qUP29zvrHH/0lVt3ygOEfkEEUI=; b=uRya1vDyiNfqta2fBfmmkXdNuluIIzM3kSXSMutDI6J97vQ4IpSbkYBb0IuJshkWkT VIgwPIsWHHneTKNmbQFylpkKgxK0jERc7xY9qHeSlDOgsbUhH/N2J5hg6wU0CSUNyqtU IF4H6qs4J9iJMdvnjHzARrx3ZWNZyZolZTJyoDv5ZgXUGX+Ab5AUtvSGyL72C4mT5BMf KJGb08QMU6Jb526tJLlIo09bOJJpNx95KB0frJ0HyYth/DictR1h8JwCyUyPIrO0NbJY nGYsN5VHtZWs4D0xvJgnpB84uBEXZ15GcoBTSG+bAMKUtKytLplmbeaj/Yzehu/pb/7y hjVA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=M0RiF84r; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 18si15195723edv.191.2020.07.07.13.06.34; Tue, 07 Jul 2020 13:06:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=M0RiF84r; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728628AbgGGUE3 (ORCPT + 99 others); Tue, 7 Jul 2020 16:04:29 -0400 Received: from mail-eopbgr770043.outbound.protection.outlook.com ([40.107.77.43]:12455 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727895AbgGGUE3 (ORCPT ); Tue, 7 Jul 2020 16:04:29 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A3J1E3gxEDrBoVdt3rs0YqDl0m7JrbipgUQ38EFkLOurh5HzHsRxbuIqHtJrCgBNJJk886LBxl5u1k/9FThjMs4sUAjYF9GRx6Zf1QKyuJrLDTktiMhhminUSBSYXwko1UAxQo7NCLkpzS1Rrb6Jvd2cQhaLn+oND4sdOzge+Lo+Ebja72JoCPy6RHGNOgt6yz4TDDLNmOD3r+jCP24h5zRprwXvW/3964Q955xpoZrIzkK8qGjkKQufiBPeFmoUbkWCJJMiLaxQpEpbiI5OKSwSzBqGwaBNdos/6hRoZ9oH7eorIR/LuduU9hDJVbTllMjxVOgFL1+KImNNO3Qyaw== 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-SenderADCheck; bh=RQWNGQ2dJvXojFQN6qUP29zvrHH/0lVt3ygOEfkEEUI=; b=M6vy+BU4YQaUPgJo3Has8tz8XWmdfEdXGVsbEthavnaygNkkaCc120tPJcnUNcduEp1qzdf/QchnOtvG73PN++ilWMRNFSetNncao2s3CFhgk0dycowTOUfHd/FZFqNmUU1lr/eCqVtsz9ASfOAJuuzsliT3GOdaQ8EXRC9VyNnjGP2DeRBEqWIvyC+yy2ooRdQnTyci9boxVpaM50VIckZSziLxF/wr8w3Qx/Z567AyX3zD20vBRrDU8zonZEtPHE7s83UDpYVBL2dkRiOb5YXz66FUv9DkueYqsLDcaUr0TNW+PLilv8/wY6KM/lQw8zxobH4MjJVmgnwXElhC/A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RQWNGQ2dJvXojFQN6qUP29zvrHH/0lVt3ygOEfkEEUI=; b=M0RiF84r9WoS0HaFb7IsUOm10qWfCA5d2PrAGxQPk0IwYGm6Dwj07VelDMsmWxr9ueRcdA/+CajW6Ryn+2Nut7KeyI905sJR7jsZixDMQDmLaXbtBVH6c6qgbegtgHFiDzaaKQoqR0oP4dhkOTdXf98IIVKPKionSVBJp5vsY2k= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=amd.com; Received: from SN1PR12MB2590.namprd12.prod.outlook.com (2603:10b6:802:2e::17) by SA0PR12MB4496.namprd12.prod.outlook.com (2603:10b6:806:9b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.23; Tue, 7 Jul 2020 20:04:26 +0000 Received: from SN1PR12MB2590.namprd12.prod.outlook.com ([fe80::c179:ec27:4476:8e05]) by SN1PR12MB2590.namprd12.prod.outlook.com ([fe80::c179:ec27:4476:8e05%7]) with mapi id 15.20.3153.029; Tue, 7 Jul 2020 20:04:26 +0000 Date: Tue, 7 Jul 2020 15:04:18 -0500 From: John Allen To: Ard Biesheuvel Cc: linux-crypto@vger.kernel.org, Corentin Labbe , Corentin Labbe , Herbert Xu , "David S. Miller" , Maxime Ripard , Chen-Yu Tsai , Tom Lendacky , Ayush Sawal , Vinay Kumar Yadav , Rohit Maheshwari , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Jamie Iles , Eric Biggers , Tero Kristo , Matthias Brugger , Horia =?utf-8?Q?Geant=C4=83?= , linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-amlogic@lists.infradead.org Subject: Re: [PATCH v4 07/13] crypto: ccp - permit asynchronous skcipher as fallback Message-ID: <20200707200348.GA127522@mojo.amd.com> References: <20200707063203.5018-1-ardb@kernel.org> <20200707063203.5018-8-ardb@kernel.org> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200707063203.5018-8-ardb@kernel.org> X-ClientProxiedBy: SN2PR01CA0051.prod.exchangelabs.com (2603:10b6:800::19) To SN1PR12MB2590.namprd12.prod.outlook.com (2603:10b6:802:2e::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mojo.amd.com (165.204.77.1) by SN2PR01CA0051.prod.exchangelabs.com (2603:10b6:800::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.23 via Frontend Transport; Tue, 7 Jul 2020 20:04:25 +0000 X-Originating-IP: [165.204.77.1] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b393c32a-c880-47e9-8314-08d822b0f300 X-MS-TrafficTypeDiagnostic: SA0PR12MB4496: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-Forefront-PRVS: 0457F11EAF X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dTwtxGCgVESod0ofTo3TKbYK9RkbqXd+92ipVnWyU6aDNm/wv4Ejq6qRBMjo1DQWKZ5Z+NxUILgqmerv6oqqL6HkY8EKFPqqx/CJi5r2xHSC81SmzBouWIvC3sT/ryaU1GbuAzdSnlehlFPd3ZAWvTLvvFlmyDplz1d3ECopqaTF3qGmCGmndzJQ+P5xSCC4o/RiEMkuN5AQsquS6jRdA28wr1vthNzJjhmcjg2VHVVbw4nwHFwbRoIeomrU9XFX2e/XvmId91gh7isbWFziFM07c1X4g4q5xyfFR58vn6Iu4AgDfExQgYgoij1Zh1uY X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN1PR12MB2590.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(39860400002)(396003)(376002)(366004)(346002)(136003)(44832011)(83380400001)(6666004)(316002)(956004)(54906003)(66946007)(66556008)(66476007)(7416002)(4326008)(6916009)(478600001)(55016002)(8676002)(2906002)(52116002)(7696005)(5660300002)(33656002)(1076003)(8936002)(26005)(186003)(16526019)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: YeGb2stMMcMRTzsP7vfzpcpVwMdaSBN/IHzlOoGT089aC/PJIeIpMLWcymQeEY5cAcn/aKNBCodZQt/OslIGZbWQlOxMYZHlBqlYsotojHvj8qS10ItkfvebGx0Mt/tNJURku69/VqM0eth89LVmhgGvpPt8k2/bNuvGwYGKq4DFnASjTaKgNws3IldTbDXX+wjKUUDSP9zUHNMBET/z6eVqKnqhljyI0D4FxbALq1Zjv2CuagdtNi66i1mqm63anadT4kpPt/qm7tli3sbb3IBxV0T7WbknmP8PBSUMWJq36wCw5yb2DPQOqOYTVn5knM2+rBWYXyEi8IKStLfrLdcKcgH48NBoCjICzBN6JTqNw5F+ZZa70Bdh/NmizfFgGWoQg7Gt9SSamudyfEnUMkZ8f4PwjMD+1LJh/xlv9IdFsNMKKUs1+UD7R2yiYLE8U5eCvUVkmoRFoa34qfD2b/kN5gFRmQexoFhaCoklokw= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: b393c32a-c880-47e9-8314-08d822b0f300 X-MS-Exchange-CrossTenant-AuthSource: SN1PR12MB2590.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2020 20:04:26.3218 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: IW32qZl7sQGZLPjTFnIkn89LCajYPQBiho9LKjrkka+RWllG4/o/V9a7bdu1S/2Q3wmlMulhYMs+ROcBfCc2yA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4496 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Jul 07, 2020 at 09:31:57AM +0300, Ard Biesheuvel wrote: > Even though the ccp driver implements an asynchronous version of xts(aes), > the fallback it allocates is required to be synchronous. Given that SIMD > based software implementations are usually asynchronous as well, even > though they rarely complete asynchronously (this typically only happens > in cases where the request was made from softirq context, while SIMD was > already in use in the task context that it interrupted), these > implementations are disregarded, and either the generic C version or > another table based version implemented in assembler is selected instead. > > Since falling back to synchronous AES is not only a performance issue, but > potentially a security issue as well (due to the fact that table based AES > is not time invariant), let's fix this, by allocating an ordinary skcipher > as the fallback, and invoke it with the completion routine that was given > to the outer request. > > Signed-off-by: Ard Biesheuvel Acked-by: John Allen