diff options
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/boot/dts/apm-storm.dtsi | 3 | ||||
-rw-r--r-- | arch/arm64/boot/dts/rtsm_ve-motherboard.dtsi | 2 | ||||
-rw-r--r-- | arch/arm64/include/asm/memory.h | 1 | ||||
-rw-r--r-- | arch/arm64/include/asm/pgtable.h | 2 | ||||
-rw-r--r-- | arch/arm64/kernel/irq.c | 10 | ||||
-rw-r--r-- | arch/arm64/kernel/setup.c | 2 | ||||
-rw-r--r-- | arch/arm64/mm/dma-mapping.c | 35 | ||||
-rw-r--r-- | arch/arm64/mm/hugetlbpage.c | 4 | ||||
-rw-r--r-- | arch/arm64/mm/mmu.c | 3 | ||||
-rw-r--r-- | arch/arm64/xen/hypercall.S | 1 |
10 files changed, 55 insertions, 8 deletions
diff --git a/arch/arm64/boot/dts/apm-storm.dtsi b/arch/arm64/boot/dts/apm-storm.dtsi index 93f4b2dd9248..f8c40a66e65d 100644 --- a/arch/arm64/boot/dts/apm-storm.dtsi +++ b/arch/arm64/boot/dts/apm-storm.dtsi | |||
@@ -307,6 +307,7 @@ | |||
307 | <0x0 0x1f21e000 0x0 0x1000>, | 307 | <0x0 0x1f21e000 0x0 0x1000>, |
308 | <0x0 0x1f217000 0x0 0x1000>; | 308 | <0x0 0x1f217000 0x0 0x1000>; |
309 | interrupts = <0x0 0x86 0x4>; | 309 | interrupts = <0x0 0x86 0x4>; |
310 | dma-coherent; | ||
310 | status = "disabled"; | 311 | status = "disabled"; |
311 | clocks = <&sata01clk 0>; | 312 | clocks = <&sata01clk 0>; |
312 | phys = <&phy1 0>; | 313 | phys = <&phy1 0>; |
@@ -321,6 +322,7 @@ | |||
321 | <0x0 0x1f22e000 0x0 0x1000>, | 322 | <0x0 0x1f22e000 0x0 0x1000>, |
322 | <0x0 0x1f227000 0x0 0x1000>; | 323 | <0x0 0x1f227000 0x0 0x1000>; |
323 | interrupts = <0x0 0x87 0x4>; | 324 | interrupts = <0x0 0x87 0x4>; |
325 | dma-coherent; | ||
324 | status = "ok"; | 326 | status = "ok"; |
325 | clocks = <&sata23clk 0>; | 327 | clocks = <&sata23clk 0>; |
326 | phys = <&phy2 0>; | 328 | phys = <&phy2 0>; |
@@ -334,6 +336,7 @@ | |||
334 | <0x0 0x1f23d000 0x0 0x1000>, | 336 | <0x0 0x1f23d000 0x0 0x1000>, |
335 | <0x0 0x1f23e000 0x0 0x1000>; | 337 | <0x0 0x1f23e000 0x0 0x1000>; |
336 | interrupts = <0x0 0x88 0x4>; | 338 | interrupts = <0x0 0x88 0x4>; |
339 | dma-coherent; | ||
337 | status = "ok"; | 340 | status = "ok"; |
338 | clocks = <&sata45clk 0>; | 341 | clocks = <&sata45clk 0>; |
339 | phys = <&phy3 0>; | 342 | phys = <&phy3 0>; |
diff --git a/arch/arm64/boot/dts/rtsm_ve-motherboard.dtsi b/arch/arm64/boot/dts/rtsm_ve-motherboard.dtsi index 2f2ecd217363..ac2cb2418025 100644 --- a/arch/arm64/boot/dts/rtsm_ve-motherboard.dtsi +++ b/arch/arm64/boot/dts/rtsm_ve-motherboard.dtsi | |||
@@ -200,7 +200,7 @@ | |||
200 | }; | 200 | }; |
201 | 201 | ||
202 | mcc { | 202 | mcc { |
203 | compatible = "arm,vexpress,config-bus", "simple-bus"; | 203 | compatible = "arm,vexpress,config-bus"; |
204 | arm,vexpress,config-bridge = <&v2m_sysreg>; | 204 | arm,vexpress,config-bridge = <&v2m_sysreg>; |
205 | 205 | ||
206 | v2m_oscclk1: osc@1 { | 206 | v2m_oscclk1: osc@1 { |
diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index e94f9458aa6f..993bce527b85 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h | |||
@@ -138,6 +138,7 @@ static inline void *phys_to_virt(phys_addr_t x) | |||
138 | #define __pa(x) __virt_to_phys((unsigned long)(x)) | 138 | #define __pa(x) __virt_to_phys((unsigned long)(x)) |
139 | #define __va(x) ((void *)__phys_to_virt((phys_addr_t)(x))) | 139 | #define __va(x) ((void *)__phys_to_virt((phys_addr_t)(x))) |
140 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) | 140 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) |
141 | #define virt_to_pfn(x) __phys_to_pfn(__virt_to_phys(x)) | ||
141 | 142 | ||
142 | /* | 143 | /* |
143 | * virt_to_page(k) convert a _valid_ virtual address to struct page * | 144 | * virt_to_page(k) convert a _valid_ virtual address to struct page * |
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 90c811f05a2e..7b1c67a0b485 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h | |||
@@ -266,7 +266,7 @@ static inline pmd_t pte_pmd(pte_t pte) | |||
266 | 266 | ||
267 | #define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd) & PHYS_MASK)) | 267 | #define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd) & PHYS_MASK)) |
268 | 268 | ||
269 | #define set_pmd_at(mm, addr, pmdp, pmd) set_pmd(pmdp, pmd) | 269 | #define set_pmd_at(mm, addr, pmdp, pmd) set_pte_at(mm, addr, (pte_t *)pmdp, pmd_pte(pmd)) |
270 | 270 | ||
271 | static inline int has_transparent_hugepage(void) | 271 | static inline int has_transparent_hugepage(void) |
272 | { | 272 | { |
diff --git a/arch/arm64/kernel/irq.c b/arch/arm64/kernel/irq.c index 473e5dbf8f39..0f08dfd69ebc 100644 --- a/arch/arm64/kernel/irq.c +++ b/arch/arm64/kernel/irq.c | |||
@@ -97,11 +97,15 @@ static bool migrate_one_irq(struct irq_desc *desc) | |||
97 | if (irqd_is_per_cpu(d) || !cpumask_test_cpu(smp_processor_id(), affinity)) | 97 | if (irqd_is_per_cpu(d) || !cpumask_test_cpu(smp_processor_id(), affinity)) |
98 | return false; | 98 | return false; |
99 | 99 | ||
100 | if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) { | 100 | if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) |
101 | affinity = cpu_online_mask; | ||
102 | ret = true; | 101 | ret = true; |
103 | } | ||
104 | 102 | ||
103 | /* | ||
104 | * when using forced irq_set_affinity we must ensure that the cpu | ||
105 | * being offlined is not present in the affinity mask, it may be | ||
106 | * selected as the target CPU otherwise | ||
107 | */ | ||
108 | affinity = cpu_online_mask; | ||
105 | c = irq_data_get_irq_chip(d); | 109 | c = irq_data_get_irq_chip(d); |
106 | if (!c->irq_set_affinity) | 110 | if (!c->irq_set_affinity) |
107 | pr_debug("IRQ%u: unable to set affinity\n", d->irq); | 111 | pr_debug("IRQ%u: unable to set affinity\n", d->irq); |
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 93e7df8968fe..7ec784653b29 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c | |||
@@ -396,7 +396,7 @@ static int __init arm64_device_init(void) | |||
396 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 396 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
397 | return 0; | 397 | return 0; |
398 | } | 398 | } |
399 | arch_initcall(arm64_device_init); | 399 | arch_initcall_sync(arm64_device_init); |
400 | 400 | ||
401 | static DEFINE_PER_CPU(struct cpu, cpu_data); | 401 | static DEFINE_PER_CPU(struct cpu, cpu_data); |
402 | 402 | ||
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c index 0ba347e59f06..c851eb44dc50 100644 --- a/arch/arm64/mm/dma-mapping.c +++ b/arch/arm64/mm/dma-mapping.c | |||
@@ -22,8 +22,11 @@ | |||
22 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
23 | #include <linux/dma-mapping.h> | 23 | #include <linux/dma-mapping.h> |
24 | #include <linux/dma-contiguous.h> | 24 | #include <linux/dma-contiguous.h> |
25 | #include <linux/of.h> | ||
26 | #include <linux/platform_device.h> | ||
25 | #include <linux/vmalloc.h> | 27 | #include <linux/vmalloc.h> |
26 | #include <linux/swiotlb.h> | 28 | #include <linux/swiotlb.h> |
29 | #include <linux/amba/bus.h> | ||
27 | 30 | ||
28 | #include <asm/cacheflush.h> | 31 | #include <asm/cacheflush.h> |
29 | 32 | ||
@@ -305,17 +308,45 @@ struct dma_map_ops coherent_swiotlb_dma_ops = { | |||
305 | }; | 308 | }; |
306 | EXPORT_SYMBOL(coherent_swiotlb_dma_ops); | 309 | EXPORT_SYMBOL(coherent_swiotlb_dma_ops); |
307 | 310 | ||
311 | static int dma_bus_notifier(struct notifier_block *nb, | ||
312 | unsigned long event, void *_dev) | ||
313 | { | ||
314 | struct device *dev = _dev; | ||
315 | |||
316 | if (event != BUS_NOTIFY_ADD_DEVICE) | ||
317 | return NOTIFY_DONE; | ||
318 | |||
319 | if (of_property_read_bool(dev->of_node, "dma-coherent")) | ||
320 | set_dma_ops(dev, &coherent_swiotlb_dma_ops); | ||
321 | |||
322 | return NOTIFY_OK; | ||
323 | } | ||
324 | |||
325 | static struct notifier_block platform_bus_nb = { | ||
326 | .notifier_call = dma_bus_notifier, | ||
327 | }; | ||
328 | |||
329 | static struct notifier_block amba_bus_nb = { | ||
330 | .notifier_call = dma_bus_notifier, | ||
331 | }; | ||
332 | |||
308 | extern int swiotlb_late_init_with_default_size(size_t default_size); | 333 | extern int swiotlb_late_init_with_default_size(size_t default_size); |
309 | 334 | ||
310 | static int __init swiotlb_late_init(void) | 335 | static int __init swiotlb_late_init(void) |
311 | { | 336 | { |
312 | size_t swiotlb_size = min(SZ_64M, MAX_ORDER_NR_PAGES << PAGE_SHIFT); | 337 | size_t swiotlb_size = min(SZ_64M, MAX_ORDER_NR_PAGES << PAGE_SHIFT); |
313 | 338 | ||
314 | dma_ops = &coherent_swiotlb_dma_ops; | 339 | /* |
340 | * These must be registered before of_platform_populate(). | ||
341 | */ | ||
342 | bus_register_notifier(&platform_bus_type, &platform_bus_nb); | ||
343 | bus_register_notifier(&amba_bustype, &amba_bus_nb); | ||
344 | |||
345 | dma_ops = &noncoherent_swiotlb_dma_ops; | ||
315 | 346 | ||
316 | return swiotlb_late_init_with_default_size(swiotlb_size); | 347 | return swiotlb_late_init_with_default_size(swiotlb_size); |
317 | } | 348 | } |
318 | subsys_initcall(swiotlb_late_init); | 349 | arch_initcall(swiotlb_late_init); |
319 | 350 | ||
320 | #define PREALLOC_DMA_DEBUG_ENTRIES 4096 | 351 | #define PREALLOC_DMA_DEBUG_ENTRIES 4096 |
321 | 352 | ||
diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c index 5e9aec358306..31eb959e9aa8 100644 --- a/arch/arm64/mm/hugetlbpage.c +++ b/arch/arm64/mm/hugetlbpage.c | |||
@@ -51,7 +51,11 @@ int pmd_huge(pmd_t pmd) | |||
51 | 51 | ||
52 | int pud_huge(pud_t pud) | 52 | int pud_huge(pud_t pud) |
53 | { | 53 | { |
54 | #ifndef __PAGETABLE_PMD_FOLDED | ||
54 | return !(pud_val(pud) & PUD_TABLE_BIT); | 55 | return !(pud_val(pud) & PUD_TABLE_BIT); |
56 | #else | ||
57 | return 0; | ||
58 | #endif | ||
55 | } | 59 | } |
56 | 60 | ||
57 | int pmd_huge_support(void) | 61 | int pmd_huge_support(void) |
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 6b7e89569a3a..0a472c41a67f 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c | |||
@@ -374,6 +374,9 @@ int kern_addr_valid(unsigned long addr) | |||
374 | if (pmd_none(*pmd)) | 374 | if (pmd_none(*pmd)) |
375 | return 0; | 375 | return 0; |
376 | 376 | ||
377 | if (pmd_sect(*pmd)) | ||
378 | return pfn_valid(pmd_pfn(*pmd)); | ||
379 | |||
377 | pte = pte_offset_kernel(pmd, addr); | 380 | pte = pte_offset_kernel(pmd, addr); |
378 | if (pte_none(*pte)) | 381 | if (pte_none(*pte)) |
379 | return 0; | 382 | return 0; |
diff --git a/arch/arm64/xen/hypercall.S b/arch/arm64/xen/hypercall.S index 531342ec4bcf..8bbe9401f4f0 100644 --- a/arch/arm64/xen/hypercall.S +++ b/arch/arm64/xen/hypercall.S | |||
@@ -80,6 +80,7 @@ HYPERCALL2(memory_op); | |||
80 | HYPERCALL2(physdev_op); | 80 | HYPERCALL2(physdev_op); |
81 | HYPERCALL3(vcpu_op); | 81 | HYPERCALL3(vcpu_op); |
82 | HYPERCALL1(tmem_op); | 82 | HYPERCALL1(tmem_op); |
83 | HYPERCALL2(multicall); | ||
83 | 84 | ||
84 | ENTRY(privcmd_call) | 85 | ENTRY(privcmd_call) |
85 | mov x16, x0 | 86 | mov x16, x0 |