<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -40,7 +40,13 @@ int main(int argc, char * *argv)
 	/* hyperthreads, cores, or truly physical CPUs. */
 	/* */
 	/* If the Physical and Logical counts are equal, the number of Physical/Logical is the */
-	/* core count, because it's a dual core system. */
+	/* core count, because it's a multi-core system. */
+	/* */
+	/* If a count of the processor packages is needed, simply divide VirtualCount */
+	/* by LogicalPerPackage to get the number.  This may fail in some situations where */
+	/* the OS or a HyperVisor (VMWare or HyperV) limit the number of processors the OS */
+	/* sees - the CPU hardware will still report the total number of cores it has, but */
+	/* the underlying software will not have access to it. */
 
 	console-&gt;WriteLine(&quot;There are %d processors in the system (%d cores per package, %d logical per package).&quot;,
 	                   cpuid-&gt;VirtualCount(),
@@ -71,7 +77,7 @@ int main(int argc, char * *argv)
 	if ((int)ratio &lt; 1) {
 		console-&gt;WriteLine();
 		console-&gt;SetColour(console-&gt;FG_YELLOW | console-&gt;FG_INTENSITY);
-		console-&gt;WriteLine(&quot;WARNING: Expected at least 1 physical package, but detected %0.1lf. Are you\n&quot;
+		console-&gt;WriteLine(&quot;WARNING: Expected at least 1 physical package, but detected %0.2lf. Are you\n&quot;
 		                   &quot;running this under a hypervisor?&quot;, ratio);
 		console-&gt;SetColour();
 	}</diff>
      <filename>examples/CPUID/main.cpp</filename>
    </modified>
    <modified>
      <diff>@@ -1081,10 +1081,10 @@ namespace CrissCross
 
 				if (proc[processor]-&gt;m_cores &gt; 1 &amp;&amp;
 				    proc[processor]-&gt;m_logical &gt; proc[processor]-&gt;m_cores) {
-					/* Hyperthreaded dual core. */
+					/* Hyperthreaded core. */
 				} else if (proc[processor]-&gt;m_cores &gt; 1 &amp;&amp;
 				           proc[processor]-&gt;m_logical == proc[processor]-&gt;m_cores) {
-					/* Dual core. */
+					/* Multi-core processor not presenting HTT */
 					proc[processor]-&gt;m_features.erase(&quot;HTT&quot;);
 				} else if (proc[processor]-&gt;m_cores == 1 &amp;&amp;
 				           proc[processor]-&gt;m_logical &gt; proc[processor]-&gt;m_cores) {
@@ -1092,8 +1092,9 @@ namespace CrissCross
 					proc[processor]-&gt;m_features.erase(&quot;CMP&quot;);
 				}
 			} else {
-				/* HTT not supported. Report logical processor count as 1. */
-				proc[processor]-&gt;m_logical = 1;
+				/* HTT not supported. Report cores and logical processor count as equal. */
+				proc[processor]-&gt;m_cores = (char)(((Std[4].eax &amp; 0xFC000000) &gt;&gt; 26) + 1);
+				proc[processor]-&gt;m_logical = proc[processor]-&gt;m_cores;
 			}
 		}
 </diff>
      <filename>source/cpuid.cpp</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>050ccffc41c55f33f0ff1c3643d4d61737369c2a</id>
    </parent>
  </parents>
  <author>
    <name>Dan Linder</name>
    <email>dan@linder.org</email>
  </author>
  <url>http://github.com/tycho/crisscross/commit/f4c7122ce18e31289dc213ac3d9750ce6b879955</url>
  <id>f4c7122ce18e31289dc213ac3d9750ce6b879955</id>
  <committed-date>2009-10-22T13:33:23-07:00</committed-date>
  <authored-date>2009-10-22T13:33:23-07:00</authored-date>
  <message>Update code for older non-HTT cpus to correctly report the number of cores and logical processors.  Also update in-line comments to better explain how to determine physical cpu count strategy.</message>
  <tree>f069cd6da63a923b9117eb81860f415c25c99aa3</tree>
  <committer>
    <name>Dan Linder</name>
    <email>dan@linder.org</email>
  </committer>
</commit>
