Skip to content

Commit 8b65bb5

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Pull sparc fixes from David Miller: "Several fixes here, mostly having to due with either build errors or memory corruptions depending upon whether you have THP enabled or not" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc: sparc: remove unused wp_works_ok macro sparc32: Export vac_cache_size to fix build error sparc64: Fix memory corruption when THP is enabled sparc64: Fix kernel panic due to erroneous #ifdef surrounding pmd_write() arch/sparc: Avoid DCTI Couples sparc64: kern_addr_valid regression sparc64: Add support for 2G hugepages sparc64: Fix size check in huge_pte_alloc
2 parents 542380a + 86e1066 commit 8b65bb5

20 files changed

Lines changed: 47 additions & 25 deletions

‎arch/sparc/include/asm/page_64.h‎

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

1818
#define HPAGE_SHIFT 23
1919
#define REAL_HPAGE_SHIFT 22
20+
#define HPAGE_2GB_SHIFT 31
2021
#define HPAGE_256MB_SHIFT 28
2122
#define HPAGE_64K_SHIFT 16
2223
#define REAL_HPAGE_SIZE (_AC(1,UL) << REAL_HPAGE_SHIFT)
@@ -27,7 +28,7 @@
2728
#define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT)
2829
#define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
2930
#define REAL_HPAGE_PER_HPAGE (_AC(1,UL) << (HPAGE_SHIFT - REAL_HPAGE_SHIFT))
30-
#define HUGE_MAX_HSTATE 3
31+
#define HUGE_MAX_HSTATE 4
3132
#endif
3233

3334
#ifndef __ASSEMBLY__

‎arch/sparc/include/asm/pgtable_64.h‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -679,26 +679,27 @@ static inline unsigned long pmd_pfn(pmd_t pmd)
679679
return pte_pfn(pte);
680680
}
681681

682-
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
683-
static inline unsigned long pmd_dirty(pmd_t pmd)
682+
#define __HAVE_ARCH_PMD_WRITE
683+
static inline unsigned long pmd_write(pmd_t pmd)
684684
{
685685
pte_t pte = __pte(pmd_val(pmd));
686686

687-
return pte_dirty(pte);
687+
return pte_write(pte);
688688
}
689689

690-
static inline unsigned long pmd_young(pmd_t pmd)
690+
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
691+
static inline unsigned long pmd_dirty(pmd_t pmd)
691692
{
692693
pte_t pte = __pte(pmd_val(pmd));
693694

694-
return pte_young(pte);
695+
return pte_dirty(pte);
695696
}
696697

697-
static inline unsigned long pmd_write(pmd_t pmd)
698+
static inline unsigned long pmd_young(pmd_t pmd)
698699
{
699700
pte_t pte = __pte(pmd_val(pmd));
700701

701-
return pte_write(pte);
702+
return pte_young(pte);
702703
}
703704

704705
static inline unsigned long pmd_trans_huge(pmd_t pmd)

‎arch/sparc/include/asm/processor_32.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@
1818
#include <asm/signal.h>
1919
#include <asm/page.h>
2020

21-
/*
22-
* The sparc has no problems with write protection
23-
*/
24-
#define wp_works_ok 1
25-
#define wp_works_ok__is_a_macro /* for versions in ksyms.c */
26-
2721
/* Whee, this is STACK_TOP + PAGE_SIZE and the lowest kernel address too...
2822
* That one page is used to protect kernel from intruders, so that
2923
* we can make our access_ok test faster

‎arch/sparc/include/asm/processor_64.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@
1818
#include <asm/ptrace.h>
1919
#include <asm/page.h>
2020

21-
/* The sparc has no problems with write protection */
22-
#define wp_works_ok 1
23-
#define wp_works_ok__is_a_macro /* for versions in ksyms.c */
24-
2521
/*
2622
* User lives in his very own context, and cannot reference us. Note
2723
* that TASK_SIZE is a misnomer, it really gives maximum user virtual

‎arch/sparc/kernel/head_64.S‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ sparc64_boot:
9696
andn %g1, PSTATE_AM, %g1
9797
wrpr %g1, 0x0, %pstate
9898
ba,a,pt %xcc, 1f
99+
nop
99100

100101
.globl prom_finddev_name, prom_chosen_path, prom_root_node
101102
.globl prom_getprop_name, prom_mmu_name, prom_peer_name
@@ -613,6 +614,7 @@ niagara_tlb_fixup:
613614
nop
614615

615616
ba,a,pt %xcc, 80f
617+
nop
616618
niagara4_patch:
617619
call niagara4_patch_copyops
618620
nop
@@ -622,6 +624,7 @@ niagara4_patch:
622624
nop
623625

624626
ba,a,pt %xcc, 80f
627+
nop
625628

626629
niagara2_patch:
627630
call niagara2_patch_copyops
@@ -632,6 +635,7 @@ niagara2_patch:
632635
nop
633636

634637
ba,a,pt %xcc, 80f
638+
nop
635639

636640
niagara_patch:
637641
call niagara_patch_copyops

‎arch/sparc/kernel/misctrap.S‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ do_stdfmna:
8282
call handle_stdfmna
8383
add %sp, PTREGS_OFF, %o0
8484
ba,a,pt %xcc, rtrap
85+
nop
8586
.size do_stdfmna,.-do_stdfmna
8687

8788
.type breakpoint_trap,#function

‎arch/sparc/kernel/rtrap_64.S‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ rt_continue: ldx [%sp + PTREGS_OFF + PT_V9_G1], %g1
237237
bne,pt %xcc, user_rtt_fill_32bit
238238
wrpr %g1, %cwp
239239
ba,a,pt %xcc, user_rtt_fill_64bit
240+
nop
240241

241242
user_rtt_fill_fixup_dax:
242243
ba,pt %xcc, user_rtt_fill_fixup_common

‎arch/sparc/kernel/spiterrs.S‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ __spitfire_cee_trap_continue:
8686
rd %pc, %g7
8787

8888
ba,a,pt %xcc, 2f
89+
nop
8990

9091
1: ba,pt %xcc, etrap_irq
9192
rd %pc, %g7

‎arch/sparc/kernel/sun4v_tlb_miss.S‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ sun4v_mna:
352352
call sun4v_do_mna
353353
add %sp, PTREGS_OFF, %o0
354354
ba,a,pt %xcc, rtrap
355+
nop
355356

356357
/* Privileged Action. */
357358
sun4v_privact:

‎arch/sparc/kernel/urtt_fill.S‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ user_rtt_fill_fixup_common:
9292
call sun4v_data_access_exception
9393
nop
9494
ba,a,pt %xcc, rtrap
95+
nop
9596

9697
1: call spitfire_data_access_exception
9798
nop

0 commit comments

Comments
 (0)