Using SMM for task switch

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
lopidas
Member
Member
Posts: 65
Joined: Sun May 26, 2013 10:12 am

Using SMM for task switch

Post 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?
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Using SMM for task switch

Post 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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
theesemtheesem
Member
Member
Posts: 31
Joined: Thu Mar 20, 2014 2:22 pm
Location: London, UK

Re: Using SMM for task switch

Post 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
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

Re: Using SMM for task switch

Post 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.
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
Post Reply