diff options
| author | Ingo Molnar <mingo@kernel.org> | 2017-03-16 04:50:50 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2017-03-16 04:50:50 -0400 |
| commit | 2b95bd7d58d368fe5dcbe6f4e494847ea082d89d (patch) | |
| tree | 48c38d792f31f2fe10b26b03bdf1b10a82ca03a4 /include | |
| parent | ffa86c2f1a8862cf58c873f6f14d4b2c3250fb48 (diff) | |
| parent | 69eea5a4ab9c705496e912b55a9d312325de19e6 (diff) | |
Merge branch 'linus' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include')
45 files changed, 433 insertions, 104 deletions
diff --git a/include/asm-generic/4level-fixup.h b/include/asm-generic/4level-fixup.h index 5bdab6bffd23..928fd66b1271 100644 --- a/include/asm-generic/4level-fixup.h +++ b/include/asm-generic/4level-fixup.h | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | ((unlikely(pgd_none(*(pud))) && __pmd_alloc(mm, pud, address))? \ | 15 | ((unlikely(pgd_none(*(pud))) && __pmd_alloc(mm, pud, address))? \ |
| 16 | NULL: pmd_offset(pud, address)) | 16 | NULL: pmd_offset(pud, address)) |
| 17 | 17 | ||
| 18 | #define pud_alloc(mm, pgd, address) (pgd) | ||
| 19 | #define pud_offset(pgd, start) (pgd) | 18 | #define pud_offset(pgd, start) (pgd) |
| 20 | #define pud_none(pud) 0 | 19 | #define pud_none(pud) 0 |
| 21 | #define pud_bad(pud) 0 | 20 | #define pud_bad(pud) 0 |
| @@ -35,4 +34,6 @@ | |||
| 35 | #undef pud_addr_end | 34 | #undef pud_addr_end |
| 36 | #define pud_addr_end(addr, end) (end) | 35 | #define pud_addr_end(addr, end) (end) |
| 37 | 36 | ||
| 37 | #include <asm-generic/5level-fixup.h> | ||
| 38 | |||
| 38 | #endif | 39 | #endif |
diff --git a/include/asm-generic/5level-fixup.h b/include/asm-generic/5level-fixup.h new file mode 100644 index 000000000000..b5ca82dc4175 --- /dev/null +++ b/include/asm-generic/5level-fixup.h | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | #ifndef _5LEVEL_FIXUP_H | ||
| 2 | #define _5LEVEL_FIXUP_H | ||
| 3 | |||
| 4 | #define __ARCH_HAS_5LEVEL_HACK | ||
| 5 | #define __PAGETABLE_P4D_FOLDED | ||
| 6 | |||
| 7 | #define P4D_SHIFT PGDIR_SHIFT | ||
| 8 | #define P4D_SIZE PGDIR_SIZE | ||
| 9 | #define P4D_MASK PGDIR_MASK | ||
| 10 | #define PTRS_PER_P4D 1 | ||
| 11 | |||
| 12 | #define p4d_t pgd_t | ||
| 13 | |||
| 14 | #define pud_alloc(mm, p4d, address) \ | ||
| 15 | ((unlikely(pgd_none(*(p4d))) && __pud_alloc(mm, p4d, address)) ? \ | ||
| 16 | NULL : pud_offset(p4d, address)) | ||
| 17 | |||
| 18 | #define p4d_alloc(mm, pgd, address) (pgd) | ||
| 19 | #define p4d_offset(pgd, start) (pgd) | ||
| 20 | #define p4d_none(p4d) 0 | ||
| 21 | #define p4d_bad(p4d) 0 | ||
| 22 | #define p4d_present(p4d) 1 | ||
| 23 | #define p4d_ERROR(p4d) do { } while (0) | ||
| 24 | #define p4d_clear(p4d) pgd_clear(p4d) | ||
| 25 | #define p4d_val(p4d) pgd_val(p4d) | ||
| 26 | #define p4d_populate(mm, p4d, pud) pgd_populate(mm, p4d, pud) | ||
| 27 | #define p4d_page(p4d) pgd_page(p4d) | ||
| 28 | #define p4d_page_vaddr(p4d) pgd_page_vaddr(p4d) | ||
| 29 | |||
| 30 | #define __p4d(x) __pgd(x) | ||
| 31 | #define set_p4d(p4dp, p4d) set_pgd(p4dp, p4d) | ||
| 32 | |||
| 33 | #undef p4d_free_tlb | ||
| 34 | #define p4d_free_tlb(tlb, x, addr) do { } while (0) | ||
| 35 | #define p4d_free(mm, x) do { } while (0) | ||
| 36 | #define __p4d_free_tlb(tlb, x, addr) do { } while (0) | ||
| 37 | |||
| 38 | #undef p4d_addr_end | ||
| 39 | #define p4d_addr_end(addr, end) (end) | ||
| 40 | |||
| 41 | #endif | ||
diff --git a/include/asm-generic/pgtable-nop4d-hack.h b/include/asm-generic/pgtable-nop4d-hack.h new file mode 100644 index 000000000000..752fb7511750 --- /dev/null +++ b/include/asm-generic/pgtable-nop4d-hack.h | |||
| @@ -0,0 +1,62 @@ | |||
| 1 | #ifndef _PGTABLE_NOP4D_HACK_H | ||
| 2 | #define _PGTABLE_NOP4D_HACK_H | ||
| 3 | |||
| 4 | #ifndef __ASSEMBLY__ | ||
| 5 | #include <asm-generic/5level-fixup.h> | ||
| 6 | |||
| 7 | #define __PAGETABLE_PUD_FOLDED | ||
| 8 | |||
| 9 | /* | ||
| 10 | * Having the pud type consist of a pgd gets the size right, and allows | ||
| 11 | * us to conceptually access the pgd entry that this pud is folded into | ||
| 12 | * without casting. | ||
| 13 | */ | ||
| 14 | typedef struct { pgd_t pgd; } pud_t; | ||
| 15 | |||
| 16 | #define PUD_SHIFT PGDIR_SHIFT | ||
| 17 | #define PTRS_PER_PUD 1 | ||
| 18 | #define PUD_SIZE (1UL << PUD_SHIFT) | ||
| 19 | #define PUD_MASK (~(PUD_SIZE-1)) | ||
| 20 | |||
| 21 | /* | ||
| 22 | * The "pgd_xxx()" functions here are trivial for a folded two-level | ||
| 23 | * setup: the pud is never bad, and a pud always exists (as it's folded | ||
| 24 | * into the pgd entry) | ||
| 25 | */ | ||
| 26 | static inline int pgd_none(pgd_t pgd) { return 0; } | ||
| 27 | static inline int pgd_bad(pgd_t pgd) { return 0; } | ||
| 28 | static inline int pgd_present(pgd_t pgd) { return 1; } | ||
| 29 | static inline void pgd_clear(pgd_t *pgd) { } | ||
| 30 | #define pud_ERROR(pud) (pgd_ERROR((pud).pgd)) | ||
| 31 | |||
| 32 | #define pgd_populate(mm, pgd, pud) do { } while (0) | ||
| 33 | /* | ||
| 34 | * (puds are folded into pgds so this doesn't get actually called, | ||
| 35 | * but the define is needed for a generic inline function.) | ||
| 36 | */ | ||
| 37 | #define set_pgd(pgdptr, pgdval) set_pud((pud_t *)(pgdptr), (pud_t) { pgdval }) | ||
| 38 | |||
| 39 | static inline pud_t *pud_offset(pgd_t *pgd, unsigned long address) | ||
| 40 | { | ||
| 41 | return (pud_t *)pgd; | ||
| 42 | } | ||
| 43 | |||
| 44 | #define pud_val(x) (pgd_val((x).pgd)) | ||
| 45 | #define __pud(x) ((pud_t) { __pgd(x) }) | ||
| 46 | |||
| 47 | #define pgd_page(pgd) (pud_page((pud_t){ pgd })) | ||
| 48 | #define pgd_page_vaddr(pgd) (pud_page_vaddr((pud_t){ pgd })) | ||
| 49 | |||
| 50 | /* | ||
| 51 | * allocating and freeing a pud is trivial: the 1-entry pud is | ||
| 52 | * inside the pgd, so has no extra memory associated with it. | ||
| 53 | */ | ||
| 54 | #define pud_alloc_one(mm, address) NULL | ||
| 55 | #define pud_free(mm, x) do { } while (0) | ||
| 56 | #define __pud_free_tlb(tlb, x, a) do { } while (0) | ||
| 57 | |||
| 58 | #undef pud_addr_end | ||
| 59 | #define pud_addr_end(addr, end) (end) | ||
| 60 | |||
| 61 | #endif /* __ASSEMBLY__ */ | ||
| 62 | #endif /* _PGTABLE_NOP4D_HACK_H */ | ||
diff --git a/include/asm-generic/pgtable-nop4d.h b/include/asm-generic/pgtable-nop4d.h new file mode 100644 index 000000000000..de364ecb8df6 --- /dev/null +++ b/include/asm-generic/pgtable-nop4d.h | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | #ifndef _PGTABLE_NOP4D_H | ||
| 2 | #define _PGTABLE_NOP4D_H | ||
| 3 | |||
| 4 | #ifndef __ASSEMBLY__ | ||
| 5 | |||
| 6 | #define __PAGETABLE_P4D_FOLDED | ||
| 7 | |||
| 8 | typedef struct { pgd_t pgd; } p4d_t; | ||
| 9 | |||
| 10 | #define P4D_SHIFT PGDIR_SHIFT | ||
| 11 | #define PTRS_PER_P4D 1 | ||
| 12 | #define P4D_SIZE (1UL << P4D_SHIFT) | ||
| 13 | #define P4D_MASK (~(P4D_SIZE-1)) | ||
| 14 | |||
| 15 | /* | ||
| 16 | * The "pgd_xxx()" functions here are trivial for a folded two-level | ||
| 17 | * setup: the p4d is never bad, and a p4d always exists (as it's folded | ||
| 18 | * into the pgd entry) | ||
| 19 | */ | ||
| 20 | static inline int pgd_none(pgd_t pgd) { return 0; } | ||
| 21 | static inline int pgd_bad(pgd_t pgd) { return 0; } | ||
| 22 | static inline int pgd_present(pgd_t pgd) { return 1; } | ||
| 23 | static inline void pgd_clear(pgd_t *pgd) { } | ||
| 24 | #define p4d_ERROR(p4d) (pgd_ERROR((p4d).pgd)) | ||
| 25 | |||
| 26 | #define pgd_populate(mm, pgd, p4d) do { } while (0) | ||
| 27 | /* | ||
| 28 | * (p4ds are folded into pgds so this doesn't get actually called, | ||
| 29 | * but the define is needed for a generic inline function.) | ||
| 30 | */ | ||
| 31 | #define set_pgd(pgdptr, pgdval) set_p4d((p4d_t *)(pgdptr), (p4d_t) { pgdval }) | ||
| 32 | |||
| 33 | static inline p4d_t *p4d_offset(pgd_t *pgd, unsigned long address) | ||
| 34 | { | ||
| 35 | return (p4d_t *)pgd; | ||
| 36 | } | ||
| 37 | |||
| 38 | #define p4d_val(x) (pgd_val((x).pgd)) | ||
| 39 | #define __p4d(x) ((p4d_t) { __pgd(x) }) | ||
| 40 | |||
| 41 | #define pgd_page(pgd) (p4d_page((p4d_t){ pgd })) | ||
| 42 | #define pgd_page_vaddr(pgd) (p4d_page_vaddr((p4d_t){ pgd })) | ||
| 43 | |||
| 44 | /* | ||
| 45 | * allocating and freeing a p4d is trivial: the 1-entry p4d is | ||
| 46 | * inside the pgd, so has no extra memory associated with it. | ||
| 47 | */ | ||
| 48 | #define p4d_alloc_one(mm, address) NULL | ||
| 49 | #define p4d_free(mm, x) do { } while (0) | ||
| 50 | #define __p4d_free_tlb(tlb, x, a) do { } while (0) | ||
| 51 | |||
| 52 | #undef p4d_addr_end | ||
| 53 | #define p4d_addr_end(addr, end) (end) | ||
| 54 | |||
| 55 | #endif /* __ASSEMBLY__ */ | ||
| 56 | #endif /* _PGTABLE_NOP4D_H */ | ||
diff --git a/include/asm-generic/pgtable-nopud.h b/include/asm-generic/pgtable-nopud.h index 810431d8351b..c2b9b96d6268 100644 --- a/include/asm-generic/pgtable-nopud.h +++ b/include/asm-generic/pgtable-nopud.h | |||
| @@ -3,52 +3,57 @@ | |||
| 3 | 3 | ||
| 4 | #ifndef __ASSEMBLY__ | 4 | #ifndef __ASSEMBLY__ |
| 5 | 5 | ||
| 6 | #ifdef __ARCH_USE_5LEVEL_HACK | ||
| 7 | #include <asm-generic/pgtable-nop4d-hack.h> | ||
| 8 | #else | ||
| 9 | #include <asm-generic/pgtable-nop4d.h> | ||
| 10 | |||
| 6 | #define __PAGETABLE_PUD_FOLDED | 11 | #define __PAGETABLE_PUD_FOLDED |
| 7 | 12 | ||
| 8 | /* | 13 | /* |
| 9 | * Having the pud type consist of a pgd gets the size right, and allows | 14 | * Having the pud type consist of a p4d gets the size right, and allows |
| 10 | * us to conceptually access the pgd entry that this pud is folded into | 15 | * us to conceptually access the p4d entry that this pud is folded into |
| 11 | * without casting. | 16 | * without casting. |
| 12 | */ | 17 | */ |
| 13 | typedef struct { pgd_t pgd; } pud_t; | 18 | typedef struct { p4d_t p4d; } pud_t; |
| 14 | 19 | ||
| 15 | #define PUD_SHIFT PGDIR_SHIFT | 20 | #define PUD_SHIFT P4D_SHIFT |
| 16 | #define PTRS_PER_PUD 1 | 21 | #define PTRS_PER_PUD 1 |
| 17 | #define PUD_SIZE (1UL << PUD_SHIFT) | 22 | #define PUD_SIZE (1UL << PUD_SHIFT) |
| 18 | #define PUD_MASK (~(PUD_SIZE-1)) | 23 | #define PUD_MASK (~(PUD_SIZE-1)) |
| 19 | 24 | ||
| 20 | /* | 25 | /* |
| 21 | * The "pgd_xxx()" functions here are trivial for a folded two-level | 26 | * The "p4d_xxx()" functions here are trivial for a folded two-level |
| 22 | * setup: the pud is never bad, and a pud always exists (as it's folded | 27 | * setup: the pud is never bad, and a pud always exists (as it's folded |
| 23 | * into the pgd entry) | 28 | * into the p4d entry) |
| 24 | */ | 29 | */ |
| 25 | static inline int pgd_none(pgd_t pgd) { return 0; } | 30 | static inline int p4d_none(p4d_t p4d) { return 0; } |
| 26 | static inline int pgd_bad(pgd_t pgd) { return 0; } | 31 | static inline int p4d_bad(p4d_t p4d) { return 0; } |
| 27 | static inline int pgd_present(pgd_t pgd) { return 1; } | 32 | static inline int p4d_present(p4d_t p4d) { return 1; } |
| 28 | static inline void pgd_clear(pgd_t *pgd) { } | 33 | static inline void p4d_clear(p4d_t *p4d) { } |
| 29 | #define pud_ERROR(pud) (pgd_ERROR((pud).pgd)) | 34 | #define pud_ERROR(pud) (p4d_ERROR((pud).p4d)) |
| 30 | 35 | ||
| 31 | #define pgd_populate(mm, pgd, pud) do { } while (0) | 36 | #define p4d_populate(mm, p4d, pud) do { } while (0) |
| 32 | /* | 37 | /* |
| 33 | * (puds are folded into pgds so this doesn't get actually called, | 38 | * (puds are folded into p4ds so this doesn't get actually called, |
| 34 | * but the define is needed for a generic inline function.) | 39 | * but the define is needed for a generic inline function.) |
| 35 | */ | 40 | */ |
| 36 | #define set_pgd(pgdptr, pgdval) set_pud((pud_t *)(pgdptr), (pud_t) { pgdval }) | 41 | #define set_p4d(p4dptr, p4dval) set_pud((pud_t *)(p4dptr), (pud_t) { p4dval }) |
| 37 | 42 | ||
| 38 | static inline pud_t * pud_offset(pgd_t * pgd, unsigned long address) | 43 | static inline pud_t *pud_offset(p4d_t *p4d, unsigned long address) |
| 39 | { | 44 | { |
| 40 | return (pud_t *)pgd; | 45 | return (pud_t *)p4d; |
| 41 | } | 46 | } |
| 42 | 47 | ||
| 43 | #define pud_val(x) (pgd_val((x).pgd)) | 48 | #define pud_val(x) (p4d_val((x).p4d)) |
| 44 | #define __pud(x) ((pud_t) { __pgd(x) } ) | 49 | #define __pud(x) ((pud_t) { __p4d(x) }) |
| 45 | 50 | ||
| 46 | #define pgd_page(pgd) (pud_page((pud_t){ pgd })) | 51 | #define p4d_page(p4d) (pud_page((pud_t){ p4d })) |
| 47 | #define pgd_page_vaddr(pgd) (pud_page_vaddr((pud_t){ pgd })) | 52 | #define p4d_page_vaddr(p4d) (pud_page_vaddr((pud_t){ p4d })) |
| 48 | 53 | ||
| 49 | /* | 54 | /* |
| 50 | * allocating and freeing a pud is trivial: the 1-entry pud is | 55 | * allocating and freeing a pud is trivial: the 1-entry pud is |
| 51 | * inside the pgd, so has no extra memory associated with it. | 56 | * inside the p4d, so has no extra memory associated with it. |
| 52 | */ | 57 | */ |
| 53 | #define pud_alloc_one(mm, address) NULL | 58 | #define pud_alloc_one(mm, address) NULL |
| 54 | #define pud_free(mm, x) do { } while (0) | 59 | #define pud_free(mm, x) do { } while (0) |
| @@ -58,4 +63,5 @@ static inline pud_t * pud_offset(pgd_t * pgd, unsigned long address) | |||
| 58 | #define pud_addr_end(addr, end) (end) | 63 | #define pud_addr_end(addr, end) (end) |
| 59 | 64 | ||
| 60 | #endif /* __ASSEMBLY__ */ | 65 | #endif /* __ASSEMBLY__ */ |
| 66 | #endif /* !__ARCH_USE_5LEVEL_HACK */ | ||
| 61 | #endif /* _PGTABLE_NOPUD_H */ | 67 | #endif /* _PGTABLE_NOPUD_H */ |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index f4ca23b158b3..1fad160f35de 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
| @@ -10,9 +10,9 @@ | |||
| 10 | #include <linux/bug.h> | 10 | #include <linux/bug.h> |
| 11 | #include <linux/errno.h> | 11 | #include <linux/errno.h> |
| 12 | 12 | ||
| 13 | #if 4 - defined(__PAGETABLE_PUD_FOLDED) - defined(__PAGETABLE_PMD_FOLDED) != \ | 13 | #if 5 - defined(__PAGETABLE_P4D_FOLDED) - defined(__PAGETABLE_PUD_FOLDED) - \ |
| 14 | CONFIG_PGTABLE_LEVELS | 14 | defined(__PAGETABLE_PMD_FOLDED) != CONFIG_PGTABLE_LEVELS |
| 15 | #error CONFIG_PGTABLE_LEVELS is not consistent with __PAGETABLE_{PUD,PMD}_FOLDED | 15 | #error CONFIG_PGTABLE_LEVELS is not consistent with __PAGETABLE_{P4D,PUD,PMD}_FOLDED |
| 16 | #endif | 16 | #endif |
| 17 | 17 | ||
| 18 | /* | 18 | /* |
| @@ -424,6 +424,13 @@ static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot) | |||
| 424 | (__boundary - 1 < (end) - 1)? __boundary: (end); \ | 424 | (__boundary - 1 < (end) - 1)? __boundary: (end); \ |
| 425 | }) | 425 | }) |
| 426 | 426 | ||
| 427 | #ifndef p4d_addr_end | ||
| 428 | #define p4d_addr_end(addr, end) \ | ||
| 429 | ({ unsigned long __boundary = ((addr) + P4D_SIZE) & P4D_MASK; \ | ||
| 430 | (__boundary - 1 < (end) - 1)? __boundary: (end); \ | ||
| 431 | }) | ||
| 432 | #endif | ||
| 433 | |||
| 427 | #ifndef pud_addr_end | 434 | #ifndef pud_addr_end |
| 428 | #define pud_addr_end(addr, end) \ | 435 | #define pud_addr_end(addr, end) \ |
| 429 | ({ unsigned long __boundary = ((addr) + PUD_SIZE) & PUD_MASK; \ | 436 | ({ unsigned long __boundary = ((addr) + PUD_SIZE) & PUD_MASK; \ |
| @@ -444,6 +451,7 @@ static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot) | |||
| 444 | * Do the tests inline, but report and clear the bad entry in mm/memory.c. | 451 | * Do the tests inline, but report and clear the bad entry in mm/memory.c. |
| 445 | */ | 452 | */ |
| 446 | void pgd_clear_bad(pgd_t *); | 453 | void pgd_clear_bad(pgd_t *); |
| 454 | void p4d_clear_bad(p4d_t *); | ||
| 447 | void pud_clear_bad(pud_t *); | 455 | void pud_clear_bad(pud_t *); |
| 448 | void pmd_clear_bad(pmd_t *); | 456 | void pmd_clear_bad(pmd_t *); |
| 449 | 457 | ||
| @@ -458,6 +466,17 @@ static inline int pgd_none_or_clear_bad(pgd_t *pgd) | |||
| 458 | return 0; | 466 | return 0; |
| 459 | } | 467 | } |
| 460 | 468 | ||
| 469 | static inline int p4d_none_or_clear_bad(p4d_t *p4d) | ||
| 470 | { | ||
| 471 | if (p4d_none(*p4d)) | ||
| 472 | return 1; | ||
| 473 | if (unlikely(p4d_bad(*p4d))) { | ||
| 474 | p4d_clear_bad(p4d); | ||
| 475 | return 1; | ||
| 476 | } | ||
| 477 | return 0; | ||
| 478 | } | ||
| 479 | |||
| 461 | static inline int pud_none_or_clear_bad(pud_t *pud) | 480 | static inline int pud_none_or_clear_bad(pud_t *pud) |
| 462 | { | 481 | { |
| 463 | if (pud_none(*pud)) | 482 | if (pud_none(*pud)) |
| @@ -844,11 +863,30 @@ static inline int pmd_protnone(pmd_t pmd) | |||
| 844 | #endif /* CONFIG_MMU */ | 863 | #endif /* CONFIG_MMU */ |
| 845 | 864 | ||
| 846 | #ifdef CONFIG_HAVE_ARCH_HUGE_VMAP | 865 | #ifdef CONFIG_HAVE_ARCH_HUGE_VMAP |
| 866 | |||
| 867 | #ifndef __PAGETABLE_P4D_FOLDED | ||
| 868 | int p4d_set_huge(p4d_t *p4d, phys_addr_t addr, pgprot_t prot); | ||
| 869 | int p4d_clear_huge(p4d_t *p4d); | ||
| 870 | #else | ||
| 871 | static inline int p4d_set_huge(p4d_t *p4d, phys_addr_t addr, pgprot_t prot) | ||
| 872 | { | ||
| 873 | return 0; | ||
| 874 | } | ||
| 875 | static inline int p4d_clear_huge(p4d_t *p4d) | ||
| 876 | { | ||
| 877 | return 0; | ||
| 878 | } | ||
| 879 | #endif /* !__PAGETABLE_P4D_FOLDED */ | ||
| 880 | |||
| 847 | int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot); | 881 | int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot); |
| 848 | int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot); | 882 | int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot); |
| 849 | int pud_clear_huge(pud_t *pud); | 883 | int pud_clear_huge(pud_t *pud); |
| 850 | int pmd_clear_huge(pmd_t *pmd); | 884 | int pmd_clear_huge(pmd_t *pmd); |
| 851 | #else /* !CONFIG_HAVE_ARCH_HUGE_VMAP */ | 885 | #else /* !CONFIG_HAVE_ARCH_HUGE_VMAP */ |
| 886 | static inline int p4d_set_huge(p4d_t *p4d, phys_addr_t addr, pgprot_t prot) | ||
| 887 | { | ||
| 888 | return 0; | ||
| 889 | } | ||
| 852 | static inline int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot) | 890 | static inline int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot) |
| 853 | { | 891 | { |
| 854 | return 0; | 892 | return 0; |
| @@ -857,6 +895,10 @@ static inline int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot) | |||
| 857 | { | 895 | { |
| 858 | return 0; | 896 | return 0; |
| 859 | } | 897 | } |
| 898 | static inline int p4d_clear_huge(p4d_t *p4d) | ||
| 899 | { | ||
| 900 | return 0; | ||
| 901 | } | ||
| 860 | static inline int pud_clear_huge(pud_t *pud) | 902 | static inline int pud_clear_huge(pud_t *pud) |
| 861 | { | 903 | { |
| 862 | return 0; | 904 | return 0; |
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h index 4329bc6ef04b..8afa4335e5b2 100644 --- a/include/asm-generic/tlb.h +++ b/include/asm-generic/tlb.h | |||
| @@ -270,6 +270,12 @@ static inline void tlb_remove_check_page_size_change(struct mmu_gather *tlb, | |||
| 270 | __pte_free_tlb(tlb, ptep, address); \ | 270 | __pte_free_tlb(tlb, ptep, address); \ |
| 271 | } while (0) | 271 | } while (0) |
| 272 | 272 | ||
| 273 | #define pmd_free_tlb(tlb, pmdp, address) \ | ||
| 274 | do { \ | ||
| 275 | __tlb_adjust_range(tlb, address, PAGE_SIZE); \ | ||
| 276 | __pmd_free_tlb(tlb, pmdp, address); \ | ||
| 277 | } while (0) | ||
| 278 | |||
| 273 | #ifndef __ARCH_HAS_4LEVEL_HACK | 279 | #ifndef __ARCH_HAS_4LEVEL_HACK |
| 274 | #define pud_free_tlb(tlb, pudp, address) \ | 280 | #define pud_free_tlb(tlb, pudp, address) \ |
| 275 | do { \ | 281 | do { \ |
| @@ -278,11 +284,13 @@ static inline void tlb_remove_check_page_size_change(struct mmu_gather *tlb, | |||
| 278 | } while (0) | 284 | } while (0) |
| 279 | #endif | 285 | #endif |
| 280 | 286 | ||
| 281 | #define pmd_free_tlb(tlb, pmdp, address) \ | 287 | #ifndef __ARCH_HAS_5LEVEL_HACK |
| 288 | #define p4d_free_tlb(tlb, pudp, address) \ | ||
| 282 | do { \ | 289 | do { \ |
| 283 | __tlb_adjust_range(tlb, address, PAGE_SIZE); \ | 290 | __tlb_adjust_range(tlb, address, PAGE_SIZE); \ |
| 284 | __pmd_free_tlb(tlb, pmdp, address); \ | 291 | __p4d_free_tlb(tlb, pudp, address); \ |
| 285 | } while (0) | 292 | } while (0) |
| 293 | #endif | ||
| 286 | 294 | ||
| 287 | #define tlb_migrate_finish(mm) do {} while (0) | 295 | #define tlb_migrate_finish(mm) do {} while (0) |
| 288 | 296 | ||
diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h index a2bfd7843f18..e2b9c6fe2714 100644 --- a/include/crypto/if_alg.h +++ b/include/crypto/if_alg.h | |||
| @@ -73,7 +73,7 @@ int af_alg_unregister_type(const struct af_alg_type *type); | |||
| 73 | 73 | ||
| 74 | int af_alg_release(struct socket *sock); | 74 | int af_alg_release(struct socket *sock); |
| 75 | void af_alg_release_parent(struct sock *sk); | 75 | void af_alg_release_parent(struct sock *sk); |
| 76 | int af_alg_accept(struct sock *sk, struct socket *newsock); | 76 | int af_alg_accept(struct sock *sk, struct socket *newsock, bool kern); |
| 77 | 77 | ||
| 78 | int af_alg_make_sg(struct af_alg_sgl *sgl, struct iov_iter *iter, int len); | 78 | int af_alg_make_sg(struct af_alg_sgl *sgl, struct iov_iter *iter, int len); |
| 79 | void af_alg_free_sg(struct af_alg_sgl *sgl); | 79 | void af_alg_free_sg(struct af_alg_sgl *sgl); |
diff --git a/include/dt-bindings/sound/cs42l42.h b/include/dt-bindings/sound/cs42l42.h index 399a123aed58..db69d84ed7d1 100644 --- a/include/dt-bindings/sound/cs42l42.h +++ b/include/dt-bindings/sound/cs42l42.h | |||
| @@ -20,7 +20,7 @@ | |||
| 20 | #define CS42L42_HPOUT_LOAD_1NF 0 | 20 | #define CS42L42_HPOUT_LOAD_1NF 0 |
| 21 | #define CS42L42_HPOUT_LOAD_10NF 1 | 21 | #define CS42L42_HPOUT_LOAD_10NF 1 |
| 22 | 22 | ||
| 23 | /* HPOUT Clamp to GND Overide */ | 23 | /* HPOUT Clamp to GND Override */ |
| 24 | #define CS42L42_HPOUT_CLAMP_EN 0 | 24 | #define CS42L42_HPOUT_CLAMP_EN 0 |
| 25 | #define CS42L42_HPOUT_CLAMP_DIS 1 | 25 | #define CS42L42_HPOUT_CLAMP_DIS 1 |
| 26 | 26 | ||
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 |
| 555 | static inline void bpf_prog_lock_ro(struct bpf_prog *fp) | 556 | static 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 | ||
| 560 | static inline void bpf_prog_unlock_ro(struct bpf_prog *fp) | 562 | static 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 | ||
| 565 | static inline void bpf_jit_binary_lock_ro(struct bpf_binary_header *hdr) | 573 | static 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 | ||
| 570 | static inline void bpf_jit_binary_unlock_ro(struct bpf_binary_header *hdr) | 578 | static 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 |
| 575 | static inline void bpf_prog_lock_ro(struct bpf_prog *fp) | 583 | static 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 | ||
| 2679 | static inline const char *kernel_read_file_id_str(enum kernel_read_file_id id) | 2679 | static 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 */ |
| 170 | struct disk_devt { | ||
| 171 | atomic_t count; | ||
| 172 | void (*release)(struct disk_devt *disk_devt); | ||
| 173 | }; | ||
| 174 | |||
| 175 | void put_disk_devt(struct disk_devt *disk_devt); | ||
| 176 | void get_disk_devt(struct disk_devt *disk_devt); | ||
| 177 | 170 | ||
| 178 | struct gendisk { | 171 | struct 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, | |||
| 122 | struct page *follow_huge_pud(struct mm_struct *mm, unsigned long address, | 122 | struct page *follow_huge_pud(struct mm_struct *mm, unsigned long address, |
| 123 | pud_t *pud, int flags); | 123 | pud_t *pud, int flags); |
| 124 | int pmd_huge(pmd_t pmd); | 124 | int pmd_huge(pmd_t pmd); |
| 125 | int pud_huge(pud_t pmd); | 125 | int pud_huge(pud_t pud); |
| 126 | unsigned long hugetlb_change_protection(struct vm_area_struct *vma, | 126 | unsigned 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 |
| 202 | static inline int pgd_write(pgd_t pgd) | 205 | static 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 | } |
| 527 | static 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; | |||
| 90 | struct static_key { | 90 | struct 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]; | |||
| 18 | extern pte_t kasan_zero_pte[PTRS_PER_PTE]; | 18 | extern pte_t kasan_zero_pte[PTRS_PER_PTE]; |
| 19 | extern pmd_t kasan_zero_pmd[PTRS_PER_PMD]; | 19 | extern pmd_t kasan_zero_pmd[PTRS_PER_PMD]; |
| 20 | extern pud_t kasan_zero_pud[PTRS_PER_PUD]; | 20 | extern pud_t kasan_zero_pud[PTRS_PER_PUD]; |
| 21 | extern p4d_t kasan_zero_p4d[PTRS_PER_P4D]; | ||
| 21 | 22 | ||
| 22 | void kasan_populate_zero_shadow(const void *shadow_start, | 23 | void 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 | ||
| 1564 | static inline int __p4d_alloc(struct mm_struct *mm, pgd_t *pgd, | ||
| 1565 | unsigned long address) | ||
| 1566 | { | ||
| 1567 | return 0; | ||
| 1568 | } | ||
| 1569 | #else | ||
| 1570 | int __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 |
| 1564 | static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, | 1574 | static 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 |
| 1570 | int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address); | 1580 | int __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) |
| 1622 | static inline pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address) | 1632 | |
| 1633 | #ifndef __ARCH_HAS_5LEVEL_HACK | ||
| 1634 | static 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 | |||
| 1641 | static 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 | ||
| 1628 | static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address) | 1649 | static 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 | ||
| 2386 | struct page *sparse_mem_map_populate(unsigned long pnum, int nid); | 2407 | struct page *sparse_mem_map_populate(unsigned long pnum, int nid); |
| 2387 | pgd_t *vmemmap_pgd_populate(unsigned long addr, int node); | 2408 | pgd_t *vmemmap_pgd_populate(unsigned long addr, int node); |
| 2388 | pud_t *vmemmap_pud_populate(pgd_t *pgd, unsigned long addr, int node); | 2409 | p4d_t *vmemmap_p4d_populate(pgd_t *pgd, unsigned long addr, int node); |
| 2410 | pud_t *vmemmap_pud_populate(p4d_t *p4d, unsigned long addr, int node); | ||
| 2389 | pmd_t *vmemmap_pmd_populate(pud_t *pud, unsigned long addr, int node); | 2411 | pmd_t *vmemmap_pmd_populate(pud_t *pud, unsigned long addr, int node); |
| 2390 | pte_t *vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node); | 2412 | pte_t *vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node); |
| 2391 | void *vmemmap_alloc_block(unsigned long size, int node); | 2413 | void *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); | |||
| 837 | int genphy_suspend(struct phy_device *phydev); | 837 | int genphy_suspend(struct phy_device *phydev); |
| 838 | int genphy_resume(struct phy_device *phydev); | 838 | int genphy_resume(struct phy_device *phydev); |
| 839 | int genphy_soft_reset(struct phy_device *phydev); | 839 | int genphy_soft_reset(struct phy_device *phydev); |
| 840 | static inline int genphy_no_soft_reset(struct phy_device *phydev) | ||
| 841 | { | ||
| 842 | return 0; | ||
| 843 | } | ||
| 840 | void phy_driver_unregister(struct phy_driver *drv); | 844 | void phy_driver_unregister(struct phy_driver *drv); |
| 841 | void phy_drivers_unregister(struct phy_driver *drv, int n); | 845 | void phy_drivers_unregister(struct phy_driver *drv, int n); |
| 842 | int phy_driver_register(struct phy_driver *new_driver, struct module *owner); | 846 | int 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 | |||
| 8 | struct 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 | */ | ||
| 20 | extern struct kexec_sha_region purgatory_sha_regions[KEXEC_SEGMENT_MAX]; | ||
| 21 | extern 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); | |||
| 37 | extern int add_random_ready_callback(struct random_ready_callback *rdy); | 37 | extern int add_random_ready_callback(struct random_ready_callback *rdy); |
| 38 | extern void del_random_ready_callback(struct random_ready_callback *rdy); | 38 | extern void del_random_ready_callback(struct random_ready_callback *rdy); |
| 39 | extern void get_random_bytes_arch(void *buf, int nbytes); | 39 | extern void get_random_bytes_arch(void *buf, int nbytes); |
| 40 | extern int random_int_secret_init(void); | ||
| 41 | 40 | ||
| 42 | #ifndef MODULE | 41 | #ifndef MODULE |
| 43 | extern const struct file_operations random_fops, urandom_fops; | 42 | extern const struct file_operations random_fops, urandom_fops; |
| 44 | #endif | 43 | #endif |
| 45 | 44 | ||
| 46 | unsigned int get_random_int(void); | 45 | u32 get_random_u32(void); |
| 47 | unsigned long get_random_long(void); | 46 | u64 get_random_u64(void); |
| 47 | static inline unsigned int get_random_int(void) | ||
| 48 | { | ||
| 49 | return get_random_u32(); | ||
| 50 | } | ||
| 51 | static 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 | |||
| 48 | unsigned long randomize_page(unsigned long start, unsigned long range); | 60 | unsigned long randomize_page(unsigned long start, unsigned long range); |
| 49 | 61 | ||
| 50 | u32 prandom_u32(void); | 62 | u32 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 | ||
| 64 | extern void userfaultfd_remove(struct vm_area_struct *vma, | 64 | extern 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, | |||
| 72 | extern void userfaultfd_unmap_complete(struct mm_struct *mm, | 71 | extern void userfaultfd_unmap_complete(struct mm_struct *mm, |
| 73 | struct list_head *uf); | 72 | struct list_head *uf); |
| 74 | 73 | ||
| 75 | extern 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 | ||
| 123 | static inline void userfaultfd_remove(struct vm_area_struct *vma, | 120 | static 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 | ||
| 130 | static inline int userfaultfd_unmap_prep(struct vm_area_struct *vma, | 127 | static 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 | ||
| 142 | static 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 | ||
| 623 | extern int do_wait_intr(wait_queue_head_t *, wait_queue_t *); | ||
| 624 | extern 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) \ |
diff --git a/include/media/vsp1.h b/include/media/vsp1.h index 458b400373d4..38aac554dbba 100644 --- a/include/media/vsp1.h +++ b/include/media/vsp1.h | |||
| @@ -20,8 +20,17 @@ struct device; | |||
| 20 | 20 | ||
| 21 | int vsp1_du_init(struct device *dev); | 21 | int vsp1_du_init(struct device *dev); |
| 22 | 22 | ||
| 23 | int vsp1_du_setup_lif(struct device *dev, unsigned int width, | 23 | /** |
| 24 | unsigned int height); | 24 | * struct vsp1_du_lif_config - VSP LIF configuration |
| 25 | * @width: output frame width | ||
| 26 | * @height: output frame height | ||
| 27 | */ | ||
| 28 | struct vsp1_du_lif_config { | ||
| 29 | unsigned int width; | ||
| 30 | unsigned int height; | ||
| 31 | }; | ||
| 32 | |||
| 33 | int vsp1_du_setup_lif(struct device *dev, const struct vsp1_du_lif_config *cfg); | ||
| 25 | 34 | ||
| 26 | struct vsp1_du_atomic_config { | 35 | struct vsp1_du_atomic_config { |
| 27 | u32 pixelformat; | 36 | u32 pixelformat; |
diff --git a/include/net/inet_common.h b/include/net/inet_common.h index b7952d55b9c0..f39ae697347f 100644 --- a/include/net/inet_common.h +++ b/include/net/inet_common.h | |||
| @@ -20,7 +20,8 @@ int __inet_stream_connect(struct socket *sock, struct sockaddr *uaddr, | |||
| 20 | int addr_len, int flags, int is_sendmsg); | 20 | int addr_len, int flags, int is_sendmsg); |
| 21 | int inet_dgram_connect(struct socket *sock, struct sockaddr *uaddr, | 21 | int inet_dgram_connect(struct socket *sock, struct sockaddr *uaddr, |
| 22 | int addr_len, int flags); | 22 | int addr_len, int flags); |
| 23 | int inet_accept(struct socket *sock, struct socket *newsock, int flags); | 23 | int inet_accept(struct socket *sock, struct socket *newsock, int flags, |
| 24 | bool kern); | ||
| 24 | int inet_sendmsg(struct socket *sock, struct msghdr *msg, size_t size); | 25 | int inet_sendmsg(struct socket *sock, struct msghdr *msg, size_t size); |
| 25 | ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset, | 26 | ssize_t inet_sendpage(struct socket *sock, struct page *page, int offset, |
| 26 | size_t size, int flags); | 27 | size_t size, int flags); |
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index 826f198374f8..c7a577976bec 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h | |||
| @@ -258,7 +258,7 @@ inet_csk_rto_backoff(const struct inet_connection_sock *icsk, | |||
| 258 | return (unsigned long)min_t(u64, when, max_when); | 258 | return (unsigned long)min_t(u64, when, max_when); |
| 259 | } | 259 | } |
| 260 | 260 | ||
| 261 | struct sock *inet_csk_accept(struct sock *sk, int flags, int *err); | 261 | struct sock *inet_csk_accept(struct sock *sk, int flags, int *err, bool kern); |
| 262 | 262 | ||
| 263 | int inet_csk_get_port(struct sock *sk, unsigned short snum); | 263 | int inet_csk_get_port(struct sock *sk, unsigned short snum); |
| 264 | 264 | ||
diff --git a/include/net/irda/timer.h b/include/net/irda/timer.h index cb2615ccf761..d784f242cf7b 100644 --- a/include/net/irda/timer.h +++ b/include/net/irda/timer.h | |||
| @@ -59,7 +59,7 @@ struct lap_cb; | |||
| 59 | * Slot timer must never exceed 85 ms, and must always be at least 25 ms, | 59 | * Slot timer must never exceed 85 ms, and must always be at least 25 ms, |
| 60 | * suggested to 75-85 msec by IrDA lite. This doesn't work with a lot of | 60 | * suggested to 75-85 msec by IrDA lite. This doesn't work with a lot of |
| 61 | * devices, and other stackes uses a lot more, so it's best we do it as well | 61 | * devices, and other stackes uses a lot more, so it's best we do it as well |
| 62 | * (Note : this is the default value and sysctl overides it - Jean II) | 62 | * (Note : this is the default value and sysctl overrides it - Jean II) |
| 63 | */ | 63 | */ |
| 64 | #define SLOT_TIMEOUT (90*HZ/1000) | 64 | #define SLOT_TIMEOUT (90*HZ/1000) |
| 65 | 65 | ||
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index a244db5e5ff7..07a0b128625a 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
| @@ -476,7 +476,8 @@ struct sctp_pf { | |||
| 476 | int (*send_verify) (struct sctp_sock *, union sctp_addr *); | 476 | int (*send_verify) (struct sctp_sock *, union sctp_addr *); |
| 477 | int (*supported_addrs)(const struct sctp_sock *, __be16 *); | 477 | int (*supported_addrs)(const struct sctp_sock *, __be16 *); |
| 478 | struct sock *(*create_accept_sk) (struct sock *sk, | 478 | struct sock *(*create_accept_sk) (struct sock *sk, |
| 479 | struct sctp_association *asoc); | 479 | struct sctp_association *asoc, |
| 480 | bool kern); | ||
| 480 | int (*addr_to_user)(struct sctp_sock *sk, union sctp_addr *addr); | 481 | int (*addr_to_user)(struct sctp_sock *sk, union sctp_addr *addr); |
| 481 | void (*to_sk_saddr)(union sctp_addr *, struct sock *sk); | 482 | void (*to_sk_saddr)(union sctp_addr *, struct sock *sk); |
| 482 | void (*to_sk_daddr)(union sctp_addr *, struct sock *sk); | 483 | void (*to_sk_daddr)(union sctp_addr *, struct sock *sk); |
diff --git a/include/net/sock.h b/include/net/sock.h index 5e5997654db6..03252d53975d 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -236,6 +236,7 @@ struct sock_common { | |||
| 236 | * @sk_shutdown: mask of %SEND_SHUTDOWN and/or %RCV_SHUTDOWN | 236 | * @sk_shutdown: mask of %SEND_SHUTDOWN and/or %RCV_SHUTDOWN |
| 237 | * @sk_userlocks: %SO_SNDBUF and %SO_RCVBUF settings | 237 | * @sk_userlocks: %SO_SNDBUF and %SO_RCVBUF settings |
| 238 | * @sk_lock: synchronizer | 238 | * @sk_lock: synchronizer |
| 239 | * @sk_kern_sock: True if sock is using kernel lock classes | ||
| 239 | * @sk_rcvbuf: size of receive buffer in bytes | 240 | * @sk_rcvbuf: size of receive buffer in bytes |
| 240 | * @sk_wq: sock wait queue and async head | 241 | * @sk_wq: sock wait queue and async head |
| 241 | * @sk_rx_dst: receive input route used by early demux | 242 | * @sk_rx_dst: receive input route used by early demux |
| @@ -430,7 +431,8 @@ struct sock { | |||
| 430 | #endif | 431 | #endif |
| 431 | 432 | ||
| 432 | kmemcheck_bitfield_begin(flags); | 433 | kmemcheck_bitfield_begin(flags); |
| 433 | unsigned int sk_padding : 2, | 434 | unsigned int sk_padding : 1, |
| 435 | sk_kern_sock : 1, | ||
| 434 | sk_no_check_tx : 1, | 436 | sk_no_check_tx : 1, |
| 435 | sk_no_check_rx : 1, | 437 | sk_no_check_rx : 1, |
| 436 | sk_userlocks : 4, | 438 | sk_userlocks : 4, |
| @@ -1015,7 +1017,8 @@ struct proto { | |||
| 1015 | int addr_len); | 1017 | int addr_len); |
| 1016 | int (*disconnect)(struct sock *sk, int flags); | 1018 | int (*disconnect)(struct sock *sk, int flags); |
| 1017 | 1019 | ||
| 1018 | struct sock * (*accept)(struct sock *sk, int flags, int *err); | 1020 | struct sock * (*accept)(struct sock *sk, int flags, int *err, |
| 1021 | bool kern); | ||
| 1019 | 1022 | ||
| 1020 | int (*ioctl)(struct sock *sk, int cmd, | 1023 | int (*ioctl)(struct sock *sk, int cmd, |
| 1021 | unsigned long arg); | 1024 | unsigned long arg); |
| @@ -1573,7 +1576,7 @@ int sock_cmsg_send(struct sock *sk, struct msghdr *msg, | |||
| 1573 | int sock_no_bind(struct socket *, struct sockaddr *, int); | 1576 | int sock_no_bind(struct socket *, struct sockaddr *, int); |
| 1574 | int sock_no_connect(struct socket *, struct sockaddr *, int, int); | 1577 | int sock_no_connect(struct socket *, struct sockaddr *, int, int); |
| 1575 | int sock_no_socketpair(struct socket *, struct socket *); | 1578 | int sock_no_socketpair(struct socket *, struct socket *); |
| 1576 | int sock_no_accept(struct socket *, struct socket *, int); | 1579 | int sock_no_accept(struct socket *, struct socket *, int, bool); |
| 1577 | int sock_no_getname(struct socket *, struct sockaddr *, int *, int); | 1580 | int sock_no_getname(struct socket *, struct sockaddr *, int *, int); |
| 1578 | unsigned int sock_no_poll(struct file *, struct socket *, | 1581 | unsigned int sock_no_poll(struct file *, struct socket *, |
| 1579 | struct poll_table_struct *); | 1582 | struct poll_table_struct *); |
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index b0e275de6dec..583875ea136a 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h | |||
| @@ -196,6 +196,7 @@ struct iscsi_conn { | |||
| 196 | struct iscsi_task *task; /* xmit task in progress */ | 196 | struct iscsi_task *task; /* xmit task in progress */ |
| 197 | 197 | ||
| 198 | /* xmit */ | 198 | /* xmit */ |
| 199 | spinlock_t taskqueuelock; /* protects the next three lists */ | ||
| 199 | struct list_head mgmtqueue; /* mgmt (control) xmit queue */ | 200 | struct list_head mgmtqueue; /* mgmt (control) xmit queue */ |
| 200 | struct list_head cmdqueue; /* data-path cmd queue */ | 201 | struct list_head cmdqueue; /* data-path cmd queue */ |
| 201 | struct list_head requeue; /* tasks needing another run */ | 202 | struct list_head requeue; /* tasks needing another run */ |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 6f22b39f1b0c..080c7ce9bae8 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
| @@ -472,6 +472,10 @@ static inline int scsi_device_created(struct scsi_device *sdev) | |||
| 472 | sdev->sdev_state == SDEV_CREATED_BLOCK; | 472 | sdev->sdev_state == SDEV_CREATED_BLOCK; |
| 473 | } | 473 | } |
| 474 | 474 | ||
| 475 | int scsi_internal_device_block(struct scsi_device *sdev, bool wait); | ||
| 476 | int scsi_internal_device_unblock(struct scsi_device *sdev, | ||
| 477 | enum scsi_device_state new_state); | ||
| 478 | |||
| 475 | /* accessor functions for the SCSI parameters */ | 479 | /* accessor functions for the SCSI parameters */ |
| 476 | static inline int scsi_device_sync(struct scsi_device *sdev) | 480 | static inline int scsi_device_sync(struct scsi_device *sdev) |
| 477 | { | 481 | { |
diff --git a/include/trace/events/syscalls.h b/include/trace/events/syscalls.h index 14e49c798135..b35533b94277 100644 --- a/include/trace/events/syscalls.h +++ b/include/trace/events/syscalls.h | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | #undef TRACE_SYSTEM | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM raw_syscalls | 2 | #define TRACE_SYSTEM raw_syscalls |
| 3 | #undef TRACE_INCLUDE_FILE | ||
| 3 | #define TRACE_INCLUDE_FILE syscalls | 4 | #define TRACE_INCLUDE_FILE syscalls |
| 4 | 5 | ||
| 5 | #if !defined(_TRACE_EVENTS_SYSCALLS_H) || defined(TRACE_HEADER_MULTI_READ) | 6 | #if !defined(_TRACE_EVENTS_SYSCALLS_H) || defined(TRACE_HEADER_MULTI_READ) |
diff --git a/include/uapi/linux/packet_diag.h b/include/uapi/linux/packet_diag.h index d08c63f3dd6f..0c5d5dd61b6a 100644 --- a/include/uapi/linux/packet_diag.h +++ b/include/uapi/linux/packet_diag.h | |||
| @@ -64,7 +64,7 @@ struct packet_diag_mclist { | |||
| 64 | __u32 pdmc_count; | 64 | __u32 pdmc_count; |
| 65 | __u16 pdmc_type; | 65 | __u16 pdmc_type; |
| 66 | __u16 pdmc_alen; | 66 | __u16 pdmc_alen; |
| 67 | __u8 pdmc_addr[MAX_ADDR_LEN]; | 67 | __u8 pdmc_addr[32]; /* MAX_ADDR_LEN */ |
| 68 | }; | 68 | }; |
| 69 | 69 | ||
| 70 | struct packet_diag_ring { | 70 | struct packet_diag_ring { |
diff --git a/include/uapi/linux/userfaultfd.h b/include/uapi/linux/userfaultfd.h index c055947c5c98..3b059530dac9 100644 --- a/include/uapi/linux/userfaultfd.h +++ b/include/uapi/linux/userfaultfd.h | |||
| @@ -18,8 +18,7 @@ | |||
| 18 | * means the userland is reading). | 18 | * means the userland is reading). |
| 19 | */ | 19 | */ |
| 20 | #define UFFD_API ((__u64)0xAA) | 20 | #define UFFD_API ((__u64)0xAA) |
| 21 | #define UFFD_API_FEATURES (UFFD_FEATURE_EVENT_EXIT | \ | 21 | #define UFFD_API_FEATURES (UFFD_FEATURE_EVENT_FORK | \ |
| 22 | UFFD_FEATURE_EVENT_FORK | \ | ||
| 23 | UFFD_FEATURE_EVENT_REMAP | \ | 22 | UFFD_FEATURE_EVENT_REMAP | \ |
| 24 | UFFD_FEATURE_EVENT_REMOVE | \ | 23 | UFFD_FEATURE_EVENT_REMOVE | \ |
| 25 | UFFD_FEATURE_EVENT_UNMAP | \ | 24 | UFFD_FEATURE_EVENT_UNMAP | \ |
| @@ -113,7 +112,6 @@ struct uffd_msg { | |||
| 113 | #define UFFD_EVENT_REMAP 0x14 | 112 | #define UFFD_EVENT_REMAP 0x14 |
| 114 | #define UFFD_EVENT_REMOVE 0x15 | 113 | #define UFFD_EVENT_REMOVE 0x15 |
| 115 | #define UFFD_EVENT_UNMAP 0x16 | 114 | #define UFFD_EVENT_UNMAP 0x16 |
| 116 | #define UFFD_EVENT_EXIT 0x17 | ||
| 117 | 115 | ||
| 118 | /* flags for UFFD_EVENT_PAGEFAULT */ | 116 | /* flags for UFFD_EVENT_PAGEFAULT */ |
| 119 | #define UFFD_PAGEFAULT_FLAG_WRITE (1<<0) /* If this was a write fault */ | 117 | #define UFFD_PAGEFAULT_FLAG_WRITE (1<<0) /* If this was a write fault */ |
| @@ -163,7 +161,6 @@ struct uffdio_api { | |||
| 163 | #define UFFD_FEATURE_MISSING_HUGETLBFS (1<<4) | 161 | #define UFFD_FEATURE_MISSING_HUGETLBFS (1<<4) |
| 164 | #define UFFD_FEATURE_MISSING_SHMEM (1<<5) | 162 | #define UFFD_FEATURE_MISSING_SHMEM (1<<5) |
| 165 | #define UFFD_FEATURE_EVENT_UNMAP (1<<6) | 163 | #define UFFD_FEATURE_EVENT_UNMAP (1<<6) |
| 166 | #define UFFD_FEATURE_EVENT_EXIT (1<<7) | ||
| 167 | __u64 features; | 164 | __u64 features; |
| 168 | 165 | ||
| 169 | __u64 ioctls; | 166 | __u64 ioctls; |
diff --git a/include/xen/swiotlb-xen.h b/include/xen/swiotlb-xen.h index a0083be5d529..1f6d78f044b6 100644 --- a/include/xen/swiotlb-xen.h +++ b/include/xen/swiotlb-xen.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define __LINUX_SWIOTLB_XEN_H | 2 | #define __LINUX_SWIOTLB_XEN_H |
| 3 | 3 | ||
| 4 | #include <linux/dma-direction.h> | 4 | #include <linux/dma-direction.h> |
| 5 | #include <linux/scatterlist.h> | ||
| 5 | #include <linux/swiotlb.h> | 6 | #include <linux/swiotlb.h> |
| 6 | 7 | ||
| 7 | extern int xen_swiotlb_init(int verbose, bool early); | 8 | extern int xen_swiotlb_init(int verbose, bool early); |
| @@ -55,4 +56,14 @@ xen_swiotlb_dma_supported(struct device *hwdev, u64 mask); | |||
| 55 | 56 | ||
| 56 | extern int | 57 | extern int |
| 57 | xen_swiotlb_set_dma_mask(struct device *dev, u64 dma_mask); | 58 | xen_swiotlb_set_dma_mask(struct device *dev, u64 dma_mask); |
| 59 | |||
| 60 | extern int | ||
| 61 | xen_swiotlb_dma_mmap(struct device *dev, struct vm_area_struct *vma, | ||
| 62 | void *cpu_addr, dma_addr_t dma_addr, size_t size, | ||
| 63 | unsigned long attrs); | ||
| 64 | |||
| 65 | extern int | ||
| 66 | xen_swiotlb_get_sgtable(struct device *dev, struct sg_table *sgt, | ||
| 67 | void *cpu_addr, dma_addr_t handle, size_t size, | ||
| 68 | unsigned long attrs); | ||
| 58 | #endif /* __LINUX_SWIOTLB_XEN_H */ | 69 | #endif /* __LINUX_SWIOTLB_XEN_H */ |
