From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92BB9C43461 for ; Fri, 4 Sep 2020 20:08:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0B5D120665 for ; Fri, 4 Sep 2020 20:08:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="SycI87uR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B5D120665 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6073E6B0003; Fri, 4 Sep 2020 16:08:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 58F926B005A; Fri, 4 Sep 2020 16:08:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 409E56B005C; Fri, 4 Sep 2020 16:08:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0026.hostedemail.com [216.40.44.26]) by kanga.kvack.org (Postfix) with ESMTP id 23FDD6B0003 for ; Fri, 4 Sep 2020 16:08:30 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id DD3321EE6 for ; Fri, 4 Sep 2020 20:08:29 +0000 (UTC) X-FDA: 77226466338.21.glue39_4701b18270b5 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id ADECD180442C0 for ; Fri, 4 Sep 2020 20:08:29 +0000 (UTC) X-HE-Tag: glue39_4701b18270b5 X-Filterd-Recvd-Size: 5682 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Fri, 4 Sep 2020 20:08:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599250108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rx/MrJrBjON2MHt5LyXI11U1Seqyg13O7xGK8kHsIoY=; b=SycI87uRORNv3Hju+wOO2+UqxYm6HxGncQrKl2Z/m+4PA0AdhoFdmPJ4h7PcT/T44Blxpy yNFzZVgzddJlpj4inw1nA4wx43QlNtmgZ5pbBqEkfTOrdhNTG7+x2dlhiQdQ8HAGL57fai ilCgcgqKtnBBIl1LKJMyQnabT46igVg= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-549-b-_0kcsgOUiVKWxGlFRqkA-1; Fri, 04 Sep 2020 16:08:15 -0400 X-MC-Unique: b-_0kcsgOUiVKWxGlFRqkA-1 Received: by mail-ej1-f72.google.com with SMTP id qn7so2948617ejb.15 for ; Fri, 04 Sep 2020 13:08:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rx/MrJrBjON2MHt5LyXI11U1Seqyg13O7xGK8kHsIoY=; b=Cc1jZ2jx7gOyQZiLka/4xHn7i8Lsslv48dhJK7b3XiM2wA39pLC/Bw3OJWZJ+ceGOf fVWiux1ImeCAn0b6Lm7A7mOMtz+/o7A8p+o9LEckK0W+Lf88YqcoEZk5gUa29GAX8SGo Xgfy3OWyaOqUj9tbH2W8e7C+k8ek9FxcUs2eFZh9YH9n1sAMFx69QHmekVHCRp+GQmNo TbUMKt0tW2z592tUMMPPJMs+Hf/ss3IfTJWLUo+CrF50/Z0S49LbUvbcd4a/jzYY71Oj E3ld++FFbeO2sMwh13d56qB/o1ge0ev90JREsNB0XbOM9EuUoiPlkAjJlYLhzyp1thkl 4qjw== X-Gm-Message-State: AOAM530CsISYnnQFFti132ZjdC8l+PxbbxLu2od9KqQsh5/qo8n/XYPJ NJHueWSJCzHcDdffPwF0v9lA33CAGLOykZePN/uifKq/70ZhFzbUbLJFQsPAjcqANH2RVSPJv2G +Rx5/Kv8t/vM= X-Received: by 2002:a17:906:b09a:: with SMTP id x26mr9058616ejy.162.1599250094046; Fri, 04 Sep 2020 13:08:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQ0UoNYy5Xw/wkWRcGO3CqSDHSu/bI9UKBdSj6xmuqYNYindMGVrqenMWuWm7GhIdJ9AVESA== X-Received: by 2002:a17:906:b09a:: with SMTP id x26mr9058576ejy.162.1599250093821; Fri, 04 Sep 2020 13:08:13 -0700 (PDT) Received: from [192.168.10.150] ([93.56.170.5]) by smtp.gmail.com with ESMTPSA id d2sm7138622ejm.19.2020.09.04.13.08.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Sep 2020 13:08:13 -0700 (PDT) Subject: Re: [RESEND RFC PATCH 0/5] Remote mapping To: Matthew Wilcox , Jason Gunthorpe Cc: =?UTF-8?Q?Adalbert_Laz=c4=83r?= , linux-mm@kvack.org, linux-api@vger.kernel.org, Andrew Morton , Alexander Graf , Stefan Hajnoczi , Jerome Glisse , =?UTF-8?Q?Mihai_Don=c8=9bu?= , Mircea Cirjaliu , Andy Lutomirski , Arnd Bergmann , Sargun Dhillon , Aleksa Sarai , Oleg Nesterov , Jann Horn , Kees Cook , Christian Brauner References: <20200904113116.20648-1-alazar@bitdefender.com> <20200904121148.GR24045@ziepe.ca> <20200904194139.GA5881@casper.infradead.org> From: Paolo Bonzini Message-ID: Date: Fri, 4 Sep 2020 22:08:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200904194139.GA5881@casper.infradead.org> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: ADECD180442C0 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 04/09/20 21:41, Matthew Wilcox wrote: > Proposal: http://www.wil.cx/~willy/linux/sileby.html > Start at implementation: > http://git.infradead.org/users/willy/linux.git/shortlog/refs/heads/mshare The main difference between mshare() and this is that we don't want an all-or-nothing thing. Adalbert's introspection thing is rather simple, but what I would like to be able to do (and the reason why I suggested the multi-pidfd approach) is actually a bit more complex: - a parent process creates a range of memory - there are multiple VMs child processes. One of this VM is a primary VM, the others are enclave VMs. VMs are created by the parent process and each VM gets a different view of the memory range through pidfd_mem. - once an enclave VM is created, the primary VM must not be able to access the memory that has been assigned to the enclave VM. If the parent unmaps the memory in the primary VM, the child must SIGBUS when it's accessed. - if memory is removed from a VM and assigned to another, this should not involve any copy at all. For this usecase the range of memory would be backed by hugetlbfs, anonymous memory, VFIO, whatever. Userfaultfd is certainly part of the picture here on the VM side. Having userfaultfd on the parent side would be nice though I don't have a use for it right now. I'm not sure about non-anonymous VMAs. Thanks, Paolo