Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\umip.c Create Date:2022-07-28 08:50:34
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:mulate_umip_insn() - Emulate UMIP instructions and return dummy values*@insn: Instruction structure with operands*@umip_inst: A constant indicating the instruction to emulate*@data: Buffer into which the dummy result is stored*@data_size: Size of the

Proto:static int emulate_umip_insn(struct insn *insn, int umip_inst, unsigned char *data, int *data_size, bool x86_64)

Type:int

Parameter:

TypeParameterName
struct insn *insn
intumip_inst
unsigned char *data
int *data_size
boolx86_64
207  If Not data || Not data_size || Not insn Then Return -EINVAL
218  If umip_inst == 0F 01 /0 || umip_inst == 0F 01 /1 Then
220  dummy_limit = 0
223  If X86_MODRM_MOD(value) == 3 Then Return -EINVAL
226  If umip_inst == 0F 01 /0 Then dummy_base_addr = DOC: Emulation for User-Mode Instruction Prevention (UMIP)* User-Mode Instruction Prevention is a security feature present in recent* x86 processors that, when enabled, prevents a group of instructions (SGDT,* SIDT, SLDT, SMSW and STR) from being run in
228  Else dummy_base_addr = UMIP_DUMMY_IDT_BASE
237  If x86_64 Then data_size = The SGDT and SIDT instructions store the contents of the global descriptor* table and interrupt table registers, respectively. The destination is a* memory operand of X+2 bytes. X bytes are used to store the base address of
239  Else data_size = UMIP_GDT_IDT_BASE_SIZE_32BIT
242  memcpy(data + 2, & dummy_base_addr, * data_size)
244  data_size += UMIP_GDT_IDT_LIMIT_SIZE
245  memcpy(data, & dummy_limit, UMIP_GDT_IDT_LIMIT_SIZE)
247  Else if umip_inst == 0F 01 /4 Then
248  dummy_value = CR0_STATE
258  If X86_MODRM_MOD(value) == 3 Then data_size = opnd_bytes
260  Else data_size = 2
263  memcpy(data, & dummy_value, * data_size)
265  Else
266  Return -EINVAL
269  Return 0
Caller
NameDescribe
fixup_umip_exceptionxup_umip_exception() - Fixup a general protection fault caused by UMIP*@regs: Registers as saved when entering the #GP handler* The instructions SGDT, SIDT, STR, SMSW and SLDT cause a general protection* fault if executed with CPL > 0 (i