i386: improve detection of the fast page fault assist.

In particular, check that we are assisting the page fault from kernel mode.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
This commit is contained in:
Konstantin Belousov 2019-03-17 18:31:48 +00:00
parent 1a7f456a4b
commit c51b496e0b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=345246

View File

@ -131,6 +131,10 @@ IDTVEC(prot)
pushl $T_PROTFLT
jmp irettraps
IDTVEC(page)
testl $PSL_VM, TF_EFLAGS-TF_ERR(%esp)
jnz 1f
testb $SEL_RPL_MASK, TF_CS-TF_ERR(%esp)
jnz 1f
cmpl $PMAP_TRM_MIN_ADDRESS, TF_EIP-TF_ERR(%esp)
jb 1f
movl %ebx, %cr3