Skip to content

Commit

Permalink
Merge tag 'for-5.16/parisc-3' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/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
  • Loading branch information
torvalds committed Nov 14, 2021
2 parents 24318ae + 3ec18fc commit c3b68c2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
10 changes: 8 additions & 2 deletions arch/parisc/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,23 @@ static inline void purge_tlb_entries(struct mm_struct *mm, unsigned long addr)
purge_tlb_end(flags);
}

extern void __update_cache(pte_t pte);

/* Certain architectures need to do special things when PTEs
* within a page table are directly modified. Thus, the following
* hook is made available.
*/
#define set_pte(pteptr, pteval) \
do { \
*(pteptr) = (pteval); \
barrier(); \
mb(); \
} while(0)

#define set_pte_at(mm, addr, pteptr, pteval) \
do { \
if (pte_present(pteval) && \
pte_user(pteval)) \
__update_cache(pteval); \
*(pteptr) = (pteval); \
purge_tlb_entries(mm, addr); \
} while (0)
Expand Down Expand Up @@ -303,6 +308,7 @@ extern unsigned long *empty_zero_page;

#define pte_none(x) (pte_val(x) == 0)
#define pte_present(x) (pte_val(x) & _PAGE_PRESENT)
#define pte_user(x) (pte_val(x) & _PAGE_USER)
#define pte_clear(mm, addr, xp) set_pte_at(mm, addr, xp, __pte(0))

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

#define PG_dcache_dirty PG_arch_1

extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *);
#define update_mmu_cache(vms,addr,ptep) __update_cache(*ptep)

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

Expand Down
4 changes: 2 additions & 2 deletions arch/parisc/kernel/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ EXPORT_SYMBOL(flush_cache_all_local);
#define pfn_va(pfn) __va(PFN_PHYS(pfn))

void
update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
__update_cache(pte_t pte)
{
unsigned long pfn = pte_pfn(*ptep);
unsigned long pfn = pte_pfn(pte);
struct page *page;

/* We don't have pte special. As a result, we can be called with
Expand Down
2 changes: 1 addition & 1 deletion arch/parisc/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -1805,7 +1805,7 @@ syscall_restore:

/* Are we being ptraced? */
LDREG TASK_TI_FLAGS(%r1),%r19
ldi _TIF_SYSCALL_TRACE_MASK,%r2
ldi _TIF_SINGLESTEP|_TIF_BLOCKSTEP,%r2
and,COND(=) %r19,%r2,%r0
b,n syscall_restore_rfi

Expand Down
1 change: 1 addition & 0 deletions arch/parisc/kernel/stacktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
* TODO: Userspace stacktrace (CONFIG_USER_STACKTRACE_SUPPORT)
*/
#include <linux/kernel.h>
#include <linux/stacktrace.h>

#include <asm/unwind.h>
Expand Down
3 changes: 2 additions & 1 deletion arch/parisc/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ SECTIONS
{
. = KERNEL_BINARY_TEXT_START;

_stext = .; /* start of kernel text, includes init code & data */

__init_begin = .;
HEAD_TEXT_SECTION
MLONGCALL_DISCARD(INIT_TEXT_SECTION(8))
Expand All @@ -80,7 +82,6 @@ SECTIONS
/* freed after init ends here */

_text = .; /* Text and read-only data */
_stext = .;
MLONGCALL_KEEP(INIT_TEXT_SECTION(8))
.text ALIGN(PAGE_SIZE) : {
TEXT_TEXT
Expand Down

0 comments on commit c3b68c2

Please sign in to comment.