aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-03-16 04:50:50 -0400
committerIngo Molnar <mingo@kernel.org>2017-03-16 04:50:50 -0400
commit2b95bd7d58d368fe5dcbe6f4e494847ea082d89d (patch)
tree48c38d792f31f2fe10b26b03bdf1b10a82ca03a4 /include/linux
parentffa86c2f1a8862cf58c873f6f14d4b2c3250fb48 (diff)
parent69eea5a4ab9c705496e912b55a9d312325de19e6 (diff)
Merge branch 'linus' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/blkdev.h1
-rw-r--r--include/linux/ceph/libceph.h2
-rw-r--r--include/linux/ceph/osd_client.h1
-rw-r--r--include/linux/dccp.h1
-rw-r--r--include/linux/filter.h16
-rw-r--r--include/linux/fs.h2
-rw-r--r--include/linux/genhd.h8
-rw-r--r--include/linux/hugetlb.h5
-rw-r--r--include/linux/irqchip/arm-gic-v3.h2
-rw-r--r--include/linux/irqdomain.h4
-rw-r--r--include/linux/jump_label.h11
-rw-r--r--include/linux/kasan.h1
-rw-r--r--include/linux/list_nulls.h5
-rw-r--r--include/linux/mm.h34
-rw-r--r--include/linux/net.h2
-rw-r--r--include/linux/phy.h4
-rw-r--r--include/linux/purgatory.h23
-rw-r--r--include/linux/random.h18
-rw-r--r--include/linux/rculist_nulls.h14
-rw-r--r--include/linux/regulator/machine.h2
-rw-r--r--include/linux/user_namespace.h2
-rw-r--r--include/linux/userfaultfd_k.h13
-rw-r--r--include/linux/vm_event_item.h3
-rw-r--r--include/linux/wait.h31
24 files changed, 145 insertions, 60 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 796016e63c1d..5a7da607ca04 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -435,7 +435,6 @@ struct request_queue {
435 struct delayed_work delay_work; 435 struct delayed_work delay_work;
436 436
437 struct backing_dev_info *backing_dev_info; 437 struct backing_dev_info *backing_dev_info;
438 struct disk_devt *disk_devt;
439 438
440 /* 439 /*
441 * The queue owner gets to use this for whatever they like. 440 * The queue owner gets to use this for whatever they like.
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h
index 1816c5e26581..88cd5dc8e238 100644
--- a/include/linux/ceph/libceph.h
+++ b/include/linux/ceph/libceph.h
@@ -48,6 +48,7 @@ struct ceph_options {
48 unsigned long mount_timeout; /* jiffies */ 48 unsigned long mount_timeout; /* jiffies */
49 unsigned long osd_idle_ttl; /* jiffies */ 49 unsigned long osd_idle_ttl; /* jiffies */
50 unsigned long osd_keepalive_timeout; /* jiffies */ 50 unsigned long osd_keepalive_timeout; /* jiffies */
51 unsigned long osd_request_timeout; /* jiffies */
51 52
52 /* 53 /*
53 * any type that can't be simply compared or doesn't need need 54 * any type that can't be simply compared or doesn't need need
@@ -68,6 +69,7 @@ struct ceph_options {
68#define CEPH_MOUNT_TIMEOUT_DEFAULT msecs_to_jiffies(60 * 1000) 69#define CEPH_MOUNT_TIMEOUT_DEFAULT msecs_to_jiffies(60 * 1000)
69#define CEPH_OSD_KEEPALIVE_DEFAULT msecs_to_jiffies(5 * 1000) 70#define CEPH_OSD_KEEPALIVE_DEFAULT msecs_to_jiffies(5 * 1000)
70#define CEPH_OSD_IDLE_TTL_DEFAULT msecs_to_jiffies(60 * 1000) 71#define CEPH_OSD_IDLE_TTL_DEFAULT msecs_to_jiffies(60 * 1000)
72#define CEPH_OSD_REQUEST_TIMEOUT_DEFAULT 0 /* no timeout */
71 73
72#define CEPH_MONC_HUNT_INTERVAL msecs_to_jiffies(3 * 1000) 74#define CEPH_MONC_HUNT_INTERVAL msecs_to_jiffies(3 * 1000)
73#define CEPH_MONC_PING_INTERVAL msecs_to_jiffies(10 * 1000) 75#define CEPH_MONC_PING_INTERVAL msecs_to_jiffies(10 * 1000)
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index 2ea0c282f3dc..c125b5d9e13c 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -189,6 +189,7 @@ struct ceph_osd_request {
189 189
190 /* internal */ 190 /* internal */
191 unsigned long r_stamp; /* jiffies, send or check time */ 191 unsigned long r_stamp; /* jiffies, send or check time */
192 unsigned long r_start_stamp; /* jiffies */
192 int r_attempts; 193 int r_attempts;
193 struct ceph_eversion r_replay_version; /* aka reassert_version */ 194 struct ceph_eversion r_replay_version; /* aka reassert_version */
194 u32 r_last_force_resend; 195 u32 r_last_force_resend;
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 61d042bbbf60..68449293c4b6 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -163,6 +163,7 @@ struct dccp_request_sock {
163 __u64 dreq_isr; 163 __u64 dreq_isr;
164 __u64 dreq_gsr; 164 __u64 dreq_gsr;
165 __be32 dreq_service; 165 __be32 dreq_service;
166 spinlock_t dreq_lock;
166 struct list_head dreq_featneg; 167 struct list_head dreq_featneg;
167 __u32 dreq_timestamp_echo; 168 __u32 dreq_timestamp_echo;
168 __u32 dreq_timestamp_time; 169 __u32 dreq_timestamp_time;
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 0c167fdee5f7..fbf7b39e8103 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -409,6 +409,7 @@ struct bpf_prog {
409 u16 pages; /* Number of allocated pages */ 409 u16 pages; /* Number of allocated pages */
410 kmemcheck_bitfield_begin(meta); 410 kmemcheck_bitfield_begin(meta);
411 u16 jited:1, /* Is our filter JIT'ed? */ 411 u16 jited:1, /* Is our filter JIT'ed? */
412 locked:1, /* Program image locked? */
412 gpl_compatible:1, /* Is filter GPL compatible? */ 413 gpl_compatible:1, /* Is filter GPL compatible? */
413 cb_access:1, /* Is control block accessed? */ 414 cb_access:1, /* Is control block accessed? */
414 dst_needed:1, /* Do we need dst entry? */ 415 dst_needed:1, /* Do we need dst entry? */
@@ -554,22 +555,29 @@ static inline bool bpf_prog_was_classic(const struct bpf_prog *prog)
554#ifdef CONFIG_ARCH_HAS_SET_MEMORY 555#ifdef CONFIG_ARCH_HAS_SET_MEMORY
555static inline void bpf_prog_lock_ro(struct bpf_prog *fp) 556static inline void bpf_prog_lock_ro(struct bpf_prog *fp)
556{ 557{
557 set_memory_ro((unsigned long)fp, fp->pages); 558 fp->locked = 1;
559 WARN_ON_ONCE(set_memory_ro((unsigned long)fp, fp->pages));
558} 560}
559 561
560static inline void bpf_prog_unlock_ro(struct bpf_prog *fp) 562static inline void bpf_prog_unlock_ro(struct bpf_prog *fp)
561{ 563{
562 set_memory_rw((unsigned long)fp, fp->pages); 564 if (fp->locked) {
565 WARN_ON_ONCE(set_memory_rw((unsigned long)fp, fp->pages));
566 /* In case set_memory_rw() fails, we want to be the first
567 * to crash here instead of some random place later on.
568 */
569 fp->locked = 0;
570 }
563} 571}
564 572
565static inline void bpf_jit_binary_lock_ro(struct bpf_binary_header *hdr) 573static inline void bpf_jit_binary_lock_ro(struct bpf_binary_header *hdr)
566{ 574{
567 set_memory_ro((unsigned long)hdr, hdr->pages); 575 WARN_ON_ONCE(set_memory_ro((unsigned long)hdr, hdr->pages));
568} 576}
569 577
570static inline void bpf_jit_binary_unlock_ro(struct bpf_binary_header *hdr) 578static inline void bpf_jit_binary_unlock_ro(struct bpf_binary_header *hdr)
571{ 579{
572 set_memory_rw((unsigned long)hdr, hdr->pages); 580 WARN_ON_ONCE(set_memory_rw((unsigned long)hdr, hdr->pages));
573} 581}
574#else 582#else
575static inline void bpf_prog_lock_ro(struct bpf_prog *fp) 583static inline void bpf_prog_lock_ro(struct bpf_prog *fp)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index aad3fd0ff5f8..7251f7bb45e8 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2678,7 +2678,7 @@ static const char * const kernel_read_file_str[] = {
2678 2678
2679static inline const char *kernel_read_file_id_str(enum kernel_read_file_id id) 2679static inline const char *kernel_read_file_id_str(enum kernel_read_file_id id)
2680{ 2680{
2681 if (id < 0 || id >= READING_MAX_ID) 2681 if ((unsigned)id >= READING_MAX_ID)
2682 return kernel_read_file_str[READING_UNKNOWN]; 2682 return kernel_read_file_str[READING_UNKNOWN];
2683 2683
2684 return kernel_read_file_str[id]; 2684 return kernel_read_file_str[id];
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index a999d281a2f1..76f39754e7b0 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -167,13 +167,6 @@ struct blk_integrity {
167}; 167};
168 168
169#endif /* CONFIG_BLK_DEV_INTEGRITY */ 169#endif /* CONFIG_BLK_DEV_INTEGRITY */
170struct disk_devt {
171 atomic_t count;
172 void (*release)(struct disk_devt *disk_devt);
173};
174
175void put_disk_devt(struct disk_devt *disk_devt);
176void get_disk_devt(struct disk_devt *disk_devt);
177 170
178struct gendisk { 171struct gendisk {
179 /* major, first_minor and minors are input parameters only, 172 /* major, first_minor and minors are input parameters only,
@@ -183,7 +176,6 @@ struct gendisk {
183 int first_minor; 176 int first_minor;
184 int minors; /* maximum number of minors, =1 for 177 int minors; /* maximum number of minors, =1 for
185 * disks that can't be partitioned. */ 178 * disks that can't be partitioned. */
186 struct disk_devt *disk_devt;
187 179
188 char disk_name[DISK_NAME_LEN]; /* name of major driver */ 180 char disk_name[DISK_NAME_LEN]; /* name of major driver */
189 char *(*devnode)(struct gendisk *gd, umode_t *mode); 181 char *(*devnode)(struct gendisk *gd, umode_t *mode);
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 503099d8aada..b857fc8cc2ec 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -122,7 +122,7 @@ struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address,
122struct page *follow_huge_pud(struct mm_struct *mm, unsigned long address, 122struct page *follow_huge_pud(struct mm_struct *mm, unsigned long address,
123 pud_t *pud, int flags); 123 pud_t *pud, int flags);
124int pmd_huge(pmd_t pmd); 124int pmd_huge(pmd_t pmd);
125int pud_huge(pud_t pmd); 125int pud_huge(pud_t pud);
126unsigned long hugetlb_change_protection(struct vm_area_struct *vma, 126unsigned long hugetlb_change_protection(struct vm_area_struct *vma,
127 unsigned long address, unsigned long end, pgprot_t newprot); 127 unsigned long address, unsigned long end, pgprot_t newprot);
128 128
@@ -197,6 +197,9 @@ static inline void __unmap_hugepage_range(struct mmu_gather *tlb,
197#ifndef pgd_huge 197#ifndef pgd_huge
198#define pgd_huge(x) 0 198#define pgd_huge(x) 0
199#endif 199#endif
200#ifndef p4d_huge
201#define p4d_huge(x) 0
202#endif
200 203
201#ifndef pgd_write 204#ifndef pgd_write
202static inline int pgd_write(pgd_t pgd) 205static inline int pgd_write(pgd_t pgd)
diff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h
index 672cfef72fc8..97cbca19430d 100644
--- a/include/linux/irqchip/arm-gic-v3.h
+++ b/include/linux/irqchip/arm-gic-v3.h
@@ -373,6 +373,8 @@
373#define ICC_IGRPEN0_EL1_MASK (1 << ICC_IGRPEN0_EL1_SHIFT) 373#define ICC_IGRPEN0_EL1_MASK (1 << ICC_IGRPEN0_EL1_SHIFT)
374#define ICC_IGRPEN1_EL1_SHIFT 0 374#define ICC_IGRPEN1_EL1_SHIFT 0
375#define ICC_IGRPEN1_EL1_MASK (1 << ICC_IGRPEN1_EL1_SHIFT) 375#define ICC_IGRPEN1_EL1_MASK (1 << ICC_IGRPEN1_EL1_SHIFT)
376#define ICC_SRE_EL1_DIB (1U << 2)
377#define ICC_SRE_EL1_DFB (1U << 1)
376#define ICC_SRE_EL1_SRE (1U << 0) 378#define ICC_SRE_EL1_SRE (1U << 0)
377 379
378/* 380/*
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index 188eced6813e..9f3616085423 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -524,6 +524,10 @@ static inline struct irq_domain *irq_find_matching_fwnode(
524{ 524{
525 return NULL; 525 return NULL;
526} 526}
527static inline bool irq_domain_check_msi_remap(void)
528{
529 return false;
530}
527#endif /* !CONFIG_IRQ_DOMAIN */ 531#endif /* !CONFIG_IRQ_DOMAIN */
528 532
529#endif /* _LINUX_IRQDOMAIN_H */ 533#endif /* _LINUX_IRQDOMAIN_H */
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index 8e06d758ee48..2afd74b9d844 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -90,6 +90,13 @@ extern bool static_key_initialized;
90struct static_key { 90struct static_key {
91 atomic_t enabled; 91 atomic_t enabled;
92/* 92/*
93 * Note:
94 * To make anonymous unions work with old compilers, the static
95 * initialization of them requires brackets. This creates a dependency
96 * on the order of the struct with the initializers. If any fields
97 * are added, STATIC_KEY_INIT_TRUE and STATIC_KEY_INIT_FALSE may need
98 * to be modified.
99 *
93 * bit 0 => 1 if key is initially true 100 * bit 0 => 1 if key is initially true
94 * 0 if initially false 101 * 0 if initially false
95 * bit 1 => 1 if points to struct static_key_mod 102 * bit 1 => 1 if points to struct static_key_mod
@@ -166,10 +173,10 @@ extern void static_key_disable(struct static_key *key);
166 */ 173 */
167#define STATIC_KEY_INIT_TRUE \ 174#define STATIC_KEY_INIT_TRUE \
168 { .enabled = { 1 }, \ 175 { .enabled = { 1 }, \
169 .entries = (void *)JUMP_TYPE_TRUE } 176 { .entries = (void *)JUMP_TYPE_TRUE } }
170#define STATIC_KEY_INIT_FALSE \ 177#define STATIC_KEY_INIT_FALSE \
171 { .enabled = { 0 }, \ 178 { .enabled = { 0 }, \
172 .entries = (void *)JUMP_TYPE_FALSE } 179 { .entries = (void *)JUMP_TYPE_FALSE } }
173 180
174#else /* !HAVE_JUMP_LABEL */ 181#else /* !HAVE_JUMP_LABEL */
175 182
diff --git a/include/linux/kasan.h b/include/linux/kasan.h
index ceb3fe78a0d3..1c823bef4c15 100644
--- a/include/linux/kasan.h
+++ b/include/linux/kasan.h
@@ -18,6 +18,7 @@ extern unsigned char kasan_zero_page[PAGE_SIZE];
18extern pte_t kasan_zero_pte[PTRS_PER_PTE]; 18extern pte_t kasan_zero_pte[PTRS_PER_PTE];
19extern pmd_t kasan_zero_pmd[PTRS_PER_PMD]; 19extern pmd_t kasan_zero_pmd[PTRS_PER_PMD];
20extern pud_t kasan_zero_pud[PTRS_PER_PUD]; 20extern pud_t kasan_zero_pud[PTRS_PER_PUD];
21extern p4d_t kasan_zero_p4d[PTRS_PER_P4D];
21 22
22void kasan_populate_zero_shadow(const void *shadow_start, 23void kasan_populate_zero_shadow(const void *shadow_start,
23 const void *shadow_end); 24 const void *shadow_end);
diff --git a/include/linux/list_nulls.h b/include/linux/list_nulls.h
index b01fe1009084..87ff4f58a2f0 100644
--- a/include/linux/list_nulls.h
+++ b/include/linux/list_nulls.h
@@ -29,6 +29,11 @@ struct hlist_nulls_node {
29 ((ptr)->first = (struct hlist_nulls_node *) NULLS_MARKER(nulls)) 29 ((ptr)->first = (struct hlist_nulls_node *) NULLS_MARKER(nulls))
30 30
31#define hlist_nulls_entry(ptr, type, member) container_of(ptr,type,member) 31#define hlist_nulls_entry(ptr, type, member) container_of(ptr,type,member)
32
33#define hlist_nulls_entry_safe(ptr, type, member) \
34 ({ typeof(ptr) ____ptr = (ptr); \
35 !is_a_nulls(____ptr) ? hlist_nulls_entry(____ptr, type, member) : NULL; \
36 })
32/** 37/**
33 * ptr_is_a_nulls - Test if a ptr is a nulls 38 * ptr_is_a_nulls - Test if a ptr is a nulls
34 * @ptr: ptr to be tested 39 * @ptr: ptr to be tested
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 0d65dd72c0f4..5f01c88f0800 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1560,14 +1560,24 @@ static inline pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr,
1560 return ptep; 1560 return ptep;
1561} 1561}
1562 1562
1563#ifdef __PAGETABLE_P4D_FOLDED
1564static inline int __p4d_alloc(struct mm_struct *mm, pgd_t *pgd,
1565 unsigned long address)
1566{
1567 return 0;
1568}
1569#else
1570int __p4d_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address);
1571#endif
1572
1563#ifdef __PAGETABLE_PUD_FOLDED 1573#ifdef __PAGETABLE_PUD_FOLDED
1564static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, 1574static inline int __pud_alloc(struct mm_struct *mm, p4d_t *p4d,
1565 unsigned long address) 1575 unsigned long address)
1566{ 1576{
1567 return 0; 1577 return 0;
1568} 1578}
1569#else 1579#else
1570int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address); 1580int __pud_alloc(struct mm_struct *mm, p4d_t *p4d, unsigned long address);
1571#endif 1581#endif
1572 1582
1573#if defined(__PAGETABLE_PMD_FOLDED) || !defined(CONFIG_MMU) 1583#if defined(__PAGETABLE_PMD_FOLDED) || !defined(CONFIG_MMU)
@@ -1619,11 +1629,22 @@ int __pte_alloc_kernel(pmd_t *pmd, unsigned long address);
1619 * Remove it when 4level-fixup.h has been removed. 1629 * Remove it when 4level-fixup.h has been removed.
1620 */ 1630 */
1621#if defined(CONFIG_MMU) && !defined(__ARCH_HAS_4LEVEL_HACK) 1631#if defined(CONFIG_MMU) && !defined(__ARCH_HAS_4LEVEL_HACK)
1622static inline pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address) 1632
1633#ifndef __ARCH_HAS_5LEVEL_HACK
1634static inline p4d_t *p4d_alloc(struct mm_struct *mm, pgd_t *pgd,
1635 unsigned long address)
1636{
1637 return (unlikely(pgd_none(*pgd)) && __p4d_alloc(mm, pgd, address)) ?
1638 NULL : p4d_offset(pgd, address);
1639}
1640
1641static inline pud_t *pud_alloc(struct mm_struct *mm, p4d_t *p4d,
1642 unsigned long address)
1623{ 1643{
1624 return (unlikely(pgd_none(*pgd)) && __pud_alloc(mm, pgd, address))? 1644 return (unlikely(p4d_none(*p4d)) && __pud_alloc(mm, p4d, address)) ?
1625 NULL: pud_offset(pgd, address); 1645 NULL : pud_offset(p4d, address);
1626} 1646}
1647#endif /* !__ARCH_HAS_5LEVEL_HACK */
1627 1648
1628static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address) 1649static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)
1629{ 1650{
@@ -2385,7 +2406,8 @@ void sparse_mem_maps_populate_node(struct page **map_map,
2385 2406
2386struct page *sparse_mem_map_populate(unsigned long pnum, int nid); 2407struct page *sparse_mem_map_populate(unsigned long pnum, int nid);
2387pgd_t *vmemmap_pgd_populate(unsigned long addr, int node); 2408pgd_t *vmemmap_pgd_populate(unsigned long addr, int node);
2388pud_t *vmemmap_pud_populate(pgd_t *pgd, unsigned long addr, int node); 2409p4d_t *vmemmap_p4d_populate(pgd_t *pgd, unsigned long addr, int node);
2410pud_t *vmemmap_pud_populate(p4d_t *p4d, unsigned long addr, int node);
2389pmd_t *vmemmap_pmd_populate(pud_t *pud, unsigned long addr, int node); 2411pmd_t *vmemmap_pmd_populate(pud_t *pud, unsigned long addr, int node);
2390pte_t *vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node); 2412pte_t *vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node);
2391void *vmemmap_alloc_block(unsigned long size, int node); 2413void *vmemmap_alloc_block(unsigned long size, int node);
diff --git a/include/linux/net.h b/include/linux/net.h
index cd0c8bd0a1de..0620f5e18c96 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -146,7 +146,7 @@ struct proto_ops {
146 int (*socketpair)(struct socket *sock1, 146 int (*socketpair)(struct socket *sock1,
147 struct socket *sock2); 147 struct socket *sock2);
148 int (*accept) (struct socket *sock, 148 int (*accept) (struct socket *sock,
149 struct socket *newsock, int flags); 149 struct socket *newsock, int flags, bool kern);
150 int (*getname) (struct socket *sock, 150 int (*getname) (struct socket *sock,
151 struct sockaddr *addr, 151 struct sockaddr *addr,
152 int *sockaddr_len, int peer); 152 int *sockaddr_len, int peer);
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 772476028a65..43a774873aa9 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -837,6 +837,10 @@ int genphy_read_status(struct phy_device *phydev);
837int genphy_suspend(struct phy_device *phydev); 837int genphy_suspend(struct phy_device *phydev);
838int genphy_resume(struct phy_device *phydev); 838int genphy_resume(struct phy_device *phydev);
839int genphy_soft_reset(struct phy_device *phydev); 839int genphy_soft_reset(struct phy_device *phydev);
840static inline int genphy_no_soft_reset(struct phy_device *phydev)
841{
842 return 0;
843}
840void phy_driver_unregister(struct phy_driver *drv); 844void phy_driver_unregister(struct phy_driver *drv);
841void phy_drivers_unregister(struct phy_driver *drv, int n); 845void phy_drivers_unregister(struct phy_driver *drv, int n);
842int phy_driver_register(struct phy_driver *new_driver, struct module *owner); 846int phy_driver_register(struct phy_driver *new_driver, struct module *owner);
diff --git a/include/linux/purgatory.h b/include/linux/purgatory.h
new file mode 100644
index 000000000000..d60d4e278609
--- /dev/null
+++ b/include/linux/purgatory.h
@@ -0,0 +1,23 @@
1#ifndef _LINUX_PURGATORY_H
2#define _LINUX_PURGATORY_H
3
4#include <linux/types.h>
5#include <crypto/sha.h>
6#include <uapi/linux/kexec.h>
7
8struct kexec_sha_region {
9 unsigned long start;
10 unsigned long len;
11};
12
13/*
14 * These forward declarations serve two purposes:
15 *
16 * 1) Make sparse happy when checking arch/purgatory
17 * 2) Document that these are required to be global so the symbol
18 * lookup in kexec works
19 */
20extern struct kexec_sha_region purgatory_sha_regions[KEXEC_SEGMENT_MAX];
21extern u8 purgatory_sha256_digest[SHA256_DIGEST_SIZE];
22
23#endif
diff --git a/include/linux/random.h b/include/linux/random.h
index 7bd2403e4fef..ed5c3838780d 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -37,14 +37,26 @@ extern void get_random_bytes(void *buf, int nbytes);
37extern int add_random_ready_callback(struct random_ready_callback *rdy); 37extern int add_random_ready_callback(struct random_ready_callback *rdy);
38extern void del_random_ready_callback(struct random_ready_callback *rdy); 38extern void del_random_ready_callback(struct random_ready_callback *rdy);
39extern void get_random_bytes_arch(void *buf, int nbytes); 39extern void get_random_bytes_arch(void *buf, int nbytes);
40extern int random_int_secret_init(void);
41 40
42#ifndef MODULE 41#ifndef MODULE
43extern const struct file_operations random_fops, urandom_fops; 42extern const struct file_operations random_fops, urandom_fops;
44#endif 43#endif
45 44
46unsigned int get_random_int(void); 45u32 get_random_u32(void);
47unsigned long get_random_long(void); 46u64 get_random_u64(void);
47static inline unsigned int get_random_int(void)
48{
49 return get_random_u32();
50}
51static inline unsigned long get_random_long(void)
52{
53#if BITS_PER_LONG == 64
54 return get_random_u64();
55#else
56 return get_random_u32();
57#endif
58}
59
48unsigned long randomize_page(unsigned long start, unsigned long range); 60unsigned long randomize_page(unsigned long start, unsigned long range);
49 61
50u32 prandom_u32(void); 62u32 prandom_u32(void);
diff --git a/include/linux/rculist_nulls.h b/include/linux/rculist_nulls.h
index 4ae95f7e8597..a23a33153180 100644
--- a/include/linux/rculist_nulls.h
+++ b/include/linux/rculist_nulls.h
@@ -156,5 +156,19 @@ static inline void hlist_nulls_add_tail_rcu(struct hlist_nulls_node *n,
156 ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1; }); \ 156 ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1; }); \
157 pos = rcu_dereference_raw(hlist_nulls_next_rcu(pos))) 157 pos = rcu_dereference_raw(hlist_nulls_next_rcu(pos)))
158 158
159/**
160 * hlist_nulls_for_each_entry_safe -
161 * iterate over list of given type safe against removal of list entry
162 * @tpos: the type * to use as a loop cursor.
163 * @pos: the &struct hlist_nulls_node to use as a loop cursor.
164 * @head: the head for your list.
165 * @member: the name of the hlist_nulls_node within the struct.
166 */
167#define hlist_nulls_for_each_entry_safe(tpos, pos, head, member) \
168 for (({barrier();}), \
169 pos = rcu_dereference_raw(hlist_nulls_first_rcu(head)); \
170 (!is_a_nulls(pos)) && \
171 ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); \
172 pos = rcu_dereference_raw(hlist_nulls_next_rcu(pos)); 1; });)
159#endif 173#endif
160#endif 174#endif
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index ad3e5158e586..c9f795e9a2ee 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -65,7 +65,7 @@ struct regulator_state {
65 int uV; /* suspend voltage */ 65 int uV; /* suspend voltage */
66 unsigned int mode; /* suspend regulator operating mode */ 66 unsigned int mode; /* suspend regulator operating mode */
67 int enabled; /* is regulator enabled in this suspend state */ 67 int enabled; /* is regulator enabled in this suspend state */
68 int disabled; /* is the regulator disbled in this suspend state */ 68 int disabled; /* is the regulator disabled in this suspend state */
69}; 69};
70 70
71/** 71/**
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h
index be765234c0a2..32354b4b4b2b 100644
--- a/include/linux/user_namespace.h
+++ b/include/linux/user_namespace.h
@@ -72,7 +72,7 @@ struct ucounts {
72 struct hlist_node node; 72 struct hlist_node node;
73 struct user_namespace *ns; 73 struct user_namespace *ns;
74 kuid_t uid; 74 kuid_t uid;
75 atomic_t count; 75 int count;
76 atomic_t ucount[UCOUNT_COUNTS]; 76 atomic_t ucount[UCOUNT_COUNTS];
77}; 77};
78 78
diff --git a/include/linux/userfaultfd_k.h b/include/linux/userfaultfd_k.h
index 0468548acebf..48a3483dccb1 100644
--- a/include/linux/userfaultfd_k.h
+++ b/include/linux/userfaultfd_k.h
@@ -61,8 +61,7 @@ extern void mremap_userfaultfd_complete(struct vm_userfaultfd_ctx *,
61 unsigned long from, unsigned long to, 61 unsigned long from, unsigned long to,
62 unsigned long len); 62 unsigned long len);
63 63
64extern void userfaultfd_remove(struct vm_area_struct *vma, 64extern bool userfaultfd_remove(struct vm_area_struct *vma,
65 struct vm_area_struct **prev,
66 unsigned long start, 65 unsigned long start,
67 unsigned long end); 66 unsigned long end);
68 67
@@ -72,8 +71,6 @@ extern int userfaultfd_unmap_prep(struct vm_area_struct *vma,
72extern void userfaultfd_unmap_complete(struct mm_struct *mm, 71extern void userfaultfd_unmap_complete(struct mm_struct *mm,
73 struct list_head *uf); 72 struct list_head *uf);
74 73
75extern void userfaultfd_exit(struct mm_struct *mm);
76
77#else /* CONFIG_USERFAULTFD */ 74#else /* CONFIG_USERFAULTFD */
78 75
79/* mm helpers */ 76/* mm helpers */
@@ -120,11 +117,11 @@ static inline void mremap_userfaultfd_complete(struct vm_userfaultfd_ctx *ctx,
120{ 117{
121} 118}
122 119
123static inline void userfaultfd_remove(struct vm_area_struct *vma, 120static inline bool userfaultfd_remove(struct vm_area_struct *vma,
124 struct vm_area_struct **prev,
125 unsigned long start, 121 unsigned long start,
126 unsigned long end) 122 unsigned long end)
127{ 123{
124 return true;
128} 125}
129 126
130static inline int userfaultfd_unmap_prep(struct vm_area_struct *vma, 127static inline int userfaultfd_unmap_prep(struct vm_area_struct *vma,
@@ -139,10 +136,6 @@ static inline void userfaultfd_unmap_complete(struct mm_struct *mm,
139{ 136{
140} 137}
141 138
142static inline void userfaultfd_exit(struct mm_struct *mm)
143{
144}
145
146#endif /* CONFIG_USERFAULTFD */ 139#endif /* CONFIG_USERFAULTFD */
147 140
148#endif /* _LINUX_USERFAULTFD_K_H */ 141#endif /* _LINUX_USERFAULTFD_K_H */
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h
index 6aa1b6cb5828..a80b7b59cf33 100644
--- a/include/linux/vm_event_item.h
+++ b/include/linux/vm_event_item.h
@@ -79,6 +79,9 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
79 THP_SPLIT_PAGE_FAILED, 79 THP_SPLIT_PAGE_FAILED,
80 THP_DEFERRED_SPLIT_PAGE, 80 THP_DEFERRED_SPLIT_PAGE,
81 THP_SPLIT_PMD, 81 THP_SPLIT_PMD,
82#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
83 THP_SPLIT_PUD,
84#endif
82 THP_ZERO_PAGE_ALLOC, 85 THP_ZERO_PAGE_ALLOC,
83 THP_ZERO_PAGE_ALLOC_FAILED, 86 THP_ZERO_PAGE_ALLOC_FAILED,
84#endif 87#endif
diff --git a/include/linux/wait.h b/include/linux/wait.h
index aacb1282d19a..db076ca7f11d 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -620,30 +620,19 @@ do { \
620 __ret; \ 620 __ret; \
621}) 621})
622 622
623extern int do_wait_intr(wait_queue_head_t *, wait_queue_t *);
624extern int do_wait_intr_irq(wait_queue_head_t *, wait_queue_t *);
623 625
624#define __wait_event_interruptible_locked(wq, condition, exclusive, irq) \ 626#define __wait_event_interruptible_locked(wq, condition, exclusive, fn) \
625({ \ 627({ \
626 int __ret = 0; \ 628 int __ret; \
627 DEFINE_WAIT(__wait); \ 629 DEFINE_WAIT(__wait); \
628 if (exclusive) \ 630 if (exclusive) \
629 __wait.flags |= WQ_FLAG_EXCLUSIVE; \ 631 __wait.flags |= WQ_FLAG_EXCLUSIVE; \
630 do { \ 632 do { \
631 if (likely(list_empty(&__wait.task_list))) \ 633 __ret = fn(&(wq), &__wait); \
632 __add_wait_queue_tail(&(wq), &__wait); \ 634 if (__ret) \
633 set_current_state(TASK_INTERRUPTIBLE); \
634 if (signal_pending(current)) { \
635 __ret = -ERESTARTSYS; \
636 break; \ 635 break; \
637 } \
638 if (irq) \
639 spin_unlock_irq(&(wq).lock); \
640 else \
641 spin_unlock(&(wq).lock); \
642 schedule(); \
643 if (irq) \
644 spin_lock_irq(&(wq).lock); \
645 else \
646 spin_lock(&(wq).lock); \
647 } while (!(condition)); \ 636 } while (!(condition)); \
648 __remove_wait_queue(&(wq), &__wait); \ 637 __remove_wait_queue(&(wq), &__wait); \
649 __set_current_state(TASK_RUNNING); \ 638 __set_current_state(TASK_RUNNING); \
@@ -676,7 +665,7 @@ do { \
676 */ 665 */
677#define wait_event_interruptible_locked(wq, condition) \ 666#define wait_event_interruptible_locked(wq, condition) \
678 ((condition) \ 667 ((condition) \
679 ? 0 : __wait_event_interruptible_locked(wq, condition, 0, 0)) 668 ? 0 : __wait_event_interruptible_locked(wq, condition, 0, do_wait_intr))
680 669
681/** 670/**
682 * wait_event_interruptible_locked_irq - sleep until a condition gets true 671 * wait_event_interruptible_locked_irq - sleep until a condition gets true
@@ -703,7 +692,7 @@ do { \
703 */ 692 */
704#define wait_event_interruptible_locked_irq(wq, condition) \ 693#define wait_event_interruptible_locked_irq(wq, condition) \
705 ((condition) \ 694 ((condition) \
706 ? 0 : __wait_event_interruptible_locked(wq, condition, 0, 1)) 695 ? 0 : __wait_event_interruptible_locked(wq, condition, 0, do_wait_intr_irq))
707 696
708/** 697/**
709 * wait_event_interruptible_exclusive_locked - sleep exclusively until a condition gets true 698 * wait_event_interruptible_exclusive_locked - sleep exclusively until a condition gets true
@@ -734,7 +723,7 @@ do { \
734 */ 723 */
735#define wait_event_interruptible_exclusive_locked(wq, condition) \ 724#define wait_event_interruptible_exclusive_locked(wq, condition) \
736 ((condition) \ 725 ((condition) \
737 ? 0 : __wait_event_interruptible_locked(wq, condition, 1, 0)) 726 ? 0 : __wait_event_interruptible_locked(wq, condition, 1, do_wait_intr))
738 727
739/** 728/**
740 * wait_event_interruptible_exclusive_locked_irq - sleep until a condition gets true 729 * wait_event_interruptible_exclusive_locked_irq - sleep until a condition gets true
@@ -765,7 +754,7 @@ do { \
765 */ 754 */
766#define wait_event_interruptible_exclusive_locked_irq(wq, condition) \ 755#define wait_event_interruptible_exclusive_locked_irq(wq, condition) \
767 ((condition) \ 756 ((condition) \
768 ? 0 : __wait_event_interruptible_locked(wq, condition, 1, 1)) 757 ? 0 : __wait_event_interruptible_locked(wq, condition, 1, do_wait_intr_irq))
769 758
770 759
771#define __wait_event_killable(wq, condition) \ 760#define __wait_event_killable(wq, condition) \