[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47CEC408.2070604@zytor.com>
Date: Wed, 05 Mar 2008 08:02:16 -0800
From: "H. Peter Anvin" <hpa@...or.com>
To: Ingo Molnar <mingo@...e.hu>
CC: Stephan Diestelhorst <langer_mann@....de>, davej@...emonkey.org.uk,
cpufreq@...ts.linux.org.uk, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] Speedfreq-SMI call clobbers ECX
Ingo Molnar wrote:
> * Stephan Diestelhorst <langer_mann@....de> wrote:
>
>> @@ -184,7 +184,7 @@ static void speedstep_set_state (unsigne
>> __asm__ __volatile__(
>> "movl $0, %%edi\n"
>> "out %%al, (%%dx)\n"
>> - : "=b" (new_state), "=D" (result)
>> + : "=b" (new_state), "=D" (result), "=c" (ecx_clobber)
>> : "a" (command), "b" (function), "c" (state), "d" (smi_port), "S" (0)
>> );
>
> stupid suggestion: why not do a pusha/popa around those instructions, to
> make sure everything is restored? This isnt a fastpath and being
> conservative about SMI side-effects cannot hurt ...
>
You can't pusha/popa if you expect a result. You can, of course, push
and pop individual registers.
It's also kind of odd to do "movl $0,%%edi" instead of just setting EDI
as an input.
-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists