Skip to content

Commit 53262d1

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: - __cpu_suspend mm switching fix after warm boot - arch_setup_dma_ops implementation - pgd_page compilation error fix - defconfig updates * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: mm: Add pgd_page to support RCU fast_gup arm64: defconfig: defconfig update for 3.19 arm64: kernel: fix __cpu_suspend mm switch on warm-boot arm64: Replace set_arch_dma_coherent_ops with arch_setup_dma_ops
2 parents aa39477 + 5d96e0c commit 53262d1

File tree

4 files changed

+27
-12
lines changed

4 files changed

+27
-12
lines changed

arch/arm64/configs/defconfig

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# CONFIG_LOCALVERSION_AUTO is not set
22
CONFIG_SYSVIPC=y
33
CONFIG_POSIX_MQUEUE=y
4+
CONFIG_FHANDLE=y
45
CONFIG_AUDIT=y
56
CONFIG_NO_HZ_IDLE=y
67
CONFIG_HIGH_RES_TIMERS=y
@@ -13,14 +14,12 @@ CONFIG_TASK_IO_ACCOUNTING=y
1314
CONFIG_IKCONFIG=y
1415
CONFIG_IKCONFIG_PROC=y
1516
CONFIG_LOG_BUF_SHIFT=14
16-
CONFIG_RESOURCE_COUNTERS=y
1717
CONFIG_MEMCG=y
1818
CONFIG_MEMCG_SWAP=y
1919
CONFIG_MEMCG_KMEM=y
2020
CONFIG_CGROUP_HUGETLB=y
2121
# CONFIG_UTS_NS is not set
2222
# CONFIG_IPC_NS is not set
23-
# CONFIG_PID_NS is not set
2423
# CONFIG_NET_NS is not set
2524
CONFIG_SCHED_AUTOGROUP=y
2625
CONFIG_BLK_DEV_INITRD=y
@@ -92,7 +91,6 @@ CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
9291
CONFIG_SERIAL_OF_PLATFORM=y
9392
CONFIG_VIRTIO_CONSOLE=y
9493
# CONFIG_HW_RANDOM is not set
95-
# CONFIG_HMC_DRV is not set
9694
CONFIG_SPI=y
9795
CONFIG_SPI_PL022=y
9896
CONFIG_GPIO_PL061=y
@@ -133,6 +131,8 @@ CONFIG_EXT3_FS=y
133131
CONFIG_EXT4_FS=y
134132
CONFIG_FANOTIFY=y
135133
CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
134+
CONFIG_QUOTA=y
135+
CONFIG_AUTOFS4_FS=y
136136
CONFIG_FUSE_FS=y
137137
CONFIG_CUSE=y
138138
CONFIG_VFAT_FS=y
@@ -152,14 +152,15 @@ CONFIG_MAGIC_SYSRQ=y
152152
CONFIG_DEBUG_KERNEL=y
153153
CONFIG_LOCKUP_DETECTOR=y
154154
# CONFIG_SCHED_DEBUG is not set
155+
# CONFIG_DEBUG_PREEMPT is not set
155156
# CONFIG_FTRACE is not set
157+
CONFIG_KEYS=y
156158
CONFIG_SECURITY=y
157159
CONFIG_CRYPTO_ANSI_CPRNG=y
158160
CONFIG_ARM64_CRYPTO=y
159161
CONFIG_CRYPTO_SHA1_ARM64_CE=y
160162
CONFIG_CRYPTO_SHA2_ARM64_CE=y
161163
CONFIG_CRYPTO_GHASH_ARM64_CE=y
162-
CONFIG_CRYPTO_AES_ARM64_CE=y
163164
CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
164165
CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
165166
CONFIG_CRYPTO_AES_ARM64_NEON_BLK=y

arch/arm64/include/asm/dma-mapping.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,14 @@ static inline void set_dma_ops(struct device *dev, struct dma_map_ops *ops)
5252
dev->archdata.dma_ops = ops;
5353
}
5454

55-
static inline int set_arch_dma_coherent_ops(struct device *dev)
55+
static inline void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
56+
struct iommu_ops *iommu, bool coherent)
5657
{
57-
dev->archdata.dma_coherent = true;
58-
set_dma_ops(dev, &coherent_swiotlb_dma_ops);
59-
return 0;
58+
dev->archdata.dma_coherent = coherent;
59+
if (coherent)
60+
set_dma_ops(dev, &coherent_swiotlb_dma_ops);
6061
}
61-
#define set_arch_dma_coherent_ops set_arch_dma_coherent_ops
62+
#define arch_setup_dma_ops arch_setup_dma_ops
6263

6364
/* do not use this function in a driver */
6465
static inline bool is_device_dma_coherent(struct device *dev)

arch/arm64/include/asm/pgtable.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ void pmdp_splitting_flush(struct vm_area_struct *vma, unsigned long address,
298298
#define pfn_pmd(pfn,prot) (__pmd(((phys_addr_t)(pfn) << PAGE_SHIFT) | pgprot_val(prot)))
299299
#define mk_pmd(page,prot) pfn_pmd(page_to_pfn(page),prot)
300300

301-
#define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd) & PHYS_MASK))
302301
#define pud_write(pud) pte_write(pud_pte(pud))
303302
#define pud_pfn(pud) (((pud_val(pud) & PUD_MASK) & PHYS_MASK) >> PAGE_SHIFT)
304303

@@ -401,7 +400,7 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)
401400
return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(addr);
402401
}
403402

404-
#define pud_page(pud) pmd_page(pud_pmd(pud))
403+
#define pud_page(pud) pfn_to_page(__phys_to_pfn(pud_val(pud) & PHYS_MASK))
405404

406405
#endif /* CONFIG_ARM64_PGTABLE_LEVELS > 2 */
407406

@@ -437,6 +436,8 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long addr)
437436
return (pud_t *)pgd_page_vaddr(*pgd) + pud_index(addr);
438437
}
439438

439+
#define pgd_page(pgd) pfn_to_page(__phys_to_pfn(pgd_val(pgd) & PHYS_MASK))
440+
440441
#endif /* CONFIG_ARM64_PGTABLE_LEVELS > 3 */
441442

442443
#define pgd_ERROR(pgd) __pgd_error(__FILE__, __LINE__, pgd_val(pgd))

arch/arm64/kernel/suspend.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <asm/debug-monitors.h>
66
#include <asm/pgtable.h>
77
#include <asm/memory.h>
8+
#include <asm/mmu_context.h>
89
#include <asm/smp_plat.h>
910
#include <asm/suspend.h>
1011
#include <asm/tlbflush.h>
@@ -98,7 +99,18 @@ int __cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
9899
*/
99100
ret = __cpu_suspend_enter(arg, fn);
100101
if (ret == 0) {
101-
cpu_switch_mm(mm->pgd, mm);
102+
/*
103+
* We are resuming from reset with TTBR0_EL1 set to the
104+
* idmap to enable the MMU; restore the active_mm mappings in
105+
* TTBR0_EL1 unless the active_mm == &init_mm, in which case
106+
* the thread entered __cpu_suspend with TTBR0_EL1 set to
107+
* reserved TTBR0 page tables and should be restored as such.
108+
*/
109+
if (mm == &init_mm)
110+
cpu_set_reserved_ttbr0();
111+
else
112+
cpu_switch_mm(mm->pgd, mm);
113+
102114
flush_tlb_all();
103115

104116
/*

0 commit comments

Comments
 (0)