3

I am wondering if it is, in theory, possible to enable hyperthreads after they have been disabled in the BIOS and vice-versa. As it turns out, if hyper-threads are disabled they do still show up in the MADT tables of ACPI as disabled cores. This is a sample output from the MADT with a processor having 4 cores and 2 threads per core and hyper-threading disabled.

CPU 0: APIC_ID=0 ACPI_PROCESSOR_ID=0 ENABLED=1
CPU 1: APIC_ID=2 ACPI_PROCESSOR_ID=1 ENABLED=1
CPU 2: APIC_ID=4 ACPI_PROCESSOR_ID=2 ENABLED=1
CPU 3: APIC_ID=6 ACPI_PROCESSOR_ID=3 ENABLED=1
CPU 4: APIC_ID=255 ACPI_PROCESSOR_ID=4 ENABLED=0
CPU 5: APIC_ID=255 ACPI_PROCESSOR_ID=5 ENABLED=0
CPU 6: APIC_ID=255 ACPI_PROCESSOR_ID=6 ENABLED=0
CPU 7: APIC_ID=255 ACPI_PROCESSOR_ID=7 ENABLED=0

I'm wondering if (a) there is an option to enable these cores at runtime (without rebooting and going through the BIOS). And (b) what (well defined or not) state is a hyperthread/processor in, if it is not enabled (i.e., is it executing hlt or mwait instructions with local APIC disabled for example?).

What I read in the ACPI specification (5.2.12.2 Processor Local APIC Structure) is the following for the enabled flag:

If zero, this processor is unusable, and the operating system support will not attempt to use it.

However, if someone knows, I'm interested in knowing about what is the actual state a disabled hyperthread is in. For example, did the MP Initialization Protocol Algorithm as described in Intels Software Developers Manual Volume 3 (Section 8.4.3) execute on the disabled hyper-threads during initialization?

zgerd
  • 1,080
  • 8
  • 17
  • Well if the BIOS can do it, surely you can do it too. However, it's likely to be a motherboard/chipset specific method so it won't be portable – tangrs Apr 18 '14 at 08:53
  • I agree, however depending on the state the BIOS leaves disabled cores in, it might be just a simple matter of sending a series of IPIs and setting the APIC ID to wake the core. On the other hand if the core was never initialized properly it will be harder to do as it probably involves chipset specific operations as you have pointed out. – zgerd Apr 19 '14 at 09:43
  • Never tried such a thing. I have no idea what state the cores might 'wake up' in and and what mode they might start to operate in. The OS would have to start managing them and dispatching threads onto them, configuring the mto handle interrupts etc. The whole prospect seems to me to be in the 'very unlikly' category:( – Martin James Apr 19 '14 at 10:33

1 Answers1

1

(a) Sorry to say but you cannot with 99.99% certainty unless you have access to the processor initialization code or your BIOS vendor happened to comment out a few different lines of code. The number of cores & threads are locked in at the end of the cold boot process.

(b) I'm pretty sure when the HT disabled bit is set. The logical Processor 1 and secondary APIC are disabled.

James
  • 71
  • 1
  • 5
  • I think the question relates to hacking an i5 into an i7 or something like that. I haven't heard of anyone succeeding in that. To begin with you'd need to assign valid APIC ids to the HT cores, which are always identified by the last bit so "CPU 4" would need an APIC id of 1 and so forth. But I'm sure there are some CPU "features" that would ignore such a MADT, even if you hacked it in your BIOS. – Fizz Jul 13 '14 at 08:03