ARM Linux权限内存控制的实现
early_trap_init->modify_domain(DOMAIN_USER, DOMAIN_CLIENT);
设置USER MODE的domain权限为client(01)
根据创建的page maps表设置0xc0000000开始的地址SVC模式读写,USR模式不能读写
gdb dump memory的命令如下:(struct thread_info *)0xc033a000 = (struct task_struct *)->stack
(gdb) x/32wx 0xc033a000
0xc033a000 <init_thread_union>: 0x00000000 0x00000000 0x00000000 0xc033e0c8 (struct task_struct *)
0xc033a010 <init_thread_union+16>: 0xc0341cec 0x00000000 0x00000017(CPU domain) 0x00000000
0xc033a020 <init_thread_union+32>: 0x00000000 0x00000000 0x00000000 0x00000000
0xc033a030 <init_thread_union+48>: 0x00000000 0x00000000 0x00000000 0x00000000
0xc033a040 <init_thread_union+64>: 0x00000000 0x00000000 0x00000000 0x00000000
0xc033a050 <init_thread_union+80>: 0x00000000 0x00000000 0x00000000 0x00000000
0xc033a060 <init_thread_union+96>: 0x00000000 0x00000000 0x00000000 0x00000000
#define DOMAIN_KERNEL 0 DOMAIN_MANAGER
#define DOMAIN_TABLE 0
#define DOMAIN_USER 1 DOMAIN_CLIENT
#define DOMAIN_IO 2 DOMAIN_CLIENT
注:x/32wx为显示32个单位,单位为w(word),以十六进制显示