|
@@ -108,7 +108,7 @@ static bool pgattr_change_is_safe(u64 old, u64 new)
|
|
|
* The following mapping attributes may be updated in live
|
|
|
* kernel mappings without the need for break-before-make.
|
|
|
*/
|
|
|
- static const pteval_t mask = PTE_PXN | PTE_RDONLY | PTE_WRITE;
|
|
|
+ static const pteval_t mask = PTE_PXN | PTE_RDONLY | PTE_WRITE | PTE_NG;
|
|
|
|
|
|
/* creating or taking down mappings is always safe */
|
|
|
if (old == 0 || new == 0)
|
|
@@ -118,9 +118,9 @@ static bool pgattr_change_is_safe(u64 old, u64 new)
|
|
|
if ((old | new) & PTE_CONT)
|
|
|
return false;
|
|
|
|
|
|
- /* Transitioning from Global to Non-Global is safe */
|
|
|
- if (((old ^ new) == PTE_NG) && (new & PTE_NG))
|
|
|
- return true;
|
|
|
+ /* Transitioning from Non-Global to Global is unsafe */
|
|
|
+ if (old & ~new & PTE_NG)
|
|
|
+ return false;
|
|
|
|
|
|
return ((old ^ new) & ~mask) == 0;
|
|
|
}
|