On Thu, Oct 17, 2013 at 03:10:16PM +0200, 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 tradeoff to this is the change from O(N)
complexity to O(N^2) in x86DataAdd and x86DataSubtract. The rest of the
functions were already using O(N^2) algorithms.
---
Notes:
Version 2:
- no change, weak ACK from Daniel
- fixed typo in commit message
src/cpu/cpu_x86.c | 213 ++++++++++++++++++-------------------------------
src/cpu/cpu_x86_data.h | 8 +-
2 files changed, 80 insertions(+), 141 deletions(-)
ACK, but as before, I'd still prefer if someone (ideally Jiri) double
checked this particular patch.
Daniel
--
|:
http://berrange.com -o-
http://www.flickr.com/photos/dberrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|:
http://entangle-photo.org -o-
http://live.gnome.org/gtk-vnc :|