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:30
Last Modify:2022-05-22 10:11:03 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:save_v86_state

Proto:void save_v86_state(struct kernel_vm86_regs *regs, int retval)

Type:void

Parameter:

TypeParameterName
struct kernel_vm86_regs *regs
intretval
98  tsk = current process
99  __user * user
100  vm86 = vm86
101  err = 0
108  The local_irq_*() APIs are equal to the raw_local_irq*()* if !TRACE_IRQFLAGS.()
110  If Not vm86 || Not user_vm86 Then
111  pr_alert("no user_vm86: BAD\n")
112  do_exit(SIGSEGV)
114  set_flags(flags, VEFLAGS, X86_EFLAGS_VIF | veflags_mask)
115  user = user_vm86
117  If Not access_ok - Checks if a user space pointer is valid*@addr: User space pointer to start of block to check*@size: Size of block to check* Context: User context only. This function may sleep if pagefaults are* enabled.(user, is_vm86pus ? sizeof(structvm86plus_struct) : sizeof(structvm86_struct)) Then
120  pr_alert("could not access userspace vm86 info\n")
121  do_exit(SIGSEGV)
124  put_user_try
125  put_user_ex(bx, & ebx)
126  put_user_ex(cx, & ecx)
127  put_user_ex(dx, & edx)
128  put_user_ex(si, & esi)
129  put_user_ex(di, & edi)
130  put_user_ex(bp, & ebp)
131  put_user_ex(ax, & eax)
132  put_user_ex( Return frame for iretq , & eip)
133  put_user_ex(cs, & cs)
134  put_user_ex(flags, & eflags)
135  put_user_ex(sp, & esp)
136  put_user_ex(ss, & ss)
137  put_user_ex(hese are specific to v86 mode:, & hese are specific to v86 mode:)
138  put_user_ex(ds, & ds)
139  put_user_ex(fs, & fs)
140  put_user_ex(gs, & gs)
142  put_user_ex(screen_bitmap, & screen_bitmap)
143  put_user_catch(err)
144  If err Then
145  pr_alert("could not access userspace vm86 info\n")
146  do_exit(SIGSEGV)
149  Even if we don't have any preemption, we need preempt disable/enable* to be barriers, so that we don't have things like get_user/put_user* that can cause faults and scheduling migrate into our preempt-protected* region.()
150  sp0 = saved_sp0
151  sysenter_cs = Segment selector values corresponding to the above entries:
152  This is used when switching tasks or entering/exiting vm86 mode.
153  refresh_sysenter_cs( & * New fields for task_struct should be added above here, so that * they are included in the randomized portion of task_struct.)
154  saved_sp0 = 0
155  preempt_enable()
157  memcpy( & rmal regs, with special meaning for the segment descriptors.., & regs32, sizeof(structpt_regs))
159  lazy_load_gs(gs)
161  ax = retval
Caller
NameDescribe
do_intThere 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]
handle_vm86_trap
handle_vm86_fault
handle_signal