[libvirt] [PATCHv2 17/23] cpu_x86: Refactor storage of CPUID data to add support for KVM features

Eric Blake eblake at redhat.com
Tue Oct 15 15:08:51 UTC 2013


On 10/15/2013 06:30 AM, Peter Krempa wrote:
> The CPUID functions were stored in multiple arrays according to a
> specified prefix of those. This made it very hard to add another prefix
> to store KVM CPUID features (0x40000000). Instead of hardcoding a third
> array this patch changes the approach used:
> 
> The code is refactored to use a single array where the CPUID functions
> are stored ordered by the cpuid function so that they don't depend on
> the specific prefix and don't waste memory. The code is also less
> complex using this approach. A trateoff to this is the change from O(N)

s/trateoff/tradeoff/

> complexity to O(N^2) in x86DataAdd and x86DataSubtract. The rest of the
> functions were already using O(N^2) algorithms.

(Haven't reviewed the actual patch yet, since Dan was doing the series...)

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20131015/5530837e/attachment-0001.sig>


More information about the libvir-list mailing list