Re: [PATCH] qemu/timer: Don't use RDTSC on i486

2023-11-29 Thread Richard Henderson
On 11/29/23 07:50, Petr Cvek wrote: I can agree that binary compiled for i486 doesn't contain cmpxchg8b and works OK with exception of setjmp bug I described in another thread [1]. glxgears which doesn't use signals works without problem. 64bit atomic operations seems to be emulated in

Re: [PATCH] qemu/timer: Don't use RDTSC on i486

2023-11-29 Thread Petr Cvek
I can agree that binary compiled for i486 doesn't contain cmpxchg8b and works OK with exception of setjmp bug I described in another thread [1]. glxgears which doesn't use signals works without problem. 64bit atomic operations seems to be emulated in util/atomic64.c. However I've found out the

Re: [PATCH] qemu/timer: Don't use RDTSC on i486

2023-11-28 Thread Richard Henderson
On 11/26/23 09:56, Paolo Bonzini wrote: Il sab 25 nov 2023, 13:23 Petr Cvek mailto:petrcve...@gmail.com>> ha scritto: GCC defines __i386__ for i386 and i486, which both lack RDTSC instruction. The i386 seems to be impossible to distinguish, but i486 can be identified by checking

Re: [PATCH] qemu/timer: Don't use RDTSC on i486

2023-11-27 Thread Peter Maydell
On Sat, 25 Nov 2023 at 12:24, Petr Cvek wrote: > > GCC defines __i386__ for i386 and i486, which both lack RDTSC instruction. > The i386 seems to be impossible to distinguish, but i486 can be identified > by checking for undefined __i486__. > > Signed-off-by: Petr Cvek Last time this came up

Re: [PATCH] qemu/timer: Don't use RDTSC on i486

2023-11-26 Thread Petr Cvek
Dne 26. 11. 23 v 16:56 Paolo Bonzini napsal(a): > > > Il sab 25 nov 2023, 13:23 Petr Cvek > ha scritto: > > GCC defines __i386__ for i386 and i486, which both lack RDTSC instruction. > The i386 seems to be impossible to distinguish, but i486 can be

Re: [PATCH] qemu/timer: Don't use RDTSC on i486

2023-11-26 Thread Petr Cvek
Dne 26. 11. 23 v 14:03 Samuel Tardieu napsal(a): > > Petr Cvek writes: > >> Actually I was thinking about mentioning it in the commit message also, but >> I wasn't able >> to find any specification for that (if all compilers use it). > > Note that this change would be safe: at worst, some

Re: [PATCH] qemu/timer: Don't use RDTSC on i486

2023-11-26 Thread Paolo Bonzini
Il sab 25 nov 2023, 13:23 Petr Cvek ha scritto: > GCC defines __i386__ for i386 and i486, which both lack RDTSC instruction. > The i386 seems to be impossible to distinguish, but i486 can be identified > by checking for undefined __i486__. > As far as I know QEMU cannot be run on i486 anyway

Re: [PATCH] qemu/timer: Don't use RDTSC on i486

2023-11-26 Thread Samuel Tardieu
Petr Cvek writes: Actually I was thinking about mentioning it in the commit message also, but I wasn't able to find any specification for that (if all compilers use it). Note that this change would be safe: at worst, some compilers don't use __tune_i386__ and the situation would be the

Re: [PATCH] qemu/timer: Don't use RDTSC on i486

2023-11-26 Thread Petr Cvek
Actually I was thinking about mentioning it in the commit message also, but I wasn't able to find any specification for that (if all compilers use it). Other problem is the __tune_i386__ is also set when -mtune=i386 (but with -march=i686). But if the general idea of changing the code for 486

Re: [PATCH] qemu/timer: Don't use RDTSC on i486

2023-11-26 Thread Samuel Tardieu
Petr Cvek writes: GCC defines __i386__ for i386 and i486, which both lack RDTSC instruction. The i386 seems to be impossible to distinguish, but i486 can be identified by checking for undefined __i486__. Couldn't you check for an undefined __tune_i386__, which would be set by both GCC

[PATCH] qemu/timer: Don't use RDTSC on i486

2023-11-25 Thread Petr Cvek
GCC defines __i386__ for i386 and i486, which both lack RDTSC instruction. The i386 seems to be impossible to distinguish, but i486 can be identified by checking for undefined __i486__. Signed-off-by: Petr Cvek --- include/qemu/timer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff