Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(19)

Issue 864002: Add MMX detection when getting registers in Linux. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 10 months ago by Lei Zhang (chromium)
Modified:
10 years, 10 months ago
CC:
google-breakpad-dev_googlegroups.com
Base URL:
http://google-breakpad.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Add MMX detection when getting registers in Linux.

For CPUs that don't support the MMX instruction set, such pre-Pentium III or
industrial x86 embedded PCs, the minidump fails when it tries to retrieve MMX
specific registers.

This patch adds MMX detection for that call.

Tested on Ubuntu 12.04 with i686, and on a custom Linux distro on a Vortex86DX
microcontroller.

Original review: https://breakpad.appspot.com/455002/
A=aras.vaichas
BUG=495

Committed: https://code.google.com/p/google-breakpad/source/detail?r=1248

Patch Set 1 #

Patch Set 2 : fix nits #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats Patch
M src/client/linux/minidump_writer/linux_ptrace_dumper.cc View 1 2 chunks +11 lines, -2 lines 4 comments Download

Messages

Total messages: 3
Lei Zhang (chromium)
10 years, 10 months ago #1
Lei Zhang (chromium)
Committed patchset #2 manually as r1248 (presubmit successful).
10 years, 10 months ago #2
Mark Mentovai
10 years, 10 months ago #3
Message was sent while issue was closed.
Feel free to check me on this.

arch/x86/kernel/ptrace.c arch_ptrace and x32_arch_ptrace PTRACE_GETFPREGS
use REGSET_XFP which is set up in
arch/x86/kernel/ptrace.c x86_32_regsets
whose getter is
arch/x86/kernel/i387.c xfpregs_get
which tests
arch/x86/include/asm/cpufeature.h cpu_has_fxsr
which is
arch/x86/include/asm/cpufeature.h boot_cpu_has(X86_FEATURE_FXSR)
which is
#define X86_FEATURE_FXSR        (0*32+24) /* FXSAVE/FXRSTOR, CR4.OSFXSR */
(0 = %edx; 23 = MMX, 24 = FXSR)

https://breakpad.appspot.com/864002/diff/30001/src/client/linux/minidump_writ...
File src/client/linux/minidump_writer/linux_ptrace_dumper.cc (right):

https://breakpad.appspot.com/864002/diff/30001/src/client/linux/minidump_writ...
src/client/linux/minidump_writer/linux_ptrace_dumper.cc:195: // Detect if the
CPU supports the MMX instructions
That’s the wrong bit to check. MMX = %mmx registers, which alias the %fp
registers. The %xmm registers, which is what REGSET_XFP is about, started with
SSE.

https://breakpad.appspot.com/864002/diff/30001/src/client/linux/minidump_writ...
src/client/linux/minidump_writer/linux_ptrace_dumper.cc:197:
__cpuid(1,eax,ebx,ecx,edx);
Spaces after commas.

https://breakpad.appspot.com/864002/diff/30001/src/client/linux/minidump_writ...
src/client/linux/minidump_writer/linux_ptrace_dumper.cc:198: if (edx & bit_MMX)
{
Therefore you want bit_FXSAVE.

https://breakpad.appspot.com/864002/diff/30001/src/client/linux/minidump_writ...
src/client/linux/minidump_writer/linux_ptrace_dumper.cc:203: memset(
&info->fpxregs, 0, sizeof(info->fpxregs) );
No spaces inside parentheses.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted