From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Sistare Subject: Re: [RFC PATCH 0/5] madvise MADV_DOEXEC Date: Fri, 31 Jul 2020 13:15:34 -0400 Message-ID: <71ddd3c1-bb59-3e63-e137-99b88ace454d@oracle.com> References: <20200730152250.GG23808@casper.infradead.org> <20200730171251.GI23808@casper.infradead.org> <63a7404c-e4f6-a82e-257b-217585b0277f@oracle.com> <20200730174956.GK23808@casper.infradead.org> <87y2n03brx.fsf@x220.int.ebiederm.org> <689d6348-6029-5396-8de7-a26bc3c017e5@oracle.com> <20200731152736.GP23808@casper.infradead.org> <9ba26063-0098-e796-9431-8c1d0c076ffc@oracle.com> <20200731165649.GG24045@ziepe.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20200731165649.GG24045@ziepe.ca> Content-Language: en-US Sender: linux-fsdevel-owner@vger.kernel.org To: Jason Gunthorpe Cc: Matthew Wilcox , "Eric W. Biederman" , Anthony Yznaga , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, mhocko@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, arnd@arndb.de, keescook@chromium.org, gerg@linux-m68k.org, ktkhai@virtuozzo.com, christian.brauner@ubuntu.com, peterz@infradead.org, esyr@redhat.com, christian@kellner.me, areber@redhat.com, cyphar@cyphar.com List-Id: linux-arch.vger.kernel.org On 7/31/2020 12:56 PM, Jason Gunthorpe wrote: > On Fri, Jul 31, 2020 at 12:11:52PM -0400, Steven Sistare wrote: >>> Your preservation-across-exec use-case might or might not need the >>> VMA to be mapped at the same address. >> >> It does. qemu registers memory with vfio which remembers the va's in kernel >> metadata for the device. > > Once the memory is registered with vfio the VA doesn't matter, vfio > will keep the iommu pointing at the same physical pages no matter > where they are mapped. Yes, but there are other code paths that compute and use offsets between va and the base va. Mapping at a different va in the new process breaks vfio; I have tried it. - Steve From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [RFC PATCH 0/5] madvise MADV_DOEXEC References: <20200730152250.GG23808@casper.infradead.org> <20200730171251.GI23808@casper.infradead.org> <63a7404c-e4f6-a82e-257b-217585b0277f@oracle.com> <20200730174956.GK23808@casper.infradead.org> <87y2n03brx.fsf@x220.int.ebiederm.org> <689d6348-6029-5396-8de7-a26bc3c017e5@oracle.com> <20200731152736.GP23808@casper.infradead.org> <9ba26063-0098-e796-9431-8c1d0c076ffc@oracle.com> <20200731165649.GG24045@ziepe.ca> From: Steven Sistare Message-ID: <71ddd3c1-bb59-3e63-e137-99b88ace454d@oracle.com> Date: Fri, 31 Jul 2020 13:15:34 -0400 MIME-Version: 1.0 In-Reply-To: <20200731165649.GG24045@ziepe.ca> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org To: Jason Gunthorpe Cc: Matthew Wilcox , "Eric W. Biederman" , Anthony Yznaga , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, mhocko@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, arnd@arndb.de, keescook@chromium.org, gerg@linux-m68k.org, ktkhai@virtuozzo.com, christian.brauner@ubuntu.com, peterz@infradead.org, esyr@redhat.com, christian@kellner.me, areber@redhat.com, cyphar@cyphar.com List-ID: Message-ID: <20200731171534.IbuQbcEpC2Y2SkiEIzLBrB9IAnAg3OHNWu9GS-JqpZU@z> On 7/31/2020 12:56 PM, Jason Gunthorpe wrote: > On Fri, Jul 31, 2020 at 12:11:52PM -0400, Steven Sistare wrote: >>> Your preservation-across-exec use-case might or might not need the >>> VMA to be mapped at the same address. >> >> It does. qemu registers memory with vfio which remembers the va's in kernel >> metadata for the device. > > Once the memory is registered with vfio the VA doesn't matter, vfio > will keep the iommu pointing at the same physical pages no matter > where they are mapped. Yes, but there are other code paths that compute and use offsets between va and the base va. Mapping at a different va in the new process breaks vfio; I have tried it. - Steve