|
Lines 225-232
sysret_check:
Link Here
|
| 225 |
/*CFI_REGISTER rflags,r11*/ |
225 |
/*CFI_REGISTER rflags,r11*/ |
| 226 |
movq %gs:pda_oldrsp,%rsp |
226 |
movq %gs:pda_oldrsp,%rsp |
| 227 |
swapgs |
227 |
swapgs |
|
|
228 |
sysret_label: |
| 228 |
sysretq |
229 |
sysretq |
| 229 |
|
230 |
|
|
|
231 |
.section __ex_table,"a" |
| 232 |
.quad sysret_label,bad_iret |
| 233 |
.previous |
| 234 |
|
| 230 |
/* Handle reschedules */ |
235 |
/* Handle reschedules */ |
| 231 |
/* edx: work, edi: workmask */ |
236 |
/* edx: work, edi: workmask */ |
| 232 |
sysret_careful: |
237 |
sysret_careful: |
|
Lines 776-786
error_exit:
Link Here
|
| 776 |
|
781 |
|
| 777 |
error_kernelspace: |
782 |
error_kernelspace: |
| 778 |
incl %ebx |
783 |
incl %ebx |
| 779 |
/* There are two places in the kernel that can potentially fault with |
784 |
/* There are a few places in the kernel that can potentially fault with |
| 780 |
usergs. Handle them here. The exception handlers after |
785 |
usergs. Handle them here. |
| 781 |
iret run with kernel gs again, so don't set the user space flag. |
786 |
B stepping K8s sometimes report an truncated RIP for IRET |
| 782 |
B stepping K8s sometimes report an truncated RIP for IRET |
787 |
exceptions returning to compat mode. Check for these here too. */ |
| 783 |
exceptions returning to compat mode. Check for these here too. */ |
|
|
| 784 |
leaq iret_label(%rip),%rbp |
788 |
leaq iret_label(%rip),%rbp |
| 785 |
cmpq %rbp,RIP(%rsp) |
789 |
cmpq %rbp,RIP(%rsp) |
| 786 |
je error_swapgs |
790 |
je error_swapgs |
|
Lines 789-794
error_kernelspace:
Link Here
|
| 789 |
je error_swapgs |
793 |
je error_swapgs |
| 790 |
cmpq $gs_change,RIP(%rsp) |
794 |
cmpq $gs_change,RIP(%rsp) |
| 791 |
je error_swapgs |
795 |
je error_swapgs |
|
|
796 |
cmpq $sysret_label,RIP(%rsp) |
| 797 |
je error_swapgs |
| 792 |
jmp error_sti |
798 |
jmp error_sti |
| 793 |
|
799 |
|
| 794 |
/* Reload gs selector with exception handling */ |
800 |
/* Reload gs selector with exception handling */ |