This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/17259] sysdeps/x86_64/cacheinfo.c:intel_check_word may corrupt rbx
- From: "hjl.tools at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 12 Aug 2014 16:04:38 +0000
- Subject: [Bug libc/17259] sysdeps/x86_64/cacheinfo.c:intel_check_word may corrupt rbx
- Auto-submitted: auto-generated
- References: <bug-17259-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=17259
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hjl.tools at gmail dot com
Summary|sysdeps/x86_64/cacheinfo.c: |sysdeps/x86_64/cacheinfo.c:
|intel_check_word corrupts |intel_check_word may
|rbx and another register |corrupt rbx
--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
There are
asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1"
: "=a" (eax), "=r" (ebx), "=c" (ecx), "=d" (edx)
: "0" (4), "2" (round));
The only register compiler is aware of is RBX. No other registers are
impacted. We are lucky that it doesn't cause any problems since RBX
is also used by compiler for other purposes so that RBX is saved and
restored in intel_check_word. We should just use __cpuid_count instead.
--
You are receiving this mail because:
You are on the CC list for the bug.