Skip to content

Commit c4c6044

Browse files
committed
Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
Pull ARM updates from Russell King: - add missing neon instructions for the neon support hook - arrange for davinci to select PINCTRL - try VMA lock-base page fault handling first - use memblock_alloc_try_nid_raw() for kasan shadow page - dma: use kvzalloc() rather than kzalloc()/vzalloc() * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 9331/1: ARM/dma-mapping: replace kzalloc() and vzalloc() with kvzalloc() ARM: 9329/1: kasan: Use memblock_alloc_try_nid_raw for shadow page ARM: 9328/1: mm: try VMA lock-based page fault handling first ARM: 9330/1: davinci: also select PINCTRL ARM: 9327/1: vfp: Add missing VFP instructions to neon_support_hook
2 parents 284a4dd + 8790fad commit c4c6044

File tree

6 files changed

+58
-5
lines changed

6 files changed

+58
-5
lines changed

arch/arm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ config ARM
3535
select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if CPU_V7
3636
select ARCH_SUPPORTS_ATOMIC_RMW
3737
select ARCH_SUPPORTS_HUGETLBFS if ARM_LPAE
38+
select ARCH_SUPPORTS_PER_VMA_LOCK
3839
select ARCH_USE_BUILTIN_BSWAP
3940
select ARCH_USE_CMPXCHG_LOCKREF
4041
select ARCH_USE_MEMTEST

arch/arm/mach-davinci/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ menuconfig ARCH_DAVINCI
1111
select PM_GENERIC_DOMAINS_OF if PM && OF
1212
select REGMAP_MMIO
1313
select RESET_CONTROLLER
14+
select PINCTRL
1415
select PINCTRL_SINGLE
1516

1617
if ARCH_DAVINCI

arch/arm/mm/dma-mapping.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -859,10 +859,7 @@ static struct page **__iommu_alloc_buffer(struct device *dev, size_t size,
859859
int i = 0;
860860
int order_idx = 0;
861861

862-
if (array_size <= PAGE_SIZE)
863-
pages = kzalloc(array_size, GFP_KERNEL);
864-
else
865-
pages = vzalloc(array_size);
862+
pages = kvzalloc(array_size, GFP_KERNEL);
866863
if (!pages)
867864
return NULL;
868865

arch/arm/mm/fault.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,35 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
278278

279279
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, addr);
280280

281+
if (!(flags & FAULT_FLAG_USER))
282+
goto lock_mmap;
283+
284+
vma = lock_vma_under_rcu(mm, addr);
285+
if (!vma)
286+
goto lock_mmap;
287+
288+
if (!(vma->vm_flags & vm_flags)) {
289+
vma_end_read(vma);
290+
goto lock_mmap;
291+
}
292+
fault = handle_mm_fault(vma, addr, flags | FAULT_FLAG_VMA_LOCK, regs);
293+
if (!(fault & (VM_FAULT_RETRY | VM_FAULT_COMPLETED)))
294+
vma_end_read(vma);
295+
296+
if (!(fault & VM_FAULT_RETRY)) {
297+
count_vm_vma_lock_event(VMA_LOCK_SUCCESS);
298+
goto done;
299+
}
300+
count_vm_vma_lock_event(VMA_LOCK_RETRY);
301+
302+
/* Quick path to respond to signals */
303+
if (fault_signal_pending(fault, regs)) {
304+
if (!user_mode(regs))
305+
goto no_context;
306+
return 0;
307+
}
308+
lock_mmap:
309+
281310
retry:
282311
vma = lock_mm_and_find_vma(mm, addr, regs);
283312
if (unlikely(!vma)) {
@@ -316,6 +345,7 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
316345
}
317346

318347
mmap_read_unlock(mm);
348+
done:
319349

320350
/*
321351
* Handle the "normal" case first - VM_FAULT_MAJOR

arch/arm/mm/kasan_init.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ static pgd_t tmp_pgd_table[PTRS_PER_PGD] __initdata __aligned(PGD_SIZE);
2828

2929
pmd_t tmp_pmd_table[PTRS_PER_PMD] __page_aligned_bss;
3030

31+
static __init void *kasan_alloc_block_raw(size_t size)
32+
{
33+
return memblock_alloc_try_nid_raw(size, size, __pa(MAX_DMA_ADDRESS),
34+
MEMBLOCK_ALLOC_NOLEAKTRACE, NUMA_NO_NODE);
35+
}
36+
3137
static __init void *kasan_alloc_block(size_t size)
3238
{
3339
return memblock_alloc_try_nid(size, size, __pa(MAX_DMA_ADDRESS),
@@ -50,7 +56,7 @@ static void __init kasan_pte_populate(pmd_t *pmdp, unsigned long addr,
5056
if (!pte_none(READ_ONCE(*ptep)))
5157
continue;
5258

53-
p = kasan_alloc_block(PAGE_SIZE);
59+
p = kasan_alloc_block_raw(PAGE_SIZE);
5460
if (!p) {
5561
panic("%s failed to allocate shadow page for address 0x%lx\n",
5662
__func__, addr);

arch/arm/vfp/vfpmodule.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,24 @@ static struct undef_hook neon_support_hook[] = {{
800800
.cpsr_mask = PSR_T_BIT,
801801
.cpsr_val = PSR_T_BIT,
802802
.fn = vfp_support_entry,
803+
}, {
804+
.instr_mask = 0xff000800,
805+
.instr_val = 0xfc000800,
806+
.cpsr_mask = 0,
807+
.cpsr_val = 0,
808+
.fn = vfp_support_entry,
809+
}, {
810+
.instr_mask = 0xff000800,
811+
.instr_val = 0xfd000800,
812+
.cpsr_mask = 0,
813+
.cpsr_val = 0,
814+
.fn = vfp_support_entry,
815+
}, {
816+
.instr_mask = 0xff000800,
817+
.instr_val = 0xfe000800,
818+
.cpsr_mask = 0,
819+
.cpsr_val = 0,
820+
.fn = vfp_support_entry,
803821
}};
804822

805823
static struct undef_hook vfp_support_hook = {

0 commit comments

Comments
 (0)