Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
[cascardo/linux.git] / arch / arm / kernel / process.c
index 4a803c5..91d2d5b 100644 (file)
@@ -96,19 +96,23 @@ void __show_regs(struct pt_regs *regs)
        unsigned long flags;
        char buf[64];
 #ifndef CONFIG_CPU_V7M
-       unsigned int domain;
+       unsigned int domain, fs;
 #ifdef CONFIG_CPU_SW_DOMAIN_PAN
        /*
         * Get the domain register for the parent context. In user
         * mode, we don't save the DACR, so lets use what it should
         * be. For other modes, we place it after the pt_regs struct.
         */
-       if (user_mode(regs))
+       if (user_mode(regs)) {
                domain = DACR_UACCESS_ENABLE;
-       else
-               domain = *(unsigned int *)(regs + 1);
+               fs = get_fs();
+       } else {
+               domain = to_svc_pt_regs(regs)->dacr;
+               fs = to_svc_pt_regs(regs)->addr_limit;
+       }
 #else
        domain = get_domain();
+       fs = get_fs();
 #endif
 #endif
 
@@ -144,7 +148,7 @@ void __show_regs(struct pt_regs *regs)
                if ((domain & domain_mask(DOMAIN_USER)) ==
                    domain_val(DOMAIN_USER, DOMAIN_NOACCESS))
                        segment = "none";
-               else if (get_fs() == get_ds())
+               else if (fs == get_ds())
                        segment = "kernel";
                else
                        segment = "user";
@@ -314,8 +318,7 @@ unsigned long get_wchan(struct task_struct *p)
 
 unsigned long arch_randomize_brk(struct mm_struct *mm)
 {
-       unsigned long range_end = mm->brk + 0x02000000;
-       return randomize_range(mm->brk, range_end, 0) ? : mm->brk;
+       return randomize_page(mm->brk, 0x02000000);
 }
 
 #ifdef CONFIG_MMU