Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp751226ybn; Wed, 2 Oct 2019 05:43:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxMlrmYnxthiKiviwoMGAWMJHEbOa5rXciM4T+GD+9B4luzQ2AwnBCfH3YdkQOZU2r+ClED X-Received: by 2002:a17:906:7d8:: with SMTP id m24mr2856649ejc.196.1570020189301; Wed, 02 Oct 2019 05:43:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570020189; cv=none; d=google.com; s=arc-20160816; b=a3IbGuahArpuqo/Efmqy8NGeDxe5Ahva8jINaLHpVkQrKEcuTcklVfFeptd3kmnwxd scdpw7zcchoYF6S1ZmMvcHWtIYFkVpDKXLqoVvhzPfPcJSw6CeV186XPYuiLHussIqnf xV2mQ4Znh1qAYm1W2asHTIfpi4kR4DH672Bi1v/L7WtOin/Wqsj47jeretEujqyh4Ie9 PujKWgJt7bom9Vl2Rvl3DCDmXC97yelF1FqflQrYYvmGeyAg921twK9LSGWLjTAh8JuL WH0oxxhG+u8XappT58Z/la+IqlrpUOxvAqMT26fDTHcdMlEGu8q1bhRnNpwqpNe/8rk/ LZ2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:cc:to:from:subject; bh=ksA8ibfObGyqT7NSGabIo7AEnKZ1DP+QGaScdSG5GO8=; b=ySBs8+sXQeu5b3dTKycKlvMs+HwmDv4+ehzVzud2BIieUfOtog/qwwW34M3e2GJJFT 3CCKpY8+zt1Q48cqjynURBEX5EpuYSskexK7z0cywY2q1FMsh2+zT+/wSx7Kx8a/nE3R oBJAThxa/8ejz/ubvVgd9Q2comV3PaQgohxXApSkhDtfHEaD04roNZBPzwb/PlnGK7By VrJMAcuA7SVjMrnIZlnCT/DPPRGFscFwuiIIC3UdtKtReYOtYrNWrqZYI4m08lTivylt 5ekzb4pjzWOx2+7eps2wWpEsoliyA8YTlM5MuGczMOiVgOZHdKpTS/jrtmlxldxmdfo+ E7mQ== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3si12984561edc.151.2019.10.02.05.42.45; Wed, 02 Oct 2019 05:43:09 -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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726708AbfJBMl5 (ORCPT + 99 others); Wed, 2 Oct 2019 08:41:57 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:17548 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726413AbfJBMl5 (ORCPT ); Wed, 2 Oct 2019 08:41:57 -0400 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x92CcSFZ031251 for ; Wed, 2 Oct 2019 08:41:56 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2vbsjtqtfv-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 02 Oct 2019 08:41:55 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 2 Oct 2019 13:41:52 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 2 Oct 2019 13:41:48 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x92Cfl5p46006340 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 2 Oct 2019 12:41:47 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 70F5E4C04E; Wed, 2 Oct 2019 12:41:47 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E05BA4C044; Wed, 2 Oct 2019 12:41:45 +0000 (GMT) Received: from localhost.localdomain (unknown [9.80.234.231]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 2 Oct 2019 12:41:45 +0000 (GMT) Subject: Re: [PATCH] tpm: Detach page allocation from tpm_buf From: Mimi Zohar To: Jarkko Sakkinen , James Bottomley Cc: linux-integrity@vger.kernel.org, Jerry Snitselaar , Sumit Garg , Stefan Berger , Peter Huewe , Jason Gunthorpe , Arnd Bergmann , Greg Kroah-Hartman , open list Date: Wed, 02 Oct 2019 08:41:45 -0400 In-Reply-To: <20190927130657.GA5556@linux.intel.com> References: <20190925134842.19305-1-jarkko.sakkinen@linux.intel.com> <1569420226.3642.24.camel@HansenPartnership.com> <20190927130657.GA5556@linux.intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19100212-0008-0000-0000-0000031D5493 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19100212-0009-0000-0000-00004A3C57B4 Message-Id: <1570020105.4999.106.camel@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-10-02_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=927 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910020120 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2019-09-27 at 16:06 +0300, Jarkko Sakkinen wrote: > On Wed, Sep 25, 2019 at 10:03:46AM -0400, James Bottomley wrote: > > On Wed, 2019-09-25 at 16:48 +0300, Jarkko Sakkinen wrote: > > [...] > > > + data_page = alloc_page(GFP_HIGHUSER); > > > + if (!data_page) > > > + return -ENOMEM; > > > + > > > + data_ptr = kmap(data_page); > > > > I don't think this is such a good idea. On 64 bit it's no different > > from GFP_KERNEL and on 32 bit where we do have highmem, kmap space is > > at a premium, so doing a highmem allocation + kmap is more wasteful of > > resources than simply doing GFP_KERNEL. In general, you should only do > > GFP_HIGHMEM if the page is going to be mostly used by userspace, which > > really isn't the case here. > > Changing that in this commit would be wrong even if you are right. > After this commit has been applied it is somewhat easier to make > best choices for allocation in each call site (probably most will > end up using stack). Agreed, but it could be a separate patch, prior to this one.  Why duplicate the problem all over only to change it later? Mimi