Page 1 of 1

What role do user_cs_limit/user_cs_base in the mm_context_t?

PostPosted: Tue Jun 02, 2015 11:33 pm
by lynliuyan
typedef struct {
......
#ifdef CONFIG_X86_32
#if defined(CONFIG_PAX_PAGEEXEC) || defined(CONFIG_PAX_SEGMEXEC)
unsigned long user_cs_base;
unsigned long user_cs_limit;

#if defined(CONFIG_PAX_PAGEEXEC) && defined(CONFIG_SMP)
cpumask_t cpu_user_cs_mask;
#endif

} mm_context_t;

user_cs_base/user_cs_limit is to limit memory usage for segmexec,but i do not understand the effection in pageexec?

Re: What role do user_cs_limit/user_cs_base in the mm_contex

PostPosted: Wed Jun 03, 2015 5:37 am
by PaX Team
lynliuyan wrote:user_cs_base/user_cs_limit is to limit memory usage for segmexec,but i do not understand the effection in pageexec?
it's used as a performance optimization for the old (TLB hacking) based PAGEEXEC method. the idea is that non-executable pages above the current CS limit can be mapped with user mode (vs. supervisor mode that would normally be required) thus eliminating the performance impact due to data accesses to non-executable pages and the subsequent page faults/DTLB reloads.