Skip to content

Commit f8e6859

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Pull sparc updates from David Miller: 1) Support multiple huge page sizes, from Nitin Gupta. 2) Improve boot time on large memory configurations, from Pavel Tatashin. 3) Make BRK handling more consistent and documented, from Vijay Kumar. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc: sparc64: Fix build error in flush_tsb_user_page sparc64: memblock resizes are not handled properly sparc64: use latency groups to improve add_node_ranges speed sparc64: Add 64K page size support sparc64: Multi-page size support Documentation/sparc: Steps for sending break on sunhv console sparc64: Send break twice from console to return to boot prom sparc64: Migrate hvcons irq to panicked cpu sparc64: Set cpu state to offline when stopped sunvdc: Add support for setting physical sector size sparc64: fix for user probes in high memory sparc: topology_64.h: Fix condition for including cpudata.h sparc32: mm: srmmu: add __ro_after_init to sparc32_cachetlb_ops structures
2 parents a682e00 + ac65e28 commit f8e6859

File tree

17 files changed

+488
-174
lines changed

17 files changed

+488
-174
lines changed

Documentation/sparc/console.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Steps for sending 'break' on sunhv console:
2+
===========================================
3+
4+
On Baremetal:
5+
1. press Esc + 'B'
6+
7+
On LDOM:
8+
1. press Ctrl + ']'
9+
2. telnet> send break

arch/sparc/include/asm/page_64.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
#define HPAGE_SHIFT 23
1919
#define REAL_HPAGE_SHIFT 22
20-
20+
#define HPAGE_256MB_SHIFT 28
21+
#define HPAGE_64K_SHIFT 16
2122
#define REAL_HPAGE_SIZE (_AC(1,UL) << REAL_HPAGE_SHIFT)
2223

2324
#if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE)
@@ -26,6 +27,7 @@
2627
#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
2728
#define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
2829
#define REAL_HPAGE_PER_HPAGE (_AC(1,UL) << (HPAGE_SHIFT - REAL_HPAGE_SHIFT))
30+
#define HUGE_MAX_HSTATE 3
2931
#endif
3032

3133
#ifndef __ASSEMBLY__

arch/sparc/include/asm/pgtable_64.h

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,10 @@ static inline pgprot_t pgprot_noncached(pgprot_t prot)
375375
#define pgprot_noncached pgprot_noncached
376376

377377
#if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE)
378-
static inline unsigned long __pte_huge_mask(void)
378+
extern pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma,
379+
struct page *page, int writable);
380+
#define arch_make_huge_pte arch_make_huge_pte
381+
static inline unsigned long __pte_default_huge_mask(void)
379382
{
380383
unsigned long mask;
381384

@@ -395,12 +398,14 @@ static inline unsigned long __pte_huge_mask(void)
395398

396399
static inline pte_t pte_mkhuge(pte_t pte)
397400
{
398-
return __pte(pte_val(pte) | _PAGE_PMD_HUGE | __pte_huge_mask());
401+
return __pte(pte_val(pte) | __pte_default_huge_mask());
399402
}
400403

401-
static inline bool is_hugetlb_pte(pte_t pte)
404+
static inline bool is_default_hugetlb_pte(pte_t pte)
402405
{
403-
return !!(pte_val(pte) & __pte_huge_mask());
406+
unsigned long mask = __pte_default_huge_mask();
407+
408+
return (pte_val(pte) & mask) == mask;
404409
}
405410

406411
static inline bool is_hugetlb_pmd(pmd_t pmd)
@@ -875,10 +880,12 @@ static inline unsigned long pud_pfn(pud_t pud)
875880

876881
/* Actual page table PTE updates. */
877882
void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr,
878-
pte_t *ptep, pte_t orig, int fullmm);
883+
pte_t *ptep, pte_t orig, int fullmm,
884+
unsigned int hugepage_shift);
879885

880886
static void maybe_tlb_batch_add(struct mm_struct *mm, unsigned long vaddr,
881-
pte_t *ptep, pte_t orig, int fullmm)
887+
pte_t *ptep, pte_t orig, int fullmm,
888+
unsigned int hugepage_shift)
882889
{
883890
/* It is more efficient to let flush_tlb_kernel_range()
884891
* handle init_mm tlb flushes.
@@ -887,7 +894,7 @@ static void maybe_tlb_batch_add(struct mm_struct *mm, unsigned long vaddr,
887894
* and SUN4V pte layout, so this inline test is fine.
888895
*/
889896
if (likely(mm != &init_mm) && pte_accessible(mm, orig))
890-
tlb_batch_add(mm, vaddr, ptep, orig, fullmm);
897+
tlb_batch_add(mm, vaddr, ptep, orig, fullmm, hugepage_shift);
891898
}
892899

893900
#define __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR
@@ -906,7 +913,7 @@ static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,
906913
pte_t orig = *ptep;
907914

908915
*ptep = pte;
909-
maybe_tlb_batch_add(mm, addr, ptep, orig, fullmm);
916+
maybe_tlb_batch_add(mm, addr, ptep, orig, fullmm, PAGE_SHIFT);
910917
}
911918

912919
#define set_pte_at(mm,addr,ptep,pte) \

arch/sparc/include/asm/setup.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,11 @@ extern atomic_t dcpage_flushes;
5959
extern atomic_t dcpage_flushes_xcall;
6060

6161
extern int sysctl_tsb_ratio;
62-
#endif
6362

63+
#ifdef CONFIG_SERIAL_SUNHV
64+
void sunhv_migrate_hvcons_irq(int cpu);
65+
#endif
66+
#endif
6467
void sun_do_break(void);
6568
extern int stop_a_enabled;
6669
extern int scons_pwroff;

arch/sparc/include/asm/tlbflush_64.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#define TLB_BATCH_NR 192
99

1010
struct tlb_batch {
11-
bool huge;
11+
unsigned int hugepage_shift;
1212
struct mm_struct *mm;
1313
unsigned long tlb_nr;
1414
unsigned long active;
@@ -17,7 +17,8 @@ struct tlb_batch {
1717

1818
void flush_tsb_kernel_range(unsigned long start, unsigned long end);
1919
void flush_tsb_user(struct tlb_batch *tb);
20-
void flush_tsb_user_page(struct mm_struct *mm, unsigned long vaddr, bool huge);
20+
void flush_tsb_user_page(struct mm_struct *mm, unsigned long vaddr,
21+
unsigned int hugepage_shift);
2122

2223
/* TLB flush operations. */
2324

arch/sparc/include/asm/topology_64.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#ifdef CONFIG_NUMA
55

66
#include <asm/mmzone.h>
7-
#include <asm/cpudata.h>
87

98
static inline int cpu_to_node(int cpu)
109
{
@@ -42,6 +41,9 @@ int __node_distance(int, int);
4241
#endif /* !(CONFIG_NUMA) */
4342

4443
#ifdef CONFIG_SMP
44+
45+
#include <asm/cpudata.h>
46+
4547
#define topology_physical_package_id(cpu) (cpu_data(cpu).proc_id)
4648
#define topology_core_id(cpu) (cpu_data(cpu).core_id)
4749
#define topology_core_cpumask(cpu) (&cpu_core_sib_map[cpu])

arch/sparc/include/asm/uprobes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ struct arch_uprobe {
4242
};
4343

4444
struct arch_uprobe_task {
45-
u32 saved_tpc;
46-
u32 saved_tnpc;
45+
u64 saved_tpc;
46+
u64 saved_tnpc;
4747
};
4848

4949
struct task_struct;

arch/sparc/kernel/smp_64.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,7 @@ void __irq_entry smp_receive_signal_client(int irq, struct pt_regs *regs)
14431443

14441444
static void stop_this_cpu(void *dummy)
14451445
{
1446+
set_cpu_online(smp_processor_id(), false);
14461447
prom_stopself();
14471448
}
14481449

@@ -1451,9 +1452,15 @@ void smp_send_stop(void)
14511452
int cpu;
14521453

14531454
if (tlb_type == hypervisor) {
1455+
int this_cpu = smp_processor_id();
1456+
#ifdef CONFIG_SERIAL_SUNHV
1457+
sunhv_migrate_hvcons_irq(this_cpu);
1458+
#endif
14541459
for_each_online_cpu(cpu) {
1455-
if (cpu == smp_processor_id())
1460+
if (cpu == this_cpu)
14561461
continue;
1462+
1463+
set_cpu_online(cpu, false);
14571464
#ifdef CONFIG_SUN_LDOMS
14581465
if (ldom_domaining_enabled) {
14591466
unsigned long hv_err;

arch/sparc/kernel/tsb.S

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -117,26 +117,11 @@ tsb_miss_page_table_walk_sun4v_fastpath:
117117
/* Valid PTE is now in %g5. */
118118

119119
#if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE)
120-
661: sethi %uhi(_PAGE_SZALL_4U), %g7
120+
sethi %uhi(_PAGE_PMD_HUGE), %g7
121121
sllx %g7, 32, %g7
122-
.section .sun4v_2insn_patch, "ax"
123-
.word 661b
124-
mov _PAGE_SZALL_4V, %g7
125-
nop
126-
.previous
127-
128-
and %g5, %g7, %g2
129-
130-
661: sethi %uhi(_PAGE_SZHUGE_4U), %g7
131-
sllx %g7, 32, %g7
132-
.section .sun4v_2insn_patch, "ax"
133-
.word 661b
134-
mov _PAGE_SZHUGE_4V, %g7
135-
nop
136-
.previous
137122

138-
cmp %g2, %g7
139-
bne,pt %xcc, 60f
123+
andcc %g5, %g7, %g0
124+
be,pt %xcc, 60f
140125
nop
141126

142127
/* It is a huge page, use huge page TSB entry address we

0 commit comments

Comments
 (0)