Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp301553imm; Fri, 10 Aug 2018 11:30:03 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwvxY56hU/Rz3SAX4QgdzU8Vp1NqVwvyCNfHmdIHTHnUriHhLwNLUq3PK8R35uRxhYlB6wS X-Received: by 2002:a62:7590:: with SMTP id q138-v6mr8122567pfc.1.1533925803123; Fri, 10 Aug 2018 11:30:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533925803; cv=none; d=google.com; s=arc-20160816; b=VWBcmEyw4iI0//NDQyC/CQwimSA+akQEFWl+DggKyek9UFeBSfpneW5TxycmSuQs7h AlXjxEPFNEGC6b/AcvI3DkxroqnxYAWOSjUWP5v5hNHwdN9To31E+hSRwKxj9IKiR3cC 96fH9t1WSAIysvLdhZEfJtALKsRRkUl2Nxe/ogehX1KHKusGSelhqH4hhj2i8jeTZjzl Sykwmzs6G3S3RrprgvcZNS0c5bU1aMMVXPNNsN/g04/+dNHseFM7Wdu80JZzqHUnfmwy H8jwoZ0rvzhLv/6pZRPzODuGxqWqFVe7crdIZvwucNQSgHjKg6ynCRZZZpyVc24jDbcO nEJA== 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:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :arc-authentication-results; bh=1ry//a4izv8LKSFkl1GcUpOYR1DucXsX2EuXTwtJ90g=; b=vxUyPPugHBCOS+tBHEbeZtN2KfH6VAo3BkMz0e1gmAxzDAs6tCiqNp/ARoTyEZ0Mh2 XCSSmAzFUeJnZTR2AV7QexyOEJBEGK2YXcjSwx7qHNAmLTI/sOhh3IXAdArl4KV7dZ64 bnRFg+VHpZBlte16vLW3xBNFMzDkC8lge2lFMGTVHdjtat09hFKe4HLKTLMX3/3DotBL KpWvzrkLM66MYJFYTfysQwoLBAdusSA2/jimr/8wwpzqmWKcZCsxazmEpSpkSz1c12bD UdY0QQ0p8unzKZf2mZVMFWuV2V+8uwZih9eEsJC6xjhBxkN/k4DIRI2Qj+bSXyBdqUoh z4Zw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 68-v6si10161395pga.113.2018.08.10.11.29.48; Fri, 10 Aug 2018 11:30:03 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728520AbeHJUgP (ORCPT + 99 others); Fri, 10 Aug 2018 16:36:15 -0400 Received: from mga18.intel.com ([134.134.136.126]:23788 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728168AbeHJUgP (ORCPT ); Fri, 10 Aug 2018 16:36:15 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Aug 2018 11:05:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,220,1531810800"; d="scan'208";a="64213117" Received: from bchattar-mobl.amr.corp.intel.com (HELO tstruk-mobl1.jf.intel.com) ([10.252.130.118]) by orsmga008.jf.intel.com with ESMTP; 10 Aug 2018 11:05:17 -0700 Subject: Re: [PATCH v4 1/2] tpm: add ptr to the tpm_space struct to file_priv To: Jarkko Sakkinen Cc: flihp@twobit.us, jgg@ziepe.ca, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org References: <153367365951.18015.11320230309813817454.stgit@tstruk-mobl1.jf.intel.com> <153367366462.18015.12915462188877575543.stgit@tstruk-mobl1.jf.intel.com> <20180810172700.GU4692@linux.intel.com> From: Tadeusz Struk Openpgp: preference=signencrypt Autocrypt: addr=tadeusz.struk@intel.com; prefer-encrypt=mutual; keydata= xsDiBEiLICMRBADteQacQxypsuFvAw6IwYzbD8pgQi+kLYBcqfGgVAUN/cO+sLl6u1lVdaDB fhAArdbV9lpoqcWnmhQFTb4A+W569EpydBr6nuatWkEB+fmmx8YoUtuZfXt7v+1l1rc09kaW LY+TkwQkvFCeuvdasgmBLnmRWymEGWi1E12hUgTw/wCgtK24geC7XkiuANMv0gpr+raOgQMD /2yJZ0SeXQApWyTRaeIYN8GgYHZTWuBp/ofN+viEkhrDxahcaGPP5B/Nv6VS1+M0e5m8OzHj qPUbgfyOeJcslC5aoZdqqqzVWVLaA/+Jy+O+6T3k3R/IryVVATldBlwnGFDhET0mKQsd15zt cIdQBBbfSFR5VlugZuWV5q442IpPA/4g7nen9FFPxh45Te8D54hAsOCywjm6xUE0UJGYHeJ/ MXCPtuXfVCbYcOxZVH7kUS2Vtk5d3bF40IE2WnVq1ZScNANF4ZjikxYhYGfNWX3HXak1gSoj UrY87rMSjPIAry4L0BoIx2qgL/k4iV/3QcXL4t5wosU0iw++suf1zGGcKM0gVGFkZXVzeiBT dHJ1ayA8dHN0cnVrQGdtYWlsLmNvbT7CYwQTEQIAIwIbAwYLCQgHAwIEFQIIAwQWAgMBAh4B AheABQJQTjJTAhkBAAoJEDFswfskq9xyqvcAoI2nsaUCX8ZGbu+Jhq+++qlBFJ2rAJ983RoO R2ofHhn3g3Qi4K34tw0l087BTQRauzUlARAAqkWRL/InEPnoGMg/gw/CRaDBaIBgMsvIcghI 7xevIzpleXt6jKHghSBooH+zaT7qi4u2gkgPn4odsER3Rm94XgrZJgoqls6EpKMWpJNGP4HT eYgykhfsZOLX8ijUbjTM/Sm/dZVo6aYoBL2+ciJwyl+Zt3Mp6un3/GWu6cA9005V50pRqO7j PTlVCHi2bedcEEf5DDsYJv/3Oz8/4LpSf6BL6BltjeZVa2y03dTMmD031JTH+OuyJm1yh72Z HWxhlYNXOv6uFJJVr+paQjrAsBVIYKhK24bD+uGJxLm8AN9i7/Si+2YeSsXvKUhk9mIoFBnU VFo63cziRTcpRu/kXgDAbujwN88qytEcvhEZHS6B9vdws+lhTpolEjkLCkz0Y59z4Fs9srKy QkRN+wtdiLgrwyDW3ryAKxcDmOumGWebDxpaOI/pBhrlS93HmDlvj7JmgTUU4a/NhwI3dXh5 pn8FZzZyVXe3Kc3bu5T3UAC7uztinsAvCJQS6jGZWrXmXkqYkaLXQOw61eInWjr01zE/zDbE mdJPM0+va/gtZx9TtGxr4PpjbqswqCiubLDZXZHh5uqArPv/i+E8aXIsNSTN6Rrqs1j9YgDN ALksibv6+tXH3sOlCUgjuZgJH3+s/mnaAtiV2rZ/WlH15d6nd0uiDSZrKhlR+g4NHMh1ztEA EQEAAcJPBBgRAgAPBQJauzUlAhsMBQkJZgGAAAoJEDFswfskq9xyfv8AoI8aPrJCoM0h5WOP kKxMmPEPHzUNAJ9jBBYXhX1CWg+IhI7i/fLlI0vwCA== Message-ID: <2bacb3d8-3897-e147-252f-c49de9e7806b@intel.com> Date: Fri, 10 Aug 2018 11:05:17 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180810172700.GU4692@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/10/2018 10:27 AM, Jarkko Sakkinen wrote: > On Tue, Aug 07, 2018 at 01:27:44PM -0700, Tadeusz Struk wrote: >> Add a ptr to struct tpm_space to the file_priv to have an easy >> access to it in the async job without the need to allocate memory. >> This also allows to consolidate of the write operations for >> the two interfaces. > > I think the 2nd premise should be the priority and the first premise should > be removed as it is not needed in any possible way to justify the > change. Jarkko, The main reason why the pointer to tpm_space struct was added to the file_priv was to have access to space in the async job when it is enqueued via the /dev/tpm interface. Currently it is only available in tpmrm_priv. Otherwise I would need to introduce yet another struct what would consist of a ptr file_priv and a ptr to tpm_space and allocate it on every enqueue. Much easier was to to it this way. The consolidation was only a side effect of this so I think the description is correct. Thanks, -- Tadeusz