* [Qemu-devel] [PATCH] qemu-barrier: Fix compiler version check for future gcc versions
@ 2012-10-03 21:11 Stefan Weil
2012-10-05 13:48 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
2012-10-08 20:01 ` [Qemu-devel] " Michael S. Tsirkin
0 siblings, 2 replies; 4+ messages in thread
From: Stefan Weil @ 2012-10-03 21:11 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Stefan Weil, qemu-stable, Michael S. Tsirkin
The current check will give a wrong result for gcc-5.x with x < 4.
Using QEMU_GNUC_PREREQ is simpler and fixes that issue.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
With current gcc versions (gcc-4.x) there is no problem.
Nevertheless, I suggest to fix this in stable versions, too.
Regards
Stefan Weil
qemu-barrier.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qemu-barrier.h b/qemu-barrier.h
index 7e11197..16f0942 100644
--- a/qemu-barrier.h
+++ b/qemu-barrier.h
@@ -19,7 +19,7 @@
* mfence on 32 bit as well, e.g. if built with -march=pentium-m.
* However, on i386, there seem to be known bugs as recently as 4.3.
* */
-#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 4
+#if QEMU_GNUC_PREREQ(4, 4)
#define smp_mb() __sync_synchronize()
#else
#define smp_mb() asm volatile("lock; addl $0,0(%%esp) " ::: "memory")
--
1.7.10
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [Qemu-trivial] [PATCH] qemu-barrier: Fix compiler version check for future gcc versions
2012-10-03 21:11 [Qemu-devel] [PATCH] qemu-barrier: Fix compiler version check for future gcc versions Stefan Weil
@ 2012-10-05 13:48 ` Stefan Hajnoczi
2012-10-08 20:01 ` [Qemu-devel] " Michael S. Tsirkin
1 sibling, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2012-10-05 13:48 UTC (permalink / raw)
To: Stefan Weil; +Cc: qemu-trivial, Michael S. Tsirkin, qemu-devel, qemu-stable
On Wed, Oct 03, 2012 at 11:11:02PM +0200, Stefan Weil wrote:
> The current check will give a wrong result for gcc-5.x with x < 4.
> Using QEMU_GNUC_PREREQ is simpler and fixes that issue.
>
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
>
> With current gcc versions (gcc-4.x) there is no problem.
> Nevertheless, I suggest to fix this in stable versions, too.
>
> Regards
>
> Stefan Weil
>
> qemu-barrier.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks, applied to the trivial patches tree:
https://github.com/stefanha/qemu/commits/trivial-patches
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] qemu-barrier: Fix compiler version check for future gcc versions
2012-10-03 21:11 [Qemu-devel] [PATCH] qemu-barrier: Fix compiler version check for future gcc versions Stefan Weil
2012-10-05 13:48 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
@ 2012-10-08 20:01 ` Michael S. Tsirkin
2012-10-08 20:57 ` Stefan Weil
1 sibling, 1 reply; 4+ messages in thread
From: Michael S. Tsirkin @ 2012-10-08 20:01 UTC (permalink / raw)
To: Stefan Weil; +Cc: qemu-trivial, qemu-devel, qemu-stable
On Wed, Oct 03, 2012 at 11:11:02PM +0200, Stefan Weil wrote:
> The current check will give a wrong result for gcc-5.x with x < 4.
> Using QEMU_GNUC_PREREQ is simpler and fixes that issue.
>
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
>
> With current gcc versions (gcc-4.x) there is no problem.
> Nevertheless, I suggest to fix this in stable versions, too.
>
> Regards
>
> Stefan Weil
ACK for stable tree.
> qemu-barrier.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/qemu-barrier.h b/qemu-barrier.h
> index 7e11197..16f0942 100644
> --- a/qemu-barrier.h
> +++ b/qemu-barrier.h
> @@ -19,7 +19,7 @@
> * mfence on 32 bit as well, e.g. if built with -march=pentium-m.
> * However, on i386, there seem to be known bugs as recently as 4.3.
> * */
> -#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 4
> +#if QEMU_GNUC_PREREQ(4, 4)
> #define smp_mb() __sync_synchronize()
> #else
> #define smp_mb() asm volatile("lock; addl $0,0(%%esp) " ::: "memory")
> --
> 1.7.10
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] qemu-barrier: Fix compiler version check for future gcc versions
2012-10-08 20:01 ` [Qemu-devel] " Michael S. Tsirkin
@ 2012-10-08 20:57 ` Stefan Weil
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Weil @ 2012-10-08 20:57 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: qemu-devel, qemu-stable
Am 08.10.2012 22:01, schrieb Michael S. Tsirkin:
> On Wed, Oct 03, 2012 at 11:11:02PM +0200, Stefan Weil wrote:
>> The current check will give a wrong result for gcc-5.x with x < 4.
>> Using QEMU_GNUC_PREREQ is simpler and fixes that issue.
>>
>> Signed-off-by: Stefan Weil <sw@weilnetz.de>
>> ---
>>
>> With current gcc versions (gcc-4.x) there is no problem.
>> Nevertheless, I suggest to fix this in stable versions, too.
>>
>> Regards
>>
>> Stefan Weil
> ACK for stable tree.
>
>> qemu-barrier.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/qemu-barrier.h b/qemu-barrier.h
>> index 7e11197..16f0942 100644
>> --- a/qemu-barrier.h
>> +++ b/qemu-barrier.h
>> @@ -19,7 +19,7 @@
>> * mfence on 32 bit as well, e.g. if built with -march=pentium-m.
>> * However, on i386, there seem to be known bugs as recently as 4.3.
>> * */
>> -#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 4
>> +#if QEMU_GNUC_PREREQ(4, 4)
>> #define smp_mb() __sync_synchronize()
>> #else
>> #define smp_mb() asm volatile("lock; addl $0,0(%%esp) " ::: "memory")
>> --
>> 1.7.10
My patch was incomplete: an include statement for compiler.h
is needed (see the patches which were applied to the same file in
git master.
Regards
Stefan Weil
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-10-08 20:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-03 21:11 [Qemu-devel] [PATCH] qemu-barrier: Fix compiler version check for future gcc versions Stefan Weil
2012-10-05 13:48 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
2012-10-08 20:01 ` [Qemu-devel] " Michael S. Tsirkin
2012-10-08 20:57 ` Stefan Weil
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.