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=-4.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 850B7C43461 for ; Fri, 4 Sep 2020 16:11:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3DA992074D for ; Fri, 4 Sep 2020 16:11:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="ZKDqX03Y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3DA992074D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BCF2C6B0085; Fri, 4 Sep 2020 12:11:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B7F6A6B0088; Fri, 4 Sep 2020 12:11:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A48906B0089; Fri, 4 Sep 2020 12:11:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0166.hostedemail.com [216.40.44.166]) by kanga.kvack.org (Postfix) with ESMTP id 8B4BD6B0085 for ; Fri, 4 Sep 2020 12:11:06 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 50C938245578 for ; Fri, 4 Sep 2020 16:11:06 +0000 (UTC) X-FDA: 77225868132.28.base37_0f0fe33270b3 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id 0F7176C04 for ; Fri, 4 Sep 2020 16:11:06 +0000 (UTC) X-HE-Tag: base37_0f0fe33270b3 X-Filterd-Recvd-Size: 5461 Received: from mail-qv1-f68.google.com (mail-qv1-f68.google.com [209.85.219.68]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Fri, 4 Sep 2020 16:11:05 +0000 (UTC) Received: by mail-qv1-f68.google.com with SMTP id b13so3272417qvl.2 for ; Fri, 04 Sep 2020 09:11:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ErDDXj4EwBDt0OZ5J7pAu9GlFqxRrQWgVOUzC5yARc0=; b=ZKDqX03YRzg6KyweUTUdd0ChXOJbiCvisiddVP3E6PEUgNRiqCXBqlzsShJv7hv+Yr pORN9HIcVVWEjOiOLxQnF+Fo6JP/r3VyvZKutuU0U8btisSB19ZteSzlU+ebTAgu87gn 5D+b9J/6wghr4u9dDENGi8GJZZS/rLMtlSUbVnHjxt2HasIviOb4cJTxtwJL1+u6rHat 9A/eGwLONMnjtEtDEEEi3OKWxoXz25NgQTXGRkZqKAtWFAY+Nfh4j+v2xo310iAUfac1 Ift1m2X+LhDFNgn8TlZKgawYcCnMKSlydPIDlm4Yl6xnEggFDxDOfsj2ZN+ghqondKkU gAKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ErDDXj4EwBDt0OZ5J7pAu9GlFqxRrQWgVOUzC5yARc0=; b=sy9+BTZzjajH1qGTrl14FbSuWrUhyFxZI8FO1OGVLzB7P6jSuNGJ2YhnQQiPNY8uZr sUW+8hgZIVix6mNYE5G4wgcblVECVDhKpQazYtZ7elcDz7CkzFRNFAtVfsicIkUjewxH nipeMQv572my8tBWVuSf6iY6qMQUgiNXjmLe2Vdcl9XOUUiKbpq/bESPiRffa/gjigfU B9BtY53247t7hmPyZ/GF3s0BQfrPhgP97Y3VSmINCKQzXmnjrsPDo3Gek1mNNGijYmpw F4TpU5niCqXb0KBFz37KqJJPVhNCI3X14sqd+fqFZ51XkdOQ8dF6LlOI3ebvKyxwN7i7 LVnw== X-Gm-Message-State: AOAM533rky/HvQCrBbkO+9mg1mZU3J2Yz/FFNiFpETpjboGkwcBUDpX1 2KjIDzQe5i8aAElvLeQZkppdlA== X-Google-Smtp-Source: ABdhPJz8LUvYzrCV/J0pOMMqLumsriTz8gryN+e4BnDWul2xovC8R7vel6cVOFLHAKJHxlLeDbYVtQ== X-Received: by 2002:ad4:4b30:: with SMTP id s16mr7666735qvw.8.1599235864693; Fri, 04 Sep 2020 09:11:04 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id y20sm4680134qkj.70.2020.09.04.09.11.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Sep 2020 09:11:03 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kEEIp-007iR4-0Q; Fri, 04 Sep 2020 13:11:03 -0300 Date: Fri, 4 Sep 2020 13:11:02 -0300 From: Jason Gunthorpe To: Mircea CIRJALIU - MELIU Cc: Adalbert =?utf-8?B?TGF6xINy?= , "linux-mm@kvack.org" , "linux-api@vger.kernel.org" , Andrew Morton , Alexander Graf , Stefan Hajnoczi , Jerome Glisse , Paolo Bonzini , Mihai =?utf-8?B?RG9uyJt1?= , Andy Lutomirski , Arnd Bergmann , Sargun Dhillon , Aleksa Sarai , Oleg Nesterov , Jann Horn , Kees Cook , Matthew Wilcox , Christian Brauner Subject: Re: [RESEND RFC PATCH 0/5] Remote mapping Message-ID: <20200904161102.GU24045@ziepe.ca> References: <20200904113116.20648-1-alazar@bitdefender.com> <20200904121148.GR24045@ziepe.ca> <20200904133907.GS24045@ziepe.ca> <20200904143903.GT24045@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 0F7176C04 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 Fri, Sep 04, 2020 at 03:40:55PM +0000, Mircea CIRJALIU - MELIU wrote: > > On Fri, Sep 04, 2020 at 02:18:37PM +0000, Mircea CIRJALIU - MELIU wrote: > > > > This seems really sketchy, get_user_pages is sensitive to the VMA, > > > > what happens when VMA flags are different/etc? > > > > > > A debugger shouldn't complain if a portion of the debuggee is > > > read-only, just overwrite the data. > > > > At this point the kernel API here is so incredibly limited you may as well use a > > memfd for passing the shared address space instead of trying to do and > > maintain this complexity. > > > > Your use case is only qemu, so what is the problem to replace the allocator > > backing VM memory in userspace? Other people have been talking about > > doing a memfd already for different reasons - and memfd can already be > > shared as this scheme desires. > > KSM doesn't work on shmem. > Once you replace the allocator you render KSM useless. I suspect making memfd to work with KSM will be much less hacky than this. > Figures out it can peek into any kind of memory involving pages. No, this approach is really liminted to anonymous VMAs. You might make some argument that VMA differences can be ignored if they are all anonymous to start with, but certainly not once other types are VMAs are included. Jason