freebsd-src/sys/i386
Andriy Gapon d443a96ffb i386 and amd64 mp_machdep: improve topology detection for Intel CPUs
This patch is significantly based on previous work by jkim.
List of changes:
- added comments that describe topology uniformity assumption
- added reference to Intel Processor Topology Enumeration article
- documented a few global variables that describe topology
- retired weirdly set and used logical_cpus variable
- changed fallback code for mp_ncpus > 0 case, so that CPUs are treated
  as being different packages rather than cores in a single package
- moved AMD-specific code to topo_probe_amd [jkim]
- in topo_probe_0x4() follow Intel-prescribed procedure of deriving SMT
  and core masks and match APIC IDs against those masks [started by
  jkim]
- in topo_probe_0x4() drop code for double-checking topology parameters
  by looking at L1 cache properties [jkim]
- in topo_probe_0xb() add fallback path to topo_probe_0x4() as
  prescribed by Intel [jkim]

Still to do:
- prepare for upcoming AMD CPUs by using new mechanism of uniform
  topology description [pointed by jkim]
- probe cache topology in addition to CPU topology and probably use that
  for scheduler affinity topology; e.g. Core2 Duo and Athlon II X2 have
  the same CPU topology, but Athlon cores do not share L2 cache while
  Core2's do (no L3 cache in both cases)
- think of supporting non-uniform topologies if they are ever
  implemented for platforms in question
- think how to better described old HTT vs new HTT distinction, HTT vs
  SMT can be confusing as SMT is a generic term
- more robust code for marking CPUs as "logical" and/or "hyperthreaded",
  use HTT mask instead of modulo operation
- correct support for halting logical and/or hyperthreaded CPUs, let
  scheduler know that it shouldn't schedule any threads on those CPUs

PR:			kern/145385 (related)
In collaboration with:	jkim
Tested by:		Sergey Kandaurov <pluknet@gmail.com>,
			Jeremy Chadwick <freebsd@jdc.parodius.com>,
			Chip Camden <sterling@camdensoftware.com>,
			Steve Wills <steve@mouf.net>,
			Olivier Smedts <olivier@gid0.org>,
			Florian Smeets <flo@smeets.im>
MFC after:		1 month
2010-10-01 10:32:54 +00:00
..
acpica For every instance of '.if ${CC} == "foo"' or '.if ${CC} != "foo"' in 2010-08-17 20:39:28 +00:00
bios Introduce the new kernel sub-tree x86 which should contain all the code 2010-02-25 14:13:39 +00:00
compile
conf Now userland POSIX semaphore is based on umtx. The kernel module 2010-09-24 09:04:16 +00:00
i386 i386 and amd64 mp_machdep: improve topology detection for Intel CPUs 2010-10-01 10:32:54 +00:00
ibcs2 Regenerate 2010-06-28 18:17:21 +00:00
include Refactor timer management code with priority to one-shot operation mode. 2010-09-13 07:25:35 +00:00
isa Simplify fldcw() macro. There is no reason to use pointer here. No object 2010-07-26 23:20:55 +00:00
linux The interpreter name should no longer be treated as a buffer that can be 2010-07-28 04:47:40 +00:00
pci Change the MPTable and $PIR PCI-PCI bridge drivers to inherit from the 2010-08-05 17:48:37 +00:00
svr4 Change some movl's to mov's. Newer GAS no longer accept 'movl' instructions 2009-01-31 11:37:21 +00:00
xbox Update d_mmap() to accept vm_ooffset_t and vm_memattr_t. 2009-12-29 21:51:28 +00:00
xen Update various places that store or manipulate CPU masks to use cpumask_t 2010-08-11 23:22:53 +00:00
Makefile