Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp527775ybx; Wed, 30 Oct 2019 00:15:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzpsMSNfDrr0+GhEc+zw1g6KAioEAZsGIvSsQegQzJq/chZyDNHiiPFI0yVGDn1G5Vbg6Vp X-Received: by 2002:a17:906:3790:: with SMTP id n16mr1528985ejc.171.1572419708744; Wed, 30 Oct 2019 00:15:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572419708; cv=none; d=google.com; s=arc-20160816; b=gOCFlbX1qqYRoaM4ugCeu/GPvMzuo2GuUfspbaedunfYo3mSRVkfl3n3V4DJliXRF+ 2KcV6n62KuPeD+qYHXJAXSW6VdDwaAoiYletgrVvd2SHcJwf1/c9q6v0A97q7nmpQ1J1 x3RRq+gn/HUGwOU3VBt375AX533Woqvv7oOsV7zjMoVTx+FRUMpxSmlQ6G3vZQxOnUB9 h96PVcyoqTk94BQX5fkzFiGFf1/xMHDvCryfLf1DaKBao3aq/cYlqeakt0bPWdoheSXH ikIoPoD0QW/gESY+KN+ZEUttc/3fK/zJB73PDLPUgBZ91V1rrxbTWoDewspr51RorqGl KCIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5B+Tj9H/SGtP9jQxDIYD+BDkUtDALlq3WUSxP2lZKVA=; b=lzYsmmIhqN+CLk3jmwq52K8ANmN5KV2AhxB0hfH+DS4tTm8iDgYZQiLVHm0yJ4SaEV xxrVTeYoRNXJ5l6MBjv8P/j/AGQEgwn5KNGzwWzL+vzEh7I9GwwnROyKL2QBvZl2DTb2 +sJZE2JruToQentMHp54YygfscNcV3yAjXjwxeGyq1RMiBEHKs+PZb5L07CPqdO2kqoT YfPhe1jRIlhiUW/ywcyefVmkwk026vyv5LraJmOYCv0UiUISL/b5eng6yF6/z9TnVMdK SCgO4KZ+JbpGIFTcUC6/h5eVs6ewNvBO3b6ZL6yu0ErWFPxQ+50zA79YsSjXLwXtNl1h +nUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VLe5bn2y; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y57si901421edb.138.2019.10.30.00.14.44; Wed, 30 Oct 2019 00:15:08 -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=@kernel.org header.s=default header.b=VLe5bn2y; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726317AbfJ3HLq (ORCPT + 99 others); Wed, 30 Oct 2019 03:11:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:43462 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726070AbfJ3HLq (ORCPT ); Wed, 30 Oct 2019 03:11:46 -0400 Received: from rapoport-lnx (190.228.71.37.rev.sfr.net [37.71.228.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 32A5520874; Wed, 30 Oct 2019 07:11:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572419505; bh=L+Zc5GlfgcbUGe7jxxdb2RAXncs48MBZ7tOee6QAN9U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VLe5bn2ysOr1LFizjdvtRzqnw6w/qP4cy8721MX6qc21c54PKgBcQOPj/vGxd6B9y 5R0IecChBiyW6rGRhVYM3FaX+EEzwYWxMgodHWNKs8LldpbuyxLLKSaMl1Ud/OWcHz 7yw8UC37KH4Ty1LMPJast9JF/+4ZEAWUMh3awa4o= Date: Wed, 30 Oct 2019 08:11:37 +0100 From: Mike Rapoport To: Christopher Lameter Cc: "Kirill A. Shutemov" , linux-kernel@vger.kernel.org, Alexey Dobriyan , Andrew Morton , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Dave Hansen , James Bottomley , Peter Zijlstra , Steven Rostedt , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , linux-api@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, Mike Rapoport Subject: Re: [PATCH RFC] mm: add MAP_EXCLUSIVE to create exclusive user mappings Message-ID: <20191030071136.GA20624@rapoport-lnx> References: <1572171452-7958-1-git-send-email-rppt@kernel.org> <1572171452-7958-2-git-send-email-rppt@kernel.org> <20191028123124.ogkk5ogjlamvwc2s@box> <20191028130018.GA7192@rapoport-lnx> <20191028131623.zwuwguhm4v4s5imh@box> <20191029085551.GA18773@rapoport-lnx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 29, 2019 at 10:12:04AM +0000, Christopher Lameter wrote: > > > On Tue, 29 Oct 2019, Mike Rapoport wrote: > > > I've talked with Thomas yesterday and he suggested something similar: > > > > When the MAP_EXCLUSIVE request comes for the first time, we allocate a huge > > page for it and then use this page as a pool of 4K pages for subsequent > > requests. Once this huge page is full we allocate a new one and append it > > to the pool. When all the 4K pages that comprise the huge page are freed > > the huge page is collapsed. > > Or write a device driver that allows you to mmap a secure area and avoid > all core kernel modifications? > > /dev/securemem or so? A device driver will need to remove the secure area from the direct map and then we back to square one. > It may exist already. > -- Sincerely yours, Mike.