Re: [Qemu-devel] [PATCH 14/42] migration: prepare to access s-state outside critical sections

2013-03-29 Thread Stefan Weil
Am 25.03.2013 12:02, schrieb Paolo Bonzini:

 - Messaggio originale -
 Da: Gerd Hoffmann kra...@redhat.com
 A: Stefan Hajnoczi stefa...@gmail.com
 Cc: Paolo Bonzini pbonz...@redhat.com, qemu-devel 
 qemu-devel@nongnu.org, Orit Wasserman
 owass...@redhat.com, Juan Quintela quint...@redhat.com
 Inviato: Lunedì, 25 marzo 2013 10:52:36
 Oggetto: Re: [Qemu-devel] [PATCH 14/42] migration: prepare to access 
 s-state outside critical sections

 Hi,

 http://buildbot.b1-systems.de/qemu/builders/default_mingw32/builds/566/steps/compile/logs/stdio

 The latest RHEL6 mingw gcc is version 4.4 but this buildslave is
 RHEL6.1 so perhaps it's an older version that is missing the
 atomics builtins?
 No, it's RHEL-6.4 actually, even though the name suggests otherwise
 (was a bad idea to include the minor rev in the buildslave name ...).
 Can you check if this fixes it?

 diff --git a/configure b/configure
 index 46a7594..a324ca5 100755
 --- a/configure
 +++ b/configure
 @@ -931,9 +931,9 @@ case $cpu in
 LDFLAGS=-m64 $LDFLAGS
 ;;
  i386)
 -   QEMU_CFLAGS=-m32 $QEMU_CFLAGS
 -   LDFLAGS=-m32 $LDFLAGS
 -   cc_i386='$(CC) -m32'
 +   QEMU_CFLAGS=-m32 -mcpu=i486 $QEMU_CFLAGS
 +   LDFLAGS=-m32 -mcpu=i486 $LDFLAGS
 +   cc_i386='$(CC) -m32 -mcpu=i486'
 ;;
  x86_64)
 QEMU_CFLAGS=-m64 $QEMU_CFLAGS

 Paolo

Hi Stefan, hi Paolo,

cross compilation on Debian Squeeze shows the same error.

It is fixed by setting the correct cpu architecture (-march=i686).
As far as I know, gcc 4.4 defaults to -march=i386 which does
not support the atomic operations.

I have sent a patch today - please try it.

Regards,
Stefan




Re: [Qemu-devel] [PATCH 14/42] migration: prepare to access s-state outside critical sections

2013-03-25 Thread Stefan Hajnoczi
On Fri, Feb 22, 2013 at 5:36 PM, Paolo Bonzini pbonz...@redhat.com wrote:
 Accessing s-state outside the big QEMU lock will simplify a bit the
 locking/unlocking of the iothread lock.

 We need to keep the lock in migrate_fd_error and migrate_fd_completed,
 however, because they call migrate_fd_cleanup.

 Reviewed-by: Orit Wasserman owass...@redhat.com
 Reviewed-by: Juan Quintela quint...@redhat.com
 Signed-off-by: Paolo Bonzini pbonz...@redhat.com
 ---
  migration.c | 33 +
  1 file changed, 21 insertions(+), 12 deletions(-)

 diff --git a/migration.c b/migration.c
 index b091532..b40755f 100644
 --- a/migration.c
 +++ b/migration.c
 @@ -279,19 +279,25 @@ static void migrate_fd_cleanup(MigrationState *s)
  notifier_list_notify(migration_state_notifiers, s);
  }

 +static void migrate_finish_set_state(MigrationState *s, int new_state)
 +{
 +if (__sync_val_compare_and_swap(s-state, MIG_STATE_ACTIVE,

kraxel_rhel61's mingw build fails:

  LINK  i386-softmmu/qemu-system-i386.exe
../migration.o:migration.c:(.text+0x408): undefined reference to
`__sync_val_compare_and_swap_4'
../migration.o:migration.c:(.text+0x7af): undefined reference to
`__sync_val_compare_and_swap_4'
../migration.o:migration.c:(.text+0x827): undefined reference to
`__sync_val_compare_and_swap_4'

http://buildbot.b1-systems.de/qemu/builders/default_mingw32/builds/566/steps/compile/logs/stdio

The latest RHEL6 mingw gcc is version 4.4 but this buildslave is
RHEL6.1 so perhaps it's an older version that is missing the atomics
builtins?

Stefan



Re: [Qemu-devel] [PATCH 14/42] migration: prepare to access s-state outside critical sections

2013-03-25 Thread Gerd Hoffmann
  Hi,

 http://buildbot.b1-systems.de/qemu/builders/default_mingw32/builds/566/steps/compile/logs/stdio
 
 The latest RHEL6 mingw gcc is version 4.4 but this buildslave is
 RHEL6.1 so perhaps it's an older version that is missing the atomics
 builtins?

No, it's RHEL-6.4 actually, even though the name suggests otherwise (was
a bad idea to include the minor rev in the buildslave name ...).

There is a detailed slave info page btw:
http://buildbot.b1-systems.de/qemu/buildslaves/kraxel_rhel61

cheers,
  Gerd




Re: [Qemu-devel] [PATCH 14/42] migration: prepare to access s-state outside critical sections

2013-03-25 Thread Paolo Bonzini


- Messaggio originale -
 Da: Gerd Hoffmann kra...@redhat.com
 A: Stefan Hajnoczi stefa...@gmail.com
 Cc: Paolo Bonzini pbonz...@redhat.com, qemu-devel 
 qemu-devel@nongnu.org, Orit Wasserman
 owass...@redhat.com, Juan Quintela quint...@redhat.com
 Inviato: Lunedì, 25 marzo 2013 10:52:36
 Oggetto: Re: [Qemu-devel] [PATCH 14/42] migration: prepare to access s-state 
 outside critical sections
 
 Hi,
 
  http://buildbot.b1-systems.de/qemu/builders/default_mingw32/builds/566/steps/compile/logs/stdio
  
  The latest RHEL6 mingw gcc is version 4.4 but this buildslave is
  RHEL6.1 so perhaps it's an older version that is missing the
  atomics builtins?
 
 No, it's RHEL-6.4 actually, even though the name suggests otherwise
 (was a bad idea to include the minor rev in the buildslave name ...).

Can you check if this fixes it?

diff --git a/configure b/configure
index 46a7594..a324ca5 100755
--- a/configure
+++ b/configure
@@ -931,9 +931,9 @@ case $cpu in
LDFLAGS=-m64 $LDFLAGS
;;
 i386)
-   QEMU_CFLAGS=-m32 $QEMU_CFLAGS
-   LDFLAGS=-m32 $LDFLAGS
-   cc_i386='$(CC) -m32'
+   QEMU_CFLAGS=-m32 -mcpu=i486 $QEMU_CFLAGS
+   LDFLAGS=-m32 -mcpu=i486 $LDFLAGS
+   cc_i386='$(CC) -m32 -mcpu=i486'
;;
 x86_64)
QEMU_CFLAGS=-m64 $QEMU_CFLAGS

Paolo