Skip to content

Commit 54dee40

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: - Fix SPE probe failure when backing auxbuf with high-order pages - Fix handling of DMA allocations from outside of the vmalloc area - Fix generation of build-id ELF section for vDSO object - Disable huge I/O mappings if kernel page table dumping is enabled - A few other minor fixes (comments, kconfig etc) * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: vdso: Explicitly add build-id option arm64/mm: Inhibit huge-vmap with ptdump arm64: Print physical address of page table base in show_pte() arm64: don't trash config with compat symbol if COMPAT is disabled arm64: assembler: Update comment above cond_yield_neon() macro drivers/perf: arm_spe: Don't error on high-order pages for aux buf arm64/iommu: handle non-remapped addresses in ->mmap and ->get_sgtable
2 parents 651bae9 + 7a0a93c commit 54dee40

File tree

7 files changed

+30
-23
lines changed

7 files changed

+30
-23
lines changed

arch/arm64/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ config ARM64
6969
select ARCH_SUPPORTS_ATOMIC_RMW
7070
select ARCH_SUPPORTS_INT128 if GCC_VERSION >= 50000 || CC_IS_CLANG
7171
select ARCH_SUPPORTS_NUMA_BALANCING
72-
select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
72+
select ARCH_WANT_COMPAT_IPC_PARSE_VERSION if COMPAT
7373
select ARCH_WANT_FRAME_POINTERS
7474
select ARCH_HAS_UBSAN_SANITIZE_ALL
7575
select ARM_AMBA

arch/arm64/include/asm/assembler.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -718,12 +718,11 @@ USER(\label, ic ivau, \tmp2) // invalidate I line PoU
718718
* the output section, any use of such directives is undefined.
719719
*
720720
* The yield itself consists of the following:
721-
* - Check whether the preempt count is exactly 1, in which case disabling
722-
* preemption once will make the task preemptible. If this is not the case,
723-
* yielding is pointless.
724-
* - Check whether TIF_NEED_RESCHED is set, and if so, disable and re-enable
725-
* kernel mode NEON (which will trigger a reschedule), and branch to the
726-
* yield fixup code.
721+
* - Check whether the preempt count is exactly 1 and a reschedule is also
722+
* needed. If so, calling of preempt_enable() in kernel_neon_end() will
723+
* trigger a reschedule. If it is not the case, yielding is pointless.
724+
* - Disable and re-enable kernel mode NEON, and branch to the yield fixup
725+
* code.
727726
*
728727
* This macro sequence may clobber all CPU state that is not guaranteed by the
729728
* AAPCS to be preserved across an ordinary function call.

arch/arm64/kernel/vdso/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ obj-vdso := gettimeofday.o note.o sigreturn.o
1212
targets := $(obj-vdso) vdso.so vdso.so.dbg
1313
obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
1414

15-
ldflags-y := -shared -nostdlib -soname=linux-vdso.so.1 \
16-
$(call ld-option, --hash-style=sysv) -n -T
15+
ldflags-y := -shared -nostdlib -soname=linux-vdso.so.1 --hash-style=sysv \
16+
--build-id -n -T
1717

1818
# Disable gcov profiling for VDSO code
1919
GCOV_PROFILE := n

arch/arm64/mm/dma-mapping.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,11 @@ static int __iommu_mmap_attrs(struct device *dev, struct vm_area_struct *vma,
249249
if (dma_mmap_from_dev_coherent(dev, vma, cpu_addr, size, &ret))
250250
return ret;
251251

252+
if (!is_vmalloc_addr(cpu_addr)) {
253+
unsigned long pfn = page_to_pfn(virt_to_page(cpu_addr));
254+
return __swiotlb_mmap_pfn(vma, pfn, size);
255+
}
256+
252257
if (attrs & DMA_ATTR_FORCE_CONTIGUOUS) {
253258
/*
254259
* DMA_ATTR_FORCE_CONTIGUOUS allocations are always remapped,
@@ -272,6 +277,11 @@ static int __iommu_get_sgtable(struct device *dev, struct sg_table *sgt,
272277
unsigned int count = PAGE_ALIGN(size) >> PAGE_SHIFT;
273278
struct vm_struct *area = find_vm_area(cpu_addr);
274279

280+
if (!is_vmalloc_addr(cpu_addr)) {
281+
struct page *page = virt_to_page(cpu_addr);
282+
return __swiotlb_get_sgtable_page(sgt, page, size);
283+
}
284+
275285
if (attrs & DMA_ATTR_FORCE_CONTIGUOUS) {
276286
/*
277287
* DMA_ATTR_FORCE_CONTIGUOUS allocations are always remapped,

arch/arm64/mm/fault.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,10 @@ static void show_pte(unsigned long addr)
171171
return;
172172
}
173173

174-
pr_alert("%s pgtable: %luk pages, %u-bit VAs, pgdp = %p\n",
174+
pr_alert("%s pgtable: %luk pages, %u-bit VAs, pgdp=%016lx\n",
175175
mm == &init_mm ? "swapper" : "user", PAGE_SIZE / SZ_1K,
176-
mm == &init_mm ? VA_BITS : (int) vabits_user, mm->pgd);
176+
mm == &init_mm ? VA_BITS : (int)vabits_user,
177+
(unsigned long)virt_to_phys(mm->pgd));
177178
pgdp = pgd_offset(mm, addr);
178179
pgd = READ_ONCE(*pgdp);
179180
pr_alert("[%016lx] pgd=%016llx", addr, pgd_val(pgd));

arch/arm64/mm/mmu.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -955,13 +955,18 @@ void *__init fixmap_remap_fdt(phys_addr_t dt_phys)
955955

956956
int __init arch_ioremap_pud_supported(void)
957957
{
958-
/* only 4k granule supports level 1 block mappings */
959-
return IS_ENABLED(CONFIG_ARM64_4K_PAGES);
958+
/*
959+
* Only 4k granule supports level 1 block mappings.
960+
* SW table walks can't handle removal of intermediate entries.
961+
*/
962+
return IS_ENABLED(CONFIG_ARM64_4K_PAGES) &&
963+
!IS_ENABLED(CONFIG_ARM64_PTDUMP_DEBUGFS);
960964
}
961965

962966
int __init arch_ioremap_pmd_supported(void)
963967
{
964-
return 1;
968+
/* See arch_ioremap_pud_supported() */
969+
return !IS_ENABLED(CONFIG_ARM64_PTDUMP_DEBUGFS);
965970
}
966971

967972
int pud_set_huge(pud_t *pudp, phys_addr_t phys, pgprot_t prot)

drivers/perf/arm_spe_pmu.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -855,16 +855,8 @@ static void *arm_spe_pmu_setup_aux(struct perf_event *event, void **pages,
855855
if (!pglist)
856856
goto out_free_buf;
857857

858-
for (i = 0; i < nr_pages; ++i) {
859-
struct page *page = virt_to_page(pages[i]);
860-
861-
if (PagePrivate(page)) {
862-
pr_warn("unexpected high-order page for auxbuf!");
863-
goto out_free_pglist;
864-
}
865-
858+
for (i = 0; i < nr_pages; ++i)
866859
pglist[i] = virt_to_page(pages[i]);
867-
}
868860

869861
buf->base = vmap(pglist, nr_pages, VM_MAP, PAGE_KERNEL);
870862
if (!buf->base)

0 commit comments

Comments
 (0)