Skip to contentSkip to conversation

sparc64: Fix deficiencies in sun4v error reporting.

PATCH New David Miller 1 participant 1 message Oct 11, 2012 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 1/1 sparc64: Fix deficiencies in sun4v error reporting.

Missing error types, attributes, and report fields. Pad out to 64-bytes.

Make string reporting cleaner and easier to extend in the future using "const char *" arrays that index by either bit position, or absolute field value.

Report the raw 64-byte error report as a sequence of u64s before the annotated version.

Only report fields which are valid, given the context and the attribute bits which are set.

For shutdown requests, use the local copy of the error report not the one we just freed up back to the queue. Also, use orderly_poweroff() just like the Domain Services shutdown request code does.

If the real-address reported is "-1" (unknown) try to disassemble the instruction to report the effective address of the access. Only do this in privileged mode.

---
 arch/sparc/include/asm/uaccess_64.h |   5 +
 arch/sparc/kernel/traps_64.c        | 263 +++++++++++++++++++++++++++---------
 arch/sparc/mm/fault_64.c            |   2 -
 3 files changed, 207 insertions(+), 63 deletions(-)
arch/sparc/include/asm/uaccess_64.h +5 -0
index 7c831d8..73083e1 100644
@@ -265,6 +265,11 @@ extern __must_check long strnlen_user(const char __user *str, long n);
 #define __copy_to_user_inatomic ___copy_to_user
 #define __copy_from_user_inatomic ___copy_from_user
 
+struct pt_regs;
+extern unsigned long compute_effective_address(struct pt_regs *,
+					       unsigned int insn,
+					       unsigned int rd);
+
 #endif  /* __ASSEMBLY__ */
 
 #endif /* _ASM_UACCESS_H */
arch/sparc/kernel/traps_64.c +202 -61

312 lines not on this page · raw message

arch/sparc/mm/fault_64.c +0 -2
index 2976dba..097aee7 100644
@@ -151,8 +151,6 @@ show_signal_msg(struct pt_regs *regs, int sig, int code,
 	printk(KERN_CONT "\n");
 }
 
-extern unsigned long compute_effective_address(struct pt_regs *, unsigned int, unsigned int);
-
 static void do_fault_siginfo(int code, int sig, struct pt_regs *regs,
 			     unsigned int insn, int fault_code)
 {
Signature · 1 line
1.7.12.2.dirty