All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 0/1] xen queue 2019-03-19
@ 2019-03-19 15:42 Anthony PERARD
  2019-03-19 15:42 ` [PULL 1/1] xen-mapcache: use MAP_FIXED flag so the mmap address hint is always honored Anthony PERARD
  2019-03-19 16:26 ` [PULL 0/1] xen queue 2019-03-19 Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: Anthony PERARD @ 2019-03-19 15:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: xen-devel, Peter Maydell

The following changes since commit b98a66201dbc7cf3b962f4bb260f66100cc75578:

  Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-4.0-rc0-2' into staging (2019-03-19 12:55:02 +0000)

are available in the Git repository at:

  https://xenbits.xen.org/git-http/people/aperard/qemu-dm.git tags/pull-xen-20190319

for you to fetch changes up to 4158e93f4aced247c8db94a0275fc027da7dc97e:

  xen-mapcache: use MAP_FIXED flag so the mmap address hint is always honored (2019-03-19 15:32:13 +0000)

----------------------------------------------------------------
Xen queue

Fix a bug on FreeBSD when doing a migration.

----------------------------------------------------------------
Roger Pau Monne (1):
      xen-mapcache: use MAP_FIXED flag so the mmap address hint is always honored

 hw/i386/xen/xen-mapcache.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PULL 1/1] xen-mapcache: use MAP_FIXED flag so the mmap address hint is always honored
  2019-03-19 15:42 [PULL 0/1] xen queue 2019-03-19 Anthony PERARD
@ 2019-03-19 15:42 ` Anthony PERARD
  2019-03-19 16:26 ` [PULL 0/1] xen queue 2019-03-19 Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Anthony PERARD @ 2019-03-19 15:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: xen-devel, Peter Maydell

From: Roger Pau Monne <roger.pau@citrix.com>

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@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Igor Druzhinin <igor.druzhinin@cirtix.com>
Message-Id: <20190318173731.14494-1-roger.pau@citrix.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 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..254759f776 100644
--- a/hw/i386/xen/xen-mapcache.c
+++ b/hw/i386/xen/xen-mapcache.c
@@ -184,9 +184,14 @@ static void xen_remap_bucket(MapCacheEntry *entry,
         pfns[i] = (address_index << (MCACHE_BUCKET_SHIFT-XC_PAGE_SHIFT)) + i;
     }
 
+    /*
+     * If the caller has requested the mapping at a specific address use
+     * MAP_FIXED to make sure it's honored.
+     */
     if (!dummy) {
         vaddr_base = xenforeignmemory_map2(xen_fmem, xen_domid, vaddr,
-                                           PROT_READ | PROT_WRITE, 0,
+                                           PROT_READ | PROT_WRITE,
+                                           vaddr ? MAP_FIXED : 0,
                                            nb_pfn, pfns, err);
         if (vaddr_base == NULL) {
             perror("xenforeignmemory_map2");
@@ -198,7 +203,8 @@ static void xen_remap_bucket(MapCacheEntry *entry,
          * mapping immediately due to certain circumstances (i.e. on resume now)
          */
         vaddr_base = mmap(vaddr, size, PROT_READ | PROT_WRITE,
-                          MAP_ANON | MAP_SHARED, -1, 0);
+                          MAP_ANON | MAP_SHARED | (vaddr ? MAP_FIXED : 0),
+                          -1, 0);
         if (vaddr_base == MAP_FAILED) {
             perror("mmap");
             exit(-1);
-- 
Anthony PERARD


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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PULL 0/1] xen queue 2019-03-19
  2019-03-19 15:42 [PULL 0/1] xen queue 2019-03-19 Anthony PERARD
  2019-03-19 15:42 ` [PULL 1/1] xen-mapcache: use MAP_FIXED flag so the mmap address hint is always honored Anthony PERARD
@ 2019-03-19 16:26 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2019-03-19 16:26 UTC (permalink / raw)
  To: Anthony PERARD; +Cc: open list:X86, QEMU Developers

On Tue, 19 Mar 2019 at 15:45, Anthony PERARD <anthony.perard@citrix.com> wrote:
>
> The following changes since commit b98a66201dbc7cf3b962f4bb260f66100cc75578:
>
>   Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-4.0-rc0-2' into staging (2019-03-19 12:55:02 +0000)
>
> are available in the Git repository at:
>
>   https://xenbits.xen.org/git-http/people/aperard/qemu-dm.git tags/pull-xen-20190319
>
> for you to fetch changes up to 4158e93f4aced247c8db94a0275fc027da7dc97e:
>
>   xen-mapcache: use MAP_FIXED flag so the mmap address hint is always honored (2019-03-19 15:32:13 +0000)
>
> ----------------------------------------------------------------
> Xen queue
>
> Fix a bug on FreeBSD when doing a migration.
>
> ----------------------------------------------------------------

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/4.0
for any user-visible changes.

-- PMM

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-03-19 16:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-19 15:42 [PULL 0/1] xen queue 2019-03-19 Anthony PERARD
2019-03-19 15:42 ` [PULL 1/1] xen-mapcache: use MAP_FIXED flag so the mmap address hint is always honored Anthony PERARD
2019-03-19 16:26 ` [PULL 0/1] xen queue 2019-03-19 Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.