[PATCH] sparc64: fix boot on UltraSparcIII+

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

I have Sun Blade 2000 with two UltraSparcIII+ processors and 8GB RAM. The 
kernel doesn't work on it (the last working version is 3.17).

If I put printk's at these two positions in kernel_physical_mapping_init():
	printk("kernel_physical_mapping_init: %lx\n", (long)mem_section[0]);
        kvmap_linear_patch[0] = 0x01000000; /* nop */
        flushi(&kvmap_linear_patch[0]);
        flush_all_kernel_tsbs();
        __flush_tlb_all();
	printk("kernel_physical_mapping_init: %lx\n", (long)mem_section[0]);
I get different values (the second value is 0) which indicates that the
linear bootmem mapping is not equivalent to the kernel page table mapping.
This mismatch causes crash on boot.

When I compiled the kernel with CONFIG_DEBUG_PAGEALLOC, the kernel boots
fine. CONFIG_DEBUG_PAGEALLOC disables 4M mapping, so the problem is with
it.

I have created this patch that disables large pages on UltraSparcIII and
UltraSparcIII+. It makes the kernel boot.

Do you have an idea why large pages don't work on UltraSparcIII? (they
work on UltraSparcII fine) Do you have some idea what I should test to
make them work?

Signed-off-by: Mikulas Patocka <mpatocka@xxxxxxxxxx>

---
 arch/sparc/kernel/ktlb.S |   11 +++++++++++
 arch/sparc/mm/init_64.c  |    7 +++++++
 2 files changed, 18 insertions(+)

Index: linux-stable/arch/sparc/mm/init_64.c
===================================================================
--- linux-stable.orig/arch/sparc/mm/init_64.c	2021-08-07 16:28:26.000000000 +0200
+++ linux-stable/arch/sparc/mm/init_64.c	2021-08-07 16:40:21.000000000 +0200
@@ -1882,6 +1882,10 @@ static void __init kernel_physical_mappi
 #ifdef CONFIG_DEBUG_PAGEALLOC
 	use_huge = false;
 #endif
+
+	if (tlb_type == cheetah || tlb_type == cheetah_plus)
+		use_huge = false;
+
 	for (i = 0; i < pall_ents; i++) {
 		unsigned long phys_start, phys_end;
 
@@ -2691,6 +2695,9 @@ static void __init sun4u_pgprot_init(voi
 	kern_linear_pte_xor[0] |= (_PAGE_CP_4U | _PAGE_CV_4U |
 				   _PAGE_P_4U | _PAGE_W_4U);
 
+	if (tlb_type == cheetah || tlb_type == cheetah_plus)
+		kern_linear_pte_xor[0] &= ~_PAGE_SZ4MB_4U;
+
 	for (i = 1; i < 4; i++)
 		kern_linear_pte_xor[i] = kern_linear_pte_xor[0];
 
Index: linux-stable/arch/sparc/kernel/ktlb.S
===================================================================
--- linux-stable.orig/arch/sparc/kernel/ktlb.S	2021-08-07 16:28:26.000000000 +0200
+++ linux-stable/arch/sparc/kernel/ktlb.S	2021-08-07 17:03:45.000000000 +0200
@@ -150,7 +150,18 @@ kvmap_dtlb_4v:
 	 */
 	KERN_TSB_LOOKUP_TL1(%g4, %g6, %g5, %g1, %g2, %g3, kvmap_dtlb_load)
 #else
+	sethi		%hi(tlb_type), %g1
+	lduw		[%g1 + %lo(tlb_type)], %g1
+	sub		%g1, 1, %g1
+	cmp		%g1, 1
+	bgu,pt		%xcc, use_4m_tsb
+	 nop
+
+	KERN_TSB_LOOKUP_TL1(%g4, %g6, %g5, %g1, %g2, %g3, kvmap_dtlb_load)
+	ba,pt		%xcc, kvmap_linear_patch
+	 nop
 	/* Correct TAG_TARGET is already in %g6, check 4mb TSB.  */
+use_4m_tsb:
 	KERN_TSB4M_LOOKUP_TL1(%g6, %g5, %g1, %g2, %g3, kvmap_dtlb_load)
 #endif
 	/* Linear mapping TSB lookup failed.  Fallthrough to kernel




[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux