Print this page
8956 Implement KPTI
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
*** 20,29 ****
--- 20,31 ----
*/
/*
* 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,153 ****
#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);
#endif
DBG(window);
return (window);
}
--- 145,155 ----
#else
if (kbm_pae_support)
*((x86pte_t *)pte_to_window) = physaddr | pt_bits;
else
*((x86pte32_t *)pte_to_window) = physaddr | pt_bits;
! mmu_invlpg(window);
#endif
DBG(window);
return (window);
}
*** 193,203 ****
#else
if (kbm_pae_support)
*ptep = pteval;
else
*((x86pte32_t *)ptep) = pteval;
! mmu_tlbflush_entry((caddr_t)va);
#endif
}
#ifdef __xpv
--- 195,205 ----
#else
if (kbm_pae_support)
*ptep = pteval;
else
*((x86pte32_t *)ptep) = pteval;
! mmu_invlpg((caddr_t)va);
#endif
}
#ifdef __xpv
*** 347,357 ****
if (kbm_pae_support)
*ptep = 0;
else
*((x86pte32_t *)ptep) = 0;
! mmu_tlbflush_entry((caddr_t)va);
#endif
}
}
--- 349,359 ----
if (kbm_pae_support)
*ptep = 0;
else
*((x86pte32_t *)ptep) = 0;
! mmu_invlpg((caddr_t)va);
#endif
}
}
*** 386,396 ****
#else
if (kbm_pae_support)
*((x86pte_t *)ptep) = pte_val;
else
*((x86pte32_t *)ptep) = pte_val;
! mmu_tlbflush_entry((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)));
--- 388,398 ----
#else
if (kbm_pae_support)
*((x86pte_t *)ptep) = pte_val;
else
*((x86pte32_t *)ptep) = pte_val;
! 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,429 ****
if (kbm_pae_support)
*ptep = pte_val;
else
*((x86pte32_t *)ptep) = pte_val;
! mmu_tlbflush_entry((caddr_t)va);
#endif
}
/*
* interfaces for kernel debugger to access physical memory
--- 421,431 ----
if (kbm_pae_support)
*ptep = pte_val;
else
*((x86pte32_t *)ptep) = pte_val;
! mmu_invlpg((caddr_t)va);
#endif
}
/*
* interfaces for kernel debugger to access physical memory
*** 457,467 ****
#else
if (kbm_pae_support)
*((x86pte_t *)pte_to_window) = save_pte;
else
*((x86pte32_t *)pte_to_window) = save_pte;
! mmu_tlbflush_entry(window);
#endif
}
x86pte_t
get_pteval(paddr_t table, uint_t index)
--- 459,469 ----
#else
if (kbm_pae_support)
*((x86pte_t *)pte_to_window) = save_pte;
else
*((x86pte32_t *)pte_to_window) = save_pte;
! mmu_invlpg(window);
#endif
}
x86pte_t
get_pteval(paddr_t table, uint_t index)