From c51b496e0b2f94c0dd2db6c0ede4db0b6c40a8b2 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Sun, 17 Mar 2019 18:31:48 +0000 Subject: [PATCH] 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 --- sys/i386/i386/exception.s | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s index 2ee5032312a9..a4b57876be95 100644 --- a/sys/i386/i386/exception.s +++ b/sys/i386/i386/exception.s @@ -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