[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
- To: "Huaitong Han" <huaitong.han@xxxxxxxxx>
- From: "Jan Beulich" <JBeulich@xxxxxxxx>
- Date: Thu, 17 Dec 2015 03:05:12 -0700
- Cc: Kevin Tian <kevin.tian@xxxxxxxxx>, "wei.liu2@xxxxxxxxxx" <wei.liu2@xxxxxxxxxx>, "ian.campbell@xxxxxxxxxx" <ian.campbell@xxxxxxxxxx>, "stefano.stabellini@xxxxxxxxxxxxx" <stefano.stabellini@xxxxxxxxxxxxx>, "george.dunlap@xxxxxxxxxxxxx" <george.dunlap@xxxxxxxxxxxxx>, "andrew.cooper3@xxxxxxxxxx" <andrew.cooper3@xxxxxxxxxx>, "ian.jackson@xxxxxxxxxxxxx" <ian.jackson@xxxxxxxxxxxxx>, "george.dunlap@xxxxxxxxxx" <george.dunlap@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, "keir@xxxxxxx" <keir@xxxxxxx>
- Delivery-date: Thu, 17 Dec 2015 10:06:05 +0000
- List-id: Xen developer discussion <xen-devel.lists.xen.org>
>>> 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
- References:
- [Xen-devel] [V3 PATCH 0/9] x86/hvm: pkeys, add memory protection-key support
- [Xen-devel] [V3 PATCH 7/9] x86/hvm: pkeys, add pkeys support for guest_walk_tables
- Re: [Xen-devel] [V3 PATCH 7/9] x86/hvm: pkeys, add pkeys support for guest_walk_tables
- Re: [Xen-devel] [V3 PATCH 7/9] x86/hvm: pkeys, add pkeys support for guest_walk_tables
- Re: [Xen-devel] [V3 PATCH 7/9] x86/hvm: pkeys, add pkeys support for guest_walk_tables
- Re: [Xen-devel] [V3 PATCH 7/9] x86/hvm: pkeys, add pkeys support for guest_walk_tables
- Re: [Xen-devel] [V3 PATCH 7/9] x86/hvm: pkeys, add pkeys support for guest_walk_tables
- Re: [Xen-devel] [V3 PATCH 7/9] x86/hvm: pkeys, add pkeys support for guest_walk_tables
- Re: [Xen-devel] [V3 PATCH 7/9] x86/hvm: pkeys, add pkeys support for guest_walk_tables
- Re: [Xen-devel] [V3 PATCH 7/9] x86/hvm: pkeys, add pkeys support for guest_walk_tables
- Re: [Xen-devel] [V3 PATCH 7/9] x86/hvm: pkeys, add pkeys support for guest_walk_tables
|