qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] xen-mapcache: use MAP_FIXED flag so the mmap


From: Roger Pau Monné
Subject: Re: [Qemu-devel] [PATCH v2] xen-mapcache: use MAP_FIXED flag so the mmap address hint is always honored
Date: Mon, 18 Mar 2019 17:03:55 +0100
User-agent: NeoMutt/20180716

On Mon, Mar 18, 2019 at 03:48:59PM +0000, Igor Druzhinin wrote:
> On 18/03/2019 15:45, Roger Pau Monne wrote:
> > Or if it's not possible to honor the hinted address an error is returned
> > instead. This makes it easier to spot the actual failure, instead of
> > failing later on when the caller of xen_remap_bucket realizes the
> > mapping has not been created at the requested address.
> > 
> > Also note that at least on FreeBSD using MAP_FIXED will cause mmap to
> > try harder to honor the passed address.
> > 
> > Signed-off-by: Roger Pau Monné <address@hidden>
> > ---
> > Cc: Stefano Stabellini <address@hidden>
> > Cc: Anthony Perard <address@hidden>
> > Cc: Paul Durrant <address@hidden>
> > Cc: Igor Druzhinin <address@hidden>
> > Cc: Paolo Bonzini <address@hidden>
> > Cc: Richard Henderson <address@hidden>
> > Cc: Eduardo Habkost <address@hidden>
> > Cc: "Michael S. Tsirkin" <address@hidden>
> > Cc: Marcel Apfelbaum <address@hidden>
> > Cc: address@hidden
> > ---
> > Changes since v1:
> >  - Use MAP_FIXED for the dummy mmap call also if a specific virtual
> >    address is requested.
> > ---
> >  hw/i386/xen/xen-mapcache.c | 10 ++++++++--
> >  1 file changed, 8 insertions(+), 2 deletions(-)
> > 
> > diff --git a/hw/i386/xen/xen-mapcache.c b/hw/i386/xen/xen-mapcache.c
> > index 349f72d00c..23de5517db 100644
> > --- a/hw/i386/xen/xen-mapcache.c
> > +++ b/hw/i386/xen/xen-mapcache.c
> > @@ -185,8 +185,13 @@ static void xen_remap_bucket(MapCacheEntry *entry,
> >      }
> >  
> >      if (!dummy) {
> > +        /*
> > +         * If the caller has requested the mapping at a specific address 
> > use
> > +         * MAP_FIXED to make sure it's honored.
> > +         */
> 
> Since the comment now applied to both invocation - could it be moved
> outside the if statement then?

I felt that was too far from the actual call, but I can move it if
there's consensus.

Thanks, Roger.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]