Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2169078ybv; Fri, 21 Feb 2020 10:11:27 -0800 (PST) X-Google-Smtp-Source: APXvYqxiuXExRJmVGYiw5gMYP0nJqdHW14E5i3LlTVKIVCpK18k2wzPu0fGxTGDr655Q+r2awi34 X-Received: by 2002:aca:3554:: with SMTP id c81mr934454oia.0.1582308687154; Fri, 21 Feb 2020 10:11:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582308687; cv=none; d=google.com; s=arc-20160816; b=hwBYjb8++91J5ZnOAPNjSLSIo6oiVIUwfEXjCieoqSCi05HJ6vBZos2jq5LzSyquWy wTi5hy4teVxC8E4TQUD/JeFE47WDWLcMMhl+01PtZKimi4u66n7T7L2SSj9/IJKm8CHO ucndTAWokPj/zYuiyXIcB/btDXsGsGe4HFb5J79W6wxObd/lEayB/woajFyy0W2gO53N Ot6+Qdyvti8WYEUDn+x1W4++J9js7fxgTVuCGQ50cczeNp6fqAFLuLjGPghc/f6rPRCZ OJoa1R0FE570298SF/zZHVbV2cOMe5iBI1s6azTeVIoofXK3cP+cOlINqrdzDKSYV3dx OvfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=xf/5Dafx5t/rME+FUAkXYOq5x67aKxbM4/RJSWTANOQ=; b=nxDxxM0QIRGwVCVk5J6kbNVgG6GEKvs79uXvQ50Hv7u4IX2vHHluTVbCcAtrdIN243 ZPZ9xY+gEepscJyTTku3XzGsEzSCRX8NkVkTkTGSHnX+BqFJ2vMVU/IMA736AI6VQV47 bozkwLEVVjM50hXOXCJjvXz/Ws2zY6frjeNSFtf0tNyrN4lNe/91nSv6CClTEI06cCBF ZCT78HYzTE1nQlRMq1y5DtbNmK7ul9hPytuW+CwdpiwGd1UeanyOiOp5IYqS2bLaj+K7 BE68RlAmJ6mBnlVV2MoNQFz44Q8pujGm8Z2uRPLfNh8NXY4vzcz+GBuwkWV0Jgh+NVTA s8GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CjjOcC1D; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z26si1823896oti.215.2020.02.21.10.11.16; Fri, 21 Feb 2020 10:11:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CjjOcC1D; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 S1727656AbgBUSLM (ORCPT + 99 others); Fri, 21 Feb 2020 13:11:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:58710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725995AbgBUSLL (ORCPT ); Fri, 21 Feb 2020 13:11:11 -0500 Received: from sol.localdomain (c-107-3-166-239.hsd1.ca.comcast.net [107.3.166.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 67F44208E4; Fri, 21 Feb 2020 18:11:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582308670; bh=+Cb4JLP4AzzeUHtnURjqmhLOWjfrHEnJh6ZcrHPfzIs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CjjOcC1DgFPJx0n0W5Nn6sNEYOnHeArMulQiOCQ4eexPuzr9eFQvsRUz0vIrVkkl1 YVEguzqY8Go0OdhJE+DDsByPVTEPPqTi3fX5JPN9j33JL7ACiwqD4Atau7D5PoSDQ6 Z/q7kG6l1EuZMlqYb0P1zmwE4APm4LXlkELsQOzE= Date: Fri, 21 Feb 2020 10:11:09 -0800 From: Eric Biggers To: Christoph Hellwig Cc: Satya Tangirala , linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, Barani Muthukumaran , Kuohong Wang , Stanley Chu , Kim Boojin , Ladvine D Almeida , Parshuram Raju Thombare Subject: Re: [PATCH v7 6/9] scsi: ufs: Add inline encryption support to UFS Message-ID: <20200221181109.GB925@sol.localdomain> References: <20200221115050.238976-1-satyat@google.com> <20200221115050.238976-7-satyat@google.com> <20200221172244.GC438@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200221172244.GC438@infradead.org> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Feb 21, 2020 at 09:22:44AM -0800, Christoph Hellwig wrote: > On Fri, Feb 21, 2020 at 03:50:47AM -0800, Satya Tangirala wrote: > > Wire up ufshcd.c with the UFS Crypto API, the block layer inline > > encryption additions and the keyslot manager. > > > > Also, introduce UFSHCD_QUIRK_BROKEN_CRYPTO that certain UFS drivers > > that don't yet support inline encryption need to use - taken from > > patches by John Stultz > > (https://android-review.googlesource.com/c/kernel/common/+/1162224/5) > > (https://android-review.googlesource.com/c/kernel/common/+/1162225/5) > > (https://android-review.googlesource.com/c/kernel/common/+/1164506/1) > > Between all these quirks, with what upstream SOC does this feature > actually work? It will work on DragonBoard 845c, i.e. Qualcomm's Snapdragon 845 SoC, if we apply my patchset https://lkml.kernel.org/linux-block/20200110061634.46742-1-ebiggers@kernel.org/. It's currently based on Satya's v6 patchset, but I'll be rebasing it onto v7 and resending. It uses all the UFS standard crypto code that Satya is adding except for ufshcd_program_key(), which has to be replaced with a vendor-specific operation. It does also add vendor-specific code to ufs-qcom to initialize the crypto hardware, but that's in addition to the standard code, not replacing it. DragonBoard 845c is a commercially available development board that boots the mainline kernel (modulo two arm-smmu IOMMU patches that Linaro is working on), so I think it counts as an "upstream SoC". That's all that we currently have the hardware to verify ourselves, though Mediatek says that Satya's patches are working on their hardware too. And the UFS controller on Mediatek SoCs is supported by the upstream kernel via ufs-mediatek. But I don't know whether it just works exactly as-is or whether they needed to patch ufs-mediatek too. Stanley or Kuohong, can you confirm? We're also hoping that the patches are usable with the UFS controllers from Cadence Design Systems and Synopsys, which have upstream kernel support in drivers/scsi/ufs/cdns-pltfrm.c and drivers/scsi/ufs/ufshcd-dwc.c. But we don't currently have a way to verify this. But in 2018, both companies had tried to get the UFS v2.1 standard crypto support upstream, so presumably they must have implemented it in their hardware. +Cc the people who were working on that. - Eric