[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: Roger Pau Monne <roger.pau@xxxxxxxxxx>, <qemu-devel@xxxxxxxxxx>
  • From: Igor Druzhinin <igor.druzhinin@xxxxxxxxxx>
  • Date: Mon, 18 Mar 2019 15:48:59 +0000
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Eduardo Habkost <ehabkost@xxxxxxxxxx>, "Michael S. Tsirkin" <mst@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 15:49:12 +0000
  • Ironport-data: A9a23:AkFK968pET8TrPkGNa6ODrVtTnXE1q7SOkUsXf30WtOx9vZTYH1zNC RDaFL6NvwrQR65wnvXRMO37euHkVVE78PsBs9JeH3yORE+Q6KLtBBf6AESQzoocDAzAr+86M f9HfPF4UeaxXOCYZt5wF1AXd7dJlUl/0orLSnLg5NtWxrxFtbGpF7VAd6fCXTGYNpptBtUhm UvbCgY6Oq1xsB2GM0ItVl/nFkL6/IWJMUfM1HLSXv6ME2c9lix8pWB/zwTnnrS4skmp/+wVV MCpH5zlunsxET6881mViIfBALx+7L8c/9NeOlQkESe3lLZ5mLpklh3Fu63zImVhuiy73+O0V 6ZNyCGixZlX3hoCVJCiZug6oUFinyElncFf45Mn49fYeeCwqizv7EwZt1qAqPGCnGHhzKBFQ h/wxMjJLGT90C9DSET+Go81wcNGq5Qj6X0x5SOZKYZcQ2/zWJlFfwunl3dQO7fsl6Sh92TW9 RodoBxzN/O2ASju9a4lFsDaVM0Q+d91Iyerh8S82oZFDSFwptbmjMFbPmzdz+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PGW8E0GL8VGr5ZeRGTdk3HKsnVjpJz Kr+jcuHDkLWyD0ANyUDe7IVf3JkoS2o0BNH133SADbbg25G0SPm2jL3EmanH0wcH7weApUya BkK9zDKR3BYxgcsu0W31lBif5os4lx7J+zbTHeXAp00AtcCx9rQ4YLsLJwf5eUjPYmbPLw6o dAUHOtWCEL6mk2S8PNX4nirSd2Rjr2tqjlhx9ELZDCIQESxszijFJfVrTeKNh7/5f8RyMSom W1XfVRorpvocCN6SqXUDhDiA+drz1jMbKeluPd8NS+zh1Pq56Fa8YXnh4aJek/M7cvd8hufN WwqQ24OWKOi67Rr5Kuj9sDoBPLL2jU7m3RFWzWubygLzA8i6r81qZFZlyL87mc15whsPVgX4 U2Zoh+tJqJ7m5RVq/c048MnshKnoqLtxoPcUM7L7mc6moQcTZefp7spTK2dWVsoO2YxZH8Z/ gGmv2SY9V4NRonqchbg9ztIoYCMGYdPFCGfleJO8Xyc05wtw8iD6jASJpYtE6xxyNPoapII3 oMAkkh3ehmmDLKMge9TzTd0S0JhCLW1zUhjVN5Mz5JXIUL2YTfKtmlmCE1/vSwUL/G1KvPLw ==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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?

Igor

_______________________________________________
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®.