Print this page
8956 Implement KPTI
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
@@ -20,10 +20,12 @@
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright 2018 Joyent, Inc.
*/
#include <sys/types.h>
#include <sys/systm.h>
#include <sys/archsystm.h>
@@ -143,11 +145,11 @@
#else
if (kbm_pae_support)
*((x86pte_t *)pte_to_window) = physaddr | pt_bits;
else
*((x86pte32_t *)pte_to_window) = physaddr | pt_bits;
- mmu_tlbflush_entry(window);
+ mmu_invlpg(window);
#endif
DBG(window);
return (window);
}
@@ -193,11 +195,11 @@
#else
if (kbm_pae_support)
*ptep = pteval;
else
*((x86pte32_t *)ptep) = pteval;
- mmu_tlbflush_entry((caddr_t)va);
+ mmu_invlpg((caddr_t)va);
#endif
}
#ifdef __xpv
@@ -347,11 +349,11 @@
if (kbm_pae_support)
*ptep = 0;
else
*((x86pte32_t *)ptep) = 0;
- mmu_tlbflush_entry((caddr_t)va);
+ mmu_invlpg((caddr_t)va);
#endif
}
}
@@ -386,11 +388,11 @@
#else
if (kbm_pae_support)
*((x86pte_t *)ptep) = pte_val;
else
*((x86pte32_t *)ptep) = pte_val;
- mmu_tlbflush_entry((caddr_t)va);
+ mmu_invlpg((caddr_t)va);
#endif
if (!(old_pte & PT_VALID) || ma_to_pa(old_pte) == -1)
return (PFN_INVALID);
return (mmu_btop(ma_to_pa(old_pte)));
@@ -419,11 +421,11 @@
if (kbm_pae_support)
*ptep = pte_val;
else
*((x86pte32_t *)ptep) = pte_val;
- mmu_tlbflush_entry((caddr_t)va);
+ mmu_invlpg((caddr_t)va);
#endif
}
/*
* interfaces for kernel debugger to access physical memory
@@ -457,11 +459,11 @@
#else
if (kbm_pae_support)
*((x86pte_t *)pte_to_window) = save_pte;
else
*((x86pte32_t *)pte_to_window) = save_pte;
- mmu_tlbflush_entry(window);
+ mmu_invlpg(window);
#endif
}
x86pte_t
get_pteval(paddr_t table, uint_t index)