Skip to contentSkip to conversation

Spurious unaligned access messages during bootup

DISCUSSION David Miller 1 participant 1 message Feb 12, 2010 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

From: Meelis Roos <[email protected]>
Date: Thu, 21 Jan 2010 15:26:42 +0200 (EET)

Quoted 9 lines

Got these from current 2.6.33-rc4+git:

[  125.765427] Kernel unaligned access at TPC[43e3a4] __save_stack_trace+0x84/0x220
[  125.765627] Kernel unaligned access at TPC[43e3b8] __save_stack_trace+0x98/0x220
[  125.765802] Kernel unaligned access at TPC[43e3bc] __save_stack_trace+0x9c/0x220

This was during the bootup. Never seen these specific messages before (last kernel was 2.6.32). The second bootup with current kernel did not yield these messages either.

Thanks for the report.

I wonder if we're walking randomly past the top of the firmware's stack during these backtraces.

In any event, I'll add the following sanity check to the tree, thanks for your report.

sparc64: Tighten checks in kstack_valid().

The kernel stack pointer is invalid if it is not 16-byte aligned.

Based upon a report by Meelis Roos <[email protected]>

arch/sparc/kernel/kstack.h +4 -0
index 4248d96..5247283 100644
@@ -11,6 +11,10 @@ static inline bool kstack_valid(struct thread_info *tp, unsigned long sp)
 {
 	unsigned long base = (unsigned long) tp;
 
+	/* Stack pointer must be 16-byte aligned.  */
+	if (sp & (16UL - 1))
+		return false;
+
 	if (sp >= (base + sizeof(struct thread_info)) &&
 	    sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf)))
 		return true;