Skip to content

Commit a78d7dc

Browse files
committed
Merge tag 'powerpc-6.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: - Fix a deadlock in the powerpc qspinlock MCS queue logic - Fix the return type of pgd_val() to not truncate 64-bit PTEs on 85xx - Allow the check for dynamic relocations in the VDSO to work correctly - Make mmu_pte_psize static to fix a build error Thanks to Christophe Leroy, Nysal Jan K.A., Nicholas Piggin, Geetika Moolchandani, Jijo Varghese, and Vaishnavi Bhat. * tag 'powerpc-6.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/qspinlock: Fix deadlock in MCS queue powerpc/mm: Fix return type of pgd_val() powerpc/vdso: Don't discard rela sections powerpc/64e: Define mmu_pte_psize static
2 parents d45111e + 734ad0a commit a78d7dc

File tree

6 files changed

+26
-10
lines changed

6 files changed

+26
-10
lines changed

arch/powerpc/include/asm/nohash/32/pgtable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
5353

5454
#define pgd_ERROR(e) \
55-
pr_err("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
55+
pr_err("%s:%d: bad pgd %08llx.\n", __FILE__, __LINE__, (unsigned long long)pgd_val(e))
5656

5757
/*
5858
* This is the bottom of the PKMAP area with HIGHMEM or an arbitrary
@@ -170,7 +170,7 @@ static inline void pmd_clear(pmd_t *pmdp)
170170
#define pmd_pfn(pmd) (pmd_val(pmd) >> PAGE_SHIFT)
171171
#else
172172
#define pmd_page_vaddr(pmd) \
173-
((const void *)(pmd_val(pmd) & ~(PTE_TABLE_SIZE - 1)))
173+
((const void *)((unsigned long)pmd_val(pmd) & ~(PTE_TABLE_SIZE - 1)))
174174
#define pmd_pfn(pmd) (__pa(pmd_val(pmd)) >> PAGE_SHIFT)
175175
#endif
176176

arch/powerpc/include/asm/pgtable-types.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,22 @@ static inline unsigned long pud_val(pud_t x)
4949
#endif /* CONFIG_PPC64 */
5050

5151
/* PGD level */
52-
#if defined(CONFIG_PPC_E500) && defined(CONFIG_PTE_64BIT)
52+
#if defined(CONFIG_PPC_85xx) && defined(CONFIG_PTE_64BIT)
5353
typedef struct { unsigned long long pgd; } pgd_t;
54+
55+
static inline unsigned long long pgd_val(pgd_t x)
56+
{
57+
return x.pgd;
58+
}
5459
#else
5560
typedef struct { unsigned long pgd; } pgd_t;
56-
#endif
57-
#define __pgd(x) ((pgd_t) { (x) })
61+
5862
static inline unsigned long pgd_val(pgd_t x)
5963
{
6064
return x.pgd;
6165
}
66+
#endif
67+
#define __pgd(x) ((pgd_t) { (x) })
6268

6369
/* Page protection bits */
6470
typedef struct { unsigned long pgprot; } pgprot_t;

arch/powerpc/kernel/vdso/vdso32.lds.S

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ SECTIONS
7474
.got : { *(.got) } :text
7575
.plt : { *(.plt) }
7676

77+
.rela.dyn : { *(.rela .rela*) }
78+
7779
_end = .;
7880
__end = .;
7981
PROVIDE(end = .);
@@ -87,7 +89,7 @@ SECTIONS
8789
*(.branch_lt)
8890
*(.data .data.* .gnu.linkonce.d.* .sdata*)
8991
*(.bss .sbss .dynbss .dynsbss)
90-
*(.got1 .glink .iplt .rela*)
92+
*(.got1 .glink .iplt)
9193
}
9294
}
9395

arch/powerpc/kernel/vdso/vdso64.lds.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ SECTIONS
6969
.eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
7070
.eh_frame : { KEEP (*(.eh_frame)) } :text
7171
.gcc_except_table : { *(.gcc_except_table) }
72-
.rela.dyn ALIGN(8) : { *(.rela.dyn) }
72+
.rela.dyn ALIGN(8) : { *(.rela .rela*) }
7373

7474
.got ALIGN(8) : { *(.got .toc) }
7575

@@ -86,7 +86,7 @@ SECTIONS
8686
*(.data .data.* .gnu.linkonce.d.* .sdata*)
8787
*(.bss .sbss .dynbss .dynsbss)
8888
*(.opd)
89-
*(.glink .iplt .plt .rela*)
89+
*(.glink .iplt .plt)
9090
}
9191
}
9292

arch/powerpc/lib/qspinlock.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,15 @@ static __always_inline void queued_spin_lock_mcs_queue(struct qspinlock *lock, b
697697
}
698698

699699
release:
700-
qnodesp->count--; /* release the node */
700+
/*
701+
* Clear the lock before releasing the node, as another CPU might see stale
702+
* values if an interrupt occurs after we increment qnodesp->count
703+
* but before node->lock is initialized. The barrier ensures that
704+
* there are no further stores to the node after it has been released.
705+
*/
706+
node->lock = NULL;
707+
barrier();
708+
qnodesp->count--;
701709
}
702710

703711
void queued_spin_lock_slowpath(struct qspinlock *lock)

arch/powerpc/mm/nohash/tlb_64e.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* though this will probably be made common with other nohash
3434
* implementations at some point
3535
*/
36-
int mmu_pte_psize; /* Page size used for PTE pages */
36+
static int mmu_pte_psize; /* Page size used for PTE pages */
3737
int mmu_vmemmap_psize; /* Page size used for the virtual mem map */
3838
int book3e_htw_mode; /* HW tablewalk? Value is PPC_HTW_* */
3939
unsigned long linear_map_top; /* Top of linear mapping */

0 commit comments

Comments
 (0)