stgi
Set Global Interrupt Flag
STGI
Enables global interrupts (AMD SVM).
Details
Sets the Global Interrupt Flag (GIF) in the VMCB, enabling interrupts and exceptions at the SVM guest level. This is a privileged instruction requiring CPL=0 and SVM capability. After execution, the processor will accept maskable interrupts; no EFLAGS are modified.
Pseudocode Operation
GIF ← 1; // Global interrupt flag enabled
Example
STGI
Encoding
Binary Layout
0F
+0
01
+1
DC
+2
Operands
Reference (AMD APM)
Instruction Forms
| Opcode | Instruction | Op/En | 64/32-bit Mode | CPUID | Description |
|---|---|---|---|---|---|
| 0F 01 DC | STGI | Sets the global interrupt flag (GIF). |
Description
Sets the global interrupt flag (GIF) to 1. While GIF is zero, all external interrupts are disabled.
This is a Secure Virtual Machine (SVM) instruction.
Attempted execution of this instruction causes a #UD exception if SVM is not enabled and neither
SVM Lock nor the device exclusion vector (DEV) are supported. Support for SVM Lock is indicated by CPUID Fn8000_000A_EDX[SVML] = 1. Support for DEV is part of the SKINIT architecture and is indicated by CPUID Fn8000_0001_ECX[SKINIT] = 1. For more information on using the CPUID instruction, see the description of the CPUID instruction on page 165.
For information on enabling SVM, see “Enabling SVM” in APM Volume 2.
Flags Affected
None.
Exceptions
Exceptions
Virtual
Exception Real 8086 Protected Cause of Exception
Secure Virtual Machine was not enabled (EFER.SVME=0)
and both of the following conditions were true:
• SVM Lock is not available, as indicated by
X CPUID Fn8000_000A_EDX[SVML] = 0. Invalid opcode, #UD
• DEV is not available, as indicated by
CPUID Fn8000_0001_ECX[SKINIT] = 0.
X X Instruction is only recognized in protected mode.
General protection, X CPL was not 0. #GP
System Instruction Reference 469