Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:3.14 commit in: /
Date: Tue, 30 Jun 2015 14:34:29
Message-Id: 1435674130.bc9b0397988a797ae691094eb7c83c3e210f29ca.mpagano@gentoo
1 commit: bc9b0397988a797ae691094eb7c83c3e210f29ca
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 30 14:22:10 2015 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 30 14:22:10 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=bc9b0397
7
8 Linux patch 3.14.46
9
10 0000_README | 4 +
11 1045_linux-3.14.46.patch | 829 +++++++++++++++++++++++++++++++++++++++++++++++
12 2 files changed, 833 insertions(+)
13
14 diff --git a/0000_README b/0000_README
15 index ac0012f..a04d242 100644
16 --- a/0000_README
17 +++ b/0000_README
18 @@ -222,6 +222,10 @@ Patch: 1044_linux-3.14.45.patch
19 From: http://www.kernel.org
20 Desc: Linux 3.14.45
21
22 +Patch: 1045_linux-3.14.46.patch
23 +From: http://www.kernel.org
24 +Desc: Linux 3.14.46
25 +
26 Patch: 1500_XATTR_USER_PREFIX.patch
27 From: https://bugs.gentoo.org/show_bug.cgi?id=470644
28 Desc: Support for namespace user.pax.* on tmpfs.
29
30 diff --git a/1045_linux-3.14.46.patch b/1045_linux-3.14.46.patch
31 new file mode 100644
32 index 0000000..11a3c89
33 --- /dev/null
34 +++ b/1045_linux-3.14.46.patch
35 @@ -0,0 +1,829 @@
36 +diff --git a/Makefile b/Makefile
37 +index c92186c3efd7..def39fdd9df4 100644
38 +--- a/Makefile
39 ++++ b/Makefile
40 +@@ -1,6 +1,6 @@
41 + VERSION = 3
42 + PATCHLEVEL = 14
43 +-SUBLEVEL = 45
44 ++SUBLEVEL = 46
45 + EXTRAVERSION =
46 + NAME = Remembering Coco
47 +
48 +diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
49 +index 09af14999c9b..530f56e19931 100644
50 +--- a/arch/arm/include/asm/kvm_host.h
51 ++++ b/arch/arm/include/asm/kvm_host.h
52 +@@ -42,7 +42,7 @@
53 +
54 + struct kvm_vcpu;
55 + u32 *kvm_vcpu_reg(struct kvm_vcpu *vcpu, u8 reg_num, u32 mode);
56 +-int kvm_target_cpu(void);
57 ++int __attribute_const__ kvm_target_cpu(void);
58 + int kvm_reset_vcpu(struct kvm_vcpu *vcpu);
59 + void kvm_reset_coprocs(struct kvm_vcpu *vcpu);
60 +
61 +diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
62 +index 7b362bc9c09a..0cbdb8ed71cf 100644
63 +--- a/arch/arm/include/asm/kvm_mmu.h
64 ++++ b/arch/arm/include/asm/kvm_mmu.h
65 +@@ -127,6 +127,18 @@ static inline void kvm_set_s2pmd_writable(pmd_t *pmd)
66 + (__boundary - 1 < (end) - 1)? __boundary: (end); \
67 + })
68 +
69 ++static inline bool kvm_page_empty(void *ptr)
70 ++{
71 ++ struct page *ptr_page = virt_to_page(ptr);
72 ++ return page_count(ptr_page) == 1;
73 ++}
74 ++
75 ++
76 ++#define kvm_pte_table_empty(ptep) kvm_page_empty(ptep)
77 ++#define kvm_pmd_table_empty(pmdp) kvm_page_empty(pmdp)
78 ++#define kvm_pud_table_empty(pudp) (0)
79 ++
80 ++
81 + struct kvm;
82 +
83 + #define kvm_flush_dcache_to_poc(a,l) __cpuc_flush_dcache_area((a), (l))
84 +diff --git a/arch/arm/kernel/hyp-stub.S b/arch/arm/kernel/hyp-stub.S
85 +index 797b1a6a4906..7e666cfda634 100644
86 +--- a/arch/arm/kernel/hyp-stub.S
87 ++++ b/arch/arm/kernel/hyp-stub.S
88 +@@ -134,9 +134,7 @@ ENTRY(__hyp_stub_install_secondary)
89 + mcr p15, 4, r7, c1, c1, 3 @ HSTR
90 +
91 + THUMB( orr r7, #(1 << 30) ) @ HSCTLR.TE
92 +-#ifdef CONFIG_CPU_BIG_ENDIAN
93 +- orr r7, #(1 << 9) @ HSCTLR.EE
94 +-#endif
95 ++ARM_BE8(orr r7, r7, #(1 << 25)) @ HSCTLR.EE
96 + mcr p15, 4, r7, c1, c0, 0 @ HSCTLR
97 +
98 + mrc p15, 4, r7, c1, c1, 1 @ HDCR
99 +diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
100 +index bd18bb8b2770..df6e75e47ae0 100644
101 +--- a/arch/arm/kvm/arm.c
102 ++++ b/arch/arm/kvm/arm.c
103 +@@ -82,7 +82,7 @@ struct kvm_vcpu *kvm_arm_get_running_vcpu(void)
104 + /**
105 + * kvm_arm_get_running_vcpus - get the per-CPU array of currently running vcpus.
106 + */
107 +-struct kvm_vcpu __percpu **kvm_get_running_vcpus(void)
108 ++struct kvm_vcpu * __percpu *kvm_get_running_vcpus(void)
109 + {
110 + return &kvm_arm_running_vcpu;
111 + }
112 +@@ -155,16 +155,6 @@ int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf)
113 + return VM_FAULT_SIGBUS;
114 + }
115 +
116 +-void kvm_arch_free_memslot(struct kvm *kvm, struct kvm_memory_slot *free,
117 +- struct kvm_memory_slot *dont)
118 +-{
119 +-}
120 +-
121 +-int kvm_arch_create_memslot(struct kvm *kvm, struct kvm_memory_slot *slot,
122 +- unsigned long npages)
123 +-{
124 +- return 0;
125 +-}
126 +
127 + /**
128 + * kvm_arch_destroy_vm - destroy the VM data structure
129 +@@ -224,33 +214,6 @@ long kvm_arch_dev_ioctl(struct file *filp,
130 + return -EINVAL;
131 + }
132 +
133 +-void kvm_arch_memslots_updated(struct kvm *kvm)
134 +-{
135 +-}
136 +-
137 +-int kvm_arch_prepare_memory_region(struct kvm *kvm,
138 +- struct kvm_memory_slot *memslot,
139 +- struct kvm_userspace_memory_region *mem,
140 +- enum kvm_mr_change change)
141 +-{
142 +- return 0;
143 +-}
144 +-
145 +-void kvm_arch_commit_memory_region(struct kvm *kvm,
146 +- struct kvm_userspace_memory_region *mem,
147 +- const struct kvm_memory_slot *old,
148 +- enum kvm_mr_change change)
149 +-{
150 +-}
151 +-
152 +-void kvm_arch_flush_shadow_all(struct kvm *kvm)
153 +-{
154 +-}
155 +-
156 +-void kvm_arch_flush_shadow_memslot(struct kvm *kvm,
157 +- struct kvm_memory_slot *slot)
158 +-{
159 +-}
160 +
161 + struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id)
162 + {
163 +diff --git a/arch/arm/kvm/coproc.c b/arch/arm/kvm/coproc.c
164 +index c58a35116f63..7c732908f1df 100644
165 +--- a/arch/arm/kvm/coproc.c
166 ++++ b/arch/arm/kvm/coproc.c
167 +@@ -742,7 +742,7 @@ static bool is_valid_cache(u32 val)
168 + u32 level, ctype;
169 +
170 + if (val >= CSSELR_MAX)
171 +- return -ENOENT;
172 ++ return false;
173 +
174 + /* Bottom bit is Instruction or Data bit. Next 3 bits are level. */
175 + level = (val >> 1);
176 +diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
177 +index c93ef38f9cb0..70ed2c1f57b0 100644
178 +--- a/arch/arm/kvm/mmu.c
179 ++++ b/arch/arm/kvm/mmu.c
180 +@@ -90,103 +90,115 @@ static void *mmu_memory_cache_alloc(struct kvm_mmu_memory_cache *mc)
181 + return p;
182 + }
183 +
184 +-static bool page_empty(void *ptr)
185 ++static void clear_pgd_entry(struct kvm *kvm, pgd_t *pgd, phys_addr_t addr)
186 + {
187 +- struct page *ptr_page = virt_to_page(ptr);
188 +- return page_count(ptr_page) == 1;
189 ++ pud_t *pud_table __maybe_unused = pud_offset(pgd, 0);
190 ++ pgd_clear(pgd);
191 ++ kvm_tlb_flush_vmid_ipa(kvm, addr);
192 ++ pud_free(NULL, pud_table);
193 ++ put_page(virt_to_page(pgd));
194 + }
195 +
196 + static void clear_pud_entry(struct kvm *kvm, pud_t *pud, phys_addr_t addr)
197 + {
198 +- if (pud_huge(*pud)) {
199 +- pud_clear(pud);
200 +- kvm_tlb_flush_vmid_ipa(kvm, addr);
201 +- } else {
202 +- pmd_t *pmd_table = pmd_offset(pud, 0);
203 +- pud_clear(pud);
204 +- kvm_tlb_flush_vmid_ipa(kvm, addr);
205 +- pmd_free(NULL, pmd_table);
206 +- }
207 ++ pmd_t *pmd_table = pmd_offset(pud, 0);
208 ++ VM_BUG_ON(pud_huge(*pud));
209 ++ pud_clear(pud);
210 ++ kvm_tlb_flush_vmid_ipa(kvm, addr);
211 ++ pmd_free(NULL, pmd_table);
212 + put_page(virt_to_page(pud));
213 + }
214 +
215 + static void clear_pmd_entry(struct kvm *kvm, pmd_t *pmd, phys_addr_t addr)
216 + {
217 +- if (kvm_pmd_huge(*pmd)) {
218 +- pmd_clear(pmd);
219 +- kvm_tlb_flush_vmid_ipa(kvm, addr);
220 +- } else {
221 +- pte_t *pte_table = pte_offset_kernel(pmd, 0);
222 +- pmd_clear(pmd);
223 +- kvm_tlb_flush_vmid_ipa(kvm, addr);
224 +- pte_free_kernel(NULL, pte_table);
225 +- }
226 ++ pte_t *pte_table = pte_offset_kernel(pmd, 0);
227 ++ VM_BUG_ON(kvm_pmd_huge(*pmd));
228 ++ pmd_clear(pmd);
229 ++ kvm_tlb_flush_vmid_ipa(kvm, addr);
230 ++ pte_free_kernel(NULL, pte_table);
231 + put_page(virt_to_page(pmd));
232 + }
233 +
234 +-static void clear_pte_entry(struct kvm *kvm, pte_t *pte, phys_addr_t addr)
235 ++static void unmap_ptes(struct kvm *kvm, pmd_t *pmd,
236 ++ phys_addr_t addr, phys_addr_t end)
237 + {
238 +- if (pte_present(*pte)) {
239 +- kvm_set_pte(pte, __pte(0));
240 +- put_page(virt_to_page(pte));
241 +- kvm_tlb_flush_vmid_ipa(kvm, addr);
242 ++ phys_addr_t start_addr = addr;
243 ++ pte_t *pte, *start_pte;
244 ++
245 ++ start_pte = pte = pte_offset_kernel(pmd, addr);
246 ++ do {
247 ++ if (!pte_none(*pte)) {
248 ++ kvm_set_pte(pte, __pte(0));
249 ++ put_page(virt_to_page(pte));
250 ++ kvm_tlb_flush_vmid_ipa(kvm, addr);
251 ++ }
252 ++ } while (pte++, addr += PAGE_SIZE, addr != end);
253 ++
254 ++ if (kvm_pte_table_empty(start_pte))
255 ++ clear_pmd_entry(kvm, pmd, start_addr);
256 + }
257 +-}
258 +
259 +-static void unmap_range(struct kvm *kvm, pgd_t *pgdp,
260 +- unsigned long long start, u64 size)
261 ++static void unmap_pmds(struct kvm *kvm, pud_t *pud,
262 ++ phys_addr_t addr, phys_addr_t end)
263 + {
264 +- pgd_t *pgd;
265 +- pud_t *pud;
266 +- pmd_t *pmd;
267 +- pte_t *pte;
268 +- unsigned long long addr = start, end = start + size;
269 +- u64 next;
270 +-
271 +- while (addr < end) {
272 +- pgd = pgdp + pgd_index(addr);
273 +- pud = pud_offset(pgd, addr);
274 +- if (pud_none(*pud)) {
275 +- addr = kvm_pud_addr_end(addr, end);
276 +- continue;
277 +- }
278 ++ phys_addr_t next, start_addr = addr;
279 ++ pmd_t *pmd, *start_pmd;
280 +
281 +- if (pud_huge(*pud)) {
282 +- /*
283 +- * If we are dealing with a huge pud, just clear it and
284 +- * move on.
285 +- */
286 +- clear_pud_entry(kvm, pud, addr);
287 +- addr = kvm_pud_addr_end(addr, end);
288 +- continue;
289 ++ start_pmd = pmd = pmd_offset(pud, addr);
290 ++ do {
291 ++ next = kvm_pmd_addr_end(addr, end);
292 ++ if (!pmd_none(*pmd)) {
293 ++ if (kvm_pmd_huge(*pmd)) {
294 ++ pmd_clear(pmd);
295 ++ kvm_tlb_flush_vmid_ipa(kvm, addr);
296 ++ put_page(virt_to_page(pmd));
297 ++ } else {
298 ++ unmap_ptes(kvm, pmd, addr, next);
299 ++ }
300 + }
301 ++ } while (pmd++, addr = next, addr != end);
302 +
303 +- pmd = pmd_offset(pud, addr);
304 +- if (pmd_none(*pmd)) {
305 +- addr = kvm_pmd_addr_end(addr, end);
306 +- continue;
307 +- }
308 ++ if (kvm_pmd_table_empty(start_pmd))
309 ++ clear_pud_entry(kvm, pud, start_addr);
310 ++}
311 +
312 +- if (!kvm_pmd_huge(*pmd)) {
313 +- pte = pte_offset_kernel(pmd, addr);
314 +- clear_pte_entry(kvm, pte, addr);
315 +- next = addr + PAGE_SIZE;
316 +- }
317 ++static void unmap_puds(struct kvm *kvm, pgd_t *pgd,
318 ++ phys_addr_t addr, phys_addr_t end)
319 ++{
320 ++ phys_addr_t next, start_addr = addr;
321 ++ pud_t *pud, *start_pud;
322 +
323 +- /*
324 +- * If the pmd entry is to be cleared, walk back up the ladder
325 +- */
326 +- if (kvm_pmd_huge(*pmd) || page_empty(pte)) {
327 +- clear_pmd_entry(kvm, pmd, addr);
328 +- next = kvm_pmd_addr_end(addr, end);
329 +- if (page_empty(pmd) && !page_empty(pud)) {
330 +- clear_pud_entry(kvm, pud, addr);
331 +- next = kvm_pud_addr_end(addr, end);
332 ++ start_pud = pud = pud_offset(pgd, addr);
333 ++ do {
334 ++ next = kvm_pud_addr_end(addr, end);
335 ++ if (!pud_none(*pud)) {
336 ++ if (pud_huge(*pud)) {
337 ++ pud_clear(pud);
338 ++ kvm_tlb_flush_vmid_ipa(kvm, addr);
339 ++ put_page(virt_to_page(pud));
340 ++ } else {
341 ++ unmap_pmds(kvm, pud, addr, next);
342 + }
343 + }
344 ++ } while (pud++, addr = next, addr != end);
345 +
346 +- addr = next;
347 +- }
348 ++ if (kvm_pud_table_empty(start_pud))
349 ++ clear_pgd_entry(kvm, pgd, start_addr);
350 ++}
351 ++
352 ++
353 ++static void unmap_range(struct kvm *kvm, pgd_t *pgdp,
354 ++ phys_addr_t start, u64 size)
355 ++{
356 ++ pgd_t *pgd;
357 ++ phys_addr_t addr = start, end = start + size;
358 ++ phys_addr_t next;
359 ++
360 ++ pgd = pgdp + pgd_index(addr);
361 ++ do {
362 ++ next = kvm_pgd_addr_end(addr, end);
363 ++ unmap_puds(kvm, pgd, addr, next);
364 ++ } while (pgd++, addr = next, addr != end);
365 + }
366 +
367 + static void stage2_flush_ptes(struct kvm *kvm, pmd_t *pmd,
368 +@@ -747,6 +759,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
369 + struct kvm_mmu_memory_cache *memcache = &vcpu->arch.mmu_page_cache;
370 + struct vm_area_struct *vma;
371 + pfn_t pfn;
372 ++ pgprot_t mem_type = PAGE_S2;
373 +
374 + write_fault = kvm_is_write_fault(kvm_vcpu_get_hsr(vcpu));
375 + if (fault_status == FSC_PERM && !write_fault) {
376 +@@ -797,6 +810,9 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
377 + if (is_error_pfn(pfn))
378 + return -EFAULT;
379 +
380 ++ if (kvm_is_mmio_pfn(pfn))
381 ++ mem_type = PAGE_S2_DEVICE;
382 ++
383 + spin_lock(&kvm->mmu_lock);
384 + if (mmu_notifier_retry(kvm, mmu_seq))
385 + goto out_unlock;
386 +@@ -804,7 +820,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
387 + hugetlb = transparent_hugepage_adjust(&pfn, &fault_ipa);
388 +
389 + if (hugetlb) {
390 +- pmd_t new_pmd = pfn_pmd(pfn, PAGE_S2);
391 ++ pmd_t new_pmd = pfn_pmd(pfn, mem_type);
392 + new_pmd = pmd_mkhuge(new_pmd);
393 + if (writable) {
394 + kvm_set_s2pmd_writable(&new_pmd);
395 +@@ -813,13 +829,14 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
396 + coherent_cache_guest_page(vcpu, hva & PMD_MASK, PMD_SIZE);
397 + ret = stage2_set_pmd_huge(kvm, memcache, fault_ipa, &new_pmd);
398 + } else {
399 +- pte_t new_pte = pfn_pte(pfn, PAGE_S2);
400 ++ pte_t new_pte = pfn_pte(pfn, mem_type);
401 + if (writable) {
402 + kvm_set_s2pte_writable(&new_pte);
403 + kvm_set_pfn_dirty(pfn);
404 + }
405 + coherent_cache_guest_page(vcpu, hva, PAGE_SIZE);
406 +- ret = stage2_set_pte(kvm, memcache, fault_ipa, &new_pte, false);
407 ++ ret = stage2_set_pte(kvm, memcache, fault_ipa, &new_pte,
408 ++ mem_type == PAGE_S2_DEVICE);
409 + }
410 +
411 +
412 +@@ -1099,3 +1116,49 @@ out:
413 + free_hyp_pgds();
414 + return err;
415 + }
416 ++
417 ++void kvm_arch_commit_memory_region(struct kvm *kvm,
418 ++ struct kvm_userspace_memory_region *mem,
419 ++ const struct kvm_memory_slot *old,
420 ++ enum kvm_mr_change change)
421 ++{
422 ++ gpa_t gpa = old->base_gfn << PAGE_SHIFT;
423 ++ phys_addr_t size = old->npages << PAGE_SHIFT;
424 ++ if (change == KVM_MR_DELETE || change == KVM_MR_MOVE) {
425 ++ spin_lock(&kvm->mmu_lock);
426 ++ unmap_stage2_range(kvm, gpa, size);
427 ++ spin_unlock(&kvm->mmu_lock);
428 ++ }
429 ++}
430 ++
431 ++int kvm_arch_prepare_memory_region(struct kvm *kvm,
432 ++ struct kvm_memory_slot *memslot,
433 ++ struct kvm_userspace_memory_region *mem,
434 ++ enum kvm_mr_change change)
435 ++{
436 ++ return 0;
437 ++}
438 ++
439 ++void kvm_arch_free_memslot(struct kvm *kvm, struct kvm_memory_slot *free,
440 ++ struct kvm_memory_slot *dont)
441 ++{
442 ++}
443 ++
444 ++int kvm_arch_create_memslot(struct kvm *kvm, struct kvm_memory_slot *slot,
445 ++ unsigned long npages)
446 ++{
447 ++ return 0;
448 ++}
449 ++
450 ++void kvm_arch_memslots_updated(struct kvm *kvm)
451 ++{
452 ++}
453 ++
454 ++void kvm_arch_flush_shadow_all(struct kvm *kvm)
455 ++{
456 ++}
457 ++
458 ++void kvm_arch_flush_shadow_memslot(struct kvm *kvm,
459 ++ struct kvm_memory_slot *slot)
460 ++{
461 ++}
462 +diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
463 +index 0a1d69751562..3fb0946d963a 100644
464 +--- a/arch/arm64/include/asm/kvm_host.h
465 ++++ b/arch/arm64/include/asm/kvm_host.h
466 +@@ -42,7 +42,7 @@
467 + #define KVM_VCPU_MAX_FEATURES 2
468 +
469 + struct kvm_vcpu;
470 +-int kvm_target_cpu(void);
471 ++int __attribute_const__ kvm_target_cpu(void);
472 + int kvm_reset_vcpu(struct kvm_vcpu *vcpu);
473 + int kvm_arch_dev_ioctl_check_extension(long ext);
474 +
475 +@@ -177,7 +177,7 @@ static inline int kvm_test_age_hva(struct kvm *kvm, unsigned long hva)
476 + }
477 +
478 + struct kvm_vcpu *kvm_arm_get_running_vcpu(void);
479 +-struct kvm_vcpu __percpu **kvm_get_running_vcpus(void);
480 ++struct kvm_vcpu * __percpu *kvm_get_running_vcpus(void);
481 +
482 + u64 kvm_call_hyp(void *hypfn, ...);
483 +
484 +diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
485 +index 7d29847a893b..8e138c7c53ac 100644
486 +--- a/arch/arm64/include/asm/kvm_mmu.h
487 ++++ b/arch/arm64/include/asm/kvm_mmu.h
488 +@@ -125,6 +125,21 @@ static inline void kvm_set_s2pmd_writable(pmd_t *pmd)
489 + #define kvm_pud_addr_end(addr, end) pud_addr_end(addr, end)
490 + #define kvm_pmd_addr_end(addr, end) pmd_addr_end(addr, end)
491 +
492 ++static inline bool kvm_page_empty(void *ptr)
493 ++{
494 ++ struct page *ptr_page = virt_to_page(ptr);
495 ++ return page_count(ptr_page) == 1;
496 ++}
497 ++
498 ++#define kvm_pte_table_empty(ptep) kvm_page_empty(ptep)
499 ++#ifndef CONFIG_ARM64_64K_PAGES
500 ++#define kvm_pmd_table_empty(pmdp) kvm_page_empty(pmdp)
501 ++#else
502 ++#define kvm_pmd_table_empty(pmdp) (0)
503 ++#endif
504 ++#define kvm_pud_table_empty(pudp) (0)
505 ++
506 ++
507 + struct kvm;
508 +
509 + #define kvm_flush_dcache_to_poc(a,l) __flush_dcache_area((a), (l))
510 +diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S
511 +index b0d1512acf08..5dfc8331c385 100644
512 +--- a/arch/arm64/kvm/hyp.S
513 ++++ b/arch/arm64/kvm/hyp.S
514 +@@ -830,7 +830,7 @@ el1_trap:
515 + mrs x2, far_el2
516 +
517 + 2: mrs x0, tpidr_el2
518 +- str x1, [x0, #VCPU_ESR_EL2]
519 ++ str w1, [x0, #VCPU_ESR_EL2]
520 + str x2, [x0, #VCPU_FAR_EL2]
521 + str x3, [x0, #VCPU_HPFAR_EL2]
522 +
523 +diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
524 +index 03244582bc55..7691b2563d27 100644
525 +--- a/arch/arm64/kvm/sys_regs.c
526 ++++ b/arch/arm64/kvm/sys_regs.c
527 +@@ -836,7 +836,7 @@ static bool is_valid_cache(u32 val)
528 + u32 level, ctype;
529 +
530 + if (val >= CSSELR_MAX)
531 +- return -ENOENT;
532 ++ return false;
533 +
534 + /* Bottom bit is Instruction or Data bit. Next 3 bits are level. */
535 + level = (val >> 1);
536 +@@ -962,7 +962,7 @@ static unsigned int num_demux_regs(void)
537 +
538 + static int write_demux_regids(u64 __user *uindices)
539 + {
540 +- u64 val = KVM_REG_ARM | KVM_REG_SIZE_U32 | KVM_REG_ARM_DEMUX;
541 ++ u64 val = KVM_REG_ARM64 | KVM_REG_SIZE_U32 | KVM_REG_ARM_DEMUX;
542 + unsigned int i;
543 +
544 + val |= KVM_REG_ARM_DEMUX_ID_CCSIDR;
545 +diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
546 +index 26b03e1254ef..8ff2b3ca7ee9 100644
547 +--- a/drivers/bluetooth/ath3k.c
548 ++++ b/drivers/bluetooth/ath3k.c
549 +@@ -79,6 +79,7 @@ static const struct usb_device_id ath3k_table[] = {
550 + { USB_DEVICE(0x0489, 0xe057) },
551 + { USB_DEVICE(0x0489, 0xe056) },
552 + { USB_DEVICE(0x0489, 0xe05f) },
553 ++ { USB_DEVICE(0x0489, 0xe076) },
554 + { USB_DEVICE(0x0489, 0xe078) },
555 + { USB_DEVICE(0x04c5, 0x1330) },
556 + { USB_DEVICE(0x04CA, 0x3004) },
557 +@@ -109,6 +110,7 @@ static const struct usb_device_id ath3k_table[] = {
558 + { USB_DEVICE(0x13d3, 0x3402) },
559 + { USB_DEVICE(0x13d3, 0x3408) },
560 + { USB_DEVICE(0x13d3, 0x3432) },
561 ++ { USB_DEVICE(0x13d3, 0x3474) },
562 +
563 + /* Atheros AR5BBU12 with sflash firmware */
564 + { USB_DEVICE(0x0489, 0xE02C) },
565 +@@ -133,6 +135,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
566 + { USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 },
567 + { USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
568 + { USB_DEVICE(0x0489, 0xe05f), .driver_info = BTUSB_ATH3012 },
569 ++ { USB_DEVICE(0x0489, 0xe076), .driver_info = BTUSB_ATH3012 },
570 + { USB_DEVICE(0x0489, 0xe078), .driver_info = BTUSB_ATH3012 },
571 + { USB_DEVICE(0x04c5, 0x1330), .driver_info = BTUSB_ATH3012 },
572 + { USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
573 +@@ -163,6 +166,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
574 + { USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 },
575 + { USB_DEVICE(0x13d3, 0x3408), .driver_info = BTUSB_ATH3012 },
576 + { USB_DEVICE(0x13d3, 0x3432), .driver_info = BTUSB_ATH3012 },
577 ++ { USB_DEVICE(0x13d3, 0x3474), .driver_info = BTUSB_ATH3012 },
578 +
579 + /* Atheros AR5BBU22 with sflash firmware */
580 + { USB_DEVICE(0x0489, 0xE036), .driver_info = BTUSB_ATH3012 },
581 +diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
582 +index 9eb1669962ef..c0e7a9aa97a4 100644
583 +--- a/drivers/bluetooth/btusb.c
584 ++++ b/drivers/bluetooth/btusb.c
585 +@@ -157,6 +157,7 @@ static const struct usb_device_id blacklist_table[] = {
586 + { USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 },
587 + { USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 },
588 + { USB_DEVICE(0x0489, 0xe05f), .driver_info = BTUSB_ATH3012 },
589 ++ { USB_DEVICE(0x0489, 0xe076), .driver_info = BTUSB_ATH3012 },
590 + { USB_DEVICE(0x0489, 0xe078), .driver_info = BTUSB_ATH3012 },
591 + { USB_DEVICE(0x04c5, 0x1330), .driver_info = BTUSB_ATH3012 },
592 + { USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
593 +@@ -187,6 +188,7 @@ static const struct usb_device_id blacklist_table[] = {
594 + { USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 },
595 + { USB_DEVICE(0x13d3, 0x3408), .driver_info = BTUSB_ATH3012 },
596 + { USB_DEVICE(0x13d3, 0x3432), .driver_info = BTUSB_ATH3012 },
597 ++ { USB_DEVICE(0x13d3, 0x3474), .driver_info = BTUSB_ATH3012 },
598 +
599 + /* Atheros AR5BBU12 with sflash firmware */
600 + { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
601 +diff --git a/drivers/crypto/caam/caamrng.c b/drivers/crypto/caam/caamrng.c
602 +index 28486b19fc36..ae6dae8ef7ab 100644
603 +--- a/drivers/crypto/caam/caamrng.c
604 ++++ b/drivers/crypto/caam/caamrng.c
605 +@@ -56,7 +56,7 @@
606 +
607 + /* Buffer, its dma address and lock */
608 + struct buf_data {
609 +- u8 buf[RN_BUF_SIZE];
610 ++ u8 buf[RN_BUF_SIZE] ____cacheline_aligned;
611 + dma_addr_t addr;
612 + struct completion filled;
613 + u32 hw_desc[DESC_JOB_O_LEN];
614 +diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
615 +index 968374776db9..f2511a03e3e9 100644
616 +--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
617 ++++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
618 +@@ -1529,6 +1529,11 @@ static int mga_vga_mode_valid(struct drm_connector *connector,
619 + return MODE_BANDWIDTH;
620 + }
621 +
622 ++ if ((mode->hdisplay % 8) != 0 || (mode->hsync_start % 8) != 0 ||
623 ++ (mode->hsync_end % 8) != 0 || (mode->htotal % 8) != 0) {
624 ++ return MODE_H_ILLEGAL;
625 ++ }
626 ++
627 + if (mode->crtc_hdisplay > 2048 || mode->crtc_hsync_start > 4096 ||
628 + mode->crtc_hsync_end > 4096 || mode->crtc_htotal > 4096 ||
629 + mode->crtc_vdisplay > 2048 || mode->crtc_vsync_start > 4096 ||
630 +diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
631 +index 8f580fda443f..ce211328bc1c 100644
632 +--- a/drivers/scsi/lpfc/lpfc_sli.c
633 ++++ b/drivers/scsi/lpfc/lpfc_sli.c
634 +@@ -265,6 +265,16 @@ lpfc_sli4_eq_get(struct lpfc_queue *q)
635 + return NULL;
636 +
637 + q->hba_index = idx;
638 ++
639 ++ /*
640 ++ * insert barrier for instruction interlock : data from the hardware
641 ++ * must have the valid bit checked before it can be copied and acted
642 ++ * upon. Given what was seen in lpfc_sli4_cq_get() of speculative
643 ++ * instructions allowing action on content before valid bit checked,
644 ++ * add barrier here as well. May not be needed as "content" is a
645 ++ * single 32-bit entity here (vs multi word structure for cq's).
646 ++ */
647 ++ mb();
648 + return eqe;
649 + }
650 +
651 +@@ -370,6 +380,17 @@ lpfc_sli4_cq_get(struct lpfc_queue *q)
652 +
653 + cqe = q->qe[q->hba_index].cqe;
654 + q->hba_index = idx;
655 ++
656 ++ /*
657 ++ * insert barrier for instruction interlock : data from the hardware
658 ++ * must have the valid bit checked before it can be copied and acted
659 ++ * upon. Speculative instructions were allowing a bcopy at the start
660 ++ * of lpfc_sli4_fp_handle_wcqe(), which is called immediately
661 ++ * after our return, to copy data before the valid bit check above
662 ++ * was done. As such, some of the copied data was stale. The barrier
663 ++ * ensures the check is before any data is copied.
664 ++ */
665 ++ mb();
666 + return cqe;
667 + }
668 +
669 +diff --git a/fs/pipe.c b/fs/pipe.c
670 +index 78fd0d0788db..46f1ab264a4c 100644
671 +--- a/fs/pipe.c
672 ++++ b/fs/pipe.c
673 +@@ -117,25 +117,27 @@ void pipe_wait(struct pipe_inode_info *pipe)
674 + }
675 +
676 + static int
677 +-pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
678 +- int atomic)
679 ++pipe_iov_copy_from_user(void *addr, int *offset, struct iovec *iov,
680 ++ size_t *remaining, int atomic)
681 + {
682 + unsigned long copy;
683 +
684 +- while (len > 0) {
685 ++ while (*remaining > 0) {
686 + while (!iov->iov_len)
687 + iov++;
688 +- copy = min_t(unsigned long, len, iov->iov_len);
689 ++ copy = min_t(unsigned long, *remaining, iov->iov_len);
690 +
691 + if (atomic) {
692 +- if (__copy_from_user_inatomic(to, iov->iov_base, copy))
693 ++ if (__copy_from_user_inatomic(addr + *offset,
694 ++ iov->iov_base, copy))
695 + return -EFAULT;
696 + } else {
697 +- if (copy_from_user(to, iov->iov_base, copy))
698 ++ if (copy_from_user(addr + *offset,
699 ++ iov->iov_base, copy))
700 + return -EFAULT;
701 + }
702 +- to += copy;
703 +- len -= copy;
704 ++ *offset += copy;
705 ++ *remaining -= copy;
706 + iov->iov_base += copy;
707 + iov->iov_len -= copy;
708 + }
709 +@@ -143,25 +145,27 @@ pipe_iov_copy_from_user(void *to, struct iovec *iov, unsigned long len,
710 + }
711 +
712 + static int
713 +-pipe_iov_copy_to_user(struct iovec *iov, const void *from, unsigned long len,
714 +- int atomic)
715 ++pipe_iov_copy_to_user(struct iovec *iov, void *addr, int *offset,
716 ++ size_t *remaining, int atomic)
717 + {
718 + unsigned long copy;
719 +
720 +- while (len > 0) {
721 ++ while (*remaining > 0) {
722 + while (!iov->iov_len)
723 + iov++;
724 +- copy = min_t(unsigned long, len, iov->iov_len);
725 ++ copy = min_t(unsigned long, *remaining, iov->iov_len);
726 +
727 + if (atomic) {
728 +- if (__copy_to_user_inatomic(iov->iov_base, from, copy))
729 ++ if (__copy_to_user_inatomic(iov->iov_base,
730 ++ addr + *offset, copy))
731 + return -EFAULT;
732 + } else {
733 +- if (copy_to_user(iov->iov_base, from, copy))
734 ++ if (copy_to_user(iov->iov_base,
735 ++ addr + *offset, copy))
736 + return -EFAULT;
737 + }
738 +- from += copy;
739 +- len -= copy;
740 ++ *offset += copy;
741 ++ *remaining -= copy;
742 + iov->iov_base += copy;
743 + iov->iov_len -= copy;
744 + }
745 +@@ -395,7 +399,7 @@ pipe_read(struct kiocb *iocb, const struct iovec *_iov,
746 + struct pipe_buffer *buf = pipe->bufs + curbuf;
747 + const struct pipe_buf_operations *ops = buf->ops;
748 + void *addr;
749 +- size_t chars = buf->len;
750 ++ size_t chars = buf->len, remaining;
751 + int error, atomic;
752 +
753 + if (chars > total_len)
754 +@@ -409,9 +413,11 @@ pipe_read(struct kiocb *iocb, const struct iovec *_iov,
755 + }
756 +
757 + atomic = !iov_fault_in_pages_write(iov, chars);
758 ++ remaining = chars;
759 + redo:
760 + addr = ops->map(pipe, buf, atomic);
761 +- error = pipe_iov_copy_to_user(iov, addr + buf->offset, chars, atomic);
762 ++ error = pipe_iov_copy_to_user(iov, addr, &buf->offset,
763 ++ &remaining, atomic);
764 + ops->unmap(pipe, buf, addr);
765 + if (unlikely(error)) {
766 + /*
767 +@@ -426,7 +432,6 @@ redo:
768 + break;
769 + }
770 + ret += chars;
771 +- buf->offset += chars;
772 + buf->len -= chars;
773 +
774 + /* Was it a packet buffer? Clean up and exit */
775 +@@ -531,6 +536,7 @@ pipe_write(struct kiocb *iocb, const struct iovec *_iov,
776 + if (ops->can_merge && offset + chars <= PAGE_SIZE) {
777 + int error, atomic = 1;
778 + void *addr;
779 ++ size_t remaining = chars;
780 +
781 + error = ops->confirm(pipe, buf);
782 + if (error)
783 +@@ -539,8 +545,8 @@ pipe_write(struct kiocb *iocb, const struct iovec *_iov,
784 + iov_fault_in_pages_read(iov, chars);
785 + redo1:
786 + addr = ops->map(pipe, buf, atomic);
787 +- error = pipe_iov_copy_from_user(offset + addr, iov,
788 +- chars, atomic);
789 ++ error = pipe_iov_copy_from_user(addr, &offset, iov,
790 ++ &remaining, atomic);
791 + ops->unmap(pipe, buf, addr);
792 + ret = error;
793 + do_wakeup = 1;
794 +@@ -575,6 +581,8 @@ redo1:
795 + struct page *page = pipe->tmp_page;
796 + char *src;
797 + int error, atomic = 1;
798 ++ int offset = 0;
799 ++ size_t remaining;
800 +
801 + if (!page) {
802 + page = alloc_page(GFP_HIGHUSER);
803 +@@ -595,14 +603,15 @@ redo1:
804 + chars = total_len;
805 +
806 + iov_fault_in_pages_read(iov, chars);
807 ++ remaining = chars;
808 + redo2:
809 + if (atomic)
810 + src = kmap_atomic(page);
811 + else
812 + src = kmap(page);
813 +
814 +- error = pipe_iov_copy_from_user(src, iov, chars,
815 +- atomic);
816 ++ error = pipe_iov_copy_from_user(src, &offset, iov,
817 ++ &remaining, atomic);
818 + if (atomic)
819 + kunmap_atomic(src);
820 + else
821 +diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
822 +index 8a8631926a07..cb347e85f75e 100644
823 +--- a/kernel/trace/trace_events_filter.c
824 ++++ b/kernel/trace/trace_events_filter.c
825 +@@ -1399,19 +1399,24 @@ static int check_preds(struct filter_parse_state *ps)
826 + {
827 + int n_normal_preds = 0, n_logical_preds = 0;
828 + struct postfix_elt *elt;
829 ++ int cnt = 0;
830 +
831 + list_for_each_entry(elt, &ps->postfix, list) {
832 +- if (elt->op == OP_NONE)
833 ++ if (elt->op == OP_NONE) {
834 ++ cnt++;
835 + continue;
836 ++ }
837 +
838 ++ cnt--;
839 + if (elt->op == OP_AND || elt->op == OP_OR) {
840 + n_logical_preds++;
841 + continue;
842 + }
843 + n_normal_preds++;
844 ++ WARN_ON_ONCE(cnt < 0);
845 + }
846 +
847 +- if (!n_normal_preds || n_logical_preds >= n_normal_preds) {
848 ++ if (cnt != 1 || !n_normal_preds || n_logical_preds >= n_normal_preds) {
849 + parse_error(ps, FILT_ERR_INVALID_FILTER, 0);
850 + return -EINVAL;
851 + }
852 +diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c
853 +index 4eec2d436109..1316e558db64 100644
854 +--- a/virt/kvm/arm/vgic.c
855 ++++ b/virt/kvm/arm/vgic.c
856 +@@ -1654,7 +1654,7 @@ out:
857 + return ret;
858 + }
859 +
860 +-static bool vgic_ioaddr_overlap(struct kvm *kvm)
861 ++static int vgic_ioaddr_overlap(struct kvm *kvm)
862 + {
863 + phys_addr_t dist = kvm->arch.vgic.vgic_dist_base;
864 + phys_addr_t cpu = kvm->arch.vgic.vgic_cpu_base;