[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [V3 PATCH 7/9] x86/hvm: pkeys, add pkeys support for guest_walk_tables



>>> On 17.12.15 at 10:18, <huaitong.han@xxxxxxxxx> wrote:
> On Wed, 2015-12-16 at 02:12 -0700, Jan Beulich wrote:
>> > > > On 16.12.15 at 10:03, <huaitong.han@xxxxxxxxx> wrote:
>> > On Wed, 2015-12-16 at 01:32 -0700, Jan Beulich wrote:
>> > > Depending on how frequently this might get called, the allocation
>> > > overhead may not be tolerable. I.e. you may want to set up e.g.
>> > > a per-CPU buffer up front. Or you check whether using RDPKRU
>> > > (with temporarily setting CR4.PKE) is cheaper than what you
>> > > do right now.
>> > RDPKRU does cost less than the function, and if temporarily setting
>> > CR4.PKE is accepted, I will use RDPKRU instead of the function.
>> 
>> The question isn't just the RDPKRU cost, but that of the two CR4
>> writes.
> Testing result with NOW() function:
> Time of the function 10 times execution
> (XEN)xsave time is 1376 ns
> (XEN)read_pkru time is 28 ns

Wow, that's a huge difference. I'm having trouble to believe two
CR4 writes are this fast, and an XSAVE of just a single 32-bit item
is this slow. But well - you measured it.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.