On Tue, May 21, 2019 at 11:20 AM Uros Bizjak wrote:
>
> 2019-05-21 Uroš Bizjak
>
> * config/i386/cpuid.h (__cpuid): For 32bit targets, zero
> %ebx and %ecx bafore calling cpuid with leaf 1 or
> non-constant leaf argument.
>
> Bootstrapped and regression tested on x86_64-linux-gnu {,
On Mon, May 20, 2019 at 2:57 PM Uros Bizjak wrote:
>
> On Mon, May 20, 2019 at 6:12 PM tedheadster wrote:
> > Did you instead mean "zeroing %EBX and %ECX regs should be enough"?
>
> Ah, yes. This is what I meant to say. The patch clears %ebx and %ecx.
>
Uros,
y
On Mon, May 20, 2019 at 11:52 AM Uros Bizjak wrote:
> How about the attached patch that enables zeroing only for 32bit
> processors, and only for cpuid leaf 1? Usually, __get_cpuid is used
> with a constant leaf argument, so we benefit from constant propagation
> into inline function. Also, accor
Uros,
On Mon, May 20, 2019 at 3:29 AM Uros Bizjak wrote:
> The CPUID documentation from Intel Architectures Developer's manual is
> crystal clear on the implementation:
>
> --quote--
> CPUID—CPU Identification
>
> Returns processor identification and feature
> information to the EAX, EBX, ECX, an
I have confirmed that the IDT Winchip 2 does not expressly set %ecx
after a call to cpuid() with %eax = 1, and this causes incorrect
reporting of cpu capabilities. The %ecx register should return 0x0
(and likely %ebx should too) on this hardware. This patch proposes a
fix.
The symptoms of this aro