lkml.org 
[lkml]   [2015]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 8/8] KVM: x86: simplify kvm_apic_map


On 30/01/2015 17:57, Radim Krčmář wrote:
> As optimizations go, we could drop the "&" on cid as "cid < 16" is
> checked later, so mode=4 practically does nothing ... Not the best for
> future bugs, but still pretty safe -- only x2APIC can set a value that
> would require the "&" and it can't have valid XAPIC mode, so u32 still
> protects us enough.
>
> *cid = ldr >> mode;
> *lid = ldr & ((1 << mode) - 1);
>
> Which is probably faster a solution where we don't shuffle switch cases
> to jump to x2APIC first. A comparison is at the very bottom [2].
>
> Would that be ok in v2?

Yes, this is okay. Thanks for looking at it!

Paolo


\
 
 \ /
  Last update: 2015-01-30 22:21    [W:0.065 / U:1.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site