Conflict resolution of af_smc.c from Stephen Rothwell.
Showing the changes to include/linux (12 of 350 files). Show all
Unified · Split
| @@ -120,19 +120,23 @@ static inline bool bio_full(struct bio *bio) · 119 unmodified lines | |||
| 120 | return bio->bi_vcnt >= bio->bi_max_vecs; | 120 | return bio->bi_vcnt >= bio->bi_max_vecs; |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | #define mp_bvec_for_each_segment(bv, bvl, i, iter_all) \ | 123 | static inline bool bio_next_segment(const struct bio *bio, |
| 124 | for (bv = bvec_init_iter_all(&iter_all); \ | 124 | struct bvec_iter_all *iter) |
| 125 | (iter_all.done < (bvl)->bv_len) && \ | 125 | { |
| 126 | (mp_bvec_next_segment((bvl), &iter_all), 1); \ | 126 | if (iter->idx >= bio->bi_vcnt) |
| 127 | iter_all.done += bv->bv_len, i += 1) | 127 | return false; |
| 128 | |||
| 129 | bvec_advance(&bio->bi_io_vec[iter->idx], iter); | ||
| 130 | return true; | ||
| 131 | } | ||
| 128 | 132 | ||
| 129 | /* | 133 | /* |
| 130 | * drivers should _never_ use the all version - the bio may have been split | 134 | * drivers should _never_ use the all version - the bio may have been split |
| 131 | * before it got to the driver and the driver won't own all of it | 135 | * before it got to the driver and the driver won't own all of it |
| 132 | */ | 136 | */ |
| 133 | #define bio_for_each_segment_all(bvl, bio, i, iter_all) \ | 137 | #define bio_for_each_segment_all(bvl, bio, i, iter) \ |
| 134 | for (i = 0, iter_all.idx = 0; iter_all.idx < (bio)->bi_vcnt; iter_all.idx++) \ | 138 | for (i = 0, bvl = bvec_init_iter_all(&iter); \ |
| 135 | mp_bvec_for_each_segment(bvl, &((bio)->bi_io_vec[iter_all.idx]), i, iter_all) | 139 | bio_next_segment((bio), &iter); i++) |
| 136 | 140 | ||
| 137 | static inline void bio_advance_iter(struct bio *bio, struct bvec_iter *iter, | 141 | static inline void bio_advance_iter(struct bio *bio, struct bvec_iter *iter, |
| 138 | unsigned bytes) | 142 | unsigned bytes) |
| @@ -302,6 +302,7 @@ void blk_mq_requeue_request(struct request *rq, bool kick_requeue_list); · 301 unmodified lines | |||
| 302 | void blk_mq_kick_requeue_list(struct request_queue *q); | 302 | void blk_mq_kick_requeue_list(struct request_queue *q); |
| 303 | void blk_mq_delay_kick_requeue_list(struct request_queue *q, unsigned long msecs); | 303 | void blk_mq_delay_kick_requeue_list(struct request_queue *q, unsigned long msecs); |
| 304 | bool blk_mq_complete_request(struct request *rq); | 304 | bool blk_mq_complete_request(struct request *rq); |
| 305 | void blk_mq_complete_request_sync(struct request *rq); | ||
| 305 | bool blk_mq_bio_list_merge(struct request_queue *q, struct list_head *list, | 306 | bool blk_mq_bio_list_merge(struct request_queue *q, struct list_head *list, |
| 306 | struct bio *bio); | 307 | struct bio *bio); |
| 307 | bool blk_mq_queue_stopped(struct request_queue *q); | 308 | bool blk_mq_queue_stopped(struct request_queue *q); |
| @@ -145,18 +145,18 @@ static inline bool bvec_iter_advance(const struct bio_vec *bv, · 144 unmodified lines | |||
| 145 | 145 | ||
| 146 | static inline struct bio_vec *bvec_init_iter_all(struct bvec_iter_all *iter_all) | 146 | static inline struct bio_vec *bvec_init_iter_all(struct bvec_iter_all *iter_all) |
| 147 | { | 147 | { |
| 148 | iter_all->bv.bv_page = NULL; | ||
| 149 | iter_all->done = 0; | 148 | iter_all->done = 0; |
| 149 | iter_all->idx = 0; | ||
| 150 | 150 | ||
| 151 | return &iter_all->bv; | 151 | return &iter_all->bv; |
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | static inline void mp_bvec_next_segment(const struct bio_vec *bvec, | 154 | static inline void bvec_advance(const struct bio_vec *bvec, |
| 155 | struct bvec_iter_all *iter_all) | 155 | struct bvec_iter_all *iter_all) |
| 156 | { | 156 | { |
| 157 | struct bio_vec *bv = &iter_all->bv; | 157 | struct bio_vec *bv = &iter_all->bv; |
| 158 | 158 | ||
| 159 | if (bv->bv_page) { | 159 | if (iter_all->done) { |
| 160 | bv->bv_page = nth_page(bv->bv_page, 1); | 160 | bv->bv_page = nth_page(bv->bv_page, 1); |
| 161 | bv->bv_offset = 0; | 161 | bv->bv_offset = 0; |
| 162 | } else { | 162 | } else { |
| @@ -165,6 +165,12 @@ static inline void mp_bvec_next_segment(const struct bio_vec *bvec, · 2 unmodified lines | |||
| 165 | } | 165 | } |
| 166 | bv->bv_len = min_t(unsigned int, PAGE_SIZE - bv->bv_offset, | 166 | bv->bv_len = min_t(unsigned int, PAGE_SIZE - bv->bv_offset, |
| 167 | bvec->bv_len - iter_all->done); | 167 | bvec->bv_len - iter_all->done); |
| 168 | iter_all->done += bv->bv_len; | ||
| 169 | |||
| 170 | if (iter_all->done == bvec->bv_len) { | ||
| 171 | iter_all->idx++; | ||
| 172 | iter_all->done = 0; | ||
| 173 | } | ||
| 168 | } | 174 | } |
| 169 | 175 | ||
| 170 | /* | 176 | /* |
| @@ -47,8 +47,8 @@ · 46 unmodified lines | |||
| 47 | 47 | ||
| 48 | #define u64_to_user_ptr(x) ( \ | 48 | #define u64_to_user_ptr(x) ( \ |
| 49 | { \ | 49 | { \ |
| 50 | typecheck(u64, x); \ | 50 | typecheck(u64, (x)); \ |
| 51 | (void __user *)(uintptr_t)x; \ | 51 | (void __user *)(uintptr_t)(x); \ |
| 52 | } \ | 52 | } \ |
| 53 | ) | 53 | ) |
| 54 | 54 | ||
| @@ -28,6 +28,7 @@ · 27 unmodified lines | |||
| 28 | #include <linux/irqbypass.h> | 28 | #include <linux/irqbypass.h> |
| 29 | #include <linux/swait.h> | 29 | #include <linux/swait.h> |
| 30 | #include <linux/refcount.h> | 30 | #include <linux/refcount.h> |
| 31 | #include <linux/nospec.h> | ||
| 31 | #include <asm/signal.h> | 32 | #include <asm/signal.h> |
| 32 | 33 | ||
| 33 | #include <linux/kvm.h> | 34 | #include <linux/kvm.h> |
| @@ -513,10 +514,10 @@ static inline struct kvm_io_bus *kvm_get_bus(struct kvm *kvm, enum kvm_bus idx) · 479 unmodified lines | |||
| 513 | 514 | ||
| 514 | static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i) | 515 | static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i) |
| 515 | { | 516 | { |
| 516 | /* Pairs with smp_wmb() in kvm_vm_ioctl_create_vcpu, in case | 517 | int num_vcpus = atomic_read(&kvm->online_vcpus); |
| 517 | * the caller has read kvm->online_vcpus before (as is the case | 518 | i = array_index_nospec(i, num_vcpus); |
| 518 | * for kvm_for_each_vcpu, for example). | 519 | |
| 519 | */ | 520 | /* Pairs with smp_wmb() in kvm_vm_ioctl_create_vcpu. */ |
| 520 | smp_rmb(); | 521 | smp_rmb(); |
| 521 | return kvm->vcpus[i]; | 522 | return kvm->vcpus[i]; |
| 522 | } | 523 | } |
| @@ -600,6 +601,7 @@ void kvm_put_kvm(struct kvm *kvm); · 77 unmodified lines | |||
| 600 | 601 | ||
| 601 | static inline struct kvm_memslots *__kvm_memslots(struct kvm *kvm, int as_id) | 602 | static inline struct kvm_memslots *__kvm_memslots(struct kvm *kvm, int as_id) |
| 602 | { | 603 | { |
| 604 | as_id = array_index_nospec(as_id, KVM_ADDRESS_SPACE_NUM); | ||
| 603 | return srcu_dereference_check(kvm->memslots[as_id], &kvm->srcu, | 605 | return srcu_dereference_check(kvm->memslots[as_id], &kvm->srcu, |
| 604 | lockdep_is_held(&kvm->slots_lock) || | 606 | lockdep_is_held(&kvm->slots_lock) || |
| 605 | !refcount_read(&kvm->users_count)); | 607 | !refcount_read(&kvm->users_count)); |
| @@ -966,6 +966,10 @@ static inline bool is_pci_p2pdma_page(const struct page *page) · 965 unmodified lines | |||
| 966 | } | 966 | } |
| 967 | #endif /* CONFIG_DEV_PAGEMAP_OPS */ | 967 | #endif /* CONFIG_DEV_PAGEMAP_OPS */ |
| 968 | 968 | ||
| 969 | /* 127: arbitrary random number, small enough to assemble well */ | ||
| 970 | #define page_ref_zero_or_close_to_overflow(page) \ | ||
| 971 | ((unsigned int) page_ref_count(page) + 127u <= 127u) | ||
| 972 | |||
| 969 | static inline void get_page(struct page *page) | 973 | static inline void get_page(struct page *page) |
| 970 | { | 974 | { |
| 971 | page = compound_head(page); | 975 | page = compound_head(page); |
| @@ -973,8 +977,17 @@ static inline void get_page(struct page *page) · 1 unmodified line | |||
| 973 | * Getting a normal page or the head of a compound page | 977 | * Getting a normal page or the head of a compound page |
| 974 | * requires to already have an elevated page->_refcount. | 978 | * requires to already have an elevated page->_refcount. |
| 975 | */ | 979 | */ |
| 976 | VM_BUG_ON_PAGE(page_ref_count(page) <= 0, page); | 980 | VM_BUG_ON_PAGE(page_ref_zero_or_close_to_overflow(page), page); |
| 981 | page_ref_inc(page); | ||
| 982 | } | ||
| 983 | |||
| 984 | static inline __must_check bool try_get_page(struct page *page) | ||
| 985 | { | ||
| 986 | page = compound_head(page); | ||
| 987 | if (WARN_ON_ONCE(page_ref_count(page) <= 0)) | ||
| 988 | return false; | ||
| 977 | page_ref_inc(page); | 989 | page_ref_inc(page); |
| 990 | return true; | ||
| 978 | } | 991 | } |
| 979 | 992 | ||
| 980 | static inline void put_page(struct page *page) | 993 | static inline void put_page(struct page *page) |
| @@ -1498,6 +1498,7 @@ struct net_device_ops { · 1497 unmodified lines | |||
| 1498 | * @IFF_FAILOVER: device is a failover master device | 1498 | * @IFF_FAILOVER: device is a failover master device |
| 1499 | * @IFF_FAILOVER_SLAVE: device is lower dev of a failover master device | 1499 | * @IFF_FAILOVER_SLAVE: device is lower dev of a failover master device |
| 1500 | * @IFF_L3MDEV_RX_HANDLER: only invoke the rx handler of L3 master device | 1500 | * @IFF_L3MDEV_RX_HANDLER: only invoke the rx handler of L3 master device |
| 1501 | * @IFF_LIVE_RENAME_OK: rename is allowed while device is up and running | ||
| 1501 | */ | 1502 | */ |
| 1502 | enum netdev_priv_flags { | 1503 | enum netdev_priv_flags { |
| 1503 | IFF_802_1Q_VLAN = 1<<0, | 1504 | IFF_802_1Q_VLAN = 1<<0, |
| @@ -1530,6 +1531,7 @@ enum netdev_priv_flags { · 26 unmodified lines | |||
| 1530 | IFF_FAILOVER = 1<<27, | 1531 | IFF_FAILOVER = 1<<27, |
| 1531 | IFF_FAILOVER_SLAVE = 1<<28, | 1532 | IFF_FAILOVER_SLAVE = 1<<28, |
| 1532 | IFF_L3MDEV_RX_HANDLER = 1<<29, | 1533 | IFF_L3MDEV_RX_HANDLER = 1<<29, |
| 1534 | IFF_LIVE_RENAME_OK = 1<<30, | ||
| 1533 | }; | 1535 | }; |
| 1534 | 1536 | ||
| 1535 | #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN | 1537 | #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN |
| @@ -1561,6 +1563,7 @@ enum netdev_priv_flags { · 25 unmodified lines | |||
| 1561 | #define IFF_FAILOVER IFF_FAILOVER | 1563 | #define IFF_FAILOVER IFF_FAILOVER |
| 1562 | #define IFF_FAILOVER_SLAVE IFF_FAILOVER_SLAVE | 1564 | #define IFF_FAILOVER_SLAVE IFF_FAILOVER_SLAVE |
| 1563 | #define IFF_L3MDEV_RX_HANDLER IFF_L3MDEV_RX_HANDLER | 1565 | #define IFF_L3MDEV_RX_HANDLER IFF_L3MDEV_RX_HANDLER |
| 1566 | #define IFF_LIVE_RENAME_OK IFF_LIVE_RENAME_OK | ||
| 1564 | 1567 | ||
| 1565 | /** | 1568 | /** |
| 1566 | * struct net_device - The DEVICE structure. | 1569 | * struct net_device - The DEVICE structure. |
| @@ -967,8 +967,13 @@ struct nvme_get_log_page_command { · 966 unmodified lines | |||
| 967 | __le16 numdl; | 967 | __le16 numdl; |
| 968 | __le16 numdu; | 968 | __le16 numdu; |
| 969 | __u16 rsvd11; | 969 | __u16 rsvd11; |
| 970 | __le32 lpol; | 970 | union { |
| 971 | __le32 lpou; | 971 | struct { |
| 972 | __le32 lpol; | ||
| 973 | __le32 lpou; | ||
| 974 | }; | ||
| 975 | __le64 lpo; | ||
| 976 | }; | ||
| 972 | __u32 rsvd14[2]; | 977 | __u32 rsvd14[2]; |
| 973 | }; | 978 | }; |
| 974 | 979 | ||
| @@ -101,18 +101,20 @@ struct pipe_buf_operations { · 100 unmodified lines | |||
| 101 | /* | 101 | /* |
| 102 | * Get a reference to the pipe buffer. | 102 | * Get a reference to the pipe buffer. |
| 103 | */ | 103 | */ |
| 104 | void (*get)(struct pipe_inode_info *, struct pipe_buffer *); | 104 | bool (*get)(struct pipe_inode_info *, struct pipe_buffer *); |
| 105 | }; | 105 | }; |
| 106 | 106 | ||
| 107 | /** | 107 | /** |
| 108 | * pipe_buf_get - get a reference to a pipe_buffer | 108 | * pipe_buf_get - get a reference to a pipe_buffer |
| 109 | * @pipe: the pipe that the buffer belongs to | 109 | * @pipe: the pipe that the buffer belongs to |
| 110 | * @buf: the buffer to get a reference to | 110 | * @buf: the buffer to get a reference to |
| 111 | * | ||
| 112 | * Return: %true if the reference was successfully obtained. | ||
| 111 | */ | 113 | */ |
| 112 | static inline void pipe_buf_get(struct pipe_inode_info *pipe, | 114 | static inline __must_check bool pipe_buf_get(struct pipe_inode_info *pipe, |
| 113 | struct pipe_buffer *buf) | 115 | struct pipe_buffer *buf) |
| 114 | { | 116 | { |
| 115 | buf->ops->get(pipe, buf); | 117 | return buf->ops->get(pipe, buf); |
| 116 | } | 118 | } |
| 117 | 119 | ||
| 118 | /** | 120 | /** |
| @@ -171,7 +173,7 @@ struct pipe_inode_info *alloc_pipe_info(void); · 52 unmodified lines | |||
| 171 | void free_pipe_info(struct pipe_inode_info *); | 173 | void free_pipe_info(struct pipe_inode_info *); |
| 172 | 174 | ||
| 173 | /* Generic pipe buffer ops functions */ | 175 | /* Generic pipe buffer ops functions */ |
| 174 | void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *); | 176 | bool generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *); |
| 175 | int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *); | 177 | int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *); |
| 176 | int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); | 178 | int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); |
| 177 | void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *); | 179 | void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *); |
| @@ -35,10 +35,13 @@ struct pmc_clk { · 34 unmodified lines | |||
| 35 | * | 35 | * |
| 36 | * @base: PMC clock register base offset | 36 | * @base: PMC clock register base offset |
| 37 | * @clks: pointer to set of registered clocks, typically 0..5 | 37 | * @clks: pointer to set of registered clocks, typically 0..5 |
| 38 | * @critical: flag to indicate if firmware enabled pmc_plt_clks | ||
| 39 | * should be marked as critial or not | ||
| 38 | */ | 40 | */ |
| 39 | struct pmc_clk_data { | 41 | struct pmc_clk_data { |
| 40 | void __iomem *base; | 42 | void __iomem *base; |
| 41 | const struct pmc_clk *clks; | 43 | const struct pmc_clk *clks; |
| 44 | bool critical; | ||
| 42 | }; | 45 | }; |
| 43 | 46 | ||
| 44 | #endif /* __PLATFORM_DATA_X86_CLK_PMC_ATOM_H */ | 47 | #endif /* __PLATFORM_DATA_X86_CLK_PMC_ATOM_H */ |
| @@ -304,12 +304,4 @@ rpc_clnt_swap_deactivate(struct rpc_clnt *clnt) · 303 unmodified lines | |||
| 304 | } | 304 | } |
| 305 | #endif /* CONFIG_SUNRPC_SWAP */ | 305 | #endif /* CONFIG_SUNRPC_SWAP */ |
| 306 | 306 | ||
| 307 | static inline bool | ||
| 308 | rpc_task_need_resched(const struct rpc_task *task) | ||
| 309 | { | ||
| 310 | if (RPC_IS_QUEUED(task) || task->tk_callback) | ||
| 311 | return true; | ||
| 312 | return false; | ||
| 313 | } | ||
| 314 | |||
| 315 | #endif /* _LINUX_SUNRPC_SCHED_H_ */ | 307 | #endif /* _LINUX_SUNRPC_SCHED_H_ */ |
| @@ -63,7 +63,7 @@ struct virtqueue; · 62 unmodified lines | |||
| 63 | /* | 63 | /* |
| 64 | * Creates a virtqueue and allocates the descriptor ring. If | 64 | * Creates a virtqueue and allocates the descriptor ring. If |
| 65 | * may_reduce_num is set, then this may allocate a smaller ring than | 65 | * may_reduce_num is set, then this may allocate a smaller ring than |
| 66 | * expected. The caller should query virtqueue_get_ring_size to learn | 66 | * expected. The caller should query virtqueue_get_vring_size to learn |
| 67 | * the actual size of the ring. | 67 | * the actual size of the ring. |
| 68 | */ | 68 | */ |
| 69 | struct virtqueue *vring_create_virtqueue(unsigned int index, | 69 | struct virtqueue *vring_create_virtqueue(unsigned int index, |