lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 5 Mar 2009 15:37:26 +0100
From:	Andreas Herrmann <andreas.herrmann3@....com>
To:	Jaswinder Singh Rajput <jaswinder@...nel.org>
CC:	Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>,
	x86 maintainers <x86@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [git-pull -tip] x86: msr architecture debug code

On Thu, Mar 05, 2009 at 07:42:26PM +0530, Jaswinder Singh Rajput wrote:
> On Thu, 2009-03-05 at 14:54 +0100, Andreas Herrmann wrote:
> 
> > All nice suggestions but why in-kernel?
> > 
> 
> In Kernel Space:
> 
> We can read/write MSRs and can change the bits and see it effect without
> writing any code.

Sorry, I can't (or maybe I don't like to) follow.

(BTW, you don't even need to write C-code. You can use a one-liner in perl
or python to seek and read any MSR using /dev/cpu/*/msr.)

> And we can also dump these value if something goes wrong in thats
> sections for kernel that's why I am also using printk.

Just some example how to do this today. (I've recently used this for
debugging.) Using a kernel with msr module loaded or built-in plus using
x86info/lsmsr and hpa's msr-tools.

# lsmsr MTRRfix -c 0
MTRRfix64K_00000     = 0x0606060606060606
MTRRfix16K_80000     = 0x0606060606060606
MTRRfix16K_A0000     = 0x0000000000000000
MTRRfix4K_C0000      = 0x0505050505050505
MTRRfix4K_C8000      = 0x0505050505050505
MTRRfix4K_D0000      = 0x0000000000000000
MTRRfix4K_D8000      = 0x0000000000000000
MTRRfix4K_E0000      = 0x0505050500000000
MTRRfix4K_E8000      = 0x0505050505050505
MTRRfix4K_F0000      = 0x0505050505050505
MTRRfix4K_F8000      = 0x0505050505050505
# lsmsr SYS_CFG
SYS_CFG              = 0x0000000000160600
# lsmsr SYS_CFG -l -V3
SYS_CFG             : 0xc0010010
  8-8:SetDirtyEnE
  9-9:SetDirtyEnS
  10-10:SetDirtyEnO
  16-16:ChxToDirtyDis
  17-17:SysUcLockEn
  18-18:MtrrFixDramEn
  19-19:MtrrFixDramModEn
  20-20:MtrrVarDramEn
  21-21:MtrrTom2En
  22-22:Tom2ForceMemTypeWB
# wrmsr -p 0 0xc0010010 0x00000000001e0600
# lsmsr SYS_CFG
SYS_CFG              = 0x00000000001e0600
# lsmsr MTRRfix -c 0
MTRRfix64K_00000     = 0x1e1e1e1e1e1e1e1e
MTRRfix16K_80000     = 0x1e1e1e1e1e1e1e1e
MTRRfix16K_A0000     = 0x0000000000000000
MTRRfix4K_C0000      = 0x1515151515151515
MTRRfix4K_C8000      = 0x1515151515151515
MTRRfix4K_D0000      = 0x0000000000000000
MTRRfix4K_D8000      = 0x0000000000000000
MTRRfix4K_E0000      = 0x1515151500000000
MTRRfix4K_E8000      = 0x1515151515151515
MTRRfix4K_F0000      = 0x1515151515151515
MTRRfix4K_F8000      = 0x1515151515151515


IMHO, there is no need to do this in-kernel.


Regards,

Andreas

-- 
Operating | Advanced Micro Devices GmbH
  System  | Karl-Hammerschmidt-Str. 34, 85609 Dornach b. München, Germany
 Research | Geschäftsführer: Jochen Polster, Thomas M. McCoy, Giuliano Meroni
  Center  | Sitz: Dornach, Gemeinde Aschheim, Landkreis München
  (OSRC)  | Registergericht München, HRB Nr. 43632


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ