]> hydra-www.ietfng.org Git - xv6-public/commitdiff
Comment about APIC id versus CPU id confusion.
authorPeter H. Froehlich <peter.hans.froehlich@gmail.com>
Sun, 18 Oct 2015 23:44:35 +0000 (19:44 -0400)
committerPeter H. Froehlich <peter.hans.froehlich@gmail.com>
Sun, 18 Oct 2015 23:44:35 +0000 (19:44 -0400)
mp.c

diff --git a/mp.c b/mp.c
index 60c8a5a26d8803b3ce4cb37b72b7fe43714c8b13..01e4315ad46739b17d395037073cc0df9ee1cc69 100644 (file)
--- a/mp.c
+++ b/mp.c
@@ -122,6 +122,13 @@ mpinit(void)
         p += sizeof(struct mpproc);
         continue;
       }
+      // TODO: The following is dubious at best. We enforce a rule that the
+      // APIC ids have to be consecutive, but the MP specification explicitly
+      // says that they DON'T have to be. As long as QEMU is used to simulate
+      // multiple SOCKETS everything seems fine, but as soon as we add CORES
+      // the code here breaks (and fails to identify them). The confusion
+      // between the id we assign here and the actual APIC id continues in
+      // ioapic.c for example. A rewrite is in order.
       if(ncpu != proc->apicid){
         cprintf("mpinit: ncpu=%d apicid=%d\n", ncpu, proc->apicid);
         ismp = 0;