Re: [PATCH] xen-mapcache: avoid a race on memory map while using MAP_FIXED

2021-04-20 Thread Igor Druzhinin via
889702-13104-1-git-send-email-igor.druzhi...@citrix.com Switched to a new branch 'test' 3102519 xen-mapcache: avoid a race on memory map while using MAP_FIXED === OUTPUT BEGIN === ERROR: Author email address is mangled by the mailing list #2: Author: Igor Druzhinin via total: 1 errors, 0 warnings, 21

Re: [PATCH] xen-mapcache: avoid a race on memory map while using MAP_FIXED

2021-04-20 Thread Igor Druzhinin via
On 20/04/2021 09:53, Roger Pau Monné wrote: On Tue, Apr 20, 2021 at 04:35:02AM +0100, Igor Druzhinin wrote: When we're replacing the existing mapping there is possibility of a race on memory map with other threads doing mmap operations - the address being unmapped/re-mapped could be occupied

[PATCH] xen-mapcache: avoid a race on memory map while using MAP_FIXED

2021-04-19 Thread Igor Druzhinin via
accesses to the replaced region - those might still fail with SIGBUS due to xenforeignmemory_map not being atomic. So we're still not expecting those. Tested-by: Anthony PERARD Signed-off-by: Igor Druzhinin --- hw/i386/xen/xen-mapcache.c | 15 ++- 1 file changed, 14 insertions(+), 1

[Qemu-devel] [PATCH] xen: cleanup IOREQ server on exit

2019-07-29 Thread Igor Druzhinin
Device model is supposed to destroy IOREQ server for itself. Signed-off-by: Igor Druzhinin --- hw/i386/xen/xen-hvm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index e8e79e0..30a5948 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen

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

2019-03-18 Thread Igor Druzhinin
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é > Reviewed-by: Paul Durrant > --- > Cc: Stefano Stabellini > Cc: Anthony Perard > Cc

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

2019-03-18 Thread Igor Druzhinin
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é > --- > Cc: Stefano Stabellini > Cc: Anthony Perard > Cc: Paul Durrant > Cc:

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

2019-03-15 Thread Igor Druzhinin
On 15/03/2019 18:38, Anthony PERARD wrote: > On Fri, Mar 15, 2019 at 06:14:09PM +, Anthony PERARD wrote: >> On Fri, Mar 15, 2019 at 09:58:47AM +0100, 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

Re: [Qemu-devel] Commit 331b51 breaks live migration on FreeBSD/Xen dom0

2019-03-14 Thread Igor Druzhinin
On 14/03/2019 15:54, Roger Pau Monné wrote: > The log of the incoming QEMU is: > > qemu-system-i386: -serial pty: char device redirected to /dev/pts/4 (label > serial0) > xen: shared page at pfn feff0 > xen: buffered io page at pfn feff1 > xen: buffered io evtchn is 4 > xen_mapcache:

Re: [Qemu-devel] [PATCH] block/nvme: call blk_drain in NVMe reset code to avoid lockups

2018-11-20 Thread Igor Druzhinin
On 14/11/2018 17:42, Igor Druzhinin wrote: > On 06/11/2018 12:16, Igor Druzhinin wrote: >> When blk_flush called in NVMe reset path S/C queues are already freed >> which means that re-entering AIO handling loop having some IO requests >> unfinished will lockup or crash as thei

Re: [Qemu-devel] [PATCH] block/nvme: call blk_drain in NVMe reset code to avoid lockups

2018-11-14 Thread Igor Druzhinin
On 06/11/2018 12:16, Igor Druzhinin wrote: > When blk_flush called in NVMe reset path S/C queues are already freed > which means that re-entering AIO handling loop having some IO requests > unfinished will lockup or crash as their SG structures being potentially > reused. Call blk_

[Qemu-devel] [PATCH] block/nvme: call blk_drain in NVMe reset code to avoid lockups

2018-11-06 Thread Igor Druzhinin
. Signed-off-by: Igor Druzhinin --- hw/block/nvme.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index fc7dacb..cdf836e 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -797,6 +797,8 @@ static void nvme_clear_ctrl(NvmeCtrl *n) { int i

[Qemu-devel] [PATCH] xen/hvm: correct reporting of modified memory under physmap during migration

2018-04-25 Thread Igor Druzhinin
there is no way to access physmap properly inside xen_hvm_modified_memory() let's make it a global structure. Signed-off-by: Igor Druzhinin <igor.druzhi...@citrix.com> --- hw/i386/xen/xen-hvm.c | 37 +++-- hw/i386/xen/xen-mapcache.c| 2 +- include/

[Qemu-devel] [PATCH v2] xen/pt: use address_space_memory object for memory region hooks

2018-04-17 Thread Igor Druzhinin
that the original patch tried to workaround (uneven number of region_add/del calls on device attach/detach) was fixed in d25836cafd (memory: do explicit cleanup when remove listeners). Signed-off-by: Igor Druzhinin <igor.druzhi...@citrix.com> Reported-by: Ross Lagerwall <ross.lagerw...@citrix.c

Re: [Qemu-devel] [PATCH] xen/pt: use address_space_memory object for memory region hooks

2018-04-17 Thread Igor Druzhinin
On 17/04/18 15:15, Anthony PERARD wrote: > On Fri, Apr 06, 2018 at 10:21:23PM +0100, Igor Druzhinin wrote: >> Commit 99605175c (xen-pt: Fix PCI devices re-attach failed) introduced >> a subtle bug. As soon as the guest switches off Bus Mastering on the >> device it immediatel

Re: [Qemu-devel] [PATCH] xen/pt: use address_space_memory object for memory region hooks

2018-04-17 Thread Igor Druzhinin
On 17/04/18 15:15, Anthony PERARD wrote: > On Fri, Apr 06, 2018 at 10:21:23PM +0100, Igor Druzhinin wrote: >> Commit 99605175c (xen-pt: Fix PCI devices re-attach failed) introduced >> a subtle bug. As soon as the guest switches off Bus Mastering on the >> device it immediatel

Re: [Qemu-devel] [PATCH] xen/pt: use address_space_memory object for memory region hooks

2018-04-17 Thread Igor Druzhinin
ping?

[Qemu-devel] [PATCH] xen/pt: use address_space_memory object for memory region hooks

2018-04-06 Thread Igor Druzhinin
that the original patch tried to workaround (uneven number of region_add/del calls on device attach/detach) was fixed in later QEMU versions. Signed-off-by: Igor Druzhinin <igor.druzhi...@citrix.com> Reported-by: Ross Lagerwall <ross.lagerw...@citrix.com> --- hw/xen/xen_pt.c | 2 +- 1 fil

[Qemu-devel] [PATCH v2] xen-pvdevice: Introduce a simplistic xen-pvdevice save state

2018-03-13 Thread Igor Druzhinin
region to fail. PV tools enable some logic to save and restore PCI configuration state from within the VM every time it migrates which basically hides the issue. Older systems will acquire the new record when migrated which should not change their state for worse. Signed-off-by: Igor Druzhinin

[Qemu-devel] [PATCH] xen-pvdevice: Introduce a simplistic xen-pvdevice save state

2018-03-08 Thread Igor Druzhinin
This should help to avoid problems with accessing the device after migration/resume without PV drivers. Older systems will acquire the new record when migrated which should not change their state for worse. Signed-off-by: Igor Druzhinin <igor.druzhi...@citrix.com> --- hw/i386/xen/xen_pvde

Re: [Qemu-devel] [PULL for-2.10 6/7] xen/mapcache: introduce xen_replace_cache_entry()

2017-07-21 Thread Igor Druzhinin
On 21/07/17 14:50, Anthony PERARD wrote: On Tue, Jul 18, 2017 at 03:22:41PM -0700, Stefano Stabellini wrote: From: Igor Druzhinin <igor.druzhi...@citrix.com> ... +static uint8_t *xen_replace_cache_entry_unlocked(hwaddr old_phys_addr, +

[Qemu-devel] [PATCH v3 3/4] xen/mapcache: introduce xen_replace_cache_entry()

2017-07-10 Thread Igor Druzhinin
xenforeignmemory_map2() call with an extended interface that was recently introduced in libxenforeignmemory [1]. [1] https://www.mail-archive.com/xen-devel@lists.xen.org/msg113007.html Signed-off-by: Igor Druzhinin <igor.druzhi...@citrix.com> --- configure | 18 +++

[Qemu-devel] [PATCH v3 4/4] xen: don't use xenstore to save/restore physmap anymore

2017-07-10 Thread Igor Druzhinin
for compatibility reasons. Signed-off-by: Igor Druzhinin <igor.druzhi...@citrix.com> --- hw/i386/xen/xen-hvm.c | 48 ++--- hw/i386/xen/xen-mapcache.c | 4 include/hw/xen/xen_common.h | 1 + 3 files changed, 42 insertions(+), 11 deletions(-)

[Qemu-devel] [PATCH v3 1/4] xen: move physmap saving into a separate function

2017-07-10 Thread Igor Druzhinin
Non-functional change. Signed-off-by: Igor Druzhinin <igor.druzhi...@citrix.com> Reviewed-by: Stefano Stabellini <sstabell...@kernel.org> Reviewed-by: Paul Durrant <paul.durr...@citrix.com> --- hw/i386/xen/xen-hvm.c | 57 ---

[Qemu-devel] [PATCH v3 0/4] xen: don't save/restore the physmap on VM save/restore

2017-07-10 Thread Igor Druzhinin
instead of allocating a new one * Patch 4: don't use xen_phys_offset_to_gaddr in non-compat mode --- Igor Druzhinin (4): xen: move physmap saving into a separate function xen/mapcache: add an ability to create dummy mappings xen/mapcache: introduce xen_replace_cache_entry() xen: don't use

[Qemu-devel] [PATCH v3 2/4] xen/mapcache: add an ability to create dummy mappings

2017-07-10 Thread Igor Druzhinin
Dummys are simple anonymous mappings that are placed instead of regular foreign mappings in certain situations when we need to postpone the actual mapping but still have to give a memory region to QEMU to play with. This is planned to be used for restore on Xen. Signed-off-by: Igor Druzhinin

Re: [Qemu-devel] [PATCH v2 3/4] xen/mapcache: introduce xen_replace_cache_entry()

2017-07-04 Thread Igor Druzhinin
On 04/07/17 17:42, Paul Durrant wrote: >> -Original Message- >> From: Igor Druzhinin >> Sent: 04 July 2017 17:34 >> To: Paul Durrant <paul.durr...@citrix.com>; xen-de...@lists.xenproject.org; >> qemu-devel@nongnu.org >> Cc: sstabell...@kernel.org;

Re: [Qemu-devel] [PATCH v2 3/4] xen/mapcache: introduce xen_replace_cache_entry()

2017-07-04 Thread Igor Druzhinin
On 04/07/17 17:27, Paul Durrant wrote: >> -Original Message- >> From: Igor Druzhinin >> Sent: 04 July 2017 16:48 >> To: xen-de...@lists.xenproject.org; qemu-devel@nongnu.org >> Cc: Igor Druzhinin <igor.druzhi...@citrix.com>; sstabell...@kernel

[Qemu-devel] [PATCH v2 3/4] xen/mapcache: introduce xen_replace_cache_entry()

2017-07-04 Thread Igor Druzhinin
xenforeignmemory_map2() call with an extended interface that was recently introduced in libxenforeignmemory [1]. [1] https://www.mail-archive.com/xen-devel@lists.xen.org/msg113007.html Signed-off-by: Igor Druzhinin <igor.druzhi...@citrix.com> --- configure | 18

[Qemu-devel] [PATCH v2 2/4] xen/mapcache: add an ability to create dummy mappings

2017-07-04 Thread Igor Druzhinin
Dummys are simple anonymous mappings that are placed instead of regular foreign mappings in certain situations when we need to postpone the actual mapping but still have to give a memory region to QEMU to play with. This is planned to be used for restore on Xen. Signed-off-by: Igor Druzhinin

[Qemu-devel] [PATCH v2 1/4] xen: move physmap saving into a separate function

2017-07-04 Thread Igor Druzhinin
Non-functional change. Signed-off-by: Igor Druzhinin <igor.druzhi...@citrix.com> --- hw/i386/xen/xen-hvm.c | 57 --- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index c

[Qemu-devel] [PATCH v2 0/4] xen: don't save/restore the physmap on VM save/restore

2017-07-04 Thread Igor Druzhinin
the logic of xen_replace_cache_entry_unlocked to reuse the existing entry instead of allocating a new one * Patch 4: don't use xen_phys_offset_to_gaddr in non-compat mode --- Igor Druzhinin (4): xen: move physmap saving into a separate function xen/mapcache: add an ability to create dummy

[Qemu-devel] [PATCH v2 4/4] xen: don't use xenstore to save/restore physmap anymore

2017-07-04 Thread Igor Druzhinin
for compatibility reasons. Signed-off-by: Igor Druzhinin <igor.druzhi...@citrix.com> --- hw/i386/xen/xen-hvm.c | 48 ++--- include/hw/xen/xen_common.h | 1 + 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/hw/i386/xen/xen-hvm.c b/h

Re: [Qemu-devel] [PATCH 3/4] xen/mapcache: introduce xen_remap_cache_entry()

2017-07-03 Thread Igor Druzhinin
On 01/07/17 01:08, Stefano Stabellini wrote: > On Fri, 30 Jun 2017, Igor Druzhinin wrote: >> This new call is trying to update a requested map cache entry >> according to the changes in the physmap. The call is searching >> for the entry, unmaps it, tries to translate the addr

Re: [Qemu-devel] [PATCH 2/4] xen/mapcache: add an ability to create dummy mappings

2017-07-03 Thread Igor Druzhinin
On 01/07/17 01:06, Stefano Stabellini wrote: > On Fri, 30 Jun 2017, Igor Druzhinin wrote: >> Dummys are simple anonymous mappings that are placed instead >> of regular foreign mappings in certain situations when we need >> to postpone the actual mapping but still have to gi

[Qemu-devel] [PATCH 3/4] xen/mapcache: introduce xen_remap_cache_entry()

2017-06-30 Thread Igor Druzhinin
of a new xenforeignmemory_map2() call with extended interface that was recently introduced in libxenforeignmemory [1]. [1] https://www.mail-archive.com/xen-devel@lists.xen.org/msg113007.html Signed-off-by: Igor Druzhinin <igor.druzhi...@citrix.com> --- configure | 18 ++

[Qemu-devel] [PATCH 2/4] xen/mapcache: add an ability to create dummy mappings

2017-06-30 Thread Igor Druzhinin
Dummys are simple anonymous mappings that are placed instead of regular foreign mappings in certain situations when we need to postpone the actual mapping but still have to give a memory region to QEMU to play with. This is planned to be used for restore on Xen. Signed-off-by: Igor Druzhinin

[Qemu-devel] [PATCH 4/4] xen: don't use xenstore to save/restore physmap anymore

2017-06-30 Thread Igor Druzhinin
for compatibility reasons. Signed-off-by: Igor Druzhinin <igor.druzhi...@citrix.com> --- hw/i386/xen/xen-hvm.c | 45 ++--- include/hw/xen/xen_common.h | 1 + 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/hw/i386/xen/xen-hvm.c b/h

[Qemu-devel] [PATCH 0/4] xen: don't save/restore the physmap on VM save/restore

2017-06-30 Thread Igor Druzhinin
and change it to a real one later during machine state restore. Igor Druzhinin (4): xen: move physmap saving into a separate function xen/mapcache: add an ability to create dummy mappings xen/mapcache: introduce xen_remap_cache_entry() xen: don't use xenstore to save/restore physmap anymore

[Qemu-devel] [PATCH 1/4] xen: move physmap saving into a separate function

2017-06-30 Thread Igor Druzhinin
Non-functional change. Signed-off-by: Igor Druzhinin <igor.druzhi...@citrix.com> --- hw/i386/xen/xen-hvm.c | 57 --- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index c

Re: [Qemu-devel] [Xen-devel] [PATCH v5] xen: don't save/restore the physmap on VM save/restore

2017-03-16 Thread Igor Druzhinin
On 16/03/17 12:54, Igor Druzhinin wrote: > On 16/03/17 12:26, Anthony PERARD wrote: >> On Wed, Mar 15, 2017 at 04:01:19PM +0000, Igor Druzhinin wrote: >>> Saving/restoring the physmap to/from xenstore was introduced to >>> QEMU majorly in order to cover up th

Re: [Qemu-devel] [PATCH v5] xen: don't save/restore the physmap on VM save/restore

2017-03-16 Thread Igor Druzhinin
On 16/03/17 12:26, Anthony PERARD wrote: > On Wed, Mar 15, 2017 at 04:01:19PM +0000, Igor Druzhinin wrote: >> Saving/restoring the physmap to/from xenstore was introduced to >> QEMU majorly in order to cover up the VRAM region restore issue. >> The sequence of restore opera

[Qemu-devel] [PATCH v5] xen: don't save/restore the physmap on VM save/restore

2017-03-15 Thread Igor Druzhinin
successfully, and update the VRAM region metadata accordingly. Signed-off-by: Igor Druzhinin <igor.druzhi...@citrix.com> --- v5: * Add an assertion and debug printf v4: * Use VGA post_load handler for vram_ptr update v3: * Modify qemu_ram_ptr_length similarly with qemu_map_ram_ptr * Add a c

[Qemu-devel] [PATCH v4] xen: don't save/restore the physmap on VM save/restore

2017-03-14 Thread Igor Druzhinin
successfully, and update the VRAM region metadata accordingly. Signed-off-by: Igor Druzhinin <igor.druzhi...@citrix.com> --- v4: * Use VGA post_load handler for vram_ptr update v3: * Modify qemu_ram_ptr_length similarly with qemu_map_ram_ptr * Add a comment explaining qemu_map_r

Re: [Qemu-devel] [PATCH v3] xen: don't save/restore the physmap on VM save/restore

2017-03-13 Thread Igor Druzhinin
On 13/03/17 21:15, Stefano Stabellini wrote: > On Mon, 13 Mar 2017, Igor Druzhinin wrote: >> Saving/restoring the physmap to/from xenstore was introduced to >> QEMU majorly in order to cover up the VRAM region restore issue. >> The sequence of restore operations implie

[Qemu-devel] [PATCH v3] xen: don't save/restore the physmap on VM save/restore

2017-03-13 Thread Igor Druzhinin
and update the VRAM region metadata (including previously registered pointer) accordingly. Signed-off-by: Igor Druzhinin <igor.druzhi...@citrix.com> --- v3: * Modify qemu_ram_ptr_length similarly with qemu_map_ram_ptr * Add a comment explaining qemu_map_ram_ptr and qemu_ram_ptr_length semantic

[Qemu-devel] [PATCH v2] xen: don't save/restore the physmap on VM save/restore

2017-03-10 Thread Igor Druzhinin
and update the VRAM region metadata (including previously registered pointer) accordingly. Signed-off-by: Igor Druzhinin <igor.druzhi...@citrix.com> --- v2: * Fix some building and coding style issues --- exec.c | 3 ++ hw/display/vga.c | 2 +- include/hw/xen/xen.h | 2 +

[Qemu-devel] [PATCH] xen: don't save/restore the physmap on VM save/restore

2017-03-09 Thread Igor Druzhinin
and update the VRAM region metadata (including previously registered pointer) accordingly. Signed-off-by: Igor Druzhinin <igor.druzhi...@citrix.com> --- exec.c | 3 ++ hw/display/vga.c | 2 +- include/hw/xen/xen.h | 2 +- xen-hvm.c