Hi Jiaxin, 1) mSmmInitialized *must* be volatile. Your current code may cause anything, from skipping waiting entirely (the loop is optimized away as the compiler considers it free from side effects) to stalling (the memory access is optimized away as the compiler considers it locally-immutable). 2) ASSERTs on memory allocation failures are one of the most terrible edk2 "paradigms". 3) Comparisons against boolean constants are not allowed by the code style spec. Best regards, Marvin