From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18372 invoked by alias); 12 Aug 2014 16:04:46 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Received: (qmail 18324 invoked by uid 48); 12 Aug 2014 16:04:40 -0000 From: "hjl.tools at gmail dot com" To: glibc-bugs@sourceware.org Subject: [Bug libc/17259] sysdeps/x86_64/cacheinfo.c:intel_check_word may corrupt rbx Date: Tue, 12 Aug 2014 16:04:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc short_desc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-08/txt/msg00038.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=17259 H.J. Lu 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 --- 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.