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

Re: [Xen-devel] [PATCH v2] xen-mapcache: use MAP_FIXED flag so the mmap address hint is always honored


  • To: Igor Druzhinin <igor.druzhinin@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 18 Mar 2019 17:03:55 +0100
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Eduardo Habkost <ehabkost@xxxxxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, qemu-devel@xxxxxxxxxx, Paul Durrant <paul.durrant@xxxxxxxxxx>, Marcel Apfelbaum <marcel.apfelbaum@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Anthony Perard <anthony.perard@xxxxxxxxxx>, Paolo Bonzini <pbonzini@xxxxxxxxxx>, Richard Henderson <rth@xxxxxxxxxxx>
  • Delivery-date: Mon, 18 Mar 2019 16:06:00 +0000
  • Ironport-data: A9a23:hAYyuqztBAaTqHbKs2J6t4n5zX0d5JwBZkZCjnLp7oibGKorsQWnbB cRrBPUIPXZHx7+72VRRS0GgCJusaJMO7kswxul+68SOi+0K0hHb73o43LDnBKgPVIBU9pIbT B8f60P81zKYJWE1LgW4n6NTEkImmZP3VayFHiGwBAL1D1ICsZj99+x5ud6DqcHNi1myn2Lyk 8hGfah486RgixFO88V6J/jotwpJwheI7KdmmXM1wX7ymOhS2bO8Ch+1Hn98pB5HyNV9KYTmA Ok/zynTKI+Qg5///cqjiSicWGKnYyQmGirqlbZF5JeTtE/uB9tEBA41DE/3dWfmCCxzZmTEn Z9xbZzy3FzhOGpTSNuO6XFTUHNT8iH8bUxV+z8zYhMtc23ur5uy2E8WN0ABnD8U6s8PD043u HajdjJhfE5mFd0c6ur9ZpkK2RTuOom3C2kiS/3Zenvj0m9XPcWxyR22JKYWE2vJF22MlHRPi OQ2Cf/3JX2ZvLpVsKAsUS/YGdvutiQlr7Y7x4NzwNFBFW8aQosI3XE7Fsa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ZbembXHif5jec2N/Cr iQCak97AI2XQG085+h02HbpaepUO6bvbidBBD0iE4F9VnSF2DgQR93OmLE5J/Ym5koRdK0b2 E+nP1C4dgpWE38ZlWkgvejTob+FikcRCpzYtwmvPrk31wZkr8OeyurmsBaZPayNcLS3wMam2 yu3KXQCN34tB/hQUBmYmPSxGSocKLk9ONtnHVNMQEXRYz5Eatg5QUnYZGEZD6TtteGEelBJH ZtgDbHtxoswyY2UZ8c7M5pXzJ97nGQo+b1xGNZqQzWhRTKhoDnUJ/i/OEWPYccjGu8J9SXVu m99EfGSfzpwb1f+TJaoL4hDvMh3eFiWfPz3Z0Ec0pOtegIwMXe3JSi5gc+qlM4NEfJZDzYqh r3ndEthHnYpMj2SHBIMP5qs9sjrgOvGbvtA/veGr8Z0X41jEMcxZkNJ4Da8P2zVRNMBG7j6a FqmnHTXGoV1sS6TwfaIbETr3YXge7XbvDcQNjQq/FJ+qdzWUAVBGNi95sc7YK9AZmEPFJG31 PR0raf
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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é <roger.pau@xxxxxxxxxx>
> > ---
> > Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> > Cc: Anthony Perard <anthony.perard@xxxxxxxxxx>
> > Cc: Paul Durrant <paul.durrant@xxxxxxxxxx>
> > Cc: Igor Druzhinin <igor.druzhinin@xxxxxxxxxx>
> > Cc: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> > Cc: Richard Henderson <rth@xxxxxxxxxxx>
> > Cc: Eduardo Habkost <ehabkost@xxxxxxxxxx>
> > Cc: "Michael S. Tsirkin" <mst@xxxxxxxxxx>
> > Cc: Marcel Apfelbaum <marcel.apfelbaum@xxxxxxxxx>
> > Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
> > ---
> > 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.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.