[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [patch] option -no-tsc for i386 with speedstep
From: |
Jim C. Brown |
Subject: |
Re: [Qemu-devel] [patch] option -no-tsc for i386 with speedstep |
Date: |
Mon, 25 Apr 2005 13:07:52 -0400 |
User-agent: |
Mutt/1.4i |
On Mon, Apr 25, 2005 at 01:15:32PM +0200, Massimo Dal Zotto wrote:
> The patch works for me but I don't know if this is the best way of fixing
> this bug. If anyone has a better suggestion it is welcome.
>
> --
> Massimo Dal Zotto <address@hidden>
I just want to point out that your patches break qemu for almost every platform
other than i386.
> +#ifdef __i386__
> +static int notsc = 0;
> +extern int64_t get_clock(void);
> +#endif
> @@ -502,6 +506,9 @@
> int64_t cpu_get_real_ticks(void)
> {
> int64_t val;
> + if (notsc) {
> + return get_clock();
> + }
> asm volatile ("rdtsc" : "=A" (val));
> return val;
> }
You probably want to do this, because notsc is only declared for the i386
platform.
int64_t cpu_get_real_ticks(void)
{
int64_t val;
+#ifdef __i386__
+ if (notsc) {
+ return get_clock();
+ }
+#endif
asm volatile ("rdtsc" : "=A" (val));
return val;
}
--
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.