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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 07 May 2015 07:58:50 -0700
From:	Dave Hansen <dave.hansen@...ux.intel.com>
To:	Ingo Molnar <mingo@...nel.org>
CC:	Ingo Molnar <mingo2.kernel.org@...il.com>,
	linux-kernel@...r.kernel.org,
	Andy Lutomirski <luto@...capital.net>,
	Borislav Petkov <bp@...en8.de>,
	Fenghua Yu <fenghua.yu@...el.com>,
	"H. Peter Anvin" <hpa@...or.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Oleg Nesterov <oleg@...hat.com>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 084/208] x86/fpu: Rename xsave.header::xstate_bv to 'xfeatures'

On 05/07/2015 05:22 AM, Ingo Molnar wrote:
> I.e. are there any plans beyond using it strictly for full state 
> save/restore.

None that I know of, but having two (relatively) tiny features
(protection keys and MPX) might change things.

> Btw., regarding XCR0.PKRU: that enables 'Protection Keys' in the PTE 
> format. What's the main purpose of these keys? They seem to duplicate 
> the read/write bits in the PTE, with the exception that they don't 
> impact instruction fetches. So is this used to allow user-space to 
> execute but otherwise not read instructions?
> 
> Or some other purpose I missed?

You can change the permissions of a given key with writes to the
register without changing the PTE.  No TLB shootdown, plus the
permission changes are local to the CPU thread.

I have patches today if you're interested.

> In any case, these holes are really minor at the moment, and the 
> question is, what is the performance difference between a 'compactede' 
> XSAVE*/XRSTOR* pair, versus a standard format one?


Yeah, that would be interesting to know.

>>> Maybe once we get AVX512 in addition to MPX we can use compaction 
>>> materially: as there will be lots of tasks without MPX state but 
>>> with AVX512 state - in fact I suspect that will be the common 
>>> case.
>>
>> Right.
>>
>> But we'd need to get to a point where we are calling 'xsaves' with a 
>> Requested Feature BitMask (aka RFBM[]) that had holes in it.  As it 
>> stands today, we always call it with RFBM=-1 and so we always have 
>> XCOMP_BV = XCR0.
...
>> We'd need to determine which fields are in the init state before we 
>> do an xsaves.
> 
> Why? I don't think that's necessary.

"If RFBM[i] = 0, XSTATE_BV[i] is written as 0."

We need to pull XSTATE_BV in to the instruction mask when doing an
XSAVE* if our RFBM has bits unset that *are* set in XSTATE_BV.
Otherwise, we'll destroy the bits at XSAVE* time.

It's not a problem today because the instruction mask is always -1, so
it always has every bit set that *MIGHT* be set in XSTATE_BV.

As for the whole bit 63 thing...  It's possible and valid to have a
XCOMP_BV[62:0]=0 because the instruction mask only contained bits that
were unset in XCR0|IA32_XSS.  You need bit 63 to tell you which format
you are using.
--
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