Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3538017ioo; Mon, 30 May 2022 04:29:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnAR2tn0O4yHahYcKR2J6El6oDuEO2fqpOfmPfKd2Yeu5zTMh+7RHGd+/1QPtKhCMtEtjE X-Received: by 2002:a05:6402:27cd:b0:42b:5ba8:f744 with SMTP id c13-20020a05640227cd00b0042b5ba8f744mr42038366ede.81.1653910157186; Mon, 30 May 2022 04:29:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653910157; cv=none; d=google.com; s=arc-20160816; b=Zp0//Rxx0pVesVTt3kCpJaiEZvMMophyboQ+Ro8xEqZfRqyktT2Ue9PdF6zjSS0m8p HOYAjcRadXxWkSWGJRSWv2+WP/Tgk/RcGgaUrH6ECtrzWydijrNJn5W5snHssfcpkS5m g8WQGR88QLta7J6ZgzcylDQpEK/qnnnHtQqnJK0/nJuJTk2Xp7SHi07Tu3O+DtptZhza mbQl8rICN1wtpVH0BR43FJvz9Wk4mspZmb2l7E8vV61oIRsgfy25l/gI7tYREN7GuaOY u98CEt68Rp81rCDogxmuOgN3Ln7kHrALwe0VX9FmrJ5MoFmgxJDjkE7Yfes29/RzUu4t 65Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=DIKH/SxLXBFN9FQpLi6AQ3VZfE0wmY42EIk8jU5/hyM=; b=QsG5ESWULonqJiKknrR3J+g+9529Hhte5SHvNYodqFbecpsjR0aaVC7ImZTM236WCW /N2cPX/htBJCPhjVjKaORr4lLOSiDmVMbbPwhsTg9cN0m15+0c/RevJPsDTKQbnpoCAm Pjr/wgD+y5otggxJU+eKjxZ0FYY+pU+MKn/f29uvcFUa2AkRBDUty0dJt6TbvnbpFu4O yVuGivBx0rTo6pdymQceXJAb4fRxX/G5NV7m7iIhpLBRrQYuFhaoNWI3aiL5L+awCnSt CTvz2i/iBaeCkgmPnkg5F3fhkjTLxl9Pog/U8cWlSeCFpS4EgetH/Hc3Chg3T22atD83 nzHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FJWwmKAo; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z19-20020a05640240d300b0042ad03b5aacsi6501477edb.5.2022.05.30.04.28.31; Mon, 30 May 2022 04:29:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FJWwmKAo; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231576AbiE3KJV (ORCPT + 99 others); Mon, 30 May 2022 06:09:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235095AbiE3KJU (ORCPT ); Mon, 30 May 2022 06:09:20 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 587CA7B9CA; Mon, 30 May 2022 03:09:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 12E20B80CEE; Mon, 30 May 2022 10:09:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BFA09C34119; Mon, 30 May 2022 10:09:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653905356; bh=/kppvhYwD8/XAUtnmJGkTh0/Ss6kFj/Di0BL20r+ByY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=FJWwmKAoz1OhR0fCXaw00w8fpI0D5h7Kf9X+efPrrCEfyMERp9hKgiUrJosKGQitv Vytjn5kzWtH/P8LCemSknMl+TzlBPTf8NLWRxki0Ax406pk05vMK3XS4yOLFhlmrP9 kT/9NExxMXxolh/idTx4hsJYae4PHtqR23Q+V8zSuRIw/fXjhkDek8ZSezuf8rvtwW fAzUR1/z1tNvy7Xj+2xIoirIHAuO0zGXWLWffCb9AH1ZJKYagw5++jDVJOSE8SqKFz zJ+qKBIVcC5EY6UtT0qolpuQqng4eczB3h5CJmd2yyrS+4VoWdS0tYpuUhEdnIYnfw tFGFa8WI1UWbw== Received: by mail-ot1-f43.google.com with SMTP id e11-20020a9d6e0b000000b0060afcbafa80so7406146otr.3; Mon, 30 May 2022 03:09:16 -0700 (PDT) X-Gm-Message-State: AOAM531SnS3dnRwh1/wMhThx3QKXH9f3X8fb+7ekiiPe8ocq/QUEU9e8 K+ztaQvkA6qPDsT+oLI3LTfrw2lexZc9VOLXIAQ= X-Received: by 2002:a9d:76d5:0:b0:60b:1882:78bd with SMTP id p21-20020a9d76d5000000b0060b188278bdmr13976917otl.71.1653905355895; Mon, 30 May 2022 03:09:15 -0700 (PDT) MIME-Version: 1.0 References: <49eb2888-712e-7c81-313b-aec58e906778@foss.arm.com> In-Reply-To: <49eb2888-712e-7c81-313b-aec58e906778@foss.arm.com> From: Ard Biesheuvel Date: Mon, 30 May 2022 12:09:04 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 2/2] Removes the x86 dependency on the QAT drivers To: yoan.picchi@arm.com Cc: Andre Przywara , "David S. Miller" , Giovanni Cabiddu , Herbert Xu , Linux Crypto Mailing List , Linux Kernel Mailing List , qat-linux Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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-crypto@vger.kernel.org On Mon, 30 May 2022 at 11:58, Yoan Picchi wrote: > > > On Wed, 18 May 2022 at 17:55, Andre Przywara > wrote: > > > > > > On Tue, 17 May 2022 10:11:09 +0200 > > > Ard Biesheuvel wrote: > > > > > > Hi, > > > > > > > On Mon, 16 May 2022 at 12:16, wrote: > > > > > > > > > > From: Yoan Picchi > > > > > > > > > > This dependency looks outdated. After the previous patch, we > have been able > > > > > to use this driver to encrypt some data and to create working > VF on arm64. > > > > > > > > > > Signed-off-by: Yoan Picchi > > > > > > > > Are you sure the driver is safe for non-coherent DMA as well? > > > > > > That depends on your definition of "sure". > > > We indeed tested this only on a server with coherent PCIe. > > > > > > I skimmed through the driver, and it looks like to use the DMA API > > > correctly: > > > - I see dma_alloc_coherent() calls for DMA ring buffers. > > > - There are dma_map_single()/dma_unmap_single() pairs in other parts. > > > - Accesses to the BARs are capsuled via macros, using readl/writel. > > > - Access the the SRAM BAR is also only done via those macros. > > > > > > I didn't go through the driver systematically, and of course the > > > interesting parts are the ones you don't see easily, so I am eager > to hear > > > any other opinions on this topic. > > > > > > Ard, do you have anything special in mind? Is there something to > look out > > > for, specifically? > > > > > > > If it uses the DMA api consistently and correctly, and works as > > expected when running under a SMMU, things are probably fine > > > > > The few cards we have access to are in some server in the data > centre, so > > > I can't easily walk in with, say a RockPro64, and test this there. > > > > > > > I suppose this implies that you have tested with SMMUs enabled. > > Sorry for the delay, I was away for a few days. > Actually, our previous attempts were with the iommu set to passthrough, > but I > just tested without the passthrough and it works the same way. Thanks for confirming. So this looks fine to me as far as un-x86-like DMA topologies are concerned. I do agree that big-endian should be forbidden or tested thoroughly as well.