File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -846,7 +846,12 @@ static inline pud_t *pud_offset(p4d_t *p4d, unsigned long address)
846
846
847
847
static inline int p4d_bad (p4d_t p4d )
848
848
{
849
- return (p4d_flags (p4d ) & ~(_KERNPG_TABLE | _PAGE_USER )) != 0 ;
849
+ unsigned long ignore_flags = _KERNPG_TABLE | _PAGE_USER ;
850
+
851
+ if (IS_ENABLED (CONFIG_PAGE_TABLE_ISOLATION ))
852
+ ignore_flags |= _PAGE_NX ;
853
+
854
+ return (p4d_flags (p4d ) & ~ignore_flags ) != 0 ;
850
855
}
851
856
#endif /* CONFIG_PGTABLE_LEVELS > 3 */
852
857
@@ -880,7 +885,12 @@ static inline p4d_t *p4d_offset(pgd_t *pgd, unsigned long address)
880
885
881
886
static inline int pgd_bad (pgd_t pgd )
882
887
{
883
- return (pgd_flags (pgd ) & ~_PAGE_USER ) != _KERNPG_TABLE ;
888
+ unsigned long ignore_flags = _PAGE_USER ;
889
+
890
+ if (IS_ENABLED (CONFIG_PAGE_TABLE_ISOLATION ))
891
+ ignore_flags |= _PAGE_NX ;
892
+
893
+ return (pgd_flags (pgd ) & ~ignore_flags ) != _KERNPG_TABLE ;
884
894
}
885
895
886
896
static inline int pgd_none (pgd_t pgd )
You can’t perform that action at this time.
0 commit comments