lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 21 Jan 2021 14:13:50 -0800
From:   Axel Rasmussen <axelrasmussen@...gle.com>
To:     Peter Xu <peterx@...hat.com>
Cc:     Alexander Viro <viro@...iv.linux.org.uk>,
        Alexey Dobriyan <adobriyan@...il.com>,
        Andrea Arcangeli <aarcange@...hat.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Anshuman Khandual <anshuman.khandual@....com>,
        Catalin Marinas <catalin.marinas@....com>,
        Chinwen Chang <chinwen.chang@...iatek.com>,
        Huang Ying <ying.huang@...el.com>,
        Ingo Molnar <mingo@...hat.com>, Jann Horn <jannh@...gle.com>,
        Jerome Glisse <jglisse@...hat.com>,
        Lokesh Gidra <lokeshgidra@...gle.com>,
        "Matthew Wilcox (Oracle)" <willy@...radead.org>,
        Michael Ellerman <mpe@...erman.id.au>,
        Michal Koutný <mkoutny@...e.com>,
        Michel Lespinasse <walken@...gle.com>,
        Mike Kravetz <mike.kravetz@...cle.com>,
        Mike Rapoport <rppt@...ux.vnet.ibm.com>,
        Nicholas Piggin <npiggin@...il.com>, Shaohua Li <shli@...com>,
        Shawn Anastasio <shawn@...stas.io>,
        Steven Rostedt <rostedt@...dmis.org>,
        Steven Price <steven.price@....com>,
        Vlastimil Babka <vbabka@...e.cz>,
        LKML <linux-kernel@...r.kernel.org>,
        linux-fsdevel@...r.kernel.org, Linux MM <linux-mm@...ck.org>,
        Adam Ruprecht <ruprecht@...gle.com>,
        Cannon Matthews <cannonmatthews@...gle.com>,
        "Dr . David Alan Gilbert" <dgilbert@...hat.com>,
        David Rientjes <rientjes@...gle.com>,
        Oliver Upton <oupton@...gle.com>
Subject: Re: [PATCH 0/9] userfaultfd: add minor fault handling

On Thu, Jan 21, 2021 at 11:12 AM Peter Xu <peterx@...hat.com> wrote:
>
> On Fri, Jan 15, 2021 at 11:04:42AM -0800, Axel Rasmussen wrote:
> > UFFDIO_COPY and UFFDIO_ZEROPAGE cannot be used to resolve minor faults. Without
> > modifications, the existing codepath assumes a new page needs to be allocated.
> > This is okay, since userspace must have a second non-UFFD-registered mapping
> > anyway, thus there isn't much reason to want to use these in any case (just
> > memcpy or memset or similar).
> >
> > - If UFFDIO_COPY is used on a minor fault, -EEXIST is returned.
>
> When minor fault the dst VM will report to src with the address.  The src could
> checkup whether dst contains the latest data on that (pmd) page and either:
>
>   - it's latest, then tells dst, dst does UFFDIO_CONTINUE
>
>   - it's not latest, then tells dst (probably along with the page data?  if
>     hugetlbfs doesn't support double map, we'd need to batch all the dirty
>     small pages in one shot), dst does whatever to replace the page
>
> Then, I'm thinking what would be the way to replace an old page.. is that one
> FALLOC_FL_PUNCH_HOLE plus one UFFDIO_COPY at last?

When I wrote this, my thinking was that users of this feature would
have two mappings, one of which is not UFFD registered at all. So, to
replace the existing page contents, userspace would just write to the
non-UFFD mapping (with memcpy() or whatever else, or we could get
fancy and imagine using some RDMA technology to copy the page over the
network from the live migration source directly in place). After
performing the write, we just UFFDIO_CONTINUE.

I believe FALLOC_FL_PUNCH_HOLE / MADV_REMOVE doesn't work with
hugetlbfs? Once shmem support is implemented, I would expect
FALLOC_FL_PUNCH_HOLE + UFFDIO_COPY to work, but I wonder if such an
operation would be more expensive than just copying using the other
side of the shared mapping?

>
> Thanks,
>
> --
> Peter Xu
>

Powered by blists - more mailing lists