]> git.proxmox.com Git - qemu.git/commit
target-i386: Topology & APIC ID utility functions
authorEduardo Habkost <ehabkost@redhat.com>
Wed, 23 Jan 2013 17:58:27 +0000 (15:58 -0200)
committerAndreas Färber <afaerber@suse.de>
Sun, 27 Jan 2013 13:34:27 +0000 (14:34 +0100)
commit247c9de13f9d54a94734875000a9faea8168c8ca
tree9b26cf09cdb0b08f8252e6c3cd3b57a355363173
parent1d934e89793d2828e04af93abd181e5ed5349ef4
target-i386: Topology & APIC ID utility functions

This introduces utility functions for the APIC ID calculation, based on:
  Intel® 64 Architecture Processor Topology Enumeration
  http://software.intel.com/en-us/articles/intel-64-architecture-processor-topology-enumeration/

The code should be compatible with AMD's "Extended Method" described at:
  AMD CPUID Specification (Publication #25481)
  Section 3: Multiple Core Calcuation
as long as:
 - nr_threads is set to 1;
 - OFFSET_IDX is assumed to be 0;
 - CPUID Fn8000_0008_ECX[ApicIdCoreIdSize[3:0]] is set to
   apicid_core_width().

Unit tests included.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
target-i386/topology.h [new file with mode: 0644]
tests/.gitignore
tests/Makefile
tests/test-x86-cpuid.c [new file with mode: 0644]