Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2292209imm; Mon, 28 May 2018 05:31:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo5G2ZQy7VTKxmktjQjaDnwvDBCCD0Df2e5TidNY/vQwIg+K5DzcMqPCu/VBD/UAn/hgZ7J X-Received: by 2002:a17:902:694b:: with SMTP id k11-v6mr13570201plt.334.1527510697206; Mon, 28 May 2018 05:31:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527510697; cv=none; d=google.com; s=arc-20160816; b=SDiaXNcP06gy64GWLPIjG9jvMq3FVwqCeHr9SZ5vV77Ve5EIs7XcFEiRs2vWe3pJpE V4yOCFRgWDkQ+2Bn66J4TJbVmczsjm32KKW6AxfvNVZZM5qM6+yd2XSI87dAQFbjfeFz JRZPjXpuSWfjBgKtmcO44aqiPfM9zQebf7KQtMWgrINPNhV7NFPawKZEAGNRf0XSYz9b R73GUs6DvZHDNb4/GF/YZ7WMStAqZEDYEwz0rWR86fIxilHEaP3XVLTMrdzMdu9kD/Pm bk5re0lVFYMc9uGpGC+PD2PHdE8gFVj+NWyKeZdGrEi6mireFK5sQXP4uDTNXSWpE2Oa H90g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:cc:from :subject:to:dkim-signature:arc-authentication-results; bh=pFh3TMjpMtYSima7bPVgXt250wzxgIkFK2r55UW8oy0=; b=gHYvzpd5OpqpFS++o8zSdruQsHTWpEVwq734gB5AueEGFdp56r2MaPHtxXM0W+NiFf ktooe3EaxnAShnJ7Zu7bbAUFHNqFVd4D9L8aM7edgq7Q2Q8XhcmAmgQTSHNGdwfo2TvF Y4G1ql0W5pMX/fzdMyc1d0dCNObmJ0QOwuSnz4zDfZtnqV8iMgLRRlc052aaAiYb2Y7+ S00qlMl26ZpeqS+jCWusB6RSElPksWoZjb4te6yx12sXG5Kzr/zCylBX/6BdksOxr6Va /PuogvBM0Thh/hWT+xAIA7ce5mrWDwGUcOOYlgkB4ImQj+qcr5fqax7rD97Pm3GIUR0/ 2HpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=EMekvv2O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t18-v6si30823147plr.240.2018.05.28.05.31.21; Mon, 28 May 2018 05:31:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@synopsys.com header.s=mail header.b=EMekvv2O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938913AbeE1Mam (ORCPT + 99 others); Mon, 28 May 2018 08:30:42 -0400 Received: from smtprelay.synopsys.com ([198.182.37.59]:50676 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S938903AbeE1Maf (ORCPT ); Mon, 28 May 2018 08:30:35 -0400 Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by smtprelay.synopsys.com (Postfix) with ESMTP id 494201E04A3; Mon, 28 May 2018 14:30:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1527510633; bh=DvzJdE6SryWq+A5EZM2/BqPRWRDEieo8NDEvY2rNV7I=; h=To:Subject:From:CC:Date:From; b=EMekvv2OWodzW/rUbSDTY10CxjrZBkRsKV6LrnvQogPl8W+zvLgsaSqaGpKsee612 VxMA3NPnW/RZB9iTgucQ+UaEranoGlKoZvjJo06i/E2wHSYmQkD+mdLk3jhEHHOt4D RXAkXTAbwsRY/RXvj+YpOHicLQ630pIGlPzb/JgE8QXYwHCqbj1COcpuIhcPKswEQg 2M/Un1MQOAAlaFnl5V8iazSDBIr4SbhYr0/BTL1KyQRvgv3M/YWh7JPCCthg58lZE3 0MkC6rAqSpA+CtocC0bH6yqKd9Gc8mbqEcw1/oaUHGI7QQi8lFqriJVaQNUfvyzlVP DxE0dDCngt1Kw== Received: from US01WXQAHTC1.internal.synopsys.com (us01wxqahtc1.internal.synopsys.com [10.12.238.230]) by mailhost.synopsys.com (Postfix) with ESMTP id 328023EE5; Mon, 28 May 2018 05:30:32 -0700 (PDT) Received: from US01WEHTC1.internal.synopsys.com (10.12.239.236) by US01WXQAHTC1.internal.synopsys.com (10.12.238.230) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 28 May 2018 05:30:32 -0700 Received: from [10.0.2.15] (10.144.133.104) by us01wehtc1.internal.synopsys.com (10.12.239.231) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 28 May 2018 05:30:31 -0700 To: Jens Axboe , Hannes Reinecke , "Omar Sandoval" , Johannes Thumshirn , "Sagi Grimberg" , Shaohua Li , Greg Kroah-Hartman , Ming Lei , Bart Van Assche , Keith Busch Subject: [PATCH 1/7] block: Add block level changes for inline encryption From: Ladvine D Almeida CC: , , "Manjunath M Bettegowda ; Prabu Thangamuthu ; Tejas Joglekar" Message-ID: <8cd6a622-693a-f130-708d-eae517f26c78@synopsys.com> Date: Mon, 28 May 2018 13:30:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.144.133.104] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch introduces new variable under bio structure to facilitate inline encryption. This variable is used to associate I/O requests to crypto information. Signed-off-by: Ladvine D Almeida --- block/Kconfig | 13 +++++++++++++ block/bio.c | 6 ++++++ include/linux/blk_types.h | 3 +++ 3 files changed, 22 insertions(+) diff --git a/block/Kconfig b/block/Kconfig index 28ec557..a48ecec 100644 --- a/block/Kconfig +++ b/block/Kconfig @@ -128,6 +128,19 @@ config BLK_DEV_THROTTLING_LOW Note, this is an experimental interface and could be changed someday. +config BLK_DEV_INLINE_ENCRYPTION + bool "Enable support for block device inline encryption" + default n + help + Enable block devices for Inline Encryption support. + + This option is required to support the inline encryption capability + of the block device driver, including UFS Host Controller driver. + When the Inline Encryption feature is enabled in the block device + drivers, this option will be automatically enabled. + + If unsure, say N. + config BLK_CMDLINE_PARSER bool "Block device command line partition parser" default n diff --git a/block/bio.c b/block/bio.c index 0a4df92..91aecf5 100644 --- a/block/bio.c +++ b/block/bio.c @@ -606,6 +606,9 @@ void __bio_clone_fast(struct bio *bio, struct bio *bio_src) bio->bi_write_hint = bio_src->bi_write_hint; bio->bi_iter = bio_src->bi_iter; bio->bi_io_vec = bio_src->bi_io_vec; +#ifdef CONFIG_BLK_DEV_INLINE_ENCRYPTION + bio->bi_ie_private = bio_src->bi_ie_private; +#endif bio_clone_blkcg_association(bio, bio_src); } @@ -690,6 +693,9 @@ struct bio *bio_clone_bioset(struct bio *bio_src, gfp_t gfp_mask, bio->bi_write_hint = bio_src->bi_write_hint; bio->bi_iter.bi_sector = bio_src->bi_iter.bi_sector; bio->bi_iter.bi_size = bio_src->bi_iter.bi_size; +#ifdef CONFIG_BLK_DEV_INLINE_ENCRYPTION + bio->bi_ie_private = bio_src->bi_ie_private; +#endif switch (bio_op(bio)) { case REQ_OP_DISCARD: diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 4cb970c..11df096 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -183,6 +183,9 @@ struct bio { void *bi_cg_private; struct bio_issue bi_issue; #endif +#ifdef CONFIG_BLK_DEV_INLINE_ENCRYPTION + void *bi_ie_private; +#endif #endif union { #if defined(CONFIG_BLK_DEV_INTEGRITY) -- 2.7.4