函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\vm86_32.c Create Date:2022-07-27 09:41:00
Last Modify:2022-05-22 10:11:03 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:handle_vm86_fault

函数原型:void handle_vm86_fault(struct kernel_vm86_regs *regs, long error_code)

返回类型:void

参数:

类型参数名称
struct kernel_vm86_regs *regs
longerror_code
592  __usercsp
593  __userssp
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  循环
613  : = == 0x66
613  data32等于1
613  退出
614  : = == 0x67
614  退出
615  : = == 0x2e
615  退出
616  : = == 0x3e
616  退出
617  : = == 0x26
617  退出
618  : = == 0x36
618  退出
619  : = == 0x65
619  退出
620  : = == 0x64
620  退出
621  : = == 0xf2
621  退出
622  : = == 0xf3
622  退出
623  默认
623  pref_done等于1
625  当非pref_done循环
630  :opcode恒等于0x9c
631  如果data32
633  SP(regs)减等于4
634  否则
636  SP(regs)减等于2
638  IP(regs)等于ip
639  转到:vm86_fault_return
642  :opcode恒等于0x9d
645  如果data32
647  SP(regs)加等于4
648  否则
650  SP(regs)加等于2
652  IP(regs)等于ip
653  CHECK_IF_IN_TRAP
654  如果data32It 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  否则set_vflags_short(newflags, regs)
659  转到:check_vip
663  :opcode恒等于0xcd
664  intno等于popb(csp, ip, simulate_sigsegv)
665  IP(regs)等于ip
666  如果 for debugger
667  如果1左移intno按位与7的值位按位与 for debugger [intno >> 3]则
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  返回
677  :opcode恒等于0xcf
682  如果data32
683  newip等于popl(ssp, sp, simulate_sigsegv)
684  newcs等于popl(ssp, sp, simulate_sigsegv)
686  SP(regs)加等于12
687  否则
688  newip等于popw(ssp, sp, simulate_sigsegv)
689  newcs等于popw(ssp, sp, simulate_sigsegv)
691  SP(regs)加等于6
693  IP(regs)等于newip
694  cs等于newcs
695  CHECK_IF_IN_TRAP
696  如果data32
698  否则
701  转到:check_vip
705  :opcode恒等于0xfa
706  IP(regs)等于ip
707  clear_IF(regs)
708  转到:vm86_fault_return
717  :opcode恒等于0xfb
718  IP(regs)等于ip
719  set_IF(regs)
720  转到:check_vip
722  默认
723  save_v86_state(regs, unhandled GP fault- IO-instruction or similar )
726  返回
728  check_vip :
729  如果VEFLAGS按位与X86_EFLAGS_VIP按位或X86_EFLAGS_VIF的值的值恒等于X86_EFLAGS_VIP按位或X86_EFLAGS_VIF的值则
731  save_v86_state(regs, sti/popf/iret instruction enabledvirtual interrupts )
732  返回
735  vm86_fault_return :
736  如果force_return_for_picVEFLAGS按位与X86_EFLAGS_IF按位或X86_EFLAGS_VIF的值则
737  save_v86_state(regs, urn due to pending PIC request )
738  返回
740  如果orig_flags按位与X86_EFLAGS_TFhandle_vm86_trap(regs, 0, X86_TRAP_DB)
742  返回
744  simulate_sigsegv :
755  save_v86_state(regs, unhandled GP fault- IO-instruction or similar )
调用者
名称描述
do_general_protection