mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Dave Jones <davej@redhat.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	x86@kernel.org
Subject: Re: [x86] only print out DR registers if they are not power-on defaults.
Date: Wed, 19 Jun 2013 14:42:49 -0700	[thread overview]
Message-ID: <51C225D9.8070100@zytor.com> (raw)
In-Reply-To: <20130618155919.GC13123@pd.tnic>

On 06/18/2013 08:59 AM, Borislav Petkov wrote:
> On Tue, Jun 18, 2013 at 10:07:30AM -0400, Dave Jones wrote:
>> My intent here was to ignore cases where the reserved bits haven't
>> been set. I occasionally see DR6: 00000000fffe0ff0 for eg.
> 
> That's bit 16 which, according to the docs is read-as-1:
> 
> "All remaining bits in the DR6 register are reserved. Reserved bits
> 31:16 and 11:4 must all be set to 1, while reserved bit 12 must be
> cleared to 0. In 64-bit mode, the upper 32 bits of DR6 are reserved and
> must be written with zeros. Writing a 1 to any of the upper 32 bits
> results in a general-protection exception, #GP(0)."
> 
> This above if from AMD APM and Intel's SDM has a graphic showing the
> exact same thing:
> 
> [31:16] = set to 1; [12] = 0b, [11:4] = 1b
> 
> So if you see bit 16 cleared, then some BIOS or even hardware is doing
> funky things. I wouldn't wonder at all if BIOS dudes used reserved bits
> in registers as scratch space.
> 
>> But maybe you're right, and that is a clue and is worth printing ? I
>> can't personally recall ever diagnosing a bug using those register
>> dumps in the last 15 years.
> 
> Right, I don't know whether it would always help but if you have an
> oops and see, say bit 0 in DR6 set, i.e. a debug exception was caused
> by address breakpoint condition in DR0, then that could be useful info,
> methinks.
> 

There is serious confusion with regards to DR6 about the bits which are
*fixed* (forced to 1) and the ones which are *reserved* (should always
have a fixed value.)

There are some bits in DR6 which are used by hardware probes.

	-hpa



  parent reply	other threads:[~2013-06-19 21:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-18  4:11 Dave Jones
2013-06-18  8:43 ` Borislav Petkov
2013-06-18 14:07   ` Dave Jones
2013-06-18 15:59     ` Borislav Petkov
2013-06-18 16:09       ` [x86][v2] " Dave Jones
2013-06-18 17:08         ` Borislav Petkov
2013-06-19 18:42         ` [tip:x86/debug] x86/debug: Only " tip-bot for Dave Jones
2013-06-19 21:42       ` H. Peter Anvin [this message]
2013-06-19 21:52         ` [x86] only " Borislav Petkov
2013-06-19 22:02           ` H. Peter Anvin
2013-06-20  5:29             ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51C225D9.8070100@zytor.com \
    --to=hpa@zytor.com \
    --cc=bp@alien8.de \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome