Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\vm86_32.c Create Date:2022-07-28 08:41:49
Last Modify:2022-05-22 10:11:03 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:handle_vm86_fault

Proto:void handle_vm86_fault(struct kernel_vm86_regs *regs, long error_code)

Type:void

Parameter:

TypeParameterName
struct kernel_vm86_regs *regs
longerror_code
592  __user * csp
593  __user * ssp
596  vmpi = vm86plus
602  orig_flags = * (unsigned short * ) & flags
604  csp * __user = cs << 4
605  ssp * __user = ss << 4
606  sp = SP(regs)
607  ip = IP(regs)
609  data32 = 0
610  pref_done = 0
611  Do
613  Case = == 0x66
613  data32 = 1
613  Break
614  Case = == 0x67
614  Break
615  Case = == 0x2e
615  Break
616  Case = == 0x3e
616  Break
617  Case = == 0x26
617  Break
618  Case = == 0x36
618  Break
619  Case = == 0x65
619  Break
620  Case = == 0x64
620  Break
621  Case = == 0xf2
621  Break
622  Case = == 0xf3
622  Break
623  Default
623  pref_done = 1
625  When Not pref_done cycle
630  Case opcode == 0x9c
631  If data32 Then
633  SP(regs) -= 4
634  Else
636  SP(regs) -= 2
638  IP(regs) = ip
639  Go to vm86_fault_return
642  Case opcode == 0x9d
645  If data32 Then
647  SP(regs) += 4
648  Else
650  SP(regs) += 2
652  IP(regs) = ip
653  CHECK_IF_IN_TRAP
654  If data32 Then It is correct to call set_IF(regs) from the set_vflags_** functions. However someone forgot to call clear_IF(regs)* in the opposite case.* After the command sequence CLI PUSHF STI POPF you should* end up with interrupts disabled, but you ended up with
656  Else set_vflags_short(newflags, regs)
659  Go to check_vip
663  Case opcode == 0xcd
664  intno = popb(csp, ip, simulate_sigsegv)
665  IP(regs) = ip
666  If for debugger Then
667  If 1 << (intno & 7) & for debugger [intno >> 3] Then
672  There are so many possible reasons for this function to return* VM86_INTx, so adding another doesn't bother me. We can expect* userspace programs to be able to handle it. (Getting a problem* in userspace is always better than an Oops anyway.) [KD]
673  Return
677  Case opcode == 0xcf
682  If data32 Then
686  SP(regs) += 12
687  Else
691  SP(regs) += 6
693  IP(regs) = newip
694  cs = newcs
695  CHECK_IF_IN_TRAP
696  If data32 Then
698  Else
701  Go to check_vip
705  Case opcode == 0xfa
706  IP(regs) = ip
707  clear_IF(regs)
708  Go to vm86_fault_return
717  Case opcode == 0xfb
718  IP(regs) = ip
719  set_IF(regs)
720  Go to check_vip
722  Default
723  save_v86_state(regs, unhandled GP fault- IO-instruction or similar )
726  Return
728  check_vip :
729  If (VEFLAGS & (X86_EFLAGS_VIP | X86_EFLAGS_VIF)) == (X86_EFLAGS_VIP | X86_EFLAGS_VIF) Then
731  save_v86_state(regs, sti/popf/iret instruction enabledvirtual interrupts )
732  Return
735  vm86_fault_return :
736  If force_return_for_pic && VEFLAGS & (X86_EFLAGS_IF | X86_EFLAGS_VIF) Then
737  save_v86_state(regs, urn due to pending PIC request )
738  Return
740  If orig_flags & X86_EFLAGS_TF Then handle_vm86_trap(regs, 0, X86_TRAP_DB)
742  Return
744  simulate_sigsegv :
755  save_v86_state(regs, unhandled GP fault- IO-instruction or similar )
Caller
NameDescribe
do_general_protection