lkml.org 
[lkml]   [2015]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Dealing with the NMI mess
On Mon, 7 Sep 2015, Ingo Molnar wrote:

> > I did some work on this a few years ago, including emulating DR0-7 accesses in
> > software down the JTAG handler upon a General Detect fault to keep the kernel
> > both happy and away from real debug registers. ;) Yes, you can debug any
> > software with this stuff, including the Linux kernel: set instruction and data
> > breakpoints, single-step it, poke at all hardware registers, including
> > descriptor registers not otherwise accessible (you can set funny modes for
> > segments, also in the 64-bit mode), etc. One complication though is you operate
> > on physical addresses when poking at memory, you can't ask the CPU's MMU to
> > remap them for you (you can walk page tables manually of course, just as the MMU
> > would).
>
> Essentially the ICE breakpoint instruction enters SMM mode?

I didn't do stuff at the probe firmware level so I can't say for sure,
but my gut feeling is the debug mode is indeed very close if not the same
as SMM. I think duplicating the logic would be an unnecessary waste of
silicon.

And obviously it's any cause of #DB that enters this mode. The probe can
also request it right at the exit from the reset state, so that you can
debug software (e.g BIOS startup) right from the reset vector. You don't
need working RAM for that.

Maciej


\
 
 \ /
  Last update: 2015-09-07 10:41    [W:0.136 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site