Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp107988ybt; Thu, 25 Jun 2020 16:37:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4ZZw51CEUrQUPiNkjcbC3f50ofWSeKITxOPkOpR5Q+dAKcuVcOJzCAiO1LSSXLRiupyEs X-Received: by 2002:a17:906:97d7:: with SMTP id ef23mr119991ejb.450.1593128278295; Thu, 25 Jun 2020 16:37:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593128278; cv=none; d=google.com; s=arc-20160816; b=zzGiNVQHx7OqD6B2k7u/8fNeVoGKsM1RSMP547I3wJCEOa1XHhdmLBwlgVdBHdvYP1 /lwt/UiASS1YPZE8bLQN7/79jTl0INLkj1Esb14i5kx3Mh2AiPoSl78IyVq8Bd/ztXYT g/Df25VTON8l0Kc+Mk8LCIx+zZ3D/j7eX3mIQ69CirUvSr2wz4pLjjuFLqWVG9SjYI4n YRcPqVMqcMPgkRp57ATSMjkngA5Pf0sMepkHazrUf1bcHRyPQhZshSS2lz7t03wdvpt1 NXg+b7UH2D+RK8FS1UrHY0OuYHw91rTonl00voQiJxUFK7u9PcCScuwzUATWoEmyXHDq vFpA== 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=CDVcsaxwTdcc1DLG3101bFJUbfAu4PGvDeP30JlwQqQ=; b=kNWGykrqJ2Ph/wQ4LOgLqIhL+phTrlpfBLcDUI5sHl153gqOyxRcPq+vKkhJBKoPyc fdg+cubgjz2qKcIFIa206+xIF+e1RqIWU5WweYc6zG2wR565o60bYp8lHwFjBGxOczoH RulCWvJ2QSR32N96F0OVW12mUVz3PO0lziv/zd2kPdaRjaXHKIM/YWdd2XihpANHKmf8 vx0P2Fd/Xd9plPA8ypkKvqKvsT+0tizV8la6i3SKDYW0DbmB4iHd8uaaBFROPHHSnaP5 K0HscNAlz5ZaG5l1VLp4rwPm5zRcxeQZfSnAv2/PDTCUXN4gg6+wxCkUCfR4TRD/Gftw weig== 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 p20si10760590ejr.120.2020.06.25.16.37.35; Thu, 25 Jun 2020 16:37:58 -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 S2406078AbgFYVZJ (ORCPT + 99 others); Thu, 25 Jun 2020 17:25:09 -0400 Received: from mga12.intel.com ([192.55.52.136]:48700 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403817AbgFYVZJ (ORCPT ); Thu, 25 Jun 2020 17:25:09 -0400 IronPort-SDR: 9aj0JHzH+46SYZmpY3zgR4ipms0dJKrn3mtpToH3uuSZJkV6ebLblFTTOgW3XqZyXJr0ZhwFHl UWT36zlniaCw== X-IronPort-AV: E=McAfee;i="6000,8403,9663"; a="124731569" X-IronPort-AV: E=Sophos;i="5.75,280,1589266800"; d="scan'208";a="124731569" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2020 14:25:07 -0700 IronPort-SDR: JjzDwpV7/tC8ln67VUO2qXVTBl+4LIVaxChS5eHlCy/zuRAKXDUCyNlknQHRYEzQyWbVV0gSlN hSy5cQDguCRw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,280,1589266800"; d="scan'208";a="298925489" Received: from gumm-mobl2.ger.corp.intel.com (HELO localhost) ([10.252.49.123]) by orsmga007.jf.intel.com with ESMTP; 25 Jun 2020 14:25:01 -0700 Date: Fri, 26 Jun 2020 00:24:53 +0300 From: Jarkko Sakkinen To: Stefan Berger Cc: linux-integrity@vger.kernel.org, James Bottomley , 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: <20200625212453.GB20341@linux.intel.com> References: <20200625042424.370072-1-jarkko.sakkinen@linux.intel.com> <2f8a0127-d2ba-21aa-75b3-2dfccfb52eab@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2f8a0127-d2ba-21aa-75b3-2dfccfb52eab@linux.ibm.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 08:13:09AM -0400, Stefan Berger wrote: > On 6/25/20 12:24 AM, 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 > > --- > > Tested only for compilation. > > drivers/char/tpm/tpm2-space.c | 80 ++++++++++++++++++++++++----------- > > include/linux/tpm.h | 6 ++- > > 2 files changed, 59 insertions(+), 27 deletions(-) > > > > diff --git a/drivers/char/tpm/tpm2-space.c b/drivers/char/tpm/tpm2-space.c > > index 982d341d8837..acb9e82bf9e8 100644 > > --- a/drivers/char/tpm/tpm2-space.c > > +++ b/drivers/char/tpm/tpm2-space.c > > @@ -15,6 +15,8 @@ > > #include > > #include "tpm.h" > > +#define TPM2_SPACE_MAX_BUFFER_SIZE (4 * PAGE_SIZE) > > PAGE_SIZE is 64k on ppc64. Rather use 4 * 4096? Better to then just put it as 16384. /Jarkko