diff mbox

sparc64 WARNING: at mm/mmap.c:2757 exit_mmap+0x13c/0x160()

Message ID 20140730.150722.861254999466992321.davem@davemloft.net
State RFC
Delegated to: David Miller
Headers show

Commit Message

David Miller July 30, 2014, 10:07 p.m. UTC
From: Meelis Roos <mroos@linux.ee>
Date: Thu, 31 Jul 2014 01:02:53 +0300 (EEST)

>> Here is something I'd like you guys to test.
> 
> Very interesting.
> 
> [...]
>> Could you guys please try this patch below?  Thanks.
> 
>   CC      arch/sparc/mm/init_64.o
> arch/sparc/mm/init_64.c: In function 'update_mmu_cache_pmd':
> arch/sparc/mm/init_64.c:2625:6: error: 'pte' may be used uninitialized in this function [-Werror=uninitialized]
> 
> gcc 4.6.4.

I'm very disappointed that gcc-4.6.3 didn't say anything to me about
this :-)

Here is a fixed patch, thanks.

--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Meelis Roos Aug. 13, 2014, 11:44 a.m. UTC | #1
I tested the merged sparc64 fixes in current git.

V100: with hugetlb, looping git clone still hangs the machine. RED 
state on reboot has changed - before it gave the trace on reboot and 
continued, now it contonues looping with the trace indefinitely, gcc 
4.6.4

Netra X1: works fine with HugeTLB (but no hugetlbfs) and looping git 
clone, gcc 4.6.4.

V440: fails to boot with 3.16 and gcc 4.9.1 (same message as before, in 
fault_in_user_windows+0xe0/0x100). Tried latest git with gcc 4.9.1 but 
it stops after before getting to the previous failure point:
[   77.871887] console [tty0] enabled
[   77.912630] bootconsole [earlyprom0] disabled

T2000: works fine with gcc 4.9.1 and hugetlb, 3.16. Hangs at boot at the 
same point.

U2: looping git clone fails with 3.16, no hugetlb(!!!), gcc 4.6.4;

E420R: works fine with gcc 4.6.4. 3.16, hugetlb, looping git clone; 
fails to boot with current git

E220R: works with gcc 4.6.4, no hugetlb, 3.16. Hangs on boot with 
current git + hugetlb.

Did not test current git more. Will test the patches on top of 3.16 
separately to see if/which one of these is the culprit.
diff mbox

Patch

diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index 16b58ff..db5ddde 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -351,6 +351,10 @@  void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *
 
 	mm = vma->vm_mm;
 
+	/* Don't insert a non-valid PTE into the TSB, we'll deadlock.  */
+	if (!pte_accessible(mm, pte))
+		return;
+
 	spin_lock_irqsave(&mm->context.lock, flags);
 
 #if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE)
@@ -2619,6 +2623,10 @@  void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr,
 
 	pte = pmd_val(entry);
 
+	/* Don't insert a non-valid PMD into the TSB, we'll deadlock.  */
+	if (!(pte & _PAGE_VALID))
+		return;
+
 	/* We are fabricating 8MB pages using 4MB real hw pages.  */
 	pte |= (addr & (1UL << REAL_HPAGE_SHIFT));