Page 1 of 1

SpeedStep and TurboBoost witout ACPICA

Posted: Thu Feb 11, 2016 2:37 pm
by 0x02e0x5fident
I've been reading through the Intel and ACPI manuals trying to figure out how to support power management for Intel processors. From what I've gathered, this is done by setting the value of IA32_PERF_CTL with a value that contains the desired frequency and voltage, but the allowed values for this register are model-specific. It seems most systems implement something like ACPICA to read the legal p-state values out of the ACPI _PSS object. Perhaps this is a ridiculous question, but is it possible to get these model-specific p-states without using ACPICA?

I'd rather not implement a full AML parser, so if I could dig though the SSDTs, either searching for the _PSS object, or jumping to a known offset, that would be greatly preferred. Trouble is, I've looked through the contents of the SSDT's using acpidump on Linux and couldn't find anything around what I assume (incorrectly?) is the _PSS object that actually gives voltage or frequency information. On my machine, the only thing that differs between the _PSS sections of the various SSDT tables appears to be an identifier, so even if I did "manually" parse the SSDTs, I'm not sure what useful info I would get.

Alternatively, is there a real-mode BIOS interface that might get me these p-states, bypassing ACPI entirely? Or some other solution?

It seems I must be missing something, but I'm not sure what. Any help would be much appreciated.

I was happy to see HWP (Intel Vol.3B section 14.4), and implemented support for that, but it's still quite new, and I don't currently have any CPUs to test it with, so I'm back to trying to figure out SpeedStep.

Re: SpeedStep and TurboBoost witout ACPICA

Posted: Fri Feb 12, 2016 12:04 am
by Brendan
Hi,
0x02e0x5fident wrote:Perhaps this is a ridiculous question, but is it possible to get these model-specific p-states without using ACPICA?
In theory; yes. You can use CPUID to get the "vendor, family, model, stepping" info, then use that to search for the model specific information (in a file, database, whatever). The problem is obtaining, testing and maintaining the information (e.g. updating it every time Intel releases a new CPU), and providing it as part of the OS.
0x02e0x5fident wrote:Alternatively, is there a real-mode BIOS interface that might get me these p-states, bypassing ACPI entirely? Or some other solution?
There's an older "Advanced Power Management" interface that was used before ACPI existed and is just plain BIOS functions (actually there's 3 different interfaces - one for real mode, one for 16-bit protected mode, one for 32-bit protected mode). However, it should be considered deprecated, and I don't know if current computers bother supporting it at all. I'm also not sure if APM supports multi-CPU properly; and it doesn't give you direct control of the CPU's power management (you tell BIOS when CPU is idle/busy, and it does whatever it feels like with CPU's power management).


Cheers,

Brendan

Re: SpeedStep and TurboBoost witout ACPICA

Posted: Fri Feb 12, 2016 1:04 pm
by 0x02e0x5fident
Thanks for the help. I looked more into it and it seems I did have a fundamental misunderstanding about how the AML blocks are used and what's in them (and what isn't). Looks like in order to get it working correctly without ACPICA, I'd have to implement a whole ACPICA alternative -- at which point I may as well just use ACPICA. I also looked at BIOS APM and agree that it's not really what I should be using. Thanks again.

Re: SpeedStep and TurboBoost witout ACPICA

Posted: Fri Feb 12, 2016 2:00 pm
by kzinti
Just use ACPICA? That's what Linux does. I also did it and it was pretty straightforward to do...