Skip to content

Commit c8bc81a

Browse files
committed
Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 fixes from Catalin Marinas: - CFI failure due to kpti_ng_pgd_alloc() signature mismatch - Underallocation bug in the SVE ptrace kselftest * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: kselftest/arm64: Don't open code SVE_PT_SIZE() in fp-ptrace arm64: mm: Fix CFI failure due to kpti_ng_pgd_alloc function signature
2 parents 11e7861 + d82aa5d commit c8bc81a

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

arch/arm64/include/asm/mmu.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@
1717
#include <linux/refcount.h>
1818
#include <asm/cpufeature.h>
1919

20+
enum pgtable_type {
21+
TABLE_PTE,
22+
TABLE_PMD,
23+
TABLE_PUD,
24+
TABLE_P4D,
25+
};
26+
2027
typedef struct {
2128
atomic64_t id;
2229
#ifdef CONFIG_COMPAT

arch/arm64/kernel/cpufeature.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
#include <asm/hwcap.h>
8585
#include <asm/insn.h>
8686
#include <asm/kvm_host.h>
87+
#include <asm/mmu.h>
8788
#include <asm/mmu_context.h>
8889
#include <asm/mte.h>
8990
#include <asm/hypervisor.h>
@@ -1945,11 +1946,11 @@ static bool has_pmuv3(const struct arm64_cpu_capabilities *entry, int scope)
19451946
extern
19461947
void create_kpti_ng_temp_pgd(pgd_t *pgdir, phys_addr_t phys, unsigned long virt,
19471948
phys_addr_t size, pgprot_t prot,
1948-
phys_addr_t (*pgtable_alloc)(int), int flags);
1949+
phys_addr_t (*pgtable_alloc)(enum pgtable_type), int flags);
19491950

19501951
static phys_addr_t __initdata kpti_ng_temp_alloc;
19511952

1952-
static phys_addr_t __init kpti_ng_pgd_alloc(int shift)
1953+
static phys_addr_t __init kpti_ng_pgd_alloc(enum pgtable_type type)
19531954
{
19541955
kpti_ng_temp_alloc -= PAGE_SIZE;
19551956
return kpti_ng_temp_alloc;

arch/arm64/mm/mmu.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,6 @@
4747
#define NO_CONT_MAPPINGS BIT(1)
4848
#define NO_EXEC_MAPPINGS BIT(2) /* assumes FEAT_HPDS is not used */
4949

50-
enum pgtable_type {
51-
TABLE_PTE,
52-
TABLE_PMD,
53-
TABLE_PUD,
54-
TABLE_P4D,
55-
};
56-
5750
u64 kimage_voffset __ro_after_init;
5851
EXPORT_SYMBOL(kimage_voffset);
5952

tools/testing/selftests/arm64/fp/fp-ptrace.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ static void sve_write_sve(pid_t child, struct test_config *config)
11871187
if (!vl)
11881188
return;
11891189

1190-
iov.iov_len = SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq, SVE_PT_REGS_SVE);
1190+
iov.iov_len = SVE_PT_SIZE(vq, SVE_PT_REGS_SVE);
11911191
iov.iov_base = malloc(iov.iov_len);
11921192
if (!iov.iov_base) {
11931193
ksft_print_msg("Failed allocating %lu byte SVE write buffer\n",
@@ -1234,8 +1234,7 @@ static void sve_write_fpsimd(pid_t child, struct test_config *config)
12341234
if (!vl)
12351235
return;
12361236

1237-
iov.iov_len = SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq,
1238-
SVE_PT_REGS_FPSIMD);
1237+
iov.iov_len = SVE_PT_SIZE(vq, SVE_PT_REGS_FPSIMD);
12391238
iov.iov_base = malloc(iov.iov_len);
12401239
if (!iov.iov_base) {
12411240
ksft_print_msg("Failed allocating %lu byte SVE write buffer\n",

0 commit comments

Comments
 (0)