Page 1 of 1

Are cores detected in the MADT?

Posted: Thu Oct 08, 2020 1:39 pm
by nexos
Hello,
I am currently writing code that starts up APs. It works perfectly on QEMU. I noticed something on my newer UEFI laptop, however. The MADT reports 8 CPUs. After starting the first 3 APs, it halted. After debugging, the problem was that the online capable bit wasn't set in the LAPIC entry. I added code to not use these CPUs, and it works. I rebooted it into Windows, and Task Manager reports 4 logical CPUs, with 2 cores per CPU. I think that the four unusable entries were the cores. So my question is, how do i start CPU cores up?
Thanks,
nexos

Re: Are cores detected in the MADT?

Posted: Thu Oct 08, 2020 1:49 pm
by thewrongchristian
nexos wrote:Hello,
I am currently writing code that starts up APs. It works perfectly on QEMU. I noticed something on my newer UEFI laptop, however. The MADT reports 8 CPUs. After starting the first 3 APs, it halted. After debugging, the problem was that the online capable bit wasn't set in the LAPIC entry. I added code to not use these CPUs, and it works. I rebooted it into Windows, and Task Manager reports 4 logical CPUs, with 2 cores per CPU. I think that the four unusable entries were the cores. So my question is, how do i start CPU cores up?
Thanks,
nexos
4 HT capable cores with HT disabled in UEFI settings?

Re: Are cores detected in the MADT?

Posted: Fri Oct 09, 2020 4:23 pm
by Octocontrabass
nexos wrote:Task Manager reports 4 logical CPUs, with 2 cores per CPU.
What kind of CPU is it? It sounds like you're using a CPU capable of only 4 threads, so the MADT has extra entries for APs that don't exist.

(Why would the MADT have entries for APs that don't exist? Sometimes firmware designers are lazy and use a fixed-size table, then mark the extra entries as unusable. Sometimes the CPU manufacturer actually builds a CPU capable of 8 threads and then disables 4 of them in the factory.)

Re: Are cores detected in the MADT?

Posted: Sat Oct 10, 2020 6:24 am
by nexos
I don't have my PC in front of me, but it has an Intel Core i3

Re: Are cores detected in the MADT?

Posted: Sat Oct 10, 2020 8:10 am
by iansjack
Task Manager is telling you that your processor has 2 physical cores which each support 2 threads - giving you 4 logical processors. Hence you can only start 4. Although different i3s have different capabilities, that sounds like a typical, fairly modern, one.