Page 1 of 1
Using SMM for task switch
Posted: Sat Mar 29, 2014 9:26 am
by lopidas
Hello, I was thinking if I can use SMM code for task switching. I want to ask. Is the SMM code from manufacturer or firmware vendor? Is there possibility to check if it knows about special contexts like FPU and SSE?
Re: Using SMM for task switch
Posted: Sat Mar 29, 2014 10:07 am
by Brendan
Hi,
lopidas wrote:Hello, I was thinking if I can use SMM code for task switching.
You can't use SMM without replacing the motherboard's firmware.
lopidas wrote:Is the SMM code from manufacturer or firmware vendor?
I'd assume firmware vendor writes it (to suit chipset, etc) as part of some agreement/contract with the motherboard manufacturer.
lopidas wrote:Is there possibility to check if it knows about special contexts like FPU and SSE?
In theory, maybe (by reverse engineering the firmware's ROM). In practice it's a pointless waste of time, given that there's no sane way for an OS to use SMM and no sane reason for an OS to want to use SMM.
Cheers,
Brendan
Re: Using SMM for task switch
Posted: Sat Mar 29, 2014 11:35 am
by theesemtheesem
Hi,
Is it even possible to enter SMM from software?
Anyway, upon entering SMM the CPU saves the complete state information (including control registers), but
the FPU state is not saved. It might be conceivable to think that any code executed in SMM doesn't need
to use the FPU, so these should stay untouched.
It is just an academic discussion anyway, SMM is used by the motherboard to emulate missing hardware (like a PS2
controller on a USB-only motherboard) and to manage critical events, like temperature control, fans speeds etc.
On some Intel boards there is a piece of code that runs in SMM mode to allow remote management (it's called
AMT afaik).
Just forget about SMM mode - You can't use it for anything, and just pretend it does not exist.
Cheers,
Theesem
Re: Using SMM for task switch
Posted: Sun Mar 30, 2014 4:22 am
by Bender
Is it even possible to enter SMM from software?
I think it MAY be possible, there are some
vendor specific I/O ports you can write to which
can trigger an SMI, AFAIK it'll be useless.