aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/DMA-API.txt13
-rw-r--r--Documentation/sysctl/vm.txt2
-rw-r--r--arch/arm/include/asm/highmem.h1
-rw-r--r--arch/arm/mm/highmem.c10
-rw-r--r--arch/frv/include/asm/highmem.h2
-rw-r--r--arch/frv/mm/highmem.c5
-rw-r--r--arch/metag/include/asm/highmem.h1
-rw-r--r--arch/metag/mm/highmem.c14
-rw-r--r--arch/microblaze/include/asm/highmem.h13
-rw-r--r--arch/mips/include/asm/highmem.h1
-rw-r--r--arch/mips/include/uapi/asm/unistd.h15
-rw-r--r--arch/mips/kernel/scall32-o32.S1
-rw-r--r--arch/mips/kernel/scall64-64.S1
-rw-r--r--arch/mips/kernel/scall64-n32.S1
-rw-r--r--arch/mips/kernel/scall64-o32.S1
-rw-r--r--arch/mips/mm/highmem.c13
-rw-r--r--arch/parisc/include/asm/cacheflush.h1
-rw-r--r--arch/powerpc/include/asm/highmem.h13
-rw-r--r--arch/sparc/include/uapi/asm/unistd.h3
-rw-r--r--arch/sparc/kernel/systbls_32.S2
-rw-r--r--arch/sparc/kernel/systbls_64.S4
-rw-r--r--arch/tile/include/asm/highmem.h1
-rw-r--r--arch/tile/mm/highmem.c12
-rw-r--r--arch/x86/include/asm/highmem.h1
-rw-r--r--arch/x86/mm/highmem_32.c14
-rw-r--r--drivers/gpu/drm/drm_irq.c4
-rw-r--r--drivers/gpu/drm/tegra/sor.c4
-rw-r--r--drivers/input/joystick/walkera0701.c4
-rw-r--r--drivers/media/i2c/ov9650.c2
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c2
-rw-r--r--drivers/scsi/cxgbi/cxgb3i/Kbuild2
-rw-r--r--drivers/scsi/cxgbi/cxgb4i/Kbuild2
-rw-r--r--drivers/thermal/power_allocator.c2
-rw-r--r--drivers/usb/host/ehci-hcd.c2
-rw-r--r--drivers/usb/host/fotg210-hcd.c2
-rw-r--r--drivers/usb/host/oxu210hp-hcd.c2
-rw-r--r--fs/9p/vfs_inode.c3
-rw-r--r--fs/9p/vfs_inode_dotl.c3
-rw-r--r--fs/binfmt_elf_fdpic.c46
-rw-r--r--fs/btrfs/inode.c3
-rw-r--r--fs/exofs/namei.c3
-rw-r--r--fs/ext2/namei.c3
-rw-r--r--fs/ext4/mballoc.c4
-rw-r--r--fs/f2fs/namei.c3
-rw-r--r--fs/fs-writeback.c3
-rw-r--r--fs/gfs2/lock_dlm.c2
-rw-r--r--fs/hpfs/namei.c2
-rw-r--r--fs/inode.c1
-rw-r--r--fs/jfs/namei.c3
-rw-r--r--fs/jfs/super.c3
-rw-r--r--fs/ncpfs/dir.c2
-rw-r--r--fs/nilfs2/namei.c3
-rw-r--r--fs/reiserfs/namei.c3
-rw-r--r--fs/stat.c2
-rw-r--r--include/linux/highmem.h1
-rw-r--r--include/linux/kdev_t.h9
-rw-r--r--include/linux/kernel.h42
-rw-r--r--kernel/time/clocksource.c2
-rw-r--r--kernel/time/timekeeping.c2
-rw-r--r--lib/div64.c2
-rw-r--r--net/sctp/transport.c2
61 files changed, 104 insertions, 221 deletions
diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt
index 8d065d6ec956..1e98a7e6bccc 100644
--- a/Documentation/DMA-API.txt
+++ b/Documentation/DMA-API.txt
@@ -142,19 +142,6 @@ Part Ic - DMA addressing limitations
142------------------------------------ 142------------------------------------
143 143
144int 144int
145dma_supported(struct device *dev, u64 mask)
146
147Checks to see if the device can support DMA to the memory described by
148mask.
149
150Returns: 1 if it can and 0 if it can't.
151
152Notes: This routine merely tests to see if the mask is possible. It
153won't change the current mask settings. It is more intended as an
154internal API for use by the platform than an external API for use by
155driver writers.
156
157int
158dma_set_mask_and_coherent(struct device *dev, u64 mask) 145dma_set_mask_and_coherent(struct device *dev, u64 mask)
159 146
160Checks to see if the mask is possible and updates the device 147Checks to see if the mask is possible and updates the device
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt
index a4482fceacec..f72370b440b1 100644
--- a/Documentation/sysctl/vm.txt
+++ b/Documentation/sysctl/vm.txt
@@ -639,7 +639,7 @@ and don't use much of it.
639The default value is 0. 639The default value is 0.
640 640
641See Documentation/vm/overcommit-accounting and 641See Documentation/vm/overcommit-accounting and
642security/commoncap.c::cap_vm_enough_memory() for more information. 642mm/mmap.c::__vm_enough_memory() for more information.
643 643
644============================================================== 644==============================================================
645 645
diff --git a/arch/arm/include/asm/highmem.h b/arch/arm/include/asm/highmem.h
index 535579511ed0..0a0e2d1784c0 100644
--- a/arch/arm/include/asm/highmem.h
+++ b/arch/arm/include/asm/highmem.h
@@ -68,7 +68,6 @@ extern void kunmap(struct page *page);
68extern void *kmap_atomic(struct page *page); 68extern void *kmap_atomic(struct page *page);
69extern void __kunmap_atomic(void *kvaddr); 69extern void __kunmap_atomic(void *kvaddr);
70extern void *kmap_atomic_pfn(unsigned long pfn); 70extern void *kmap_atomic_pfn(unsigned long pfn);
71extern struct page *kmap_atomic_to_page(const void *ptr);
72#endif 71#endif
73 72
74#endif 73#endif
diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c
index 9df5f09585ca..d02f8187b1cc 100644
--- a/arch/arm/mm/highmem.c
+++ b/arch/arm/mm/highmem.c
@@ -147,13 +147,3 @@ void *kmap_atomic_pfn(unsigned long pfn)
147 147
148 return (void *)vaddr; 148 return (void *)vaddr;
149} 149}
150
151struct page *kmap_atomic_to_page(const void *ptr)
152{
153 unsigned long vaddr = (unsigned long)ptr;
154
155 if (vaddr < FIXADDR_START)
156 return virt_to_page(ptr);
157
158 return pte_page(get_fixmap_pte(vaddr));
159}
diff --git a/arch/frv/include/asm/highmem.h b/arch/frv/include/asm/highmem.h
index b3adc93611f3..1f58938703ab 100644
--- a/arch/frv/include/asm/highmem.h
+++ b/arch/frv/include/asm/highmem.h
@@ -62,8 +62,6 @@ extern void kunmap_high(struct page *page);
62extern void *kmap(struct page *page); 62extern void *kmap(struct page *page);
63extern void kunmap(struct page *page); 63extern void kunmap(struct page *page);
64 64
65extern struct page *kmap_atomic_to_page(void *ptr);
66
67#endif /* !__ASSEMBLY__ */ 65#endif /* !__ASSEMBLY__ */
68 66
69/* 67/*
diff --git a/arch/frv/mm/highmem.c b/arch/frv/mm/highmem.c
index 785344bbdc07..45750fb65c49 100644
--- a/arch/frv/mm/highmem.c
+++ b/arch/frv/mm/highmem.c
@@ -32,11 +32,6 @@ void kunmap(struct page *page)
32 32
33EXPORT_SYMBOL(kunmap); 33EXPORT_SYMBOL(kunmap);
34 34
35struct page *kmap_atomic_to_page(void *ptr)
36{
37 return virt_to_page(ptr);
38}
39
40void *kmap_atomic(struct page *page) 35void *kmap_atomic(struct page *page)
41{ 36{
42 unsigned long paddr; 37 unsigned long paddr;
diff --git a/arch/metag/include/asm/highmem.h b/arch/metag/include/asm/highmem.h
index 6646a15c73dd..9b1d172cd884 100644
--- a/arch/metag/include/asm/highmem.h
+++ b/arch/metag/include/asm/highmem.h
@@ -56,7 +56,6 @@ extern void kunmap(struct page *page);
56extern void *kmap_atomic(struct page *page); 56extern void *kmap_atomic(struct page *page);
57extern void __kunmap_atomic(void *kvaddr); 57extern void __kunmap_atomic(void *kvaddr);
58extern void *kmap_atomic_pfn(unsigned long pfn); 58extern void *kmap_atomic_pfn(unsigned long pfn);
59extern struct page *kmap_atomic_to_page(void *ptr);
60#endif 59#endif
61 60
62#endif 61#endif
diff --git a/arch/metag/mm/highmem.c b/arch/metag/mm/highmem.c
index 807f1b1c4e65..f19a87f2c1ec 100644
--- a/arch/metag/mm/highmem.c
+++ b/arch/metag/mm/highmem.c
@@ -111,20 +111,6 @@ void *kmap_atomic_pfn(unsigned long pfn)
111 return (void *)vaddr; 111 return (void *)vaddr;
112} 112}
113 113
114struct page *kmap_atomic_to_page(void *ptr)
115{
116 unsigned long vaddr = (unsigned long)ptr;
117 int idx;
118 pte_t *pte;
119
120 if (vaddr < FIXADDR_START)
121 return virt_to_page(ptr);
122
123 idx = virt_to_fix(vaddr);
124 pte = kmap_pte - (idx - FIX_KMAP_BEGIN);
125 return pte_page(*pte);
126}
127
128void __init kmap_init(void) 114void __init kmap_init(void)
129{ 115{
130 unsigned long kmap_vstart; 116 unsigned long kmap_vstart;
diff --git a/arch/microblaze/include/asm/highmem.h b/arch/microblaze/include/asm/highmem.h
index d04638932438..67925ef18cfa 100644
--- a/arch/microblaze/include/asm/highmem.h
+++ b/arch/microblaze/include/asm/highmem.h
@@ -76,19 +76,6 @@ static inline void *kmap_atomic(struct page *page)
76 return kmap_atomic_prot(page, kmap_prot); 76 return kmap_atomic_prot(page, kmap_prot);
77} 77}
78 78
79static inline struct page *kmap_atomic_to_page(void *ptr)
80{
81 unsigned long idx, vaddr = (unsigned long) ptr;
82 pte_t *pte;
83
84 if (vaddr < FIXADDR_START)
85 return virt_to_page(ptr);
86
87 idx = virt_to_fix(vaddr);
88 pte = kmap_pte - (idx - FIX_KMAP_BEGIN);
89 return pte_page(*pte);
90}
91
92#define flush_cache_kmaps() { flush_icache(); flush_dcache(); } 79#define flush_cache_kmaps() { flush_icache(); flush_dcache(); }
93 80
94#endif /* __KERNEL__ */ 81#endif /* __KERNEL__ */
diff --git a/arch/mips/include/asm/highmem.h b/arch/mips/include/asm/highmem.h
index 572e63ec2a38..01880b34a209 100644
--- a/arch/mips/include/asm/highmem.h
+++ b/arch/mips/include/asm/highmem.h
@@ -49,7 +49,6 @@ extern void kunmap(struct page *page);
49extern void *kmap_atomic(struct page *page); 49extern void *kmap_atomic(struct page *page);
50extern void __kunmap_atomic(void *kvaddr); 50extern void __kunmap_atomic(void *kvaddr);
51extern void *kmap_atomic_pfn(unsigned long pfn); 51extern void *kmap_atomic_pfn(unsigned long pfn);
52extern struct page *kmap_atomic_to_page(void *ptr);
53 52
54#define flush_cache_kmaps() flush_cache_all() 53#define flush_cache_kmaps() flush_cache_all()
55 54
diff --git a/arch/mips/include/uapi/asm/unistd.h b/arch/mips/include/uapi/asm/unistd.h
index cfabadb135d9..90f03a7da665 100644
--- a/arch/mips/include/uapi/asm/unistd.h
+++ b/arch/mips/include/uapi/asm/unistd.h
@@ -379,16 +379,17 @@
379#define __NR_execveat (__NR_Linux + 356) 379#define __NR_execveat (__NR_Linux + 356)
380#define __NR_userfaultfd (__NR_Linux + 357) 380#define __NR_userfaultfd (__NR_Linux + 357)
381#define __NR_membarrier (__NR_Linux + 358) 381#define __NR_membarrier (__NR_Linux + 358)
382#define __NR_mlock2 (__NR_Linux + 359)
382 383
383/* 384/*
384 * Offset of the last Linux o32 flavoured syscall 385 * Offset of the last Linux o32 flavoured syscall
385 */ 386 */
386#define __NR_Linux_syscalls 358 387#define __NR_Linux_syscalls 359
387 388
388#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ 389#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
389 390
390#define __NR_O32_Linux 4000 391#define __NR_O32_Linux 4000
391#define __NR_O32_Linux_syscalls 358 392#define __NR_O32_Linux_syscalls 359
392 393
393#if _MIPS_SIM == _MIPS_SIM_ABI64 394#if _MIPS_SIM == _MIPS_SIM_ABI64
394 395
@@ -715,16 +716,17 @@
715#define __NR_execveat (__NR_Linux + 316) 716#define __NR_execveat (__NR_Linux + 316)
716#define __NR_userfaultfd (__NR_Linux + 317) 717#define __NR_userfaultfd (__NR_Linux + 317)
717#define __NR_membarrier (__NR_Linux + 318) 718#define __NR_membarrier (__NR_Linux + 318)
719#define __NR_mlock2 (__NR_Linux + 319)
718 720
719/* 721/*
720 * Offset of the last Linux 64-bit flavoured syscall 722 * Offset of the last Linux 64-bit flavoured syscall
721 */ 723 */
722#define __NR_Linux_syscalls 318 724#define __NR_Linux_syscalls 319
723 725
724#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ 726#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
725 727
726#define __NR_64_Linux 5000 728#define __NR_64_Linux 5000
727#define __NR_64_Linux_syscalls 318 729#define __NR_64_Linux_syscalls 319
728 730
729#if _MIPS_SIM == _MIPS_SIM_NABI32 731#if _MIPS_SIM == _MIPS_SIM_NABI32
730 732
@@ -1055,15 +1057,16 @@
1055#define __NR_execveat (__NR_Linux + 320) 1057#define __NR_execveat (__NR_Linux + 320)
1056#define __NR_userfaultfd (__NR_Linux + 321) 1058#define __NR_userfaultfd (__NR_Linux + 321)
1057#define __NR_membarrier (__NR_Linux + 322) 1059#define __NR_membarrier (__NR_Linux + 322)
1060#define __NR_mlock2 (__NR_Linux + 323)
1058 1061
1059/* 1062/*
1060 * Offset of the last N32 flavoured syscall 1063 * Offset of the last N32 flavoured syscall
1061 */ 1064 */
1062#define __NR_Linux_syscalls 322 1065#define __NR_Linux_syscalls 323
1063 1066
1064#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ 1067#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
1065 1068
1066#define __NR_N32_Linux 6000 1069#define __NR_N32_Linux 6000
1067#define __NR_N32_Linux_syscalls 322 1070#define __NR_N32_Linux_syscalls 323
1068 1071
1069#endif /* _UAPI_ASM_UNISTD_H */ 1072#endif /* _UAPI_ASM_UNISTD_H */
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index 65a74e4f0f45..2d23c834ba96 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -594,3 +594,4 @@ EXPORT(sys_call_table)
594 PTR sys_execveat 594 PTR sys_execveat
595 PTR sys_userfaultfd 595 PTR sys_userfaultfd
596 PTR sys_membarrier 596 PTR sys_membarrier
597 PTR sys_mlock2
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S
index e732981cf99f..deac63315d0e 100644
--- a/arch/mips/kernel/scall64-64.S
+++ b/arch/mips/kernel/scall64-64.S
@@ -432,4 +432,5 @@ EXPORT(sys_call_table)
432 PTR sys_execveat 432 PTR sys_execveat
433 PTR sys_userfaultfd 433 PTR sys_userfaultfd
434 PTR sys_membarrier 434 PTR sys_membarrier
435 PTR sys_mlock2
435 .size sys_call_table,.-sys_call_table 436 .size sys_call_table,.-sys_call_table
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index c79484397584..5a69eb48d0a8 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -422,4 +422,5 @@ EXPORT(sysn32_call_table)
422 PTR compat_sys_execveat /* 6320 */ 422 PTR compat_sys_execveat /* 6320 */
423 PTR sys_userfaultfd 423 PTR sys_userfaultfd
424 PTR sys_membarrier 424 PTR sys_membarrier
425 PTR sys_mlock2
425 .size sysn32_call_table,.-sysn32_call_table 426 .size sysn32_call_table,.-sysn32_call_table
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 6369cfd390c6..e4b6d7c97822 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -577,4 +577,5 @@ EXPORT(sys32_call_table)
577 PTR compat_sys_execveat 577 PTR compat_sys_execveat
578 PTR sys_userfaultfd 578 PTR sys_userfaultfd
579 PTR sys_membarrier 579 PTR sys_membarrier
580 PTR sys_mlock2
580 .size sys32_call_table,.-sys32_call_table 581 .size sys32_call_table,.-sys32_call_table
diff --git a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c
index 11661cbc11a8..d7258a103439 100644
--- a/arch/mips/mm/highmem.c
+++ b/arch/mips/mm/highmem.c
@@ -118,19 +118,6 @@ void *kmap_atomic_pfn(unsigned long pfn)
118 return (void*) vaddr; 118 return (void*) vaddr;
119} 119}
120 120
121struct page *kmap_atomic_to_page(void *ptr)
122{
123 unsigned long idx, vaddr = (unsigned long)ptr;
124 pte_t *pte;
125
126 if (vaddr < FIXADDR_START)
127 return virt_to_page(ptr);
128
129 idx = virt_to_fix(vaddr);
130 pte = kmap_pte - (idx - FIX_KMAP_BEGIN);
131 return pte_page(*pte);
132}
133
134void __init kmap_init(void) 121void __init kmap_init(void)
135{ 122{
136 unsigned long kmap_vstart; 123 unsigned long kmap_vstart;
diff --git a/arch/parisc/include/asm/cacheflush.h b/arch/parisc/include/asm/cacheflush.h
index ec2df4bab302..845272ce9cc5 100644
--- a/arch/parisc/include/asm/cacheflush.h
+++ b/arch/parisc/include/asm/cacheflush.h
@@ -156,7 +156,6 @@ static inline void __kunmap_atomic(void *addr)
156 156
157#define kmap_atomic_prot(page, prot) kmap_atomic(page) 157#define kmap_atomic_prot(page, prot) kmap_atomic(page)
158#define kmap_atomic_pfn(pfn) kmap_atomic(pfn_to_page(pfn)) 158#define kmap_atomic_pfn(pfn) kmap_atomic(pfn_to_page(pfn))
159#define kmap_atomic_to_page(ptr) virt_to_page(ptr)
160 159
161#endif /* _PARISC_CACHEFLUSH_H */ 160#endif /* _PARISC_CACHEFLUSH_H */
162 161
diff --git a/arch/powerpc/include/asm/highmem.h b/arch/powerpc/include/asm/highmem.h
index caaf6e00630d..01c2c23b307e 100644
--- a/arch/powerpc/include/asm/highmem.h
+++ b/arch/powerpc/include/asm/highmem.h
@@ -84,19 +84,6 @@ static inline void *kmap_atomic(struct page *page)
84 return kmap_atomic_prot(page, kmap_prot); 84 return kmap_atomic_prot(page, kmap_prot);
85} 85}
86 86
87static inline struct page *kmap_atomic_to_page(void *ptr)
88{
89 unsigned long idx, vaddr = (unsigned long) ptr;
90 pte_t *pte;
91
92 if (vaddr < FIXADDR_START)
93 return virt_to_page(ptr);
94
95 idx = virt_to_fix(vaddr);
96 pte = kmap_pte - (idx - FIX_KMAP_BEGIN);
97 return pte_page(*pte);
98}
99
100 87
101#define flush_cache_kmaps() flush_cache_all() 88#define flush_cache_kmaps() flush_cache_all()
102 89
diff --git a/arch/sparc/include/uapi/asm/unistd.h b/arch/sparc/include/uapi/asm/unistd.h
index 6f35f4df17f2..efe9479f837b 100644
--- a/arch/sparc/include/uapi/asm/unistd.h
+++ b/arch/sparc/include/uapi/asm/unistd.h
@@ -416,8 +416,9 @@
416#define __NR_memfd_create 348 416#define __NR_memfd_create 348
417#define __NR_bpf 349 417#define __NR_bpf 349
418#define __NR_execveat 350 418#define __NR_execveat 350
419#define __NR_membarrier 351
419 420
420#define NR_syscalls 351 421#define NR_syscalls 352
421 422
422/* Bitmask values returned from kern_features system call. */ 423/* Bitmask values returned from kern_features system call. */
423#define KERN_FEATURE_MIXED_MODE_STACK 0x00000001 424#define KERN_FEATURE_MIXED_MODE_STACK 0x00000001
diff --git a/arch/sparc/kernel/systbls_32.S b/arch/sparc/kernel/systbls_32.S
index e31a9056a303..cc23b62b6e38 100644
--- a/arch/sparc/kernel/systbls_32.S
+++ b/arch/sparc/kernel/systbls_32.S
@@ -87,4 +87,4 @@ sys_call_table:
87/*335*/ .long sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev 87/*335*/ .long sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev
88/*340*/ .long sys_ni_syscall, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr 88/*340*/ .long sys_ni_syscall, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr
89/*345*/ .long sys_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf 89/*345*/ .long sys_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf
90/*350*/ .long sys_execveat 90/*350*/ .long sys_execveat, sys_membarrier
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S
index d72f76ae70eb..f229468a7479 100644
--- a/arch/sparc/kernel/systbls_64.S
+++ b/arch/sparc/kernel/systbls_64.S
@@ -88,7 +88,7 @@ sys_call_table32:
88 .word sys_syncfs, compat_sys_sendmmsg, sys_setns, compat_sys_process_vm_readv, compat_sys_process_vm_writev 88 .word sys_syncfs, compat_sys_sendmmsg, sys_setns, compat_sys_process_vm_readv, compat_sys_process_vm_writev
89/*340*/ .word sys_kern_features, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr 89/*340*/ .word sys_kern_features, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr
90 .word sys32_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf 90 .word sys32_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf
91/*350*/ .word sys32_execveat 91/*350*/ .word sys32_execveat, sys_membarrier
92 92
93#endif /* CONFIG_COMPAT */ 93#endif /* CONFIG_COMPAT */
94 94
@@ -168,4 +168,4 @@ sys_call_table:
168 .word sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev 168 .word sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev
169/*340*/ .word sys_kern_features, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr 169/*340*/ .word sys_kern_features, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr
170 .word sys_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf 170 .word sys_renameat2, sys_seccomp, sys_getrandom, sys_memfd_create, sys_bpf
171/*350*/ .word sys64_execveat 171/*350*/ .word sys64_execveat, sys_membarrier
diff --git a/arch/tile/include/asm/highmem.h b/arch/tile/include/asm/highmem.h
index fc8429a31c85..979579b38e57 100644
--- a/arch/tile/include/asm/highmem.h
+++ b/arch/tile/include/asm/highmem.h
@@ -63,7 +63,6 @@ void *kmap_atomic(struct page *page);
63void __kunmap_atomic(void *kvaddr); 63void __kunmap_atomic(void *kvaddr);
64void *kmap_atomic_pfn(unsigned long pfn); 64void *kmap_atomic_pfn(unsigned long pfn);
65void *kmap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot); 65void *kmap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot);
66struct page *kmap_atomic_to_page(void *ptr);
67void *kmap_atomic_prot(struct page *page, pgprot_t prot); 66void *kmap_atomic_prot(struct page *page, pgprot_t prot);
68void kmap_atomic_fix_kpte(struct page *page, int finished); 67void kmap_atomic_fix_kpte(struct page *page, int finished);
69 68
diff --git a/arch/tile/mm/highmem.c b/arch/tile/mm/highmem.c
index fcd545014e79..eca28551b22d 100644
--- a/arch/tile/mm/highmem.c
+++ b/arch/tile/mm/highmem.c
@@ -275,15 +275,3 @@ void *kmap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot)
275{ 275{
276 return kmap_atomic_prot(pfn_to_page(pfn), prot); 276 return kmap_atomic_prot(pfn_to_page(pfn), prot);
277} 277}
278
279struct page *kmap_atomic_to_page(void *ptr)
280{
281 pte_t *pte;
282 unsigned long vaddr = (unsigned long)ptr;
283
284 if (vaddr < FIXADDR_START)
285 return virt_to_page(ptr);
286
287 pte = kmap_get_pte(vaddr);
288 return pte_page(*pte);
289}
diff --git a/arch/x86/include/asm/highmem.h b/arch/x86/include/asm/highmem.h
index 04e9d023168f..1c0b43724ce3 100644
--- a/arch/x86/include/asm/highmem.h
+++ b/arch/x86/include/asm/highmem.h
@@ -68,7 +68,6 @@ void *kmap_atomic(struct page *page);
68void __kunmap_atomic(void *kvaddr); 68void __kunmap_atomic(void *kvaddr);
69void *kmap_atomic_pfn(unsigned long pfn); 69void *kmap_atomic_pfn(unsigned long pfn);
70void *kmap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot); 70void *kmap_atomic_prot_pfn(unsigned long pfn, pgprot_t prot);
71struct page *kmap_atomic_to_page(void *ptr);
72 71
73#define flush_cache_kmaps() do { } while (0) 72#define flush_cache_kmaps() do { } while (0)
74 73
diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c
index eecb207a2037..a6d739258137 100644
--- a/arch/x86/mm/highmem_32.c
+++ b/arch/x86/mm/highmem_32.c
@@ -104,20 +104,6 @@ void __kunmap_atomic(void *kvaddr)
104} 104}
105EXPORT_SYMBOL(__kunmap_atomic); 105EXPORT_SYMBOL(__kunmap_atomic);
106 106
107struct page *kmap_atomic_to_page(void *ptr)
108{
109 unsigned long idx, vaddr = (unsigned long)ptr;
110 pte_t *pte;
111
112 if (vaddr < FIXADDR_START)
113 return virt_to_page(ptr);
114
115 idx = virt_to_fix(vaddr);
116 pte = kmap_pte - (idx - FIX_KMAP_BEGIN);
117 return pte_page(*pte);
118}
119EXPORT_SYMBOL(kmap_atomic_to_page);
120
121void __init set_highmem_pages_init(void) 107void __init set_highmem_pages_init(void)
122{ 108{
123 struct zone *zone; 109 struct zone *zone;
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 22d207e211e7..22d8b78d537e 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -261,7 +261,7 @@ static void vblank_disable_and_save(struct drm_device *dev, unsigned int pipe)
261 * available. In that case we can't account for this and just 261 * available. In that case we can't account for this and just
262 * hope for the best. 262 * hope for the best.
263 */ 263 */
264 if (vblrc && (abs64(diff_ns) > 1000000)) 264 if (vblrc && (abs(diff_ns) > 1000000))
265 store_vblank(dev, pipe, 1, &tvblank); 265 store_vblank(dev, pipe, 1, &tvblank);
266 266
267 spin_unlock_irqrestore(&dev->vblank_time_lock, irqflags); 267 spin_unlock_irqrestore(&dev->vblank_time_lock, irqflags);
@@ -1772,7 +1772,7 @@ bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe)
1772 * e.g., due to spurious vblank interrupts. We need to 1772 * e.g., due to spurious vblank interrupts. We need to
1773 * ignore those for accounting. 1773 * ignore those for accounting.
1774 */ 1774 */
1775 if (abs64(diff_ns) > DRM_REDUNDANT_VBLIRQ_THRESH_NS) 1775 if (abs(diff_ns) > DRM_REDUNDANT_VBLIRQ_THRESH_NS)
1776 store_vblank(dev, pipe, 1, &tvblank); 1776 store_vblank(dev, pipe, 1, &tvblank);
1777 else 1777 else
1778 DRM_DEBUG("crtc %u: Redundant vblirq ignored. diff_ns = %d\n", 1778 DRM_DEBUG("crtc %u: Redundant vblirq ignored. diff_ns = %d\n",
diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index da1715ebdd71..3eff7cf75d25 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -555,11 +555,11 @@ static int tegra_sor_compute_params(struct tegra_sor *sor,
555 error = div_s64(active_sym - approx, tu_size); 555 error = div_s64(active_sym - approx, tu_size);
556 error *= params->num_clocks; 556 error *= params->num_clocks;
557 557
558 if (error <= 0 && abs64(error) < params->error) { 558 if (error <= 0 && abs(error) < params->error) {
559 params->active_count = div_u64(active_count, f); 559 params->active_count = div_u64(active_count, f);
560 params->active_polarity = active_polarity; 560 params->active_polarity = active_polarity;
561 params->active_frac = active_frac; 561 params->active_frac = active_frac;
562 params->error = abs64(error); 562 params->error = abs(error);
563 params->tu_size = tu_size; 563 params->tu_size = tu_size;
564 564
565 if (error == 0) 565 if (error == 0)
diff --git a/drivers/input/joystick/walkera0701.c b/drivers/input/joystick/walkera0701.c
index d88f5dd3c9d9..9c07fe911075 100644
--- a/drivers/input/joystick/walkera0701.c
+++ b/drivers/input/joystick/walkera0701.c
@@ -150,7 +150,7 @@ static void walkera0701_irq_handler(void *handler_data)
150 if (w->counter == 24) { /* full frame */ 150 if (w->counter == 24) { /* full frame */
151 walkera0701_parse_frame(w); 151 walkera0701_parse_frame(w);
152 w->counter = NO_SYNC; 152 w->counter = NO_SYNC;
153 if (abs64(pulse_time - SYNC_PULSE) < RESERVE) /* new frame sync */ 153 if (abs(pulse_time - SYNC_PULSE) < RESERVE) /* new frame sync */
154 w->counter = 0; 154 w->counter = 0;
155 } else { 155 } else {
156 if ((pulse_time > (ANALOG_MIN_PULSE - RESERVE) 156 if ((pulse_time > (ANALOG_MIN_PULSE - RESERVE)
@@ -161,7 +161,7 @@ static void walkera0701_irq_handler(void *handler_data)
161 } else 161 } else
162 w->counter = NO_SYNC; 162 w->counter = NO_SYNC;
163 } 163 }
164 } else if (abs64(pulse_time - SYNC_PULSE - BIN0_PULSE) < 164 } else if (abs(pulse_time - SYNC_PULSE - BIN0_PULSE) <
165 RESERVE + BIN1_PULSE - BIN0_PULSE) /* frame sync .. */ 165 RESERVE + BIN1_PULSE - BIN0_PULSE) /* frame sync .. */
166 w->counter = 0; 166 w->counter = 0;
167 167
diff --git a/drivers/media/i2c/ov9650.c b/drivers/media/i2c/ov9650.c
index e691bba1945b..1ee6a5527c38 100644
--- a/drivers/media/i2c/ov9650.c
+++ b/drivers/media/i2c/ov9650.c
@@ -1133,7 +1133,7 @@ static int __ov965x_set_frame_interval(struct ov965x *ov965x,
1133 if (mbus_fmt->width != iv->size.width || 1133 if (mbus_fmt->width != iv->size.width ||
1134 mbus_fmt->height != iv->size.height) 1134 mbus_fmt->height != iv->size.height)
1135 continue; 1135 continue;
1136 err = abs64((u64)(iv->interval.numerator * 10000) / 1136 err = abs((u64)(iv->interval.numerator * 10000) /
1137 iv->interval.denominator - req_int); 1137 iv->interval.denominator - req_int);
1138 if (err < min_err) { 1138 if (err < min_err) {
1139 fiv = iv; 1139 fiv = iv;
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index ee46f4647fbc..c00a7daaa4bc 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -787,7 +787,7 @@ static void mac80211_hwsim_set_tsf(struct ieee80211_hw *hw,
787 struct mac80211_hwsim_data *data = hw->priv; 787 struct mac80211_hwsim_data *data = hw->priv;
788 u64 now = mac80211_hwsim_get_tsf(hw, vif); 788 u64 now = mac80211_hwsim_get_tsf(hw, vif);
789 u32 bcn_int = data->beacon_int; 789 u32 bcn_int = data->beacon_int;
790 u64 delta = abs64(tsf - now); 790 u64 delta = abs(tsf - now);
791 791
792 /* adjust after beaconing with new timestamp at old TBTT */ 792 /* adjust after beaconing with new timestamp at old TBTT */
793 if (tsf > now) { 793 if (tsf > now) {
diff --git a/drivers/scsi/cxgbi/cxgb3i/Kbuild b/drivers/scsi/cxgbi/cxgb3i/Kbuild
index 6f095e28a974..961a12f6d318 100644
--- a/drivers/scsi/cxgbi/cxgb3i/Kbuild
+++ b/drivers/scsi/cxgbi/cxgb3i/Kbuild
@@ -1,3 +1,3 @@
1EXTRA_CFLAGS += -I$(srctree)/drivers/net/ethernet/chelsio/cxgb3 1ccflags-y += -I$(srctree)/drivers/net/ethernet/chelsio/cxgb3
2 2
3obj-$(CONFIG_SCSI_CXGB3_ISCSI) += cxgb3i.o 3obj-$(CONFIG_SCSI_CXGB3_ISCSI) += cxgb3i.o
diff --git a/drivers/scsi/cxgbi/cxgb4i/Kbuild b/drivers/scsi/cxgbi/cxgb4i/Kbuild
index 8290cdaa4652..37458643749b 100644
--- a/drivers/scsi/cxgbi/cxgb4i/Kbuild
+++ b/drivers/scsi/cxgbi/cxgb4i/Kbuild
@@ -1,3 +1,3 @@
1EXTRA_CFLAGS += -I$(srctree)/drivers/net/ethernet/chelsio/cxgb4 1ccflags-y += -I$(srctree)/drivers/net/ethernet/chelsio/cxgb4
2 2
3obj-$(CONFIG_SCSI_CXGB4_ISCSI) += cxgb4i.o 3obj-$(CONFIG_SCSI_CXGB4_ISCSI) += cxgb4i.o
diff --git a/drivers/thermal/power_allocator.c b/drivers/thermal/power_allocator.c
index e570ff084add..f0fbea386869 100644
--- a/drivers/thermal/power_allocator.c
+++ b/drivers/thermal/power_allocator.c
@@ -228,7 +228,7 @@ static u32 pid_controller(struct thermal_zone_device *tz,
228 if (err < int_to_frac(tz->tzp->integral_cutoff)) { 228 if (err < int_to_frac(tz->tzp->integral_cutoff)) {
229 s64 i_next = i + mul_frac(tz->tzp->k_i, err); 229 s64 i_next = i + mul_frac(tz->tzp->k_i, err);
230 230
231 if (abs64(i_next) < max_power_frac) { 231 if (abs(i_next) < max_power_frac) {
232 i = i_next; 232 i = i_next;
233 params->err_integral += err; 233 params->err_integral += err;
234 } 234 }
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index c63d82c91f10..48c92bf78bd0 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -589,7 +589,7 @@ static int ehci_run (struct usb_hcd *hcd)
589 * streaming mappings for I/O buffers, like pci_map_single(), 589 * streaming mappings for I/O buffers, like pci_map_single(),
590 * can return segments above 4GB, if the device allows. 590 * can return segments above 4GB, if the device allows.
591 * 591 *
592 * NOTE: the dma mask is visible through dma_supported(), so 592 * NOTE: the dma mask is visible through dev->dma_mask, so
593 * drivers can pass this info along ... like NETIF_F_HIGHDMA, 593 * drivers can pass this info along ... like NETIF_F_HIGHDMA,
594 * Scsi_Host.highmem_io, and so forth. It's readonly to all 594 * Scsi_Host.highmem_io, and so forth. It's readonly to all
595 * host side drivers though. 595 * host side drivers though.
diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c
index 787f4e3d16d8..2341af4f3490 100644
--- a/drivers/usb/host/fotg210-hcd.c
+++ b/drivers/usb/host/fotg210-hcd.c
@@ -5063,7 +5063,7 @@ static int fotg210_run(struct usb_hcd *hcd)
5063 * streaming mappings for I/O buffers, like pci_map_single(), 5063 * streaming mappings for I/O buffers, like pci_map_single(),
5064 * can return segments above 4GB, if the device allows. 5064 * can return segments above 4GB, if the device allows.
5065 * 5065 *
5066 * NOTE: the dma mask is visible through dma_supported(), so 5066 * NOTE: the dma mask is visible through dev->dma_mask, so
5067 * drivers can pass this info along ... like NETIF_F_HIGHDMA, 5067 * drivers can pass this info along ... like NETIF_F_HIGHDMA,
5068 * Scsi_Host.highmem_io, and so forth. It's readonly to all 5068 * Scsi_Host.highmem_io, and so forth. It's readonly to all
5069 * host side drivers though. 5069 * host side drivers though.
diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c
index fe3bd1cb8b6b..1f139d82cee0 100644
--- a/drivers/usb/host/oxu210hp-hcd.c
+++ b/drivers/usb/host/oxu210hp-hcd.c
@@ -2721,7 +2721,7 @@ static int oxu_run(struct usb_hcd *hcd)
2721 * streaming mappings for I/O buffers, like pci_map_single(), 2721 * streaming mappings for I/O buffers, like pci_map_single(),
2722 * can return segments above 4GB, if the device allows. 2722 * can return segments above 4GB, if the device allows.
2723 * 2723 *
2724 * NOTE: the dma mask is visible through dma_supported(), so 2724 * NOTE: the dma mask is visible through dev->dma_mask, so
2725 * drivers can pass this info along ... like NETIF_F_HIGHDMA, 2725 * drivers can pass this info along ... like NETIF_F_HIGHDMA,
2726 * Scsi_Host.highmem_io, and so forth. It's readonly to all 2726 * Scsi_Host.highmem_io, and so forth. It's readonly to all
2727 * host side drivers though. 2727 * host side drivers though.
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index b1dc51888048..699941e90667 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -1368,9 +1368,6 @@ v9fs_vfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rde
1368 dir->i_ino, dentry, mode, 1368 dir->i_ino, dentry, mode,
1369 MAJOR(rdev), MINOR(rdev)); 1369 MAJOR(rdev), MINOR(rdev));
1370 1370
1371 if (!new_valid_dev(rdev))
1372 return -EINVAL;
1373
1374 /* build extension */ 1371 /* build extension */
1375 if (S_ISBLK(mode)) 1372 if (S_ISBLK(mode))
1376 sprintf(name, "b %u %u", MAJOR(rdev), MINOR(rdev)); 1373 sprintf(name, "b %u %u", MAJOR(rdev), MINOR(rdev));
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index e8aa57dc8d6d..cb899af1babc 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -829,9 +829,6 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,
829 dir->i_ino, dentry, omode, 829 dir->i_ino, dentry, omode,
830 MAJOR(rdev), MINOR(rdev)); 830 MAJOR(rdev), MINOR(rdev));
831 831
832 if (!new_valid_dev(rdev))
833 return -EINVAL;
834
835 v9ses = v9fs_inode2v9ses(dir); 832 v9ses = v9fs_inode2v9ses(dir);
836 dir_dentry = dentry->d_parent; 833 dir_dentry = dentry->d_parent;
837 dfid = v9fs_fid_lookup(dir_dentry); 834 dfid = v9fs_fid_lookup(dir_dentry);
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
index d2b079afed0e..50d15b7b0ca9 100644
--- a/fs/binfmt_elf_fdpic.c
+++ b/fs/binfmt_elf_fdpic.c
@@ -103,19 +103,36 @@ static void __exit exit_elf_fdpic_binfmt(void)
103core_initcall(init_elf_fdpic_binfmt); 103core_initcall(init_elf_fdpic_binfmt);
104module_exit(exit_elf_fdpic_binfmt); 104module_exit(exit_elf_fdpic_binfmt);
105 105
106static int is_elf_fdpic(struct elfhdr *hdr, struct file *file) 106static int is_elf(struct elfhdr *hdr, struct file *file)
107{ 107{
108 if (memcmp(hdr->e_ident, ELFMAG, SELFMAG) != 0) 108 if (memcmp(hdr->e_ident, ELFMAG, SELFMAG) != 0)
109 return 0; 109 return 0;
110 if (hdr->e_type != ET_EXEC && hdr->e_type != ET_DYN) 110 if (hdr->e_type != ET_EXEC && hdr->e_type != ET_DYN)
111 return 0; 111 return 0;
112 if (!elf_check_arch(hdr) || !elf_check_fdpic(hdr)) 112 if (!elf_check_arch(hdr))
113 return 0; 113 return 0;
114 if (!file->f_op->mmap) 114 if (!file->f_op->mmap)
115 return 0; 115 return 0;
116 return 1; 116 return 1;
117} 117}
118 118
119#ifndef elf_check_fdpic
120#define elf_check_fdpic(x) 0
121#endif
122
123#ifndef elf_check_const_displacement
124#define elf_check_const_displacement(x) 0
125#endif
126
127static int is_constdisp(struct elfhdr *hdr)
128{
129 if (!elf_check_fdpic(hdr))
130 return 1;
131 if (elf_check_const_displacement(hdr))
132 return 1;
133 return 0;
134}
135
119/*****************************************************************************/ 136/*****************************************************************************/
120/* 137/*
121 * read the program headers table into memory 138 * read the program headers table into memory
@@ -191,8 +208,18 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm)
191 208
192 /* check that this is a binary we know how to deal with */ 209 /* check that this is a binary we know how to deal with */
193 retval = -ENOEXEC; 210 retval = -ENOEXEC;
194 if (!is_elf_fdpic(&exec_params.hdr, bprm->file)) 211 if (!is_elf(&exec_params.hdr, bprm->file))
195 goto error; 212 goto error;
213 if (!elf_check_fdpic(&exec_params.hdr)) {
214#ifdef CONFIG_MMU
215 /* binfmt_elf handles non-fdpic elf except on nommu */
216 goto error;
217#else
218 /* nommu can only load ET_DYN (PIE) ELF */
219 if (exec_params.hdr.e_type != ET_DYN)
220 goto error;
221#endif
222 }
196 223
197 /* read the program header table */ 224 /* read the program header table */
198 retval = elf_fdpic_fetch_phdrs(&exec_params, bprm->file); 225 retval = elf_fdpic_fetch_phdrs(&exec_params, bprm->file);
@@ -269,13 +296,13 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm)
269 296
270 } 297 }
271 298
272 if (elf_check_const_displacement(&exec_params.hdr)) 299 if (is_constdisp(&exec_params.hdr))
273 exec_params.flags |= ELF_FDPIC_FLAG_CONSTDISP; 300 exec_params.flags |= ELF_FDPIC_FLAG_CONSTDISP;
274 301
275 /* perform insanity checks on the interpreter */ 302 /* perform insanity checks on the interpreter */
276 if (interpreter_name) { 303 if (interpreter_name) {
277 retval = -ELIBBAD; 304 retval = -ELIBBAD;
278 if (!is_elf_fdpic(&interp_params.hdr, interpreter)) 305 if (!is_elf(&interp_params.hdr, interpreter))
279 goto error; 306 goto error;
280 307
281 interp_params.flags = ELF_FDPIC_FLAG_PRESENT; 308 interp_params.flags = ELF_FDPIC_FLAG_PRESENT;
@@ -306,9 +333,9 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm)
306 333
307 retval = -ENOEXEC; 334 retval = -ENOEXEC;
308 if (stack_size == 0) 335 if (stack_size == 0)
309 goto error; 336 stack_size = 131072UL; /* same as exec.c's default commit */
310 337
311 if (elf_check_const_displacement(&interp_params.hdr)) 338 if (is_constdisp(&interp_params.hdr))
312 interp_params.flags |= ELF_FDPIC_FLAG_CONSTDISP; 339 interp_params.flags |= ELF_FDPIC_FLAG_CONSTDISP;
313 340
314 /* flush all traces of the currently running executable */ 341 /* flush all traces of the currently running executable */
@@ -319,7 +346,10 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm)
319 /* there's now no turning back... the old userspace image is dead, 346 /* there's now no turning back... the old userspace image is dead,
320 * defunct, deceased, etc. 347 * defunct, deceased, etc.
321 */ 348 */
322 set_personality(PER_LINUX_FDPIC); 349 if (elf_check_fdpic(&exec_params.hdr))
350 set_personality(PER_LINUX_FDPIC);
351 else
352 set_personality(PER_LINUX);
323 if (elf_read_implies_exec(&exec_params.hdr, executable_stack)) 353 if (elf_read_implies_exec(&exec_params.hdr, executable_stack))
324 current->personality |= READ_IMPLIES_EXEC; 354 current->personality |= READ_IMPLIES_EXEC;
325 355
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 4439fbb4ff45..0e4f2bfcc37d 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -6360,9 +6360,6 @@ static int btrfs_mknod(struct inode *dir, struct dentry *dentry,
6360 u64 objectid; 6360 u64 objectid;
6361 u64 index = 0; 6361 u64 index = 0;
6362 6362
6363 if (!new_valid_dev(rdev))
6364 return -EINVAL;
6365
6366 /* 6363 /*
6367 * 2 for inode item and ref 6364 * 2 for inode item and ref
6368 * 2 for dir items 6365 * 2 for dir items
diff --git a/fs/exofs/namei.c b/fs/exofs/namei.c
index 09a6bb1ad63c..994e078da4bb 100644
--- a/fs/exofs/namei.c
+++ b/fs/exofs/namei.c
@@ -80,9 +80,6 @@ static int exofs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode,
80 struct inode *inode; 80 struct inode *inode;
81 int err; 81 int err;
82 82
83 if (!new_valid_dev(rdev))
84 return -EINVAL;
85
86 inode = exofs_new_inode(dir, mode); 83 inode = exofs_new_inode(dir, mode);
87 err = PTR_ERR(inode); 84 err = PTR_ERR(inode);
88 if (!IS_ERR(inode)) { 85 if (!IS_ERR(inode)) {
diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c
index b4841e3066a5..3267a80dbbe2 100644
--- a/fs/ext2/namei.c
+++ b/fs/ext2/namei.c
@@ -143,9 +143,6 @@ static int ext2_mknod (struct inode * dir, struct dentry *dentry, umode_t mode,
143 struct inode * inode; 143 struct inode * inode;
144 int err; 144 int err;
145 145
146 if (!new_valid_dev(rdev))
147 return -EINVAL;
148
149 err = dquot_initialize(dir); 146 err = dquot_initialize(dir);
150 if (err) 147 if (err)
151 return err; 148 return err;
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index b4b3c1f91814..61eaf74dca37 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -3333,8 +3333,8 @@ ext4_mb_check_group_pa(ext4_fsblk_t goal_block,
3333 atomic_inc(&pa->pa_count); 3333 atomic_inc(&pa->pa_count);
3334 return pa; 3334 return pa;
3335 } 3335 }
3336 cur_distance = abs64(goal_block - cpa->pa_pstart); 3336 cur_distance = abs(goal_block - cpa->pa_pstart);
3337 new_distance = abs64(goal_block - pa->pa_pstart); 3337 new_distance = abs(goal_block - pa->pa_pstart);
3338 3338
3339 if (cur_distance <= new_distance) 3339 if (cur_distance <= new_distance)
3340 return cpa; 3340 return cpa;
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index e48b80c49090..2c32110f9fc0 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -481,9 +481,6 @@ static int f2fs_mknod(struct inode *dir, struct dentry *dentry,
481 struct inode *inode; 481 struct inode *inode;
482 int err = 0; 482 int err = 0;
483 483
484 if (!new_valid_dev(rdev))
485 return -EINVAL;
486
487 f2fs_balance_fs(sbi); 484 f2fs_balance_fs(sbi);
488 485
489 inode = f2fs_new_inode(dir, mode); 486 inode = f2fs_new_inode(dir, mode);
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 206a68b1db1a..023f6a1f23cd 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -1981,9 +1981,9 @@ static noinline void block_dump___mark_inode_dirty(struct inode *inode)
1981 * page->mapping->host, so the page-dirtying time is recorded in the internal 1981 * page->mapping->host, so the page-dirtying time is recorded in the internal
1982 * blockdev inode. 1982 * blockdev inode.
1983 */ 1983 */
1984#define I_DIRTY_INODE (I_DIRTY_SYNC | I_DIRTY_DATASYNC)
1985void __mark_inode_dirty(struct inode *inode, int flags) 1984void __mark_inode_dirty(struct inode *inode, int flags)
1986{ 1985{
1986#define I_DIRTY_INODE (I_DIRTY_SYNC | I_DIRTY_DATASYNC)
1987 struct super_block *sb = inode->i_sb; 1987 struct super_block *sb = inode->i_sb;
1988 int dirtytime; 1988 int dirtytime;
1989 1989
@@ -2093,6 +2093,7 @@ void __mark_inode_dirty(struct inode *inode, int flags)
2093out_unlock_inode: 2093out_unlock_inode:
2094 spin_unlock(&inode->i_lock); 2094 spin_unlock(&inode->i_lock);
2095 2095
2096#undef I_DIRTY_INODE
2096} 2097}
2097EXPORT_SYMBOL(__mark_inode_dirty); 2098EXPORT_SYMBOL(__mark_inode_dirty);
2098 2099
diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c
index 284c1542783e..8b907c5cc913 100644
--- a/fs/gfs2/lock_dlm.c
+++ b/fs/gfs2/lock_dlm.c
@@ -50,7 +50,7 @@ static inline void gfs2_update_stats(struct gfs2_lkstats *s, unsigned index,
50 s64 delta = sample - s->stats[index]; 50 s64 delta = sample - s->stats[index];
51 s->stats[index] += (delta >> 3); 51 s->stats[index] += (delta >> 3);
52 index++; 52 index++;
53 s->stats[index] += ((abs64(delta) - s->stats[index]) >> 2); 53 s->stats[index] += ((abs(delta) - s->stats[index]) >> 2);
54} 54}
55 55
56/** 56/**
diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c
index 9e92c9c2d319..ae4d5a1fa4c9 100644
--- a/fs/hpfs/namei.c
+++ b/fs/hpfs/namei.c
@@ -227,8 +227,6 @@ static int hpfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, de
227 int err; 227 int err;
228 if ((err = hpfs_chk_name(name, &len))) return err==-ENOENT ? -EINVAL : err; 228 if ((err = hpfs_chk_name(name, &len))) return err==-ENOENT ? -EINVAL : err;
229 if (hpfs_sb(dir->i_sb)->sb_eas < 2) return -EPERM; 229 if (hpfs_sb(dir->i_sb)->sb_eas < 2) return -EPERM;
230 if (!new_valid_dev(rdev))
231 return -EINVAL;
232 hpfs_lock(dir->i_sb); 230 hpfs_lock(dir->i_sb);
233 err = -ENOSPC; 231 err = -ENOSPC;
234 fnode = hpfs_alloc_fnode(dir->i_sb, hpfs_i(dir)->i_dno, &fno, &bh); 232 fnode = hpfs_alloc_fnode(dir->i_sb, hpfs_i(dir)->i_dno, &fno, &bh);
diff --git a/fs/inode.c b/fs/inode.c
index 78a17b8859e1..1be5f9003eb3 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1597,6 +1597,7 @@ static int update_time(struct inode *inode, struct timespec *time, int flags)
1597/** 1597/**
1598 * touch_atime - update the access time 1598 * touch_atime - update the access time
1599 * @path: the &struct path to update 1599 * @path: the &struct path to update
1600 * @inode: inode to update
1600 * 1601 *
1601 * Update the accessed time on an inode and mark it for writeback. 1602 * Update the accessed time on an inode and mark it for writeback.
1602 * This function automatically handles read only file systems and media, 1603 * This function automatically handles read only file systems and media,
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index 35976bdccafc..9d7551f5c32a 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -1372,9 +1372,6 @@ static int jfs_mknod(struct inode *dir, struct dentry *dentry,
1372 tid_t tid; 1372 tid_t tid;
1373 struct tblock *tblk; 1373 struct tblock *tblk;
1374 1374
1375 if (!new_valid_dev(rdev))
1376 return -EINVAL;
1377
1378 jfs_info("jfs_mknod: %pd", dentry); 1375 jfs_info("jfs_mknod: %pd", dentry);
1379 1376
1380 rc = dquot_initialize(dir); 1377 rc = dquot_initialize(dir);
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index 4cd9798f4948..8f9176caf098 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -496,9 +496,6 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
496 496
497 jfs_info("In jfs_read_super: s_flags=0x%lx", sb->s_flags); 497 jfs_info("In jfs_read_super: s_flags=0x%lx", sb->s_flags);
498 498
499 if (!new_valid_dev(sb->s_bdev->bd_dev))
500 return -EOVERFLOW;
501
502 sbi = kzalloc(sizeof(struct jfs_sb_info), GFP_KERNEL); 499 sbi = kzalloc(sizeof(struct jfs_sb_info), GFP_KERNEL);
503 if (!sbi) 500 if (!sbi)
504 return -ENOMEM; 501 return -ENOMEM;
diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c
index 356816e7bc90..f0e3e9e747dd 100644
--- a/fs/ncpfs/dir.c
+++ b/fs/ncpfs/dir.c
@@ -1165,8 +1165,6 @@ out:
1165static int ncp_mknod(struct inode * dir, struct dentry *dentry, 1165static int ncp_mknod(struct inode * dir, struct dentry *dentry,
1166 umode_t mode, dev_t rdev) 1166 umode_t mode, dev_t rdev)
1167{ 1167{
1168 if (!new_valid_dev(rdev))
1169 return -EINVAL;
1170 if (ncp_is_nfs_extras(NCP_SERVER(dir), NCP_FINFO(dir)->volNumber)) { 1168 if (ncp_is_nfs_extras(NCP_SERVER(dir), NCP_FINFO(dir)->volNumber)) {
1171 ncp_dbg(1, "mode = 0%ho\n", mode); 1169 ncp_dbg(1, "mode = 0%ho\n", mode);
1172 return ncp_create_new(dir, dentry, mode, rdev, 0); 1170 return ncp_create_new(dir, dentry, mode, rdev, 0);
diff --git a/fs/nilfs2/namei.c b/fs/nilfs2/namei.c
index 37dd6b05b1b5..c9a1a491aa91 100644
--- a/fs/nilfs2/namei.c
+++ b/fs/nilfs2/namei.c
@@ -120,9 +120,6 @@ nilfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev)
120 struct nilfs_transaction_info ti; 120 struct nilfs_transaction_info ti;
121 int err; 121 int err;
122 122
123 if (!new_valid_dev(rdev))
124 return -EINVAL;
125
126 err = nilfs_transaction_begin(dir->i_sb, &ti, 1); 123 err = nilfs_transaction_begin(dir->i_sb, &ti, 1);
127 if (err) 124 if (err)
128 return err; 125 return err;
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
index 5f1c9c29eb8c..47f96988fdd4 100644
--- a/fs/reiserfs/namei.c
+++ b/fs/reiserfs/namei.c
@@ -712,9 +712,6 @@ static int reiserfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode
712 2 * (REISERFS_QUOTA_INIT_BLOCKS(dir->i_sb) + 712 2 * (REISERFS_QUOTA_INIT_BLOCKS(dir->i_sb) +
713 REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb)); 713 REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb));
714 714
715 if (!new_valid_dev(rdev))
716 return -EINVAL;
717
718 retval = dquot_initialize(dir); 715 retval = dquot_initialize(dir);
719 if (retval) 716 if (retval)
720 return retval; 717 return retval;
diff --git a/fs/stat.c b/fs/stat.c
index cccc1aab9a8b..d4a61d8dc021 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -367,8 +367,6 @@ static long cp_new_stat64(struct kstat *stat, struct stat64 __user *statbuf)
367 INIT_STRUCT_STAT64_PADDING(tmp); 367 INIT_STRUCT_STAT64_PADDING(tmp);
368#ifdef CONFIG_MIPS 368#ifdef CONFIG_MIPS
369 /* mips has weird padding, so we don't get 64 bits there */ 369 /* mips has weird padding, so we don't get 64 bits there */
370 if (!new_valid_dev(stat->dev) || !new_valid_dev(stat->rdev))
371 return -EOVERFLOW;
372 tmp.st_dev = new_encode_dev(stat->dev); 370 tmp.st_dev = new_encode_dev(stat->dev);
373 tmp.st_rdev = new_encode_dev(stat->rdev); 371 tmp.st_rdev = new_encode_dev(stat->rdev);
374#else 372#else
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 6aefcd0031a6..bb3f3297062a 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -78,7 +78,6 @@ static inline void __kunmap_atomic(void *addr)
78} 78}
79 79
80#define kmap_atomic_pfn(pfn) kmap_atomic(pfn_to_page(pfn)) 80#define kmap_atomic_pfn(pfn) kmap_atomic(pfn_to_page(pfn))
81#define kmap_atomic_to_page(ptr) virt_to_page(ptr)
82 81
83#define kmap_flush_unused() do {} while(0) 82#define kmap_flush_unused() do {} while(0)
84#endif 83#endif
diff --git a/include/linux/kdev_t.h b/include/linux/kdev_t.h
index c838abe3ee0a..052c7b32cc91 100644
--- a/include/linux/kdev_t.h
+++ b/include/linux/kdev_t.h
@@ -20,7 +20,7 @@
20 }) 20 })
21 21
22/* acceptable for old filesystems */ 22/* acceptable for old filesystems */
23static inline int old_valid_dev(dev_t dev) 23static inline bool old_valid_dev(dev_t dev)
24{ 24{
25 return MAJOR(dev) < 256 && MINOR(dev) < 256; 25 return MAJOR(dev) < 256 && MINOR(dev) < 256;
26} 26}
@@ -35,7 +35,7 @@ static inline dev_t old_decode_dev(u16 val)
35 return MKDEV((val >> 8) & 255, val & 255); 35 return MKDEV((val >> 8) & 255, val & 255);
36} 36}
37 37
38static inline int new_valid_dev(dev_t dev) 38static inline bool new_valid_dev(dev_t dev)
39{ 39{
40 return 1; 40 return 1;
41} 41}
@@ -54,11 +54,6 @@ static inline dev_t new_decode_dev(u32 dev)
54 return MKDEV(major, minor); 54 return MKDEV(major, minor);
55} 55}
56 56
57static inline int huge_valid_dev(dev_t dev)
58{
59 return 1;
60}
61
62static inline u64 huge_encode_dev(dev_t dev) 57static inline u64 huge_encode_dev(dev_t dev)
63{ 58{
64 return new_encode_dev(dev); 59 return new_encode_dev(dev);
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 2c13f747ac2e..350dfb08aee3 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -200,28 +200,28 @@ extern int _cond_resched(void);
200 200
201#define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0) 201#define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
202 202
203/* 203/**
204 * abs() handles unsigned and signed longs, ints, shorts and chars. For all 204 * abs - return absolute value of an argument
205 * input types abs() returns a signed long. 205 * @x: the value. If it is unsigned type, it is converted to signed type first
206 * abs() should not be used for 64-bit types (s64, u64, long long) - use abs64() 206 * (s64, long or int depending on its size).
207 * for those. 207 *
208 * Return: an absolute value of x. If x is 64-bit, macro's return type is s64,
209 * otherwise it is signed long.
208 */ 210 */
209#define abs(x) ({ \ 211#define abs(x) __builtin_choose_expr(sizeof(x) == sizeof(s64), ({ \
210 long ret; \ 212 s64 __x = (x); \
211 if (sizeof(x) == sizeof(long)) { \ 213 (__x < 0) ? -__x : __x; \
212 long __x = (x); \ 214 }), ({ \
213 ret = (__x < 0) ? -__x : __x; \ 215 long ret; \
214 } else { \ 216 if (sizeof(x) == sizeof(long)) { \
215 int __x = (x); \ 217 long __x = (x); \
216 ret = (__x < 0) ? -__x : __x; \ 218 ret = (__x < 0) ? -__x : __x; \
217 } \ 219 } else { \
218 ret; \ 220 int __x = (x); \
219 }) 221 ret = (__x < 0) ? -__x : __x; \
220 222 } \
221#define abs64(x) ({ \ 223 ret; \
222 s64 __x = (x); \ 224 }))
223 (__x < 0) ? -__x : __x; \
224 })
225 225
226/** 226/**
227 * reciprocal_scale - "scale" a value into range [0, ep_ro) 227 * reciprocal_scale - "scale" a value into range [0, ep_ro)
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 0d8fe8b8f727..1347882d131e 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -217,7 +217,7 @@ static void clocksource_watchdog(unsigned long data)
217 continue; 217 continue;
218 218
219 /* Check the deviation from the watchdog clocksource. */ 219 /* Check the deviation from the watchdog clocksource. */
220 if (abs64(cs_nsec - wd_nsec) > WATCHDOG_THRESHOLD) { 220 if (abs(cs_nsec - wd_nsec) > WATCHDOG_THRESHOLD) {
221 pr_warn("timekeeping watchdog: Marking clocksource '%s' as unstable because the skew is too large:\n", 221 pr_warn("timekeeping watchdog: Marking clocksource '%s' as unstable because the skew is too large:\n",
222 cs->name); 222 cs->name);
223 pr_warn(" '%s' wd_now: %llx wd_last: %llx mask: %llx\n", 223 pr_warn(" '%s' wd_now: %llx wd_last: %llx mask: %llx\n",
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index b1356b7ae570..d563c1960302 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1614,7 +1614,7 @@ static __always_inline void timekeeping_freqadjust(struct timekeeper *tk,
1614 negative = (tick_error < 0); 1614 negative = (tick_error < 0);
1615 1615
1616 /* Sort out the magnitude of the correction */ 1616 /* Sort out the magnitude of the correction */
1617 tick_error = abs64(tick_error); 1617 tick_error = abs(tick_error);
1618 for (adj = 0; tick_error > interval; adj++) 1618 for (adj = 0; tick_error > interval; adj++)
1619 tick_error >>= 1; 1619 tick_error >>= 1;
1620 1620
diff --git a/lib/div64.c b/lib/div64.c
index 19ea7ed4b948..62a698a432bc 100644
--- a/lib/div64.c
+++ b/lib/div64.c
@@ -162,7 +162,7 @@ s64 div64_s64(s64 dividend, s64 divisor)
162{ 162{
163 s64 quot, t; 163 s64 quot, t;
164 164
165 quot = div64_u64(abs64(dividend), abs64(divisor)); 165 quot = div64_u64(abs(dividend), abs(divisor));
166 t = (dividend ^ divisor) >> 63; 166 t = (dividend ^ divisor) >> 63;
167 167
168 return (quot ^ t) - t; 168 return (quot ^ t) - t;
diff --git a/net/sctp/transport.c b/net/sctp/transport.c
index a0a431824f63..aab9e3f29755 100644
--- a/net/sctp/transport.c
+++ b/net/sctp/transport.c
@@ -331,7 +331,7 @@ void sctp_transport_update_rto(struct sctp_transport *tp, __u32 rtt)
331 * 1/8, rto_alpha would be expressed as 3. 331 * 1/8, rto_alpha would be expressed as 3.
332 */ 332 */
333 tp->rttvar = tp->rttvar - (tp->rttvar >> net->sctp.rto_beta) 333 tp->rttvar = tp->rttvar - (tp->rttvar >> net->sctp.rto_beta)
334 + (((__u32)abs64((__s64)tp->srtt - (__s64)rtt)) >> net->sctp.rto_beta); 334 + (((__u32)abs((__s64)tp->srtt - (__s64)rtt)) >> net->sctp.rto_beta);
335 tp->srtt = tp->srtt - (tp->srtt >> net->sctp.rto_alpha) 335 tp->srtt = tp->srtt - (tp->srtt >> net->sctp.rto_alpha)
336 + (rtt >> net->sctp.rto_alpha); 336 + (rtt >> net->sctp.rto_alpha);
337 } else { 337 } else {