Print this page
8956 Implement KPTI
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>

*** 19,35 **** * CDDL HEADER END */ /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SYS_PC_MMU_H #define _SYS_PC_MMU_H - #pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif /* --- 19,35 ---- * CDDL HEADER END */ /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2018 Joyent, Inc. */ #ifndef _SYS_PC_MMU_H #define _SYS_PC_MMU_H #ifdef __cplusplus extern "C" { #endif /*
*** 48,60 **** #define pfn_to_mfn(pfn) (pfn) #define mfn_to_pfn(mfn) (mfn) #ifndef _BOOT ! void mmu_tlbflush_entry(caddr_t); ! void setcr3(ulong_t); #if defined(__GNUC__) #include <asm/mmu.h> #endif #endif /* !_BOOT */ --- 48,67 ---- #define pfn_to_mfn(pfn) (pfn) #define mfn_to_pfn(mfn) (mfn) #ifndef _BOOT ! extern uint64_t kpti_safe_cr3; + #define INVPCID_ADDR (0) + #define INVPCID_ID (1) + #define INVPCID_ALL_GLOBAL (2) + #define INVPCID_ALL_NONGLOBAL (3) + + extern void invpcid_insn(uint64_t, uint64_t, uintptr_t); + extern void tr_mmu_flush_user_range(uint64_t, size_t, size_t, uint64_t); + #if defined(__GNUC__) #include <asm/mmu.h> #endif #endif /* !_BOOT */