Linux userland API discussions
 help / color / mirror / Atom feed
* Re: [RFC PATCH 0/5] madvise MADV_DOEXEC
       [not found]   ` <28125570-4129-bcba-099b-f90481cfbfe8@oracle.com>
@ 2020-07-28 13:40     ` Christian Brauner
  0 siblings, 0 replies; only message in thread
From: Christian Brauner @ 2020-07-28 13:40 UTC (permalink / raw)
  To: Steven Sistare
  Cc: Eric W. Biederman, Anthony Yznaga, linux-kernel, linux-fsdevel,
	linux-mm, linux-arch, mhocko, tglx, mingo, bp, x86, hpa, viro,
	akpm, arnd, keescook, gerg, ktkhai, peterz, esyr, jgg, christian,
	areber, cyphar, linux-api

On Mon, Jul 27, 2020 at 02:00:17PM -0400, Steven Sistare wrote:
> On 7/27/2020 1:07 PM, ebiederm@xmission.com wrote:
> > Anthony Yznaga <anthony.yznaga@oracle.com> writes:
> > 
> >> This patchset adds support for preserving an anonymous memory range across
> >> exec(3) using a new madvise MADV_DOEXEC argument.  The primary benefit for
> >> sharing memory in this manner, as opposed to re-attaching to a named shared
> >> memory segment, is to ensure it is mapped at the same virtual address in
> >> the new process as it was in the old one.  An intended use for this is to
> >> preserve guest memory for guests using vfio while qemu exec's an updated
> >> version of itself.  By ensuring the memory is preserved at a fixed address,
> >> vfio mappings and their associated kernel data structures can remain valid.
> >> In addition, for the qemu use case, qemu instances that back guest RAM with
> >> anonymous memory can be updated.
> > 
> > What is wrong with using a file descriptor to a possibly deleted file
> > and re-mmaping it?
> > 
> > There is already MAP_FIXED that allows you to ensure you have the same
> > address.
> 
> MAP_FIXED blows away any existing mapping in that range, which is not the 
> desired behavior.  We want to preserve the previously created mapping at

There's also MAP_FIXED_NOREPLACE since v4.17 in case that helps.

Note that this should really go to linux-api too. I won't argue to
resend it since that would mean spamming everyone's inbox with the same
thread again but in case you send a revised version, please ensure to Cc
linux-api. The glibc folks are listening on there too.

Thanks!
Christian

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-28 13:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1595869887-23307-1-git-send-email-anthony.yznaga@oracle.com>
     [not found] ` <87pn8glwd2.fsf@x220.int.ebiederm.org>
     [not found]   ` <28125570-4129-bcba-099b-f90481cfbfe8@oracle.com>
2020-07-28 13:40     ` [RFC PATCH 0/5] madvise MADV_DOEXEC Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox