Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1147859ybt; Wed, 24 Jun 2020 21:55:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2W/tzM1gh723FE+xDmbWhF7Ov6y1qz6waMfX/Xm/dJJ8UAkmGzXJyP4CebVF7fhjtqrna X-Received: by 2002:a17:906:169b:: with SMTP id s27mr4119789ejd.363.1593060922785; Wed, 24 Jun 2020 21:55:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593060922; cv=none; d=google.com; s=arc-20160816; b=bd42aB2KCRIxpk0MJ20HpUrYB5ESFBo5dCHLHO+y2V68FWHm4K9xJylaD8g9wvo/5S J0xuIla7/dF3KtWr0AtYsCkkyq1+rivNK71gYZLPyAw1/qCDw3ix2yjGVrPbIK2YqBqy ulhDSvHxyMWX2UGtFvQElW7YVy7HeMmnQsSFv/RD+6Hk1qSh+ivgtWNhR1sOaeQYAM5V RluvCQzLsIP+CrG6ZJ+l/4/yd727sbad3mBk75UtNt/vGWajCvGenL92OSSvgTaOryA0 /QBcTCZT/dovC4f1GYZOotPO8uo6bSiKnkB4mThPrLFJNlTiASd7+1jrOW8CmoV06EOI WcSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=luYa3ymCIPnYQNoMPTA+eCbwNSXSMDNwUGhOoTHPyAs=; b=Nx6M9l3D3uodJMqyVPuQLzuREbhqt3ozm7eRI3oxtEgW7z7/8nGEuvSAexETrCUUTW 8qp7RlPc7wPBbNsgeu1x0hv5pLwZ5mDXKxpljuvGVpbo0ceNXozZWLcU8EifNt9JtRYR uWMYVDXVkpT9hNdXWaKFkawmwM9WfkINT4FoqRBQV/U3jF8NkehHsSJz+Kpe47xYOeIE LFirZtOjSeK8Pp3Lo20/rwCXYwo+da4T5m8rBgz3wryUebbuB80tHAA3d9ETM3LsGCJ1 JoC+extaQjrBYDVnB8lLp06Mi2UnPBxYQRNlvYyXtySMJDTfVwEMxXruFrLwfqnRn/wR wwHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id x70si1658588ede.405.2020.06.24.21.54.39; Wed, 24 Jun 2020 21:55:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2388392AbgFYEdq (ORCPT + 99 others); Thu, 25 Jun 2020 00:33:46 -0400 Received: from mga07.intel.com ([134.134.136.100]:18134 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726400AbgFYEdq (ORCPT ); Thu, 25 Jun 2020 00:33:46 -0400 IronPort-SDR: jw8q1uFIaky7UEEoyY2xCm4fzHl+mnOMV0JItyhpNfJp507TcSWOcDhLDBKoY5c8SzXdrZ1Gy2 5yj/y2M/HY0A== X-IronPort-AV: E=McAfee;i="6000,8403,9662"; a="209882181" X-IronPort-AV: E=Sophos;i="5.75,277,1589266800"; d="scan'208";a="209882181" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2020 21:33:45 -0700 IronPort-SDR: t5ceNEFFRaX3ndctuaOlqIxwjNG1sABH+ft7vt3s3t8UzFVTablnrxHm7SQuYSCccHwvF7Mfxs 9BlP4NBSTvxw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,278,1589266800"; d="scan'208";a="265253125" Received: from skurzyno-mobl2.ger.corp.intel.com (HELO localhost) ([10.249.40.230]) by fmsmga008.fm.intel.com with ESMTP; 24 Jun 2020 21:33:40 -0700 Date: Thu, 25 Jun 2020 07:33:38 +0300 From: Jarkko Sakkinen To: linux-integrity@vger.kernel.org Cc: James Bottomley , Stefan Berger , Peter Huewe , Jason Gunthorpe , Arnd Bergmann , Greg Kroah-Hartman , Jerry Snitselaar , Sumit Garg , Alexey Klimov , open list Subject: Re: [PATCH] tpm: tpm2-space: Resize session and context buffers dynamically Message-ID: <20200625043338.GA370462@linux.intel.com> References: <20200625042424.370072-1-jarkko.sakkinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200625042424.370072-1-jarkko.sakkinen@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 25, 2020 at 07:24:20AM +0300, Jarkko Sakkinen wrote: > Re-allocate context and session buffers when needed. Scale them in page > increments so that the reallocation is only seldomly required, and thus > causes minimal stress to the system. Add a static maximum limit of four > pages for buffer sizes. > > Cc: James Bottomley > Suggested-by: Stefan Berger > Signed-off-by: Jarkko Sakkinen I'd actually consider #define TPM2_SPACE_DEFAULT_BUFFER_SIZE PAGE_SIZE #define TPM2_SPACE_MAX_BUFFER_SIZE (4 * PAGE_SIZE) /JQ4KKO