Skip to content

Commit 4ffd96c

Browse files
committed
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Will Deacon: "A mixture of compiler/static checker resolutions and a couple of MTE fixes: - Avoid erroneously marking untagged pages with PG_mte_tagged - Always reset KASAN tags for destination page in copy_page() - Mark PMU header functions 'static inline' - Fix some sparse warnings due to missing casts" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: mte: Do not set PG_mte_tagged if tags were not initialized arm64: Also reset KASAN tag if page is not PG_mte_tagged arm64: perf: Mark all accessor functions inline ARM: perf: Mark all accessor functions inline arm64: vdso: Pass (void *) to virt_to_page() arm64/mm: mark private VM_FAULT_X defines as vm_fault_t
2 parents 46be92e + c4c597f commit 4ffd96c

File tree

6 files changed

+14
-16
lines changed

6 files changed

+14
-16
lines changed

arch/arm/include/asm/arm_pmuv3.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,22 +92,22 @@
9292

9393
#define RETURN_READ_PMEVCNTRN(n) \
9494
return read_sysreg(PMEVCNTR##n)
95-
static unsigned long read_pmevcntrn(int n)
95+
static inline unsigned long read_pmevcntrn(int n)
9696
{
9797
PMEVN_SWITCH(n, RETURN_READ_PMEVCNTRN);
9898
return 0;
9999
}
100100

101101
#define WRITE_PMEVCNTRN(n) \
102102
write_sysreg(val, PMEVCNTR##n)
103-
static void write_pmevcntrn(int n, unsigned long val)
103+
static inline void write_pmevcntrn(int n, unsigned long val)
104104
{
105105
PMEVN_SWITCH(n, WRITE_PMEVCNTRN);
106106
}
107107

108108
#define WRITE_PMEVTYPERN(n) \
109109
write_sysreg(val, PMEVTYPER##n)
110-
static void write_pmevtypern(int n, unsigned long val)
110+
static inline void write_pmevtypern(int n, unsigned long val)
111111
{
112112
PMEVN_SWITCH(n, WRITE_PMEVTYPERN);
113113
}

arch/arm64/include/asm/arm_pmuv3.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@
1313

1414
#define RETURN_READ_PMEVCNTRN(n) \
1515
return read_sysreg(pmevcntr##n##_el0)
16-
static unsigned long read_pmevcntrn(int n)
16+
static inline unsigned long read_pmevcntrn(int n)
1717
{
1818
PMEVN_SWITCH(n, RETURN_READ_PMEVCNTRN);
1919
return 0;
2020
}
2121

2222
#define WRITE_PMEVCNTRN(n) \
2323
write_sysreg(val, pmevcntr##n##_el0)
24-
static void write_pmevcntrn(int n, unsigned long val)
24+
static inline void write_pmevcntrn(int n, unsigned long val)
2525
{
2626
PMEVN_SWITCH(n, WRITE_PMEVCNTRN);
2727
}
2828

2929
#define WRITE_PMEVTYPERN(n) \
3030
write_sysreg(val, pmevtyper##n##_el0)
31-
static void write_pmevtypern(int n, unsigned long val)
31+
static inline void write_pmevtypern(int n, unsigned long val)
3232
{
3333
PMEVN_SWITCH(n, WRITE_PMEVTYPERN);
3434
}

arch/arm64/kernel/mte.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,10 @@ void mte_sync_tags(pte_t old_pte, pte_t pte)
6666
return;
6767

6868
/* if PG_mte_tagged is set, tags have already been initialised */
69-
for (i = 0; i < nr_pages; i++, page++) {
70-
if (!page_mte_tagged(page)) {
69+
for (i = 0; i < nr_pages; i++, page++)
70+
if (!page_mte_tagged(page))
7171
mte_sync_page_tags(page, old_pte, check_swap,
7272
pte_is_tagged);
73-
set_page_mte_tagged(page);
74-
}
75-
}
7673

7774
/* ensure the tags are visible before the PTE is set */
7875
smp_wmb();

arch/arm64/kernel/vdso.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ static int aarch32_alloc_kuser_vdso_page(void)
288288

289289
memcpy((void *)(vdso_page + 0x1000 - kuser_sz), __kuser_helper_start,
290290
kuser_sz);
291-
aarch32_vectors_page = virt_to_page(vdso_page);
291+
aarch32_vectors_page = virt_to_page((void *)vdso_page);
292292
return 0;
293293
}
294294

arch/arm64/mm/copypage.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ void copy_highpage(struct page *to, struct page *from)
2121

2222
copy_page(kto, kfrom);
2323

24+
if (kasan_hw_tags_enabled())
25+
page_kasan_tag_reset(to);
26+
2427
if (system_supports_mte() && page_mte_tagged(from)) {
25-
if (kasan_hw_tags_enabled())
26-
page_kasan_tag_reset(to);
2728
/* It's a new page, shouldn't have been tagged yet */
2829
WARN_ON_ONCE(!try_page_mte_tagging(to));
2930
mte_copy_page_tags(kto, kfrom);

arch/arm64/mm/fault.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,8 @@ static void do_bad_area(unsigned long far, unsigned long esr,
480480
}
481481
}
482482

483-
#define VM_FAULT_BADMAP 0x010000
484-
#define VM_FAULT_BADACCESS 0x020000
483+
#define VM_FAULT_BADMAP ((__force vm_fault_t)0x010000)
484+
#define VM_FAULT_BADACCESS ((__force vm_fault_t)0x020000)
485485

486486
static vm_fault_t __do_page_fault(struct mm_struct *mm, unsigned long addr,
487487
unsigned int mm_flags, unsigned long vm_flags,

0 commit comments

Comments
 (0)