Browse Source

Merge tag 'arm64-stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64

Pull ARM64 fixes from Catalin Marinas:
 - Compat register fault reporting fix
 - Documentation clarification on tagged pointers
 - hwcap widened to 64-bit (user space already reading it as 64-bit)

* tag 'arm64-stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64:
  arm64: Widen hwcap to be 64 bit
  arm64: Correctly report LR and SP for compat tasks
  arm64: documentation: tighten up tagged pointer documentation
  arm64: Make do_bad_area() function static
Linus Torvalds 12 years ago
parent
commit
dcb30e6592

+ 7 - 7
Documentation/arm64/tagged-pointers.txt

@@ -18,17 +18,17 @@ this byte for application use, with the following caveats:
 	    parameters containing user virtual addresses *must* have
 	    parameters containing user virtual addresses *must* have
 	    their top byte cleared before trapping to the kernel.
 	    their top byte cleared before trapping to the kernel.
 
 
-	(2) Tags are not guaranteed to be preserved when delivering
-	    signals. This means that signal handlers in applications
-	    making use of tags cannot rely on the tag information for
-	    user virtual addresses being maintained for fields inside
-	    siginfo_t. One exception to this rule is for signals raised
-	    in response to debug exceptions, where the tag information
+	(2) Non-zero tags are not preserved when delivering signals.
+	    This means that signal handlers in applications making use
+	    of tags cannot rely on the tag information for user virtual
+	    addresses being maintained for fields inside siginfo_t.
+	    One exception to this rule is for signals raised in response
+	    to watchpoint debug exceptions, where the tag information
 	    will be preserved.
 	    will be preserved.
 
 
 	(3) Special care should be taken when using tagged pointers,
 	(3) Special care should be taken when using tagged pointers,
 	    since it is likely that C compilers will not hazard two
 	    since it is likely that C compilers will not hazard two
-	    addresses differing only in the upper bits.
+	    virtual addresses differing only in the upper byte.
 
 
 The architecture prevents the use of a tagged PC, so the upper byte will
 The architecture prevents the use of a tagged PC, so the upper byte will
 be set to a sign-extension of bit 55 on exception return.
 be set to a sign-extension of bit 55 on exception return.

+ 1 - 1
arch/arm64/include/asm/hwcap.h

@@ -43,6 +43,6 @@
 				 COMPAT_HWCAP_VFPv3|COMPAT_HWCAP_VFPv4|\
 				 COMPAT_HWCAP_VFPv3|COMPAT_HWCAP_VFPv4|\
 				 COMPAT_HWCAP_NEON|COMPAT_HWCAP_IDIV)
 				 COMPAT_HWCAP_NEON|COMPAT_HWCAP_IDIV)
 
 
-extern unsigned int elf_hwcap;
+extern unsigned long elf_hwcap;
 #endif
 #endif
 #endif
 #endif

+ 16 - 5
arch/arm64/kernel/process.c

@@ -143,15 +143,26 @@ void machine_restart(char *cmd)
 
 
 void __show_regs(struct pt_regs *regs)
 void __show_regs(struct pt_regs *regs)
 {
 {
-	int i;
+	int i, top_reg;
+	u64 lr, sp;
+
+	if (compat_user_mode(regs)) {
+		lr = regs->compat_lr;
+		sp = regs->compat_sp;
+		top_reg = 12;
+	} else {
+		lr = regs->regs[30];
+		sp = regs->sp;
+		top_reg = 29;
+	}
 
 
 	show_regs_print_info(KERN_DEFAULT);
 	show_regs_print_info(KERN_DEFAULT);
 	print_symbol("PC is at %s\n", instruction_pointer(regs));
 	print_symbol("PC is at %s\n", instruction_pointer(regs));
-	print_symbol("LR is at %s\n", regs->regs[30]);
+	print_symbol("LR is at %s\n", lr);
 	printk("pc : [<%016llx>] lr : [<%016llx>] pstate: %08llx\n",
 	printk("pc : [<%016llx>] lr : [<%016llx>] pstate: %08llx\n",
-	       regs->pc, regs->regs[30], regs->pstate);
-	printk("sp : %016llx\n", regs->sp);
-	for (i = 29; i >= 0; i--) {
+	       regs->pc, lr, regs->pstate);
+	printk("sp : %016llx\n", sp);
+	for (i = top_reg; i >= 0; i--) {
 		printk("x%-2d: %016llx ", i, regs->regs[i]);
 		printk("x%-2d: %016llx ", i, regs->regs[i]);
 		if (i % 2 == 0)
 		if (i % 2 == 0)
 			printk("\n");
 			printk("\n");

+ 1 - 1
arch/arm64/kernel/setup.c

@@ -57,7 +57,7 @@
 unsigned int processor_id;
 unsigned int processor_id;
 EXPORT_SYMBOL(processor_id);
 EXPORT_SYMBOL(processor_id);
 
 
-unsigned int elf_hwcap __read_mostly;
+unsigned long elf_hwcap __read_mostly;
 EXPORT_SYMBOL_GPL(elf_hwcap);
 EXPORT_SYMBOL_GPL(elf_hwcap);
 
 
 static const char *cpu_name;
 static const char *cpu_name;

+ 1 - 1
arch/arm64/mm/fault.c

@@ -130,7 +130,7 @@ static void __do_user_fault(struct task_struct *tsk, unsigned long addr,
 	force_sig_info(sig, &si, tsk);
 	force_sig_info(sig, &si, tsk);
 }
 }
 
 
-void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *regs)
+static void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *regs)
 {
 {
 	struct task_struct *tsk = current;
 	struct task_struct *tsk = current;
 	struct mm_struct *mm = tsk->active_mm;
 	struct mm_struct *mm = tsk->active_mm;