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]
Message-ID: <20160204190757.GA4249@agluck-desk.sc.intel.com>
Date:	Thu, 4 Feb 2016 11:07:57 -0800
From:	"Luck, Tony" <tony.luck@...el.com>
To:	Borislav Petkov <bp@...en8.de>
Cc:	Ingo Molnar <mingo@...nel.org>, "H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Andy Lutomirski <luto@...capital.net>,
	Peter Zijlstra <peterz@...radead.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Brian Gerst <brgerst@...il.com>,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -v2] x86: Add an archinfo dumper module

On Thu, Feb 04, 2016 at 04:22:35PM +0100, Borislav Petkov wrote:
> Here's v2 with the stuff we talked about, implemented. I've added
> 'control_regs' file too so that you can do:
> 
> $ cat /sys/kernel/debug/x86/archinfo/control_regs
> CR4: [-|-|SMEP|OSXSAVE|-|-|-|-|OSXMMEXCPT|OSFXSR|-|PGE|MCE|PAE|PSE|-|-|-|-]: 0x1406f0
> 
> for example. Yeah, only CR4 right now.
> 
> Off the top of my head, we would need "msrs" which dumps EFER and a
> bunch of other interesting MSRs along with the names of the set bits.

It would be nce to have some helper function that makes it easier for
people to add new registers to this that just uses one string
to describe the format of a register.  E.g. if we have a register
like this:

	 63 63 62  11 10  9 8    5 4   2 1   0
	+-----+------+-----+------+-----+-----+
	| VAL | rsvd | BAZ | rsvd | BAR | FOO |
	+-----+------+-----+------+-----+-----+

	BAZ bits mean:
		00 - nope
		01 - low
		10 - mid
		11 - high

we could describe it with:

"1fVAL|52r|2[nope,low,mid,high]BAZ|4r|3xBAR|2dFOO"

syntax is <width><fmt><name>

where width is the number of bits. Format is one of:

f - flag - print the name if the field is non-zero, else print nothing
    (or "-" to match the format you used above for CR4)
r - reserved - skip this field
d - print name=%d
x - print name=0x%x
[str0,str1,...str{2^width - 1}] - print NAME=str[val]

-Tony

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ