On 02/16/2018 11:54 AM, Nadav Amit wrote: >> But I don't really want to hide that gunk in a macro like that. It >> might make more sense as a static inline. I'll give that a shot and resent. > Since determining whether PTI is on is done in several places in the kernel, > maybe there should a single function to determine whether PTI is on, > something like: > > static inline bool is_pti_on(void) > { > return IS_ENABLED(CONFIG_PAGE_TABLE_ISOLATION) && > static_cpu_has(X86_FEATURE_PTI); > } We should be able to do it with disabled-features.h and the X86_FEATURE bit. I'll look into it. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>