x86: pte_atomic_update should not return flipped
KPTI gymnastics need to be abstracted away from callers to page_map_set(). Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
40f1ca58ed
commit
2a139ee95d
1 changed files with 7 additions and 0 deletions
|
@ -861,6 +861,13 @@ static inline pentry_t pte_atomic_update(pentry_t *pte, pentry_t update_val,
|
|||
new_val = pte_finalize_value(new_val, user_table);
|
||||
} while (atomic_pte_cas(pte, old_val, new_val) == false);
|
||||
|
||||
#ifdef CONFIG_X86_KPTI
|
||||
if (is_flipped_pte(old_val)) {
|
||||
/* Page was flipped for KPTI. Un-flip it */
|
||||
old_val = ~old_val;
|
||||
}
|
||||
#endif /* CONFIG_X86_KPTI */
|
||||
|
||||
return old_val;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue