Re: [edk2] run SMM in 64-bit

Subject: Re: [edk2] run SMM in 64-bit

From: Neeraj Ladkani <>

To: "" <>

Date: 2014-09-07 06:28:25


as par SDM section 34.5.1. not sure if its a hardware limitation.

"After saving the current context of the processor, the processor initializes its core registers to the values shown in Table 34-4. Upon entering SMM, the PE and PG flags in control register CR0 are cleared, which places the processor
in an environment similar to real-address mode. The differences between the SMM execution environment and the
real-address mode execution environment are as follows:
The addressable address space ranges from 0 to FFFFFFFFH (4 GBytes).
The normal 64-KByte segment limit for real-address mode is increased to 4 GBytes.
The default operand and address sizes are set to 16 bits, which restricts the addressable SMRAM address space
to the 1-MByte real-address mode limit for native real-address-mode code. However, operand-size and
address-size override prefixes can be used to access the address space beyond the 1-MByte.

I am just curious, what kind of limitations you are facing in 4 GB limit?


On Sat, Sep 6, 2014 at 10:08 PM, Andrew Fish <> wrote:

On Sep 6, 2014, at 3:52 AM, stanley.ganyezu <> wrote:

Hi Experts,
Currently, X86 cpu run SMM in 32-bit. There are a lot of limitation about 32-bit. I want to run SMM in 64-bit to access whole cpu address spacebut I cant figure it out.

UEFI/PI systems run SMM in 64-bit mode? See UEFI Platform Initialization Specification Version 1.3.

Can you give me some tips? Any suggestion will be appreciated.

Put the system in Long mode, this requires page tables. The DXE IPL and 64-bit SEC in Ovmf both have code that transitions to 64-bit long mode.

It is really dangerous to modify the SMM code if you do not fully understand it, since SMM runs at a higher privilege than the OS it is an attack point that the OS can not defend against.


Andrew Fish

Best wishes,
Slashdot TV.
Video for Nerds. Stuff that matters.
edk2-devel mailing list

Slashdot TV.
Video for Nerds. Stuff that matters.
edk2-devel mailing list