Skip to content

Commit c3b68c2

Browse files
committed
Merge tag 'for-5.16/parisc-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull more parisc fixes from Helge Deller: "Fix a build error in stracktrace.c, fix resolving of addresses to function names in backtraces, fix single-stepping in assembly code and flush userspace pte's when using set_pte_at()" * tag 'for-5.16/parisc-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc/entry: fix trace test in syscall exit path parisc: Flush kernel data mapping in set_pte_at() when installing pte for user page parisc: Fix implicit declaration of function '__kernel_text_address' parisc: Fix backtrace to always include init funtion names
2 parents 24318ae + 3ec18fc commit c3b68c2

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

arch/parisc/include/asm/pgtable.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,23 @@ static inline void purge_tlb_entries(struct mm_struct *mm, unsigned long addr)
7676
purge_tlb_end(flags);
7777
}
7878

79+
extern void __update_cache(pte_t pte);
80+
7981
/* Certain architectures need to do special things when PTEs
8082
* within a page table are directly modified. Thus, the following
8183
* hook is made available.
8284
*/
8385
#define set_pte(pteptr, pteval) \
8486
do { \
8587
*(pteptr) = (pteval); \
86-
barrier(); \
88+
mb(); \
8789
} while(0)
8890

8991
#define set_pte_at(mm, addr, pteptr, pteval) \
9092
do { \
93+
if (pte_present(pteval) && \
94+
pte_user(pteval)) \
95+
__update_cache(pteval); \
9196
*(pteptr) = (pteval); \
9297
purge_tlb_entries(mm, addr); \
9398
} while (0)
@@ -303,6 +308,7 @@ extern unsigned long *empty_zero_page;
303308

304309
#define pte_none(x) (pte_val(x) == 0)
305310
#define pte_present(x) (pte_val(x) & _PAGE_PRESENT)
311+
#define pte_user(x) (pte_val(x) & _PAGE_USER)
306312
#define pte_clear(mm, addr, xp) set_pte_at(mm, addr, xp, __pte(0))
307313

308314
#define pmd_flag(x) (pmd_val(x) & PxD_FLAG_MASK)
@@ -410,7 +416,7 @@ extern void paging_init (void);
410416

411417
#define PG_dcache_dirty PG_arch_1
412418

413-
extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *);
419+
#define update_mmu_cache(vms,addr,ptep) __update_cache(*ptep)
414420

415421
/* Encode and de-code a swap entry */
416422

arch/parisc/kernel/cache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ EXPORT_SYMBOL(flush_cache_all_local);
8383
#define pfn_va(pfn) __va(PFN_PHYS(pfn))
8484

8585
void
86-
update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
86+
__update_cache(pte_t pte)
8787
{
88-
unsigned long pfn = pte_pfn(*ptep);
88+
unsigned long pfn = pte_pfn(pte);
8989
struct page *page;
9090

9191
/* We don't have pte special. As a result, we can be called with

arch/parisc/kernel/entry.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1805,7 +1805,7 @@ syscall_restore:
18051805

18061806
/* Are we being ptraced? */
18071807
LDREG TASK_TI_FLAGS(%r1),%r19
1808-
ldi _TIF_SYSCALL_TRACE_MASK,%r2
1808+
ldi _TIF_SINGLESTEP|_TIF_BLOCKSTEP,%r2
18091809
and,COND(=) %r19,%r2,%r0
18101810
b,n syscall_restore_rfi
18111811

arch/parisc/kernel/stacktrace.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*
99
* TODO: Userspace stacktrace (CONFIG_USER_STACKTRACE_SUPPORT)
1010
*/
11+
#include <linux/kernel.h>
1112
#include <linux/stacktrace.h>
1213

1314
#include <asm/unwind.h>

arch/parisc/kernel/vmlinux.lds.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ SECTIONS
5757
{
5858
. = KERNEL_BINARY_TEXT_START;
5959

60+
_stext = .; /* start of kernel text, includes init code & data */
61+
6062
__init_begin = .;
6163
HEAD_TEXT_SECTION
6264
MLONGCALL_DISCARD(INIT_TEXT_SECTION(8))
@@ -80,7 +82,6 @@ SECTIONS
8082
/* freed after init ends here */
8183

8284
_text = .; /* Text and read-only data */
83-
_stext = .;
8485
MLONGCALL_KEEP(INIT_TEXT_SECTION(8))
8586
.text ALIGN(PAGE_SIZE) : {
8687
TEXT_TEXT

0 commit comments

Comments
 (0)