Skip to contentSkip to conversation

sparc64: Increase max_phys_bits to 51 and VA bits to 53 for M8.

PATCH Applied Vijay Kumar 3 participants 4 messages Jul 29, 2017 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 sparc64: Increase max_phys_bits to 51 and VA bits to 53 for M8.

On M8 chips, use a max_phys_bits value of 51.

Also, M8 supports VA bits up to 54 bits. However, for now restrict VA bits to 53 due to 4-level pagetable limitation.

---
 arch/sparc/mm/init_64.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
arch/sparc/mm/init_64.c +11 -1
index a111625..d4d96b8 100644
@@ -1921,12 +1921,22 @@ static void __init setup_page_offset(void)
 			break;
 		case SUN4V_CHIP_SPARC_M7:
 		case SUN4V_CHIP_SPARC_SN:
-		default:
 			/* M7 and later support 52-bit virtual addresses.  */
 			sparc64_va_hole_top =    0xfff8000000000000UL;
 			sparc64_va_hole_bottom = 0x0008000000000000UL;
 			max_phys_bits = 49;
 			break;
+		case SUN4V_CHIP_SPARC_M8:
+		default:
+			/* M8 and later support 54-bit virtual addresses.
+			 * However, restricting M8 and above VA bits to 53
+			 * as 4-level page table cannot support more than
+			 * 53 VA bits.
+			 */
+			sparc64_va_hole_top =    0xfff0000000000000UL;
+			sparc64_va_hole_bottom = 0x0010000000000000UL;
+			max_phys_bits = 51;
+			break;
 		}
 	}
 
Signature · 1 line
1.7.1
#1 lore raw
Quoted 4 lines · Vijay Kumar
arch/sparc/mm/init_64.c +3 -0
+               case SUN4V_CHIP_SPARC_M8:
+               default:
+                       /* M8 and later support 54-bit virtual addresses.

arch/sparc/mm/init_64.c static void __init setup_page_offset(void) · line 1941

Quoted 10 lines
arch/sparc/mm/init_64.c +8 -0
+                        * However, restricting M8 and above VA bits to 53
+                        * as 4-level page table cannot support more than
+                        * 53 VA bits.
+                        */
+                       sparc64_va_hole_top =    0xfff0000000000000UL;
+                       sparc64_va_hole_bottom = 0x0010000000000000UL;
+                       max_phys_bits = 51;
+                       break;
                }
        }

These values are supposed to be initialized from MD/OBP properties, not hard-coded based on the CPU type. Then you won't need to add more cases every time.

-greg

#2 lore raw
In reply to Vijay Kumar
Quoted 15 lines · Greg Onufer

arch/sparc/mm/init_64.c static void __init setup_page_offset(void) · line 1941

Quoted 13 lines · Vijay Kumar
arch/sparc/mm/init_64.c +11 -0
+               case SUN4V_CHIP_SPARC_M8:
+               default:
+                       /* M8 and later support 54-bit virtual addresses.
+                        * However, restricting M8 and above VA bits to 53
+                        * as 4-level page table cannot support more than
+                        * 53 VA bits.
+                        */
+                       sparc64_va_hole_top =    0xfff0000000000000UL;
+                       sparc64_va_hole_bottom = 0x0010000000000000UL;
+                       max_phys_bits = 51;
+                       break;
                 }
         }
Quoted 3 lines

These values are supposed to be initialized from MD/OBP properties, not hard-coded based on the CPU type. Then you won't need to add more cases every time.

Agree. Currently these bits are hard coded for all the CPU types. This needs to be changed in future.

Thanks,
Vijay