Re: [PATCH 8/8] KVM: x86: simplify kvm_apic_map

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

 




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
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux