1 |
commit: f6d488f641a3289902abf03543bb035ce13d70e6 |
2 |
Author: Alice Ferrazzi <alicef <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Feb 26 10:42:06 2021 +0000 |
4 |
Commit: Alice Ferrazzi <alicef <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Feb 26 10:42:24 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=f6d488f6 |
7 |
|
8 |
Linux patch 5.10.19 |
9 |
|
10 |
Signed-off-by: Alice Ferrazzi <alicef <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1018_linux-5.10.19.patch | 544 +++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 548 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index ae786d2..0f03575 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -115,6 +115,10 @@ Patch: 1017_linux-5.10.18.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 5.10.18 |
23 |
|
24 |
+Patch: 1018_linux-5.10.19.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 5.10.19 |
27 |
+ |
28 |
Patch: 1500_XATTR_USER_PREFIX.patch |
29 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
30 |
Desc: Support for namespace user.pax.* on tmpfs. |
31 |
|
32 |
diff --git a/1018_linux-5.10.19.patch b/1018_linux-5.10.19.patch |
33 |
new file mode 100644 |
34 |
index 0000000..b8b2ca4 |
35 |
--- /dev/null |
36 |
+++ b/1018_linux-5.10.19.patch |
37 |
@@ -0,0 +1,544 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index 822a8e10d4325..f700bdea626d9 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,9 +1,9 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 5 |
45 |
+ PATCHLEVEL = 10 |
46 |
+-SUBLEVEL = 18 |
47 |
++SUBLEVEL = 19 |
48 |
+ EXTRAVERSION = |
49 |
+-NAME = Kleptomaniac Octopus |
50 |
++NAME = Dare mighty things |
51 |
+ |
52 |
+ # *DOCUMENTATION* |
53 |
+ # To see a list of typical targets execute "make help" |
54 |
+diff --git a/arch/arm64/boot/dts/nvidia/tegra210.dtsi b/arch/arm64/boot/dts/nvidia/tegra210.dtsi |
55 |
+index d47c88950d38d..7fd47d8f166a6 100644 |
56 |
+--- a/arch/arm64/boot/dts/nvidia/tegra210.dtsi |
57 |
++++ b/arch/arm64/boot/dts/nvidia/tegra210.dtsi |
58 |
+@@ -997,6 +997,7 @@ |
59 |
+ <&tegra_car 128>, /* hda2hdmi */ |
60 |
+ <&tegra_car 111>; /* hda2codec_2x */ |
61 |
+ reset-names = "hda", "hda2hdmi", "hda2codec_2x"; |
62 |
++ power-domains = <&pd_sor>; |
63 |
+ status = "disabled"; |
64 |
+ }; |
65 |
+ |
66 |
+diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c |
67 |
+index 52f36c8790862..dacbd13d32c69 100644 |
68 |
+--- a/arch/x86/kvm/mmu/mmu.c |
69 |
++++ b/arch/x86/kvm/mmu/mmu.c |
70 |
+@@ -2409,7 +2409,7 @@ static unsigned long kvm_mmu_zap_oldest_mmu_pages(struct kvm *kvm, |
71 |
+ return 0; |
72 |
+ |
73 |
+ restart: |
74 |
+- list_for_each_entry_safe(sp, tmp, &kvm->arch.active_mmu_pages, link) { |
75 |
++ list_for_each_entry_safe_reverse(sp, tmp, &kvm->arch.active_mmu_pages, link) { |
76 |
+ /* |
77 |
+ * Don't zap active root pages, the page itself can't be freed |
78 |
+ * and zapping it will just force vCPUs to realloc and reload. |
79 |
+diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c |
80 |
+index 9f958699141e2..1c942869baacc 100644 |
81 |
+--- a/drivers/bluetooth/btusb.c |
82 |
++++ b/drivers/bluetooth/btusb.c |
83 |
+@@ -3689,6 +3689,13 @@ static int btusb_setup_qca(struct hci_dev *hdev) |
84 |
+ info = &qca_devices_table[i]; |
85 |
+ } |
86 |
+ if (!info) { |
87 |
++ /* If the rom_version is not matched in the qca_devices_table |
88 |
++ * and the high ROM version is not zero, we assume this chip no |
89 |
++ * need to load the rampatch and nvm. |
90 |
++ */ |
91 |
++ if (ver_rom & ~0xffffU) |
92 |
++ return 0; |
93 |
++ |
94 |
+ bt_dev_err(hdev, "don't support firmware rome 0x%x", ver_rom); |
95 |
+ return -ENODEV; |
96 |
+ } |
97 |
+diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c |
98 |
+index 98bd48f13fd11..8cd8af35cfaac 100644 |
99 |
+--- a/drivers/gpu/drm/xlnx/zynqmp_disp.c |
100 |
++++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c |
101 |
+@@ -1398,19 +1398,11 @@ static void zynqmp_disp_enable(struct zynqmp_disp *disp) |
102 |
+ */ |
103 |
+ static void zynqmp_disp_disable(struct zynqmp_disp *disp) |
104 |
+ { |
105 |
+- struct drm_crtc *crtc = &disp->crtc; |
106 |
+- |
107 |
+ zynqmp_disp_audio_disable(&disp->audio); |
108 |
+ |
109 |
+ zynqmp_disp_avbuf_disable_audio(&disp->avbuf); |
110 |
+ zynqmp_disp_avbuf_disable_channels(&disp->avbuf); |
111 |
+ zynqmp_disp_avbuf_disable(&disp->avbuf); |
112 |
+- |
113 |
+- /* Mark the flip is done as crtc is disabled anyway */ |
114 |
+- if (crtc->state->event) { |
115 |
+- complete_all(crtc->state->event->base.completion); |
116 |
+- crtc->state->event = NULL; |
117 |
+- } |
118 |
+ } |
119 |
+ |
120 |
+ static inline struct zynqmp_disp *crtc_to_disp(struct drm_crtc *crtc) |
121 |
+@@ -1499,6 +1491,13 @@ zynqmp_disp_crtc_atomic_disable(struct drm_crtc *crtc, |
122 |
+ |
123 |
+ drm_crtc_vblank_off(&disp->crtc); |
124 |
+ |
125 |
++ spin_lock_irq(&crtc->dev->event_lock); |
126 |
++ if (crtc->state->event) { |
127 |
++ drm_crtc_send_vblank_event(crtc, crtc->state->event); |
128 |
++ crtc->state->event = NULL; |
129 |
++ } |
130 |
++ spin_unlock_irq(&crtc->dev->event_lock); |
131 |
++ |
132 |
+ clk_disable_unprepare(disp->pclk); |
133 |
+ pm_runtime_put_sync(disp->dev); |
134 |
+ } |
135 |
+diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c |
136 |
+index 56172fe6995cd..8a8b2b982f83c 100644 |
137 |
+--- a/drivers/hid/hid-core.c |
138 |
++++ b/drivers/hid/hid-core.c |
139 |
+@@ -90,7 +90,7 @@ EXPORT_SYMBOL_GPL(hid_register_report); |
140 |
+ * Register a new field for this report. |
141 |
+ */ |
142 |
+ |
143 |
+-static struct hid_field *hid_register_field(struct hid_report *report, unsigned usages, unsigned values) |
144 |
++static struct hid_field *hid_register_field(struct hid_report *report, unsigned usages) |
145 |
+ { |
146 |
+ struct hid_field *field; |
147 |
+ |
148 |
+@@ -101,7 +101,7 @@ static struct hid_field *hid_register_field(struct hid_report *report, unsigned |
149 |
+ |
150 |
+ field = kzalloc((sizeof(struct hid_field) + |
151 |
+ usages * sizeof(struct hid_usage) + |
152 |
+- values * sizeof(unsigned)), GFP_KERNEL); |
153 |
++ usages * sizeof(unsigned)), GFP_KERNEL); |
154 |
+ if (!field) |
155 |
+ return NULL; |
156 |
+ |
157 |
+@@ -300,7 +300,7 @@ static int hid_add_field(struct hid_parser *parser, unsigned report_type, unsign |
158 |
+ usages = max_t(unsigned, parser->local.usage_index, |
159 |
+ parser->global.report_count); |
160 |
+ |
161 |
+- field = hid_register_field(report, usages, parser->global.report_count); |
162 |
++ field = hid_register_field(report, usages); |
163 |
+ if (!field) |
164 |
+ return 0; |
165 |
+ |
166 |
+diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c |
167 |
+index ec448f5f2dc33..73b9db9e3aab6 100644 |
168 |
+--- a/drivers/hwmon/dell-smm-hwmon.c |
169 |
++++ b/drivers/hwmon/dell-smm-hwmon.c |
170 |
+@@ -1159,6 +1159,13 @@ static struct dmi_system_id i8k_blacklist_fan_support_dmi_table[] __initdata = { |
171 |
+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS13 9333"), |
172 |
+ }, |
173 |
+ }, |
174 |
++ { |
175 |
++ .ident = "Dell XPS 15 L502X", |
176 |
++ .matches = { |
177 |
++ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), |
178 |
++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Dell System XPS L502X"), |
179 |
++ }, |
180 |
++ }, |
181 |
+ { } |
182 |
+ }; |
183 |
+ |
184 |
+diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_pci_id_tbl.h b/drivers/net/ethernet/chelsio/cxgb4/t4_pci_id_tbl.h |
185 |
+index 0c5373462cedb..0b1b5f9c67d47 100644 |
186 |
+--- a/drivers/net/ethernet/chelsio/cxgb4/t4_pci_id_tbl.h |
187 |
++++ b/drivers/net/ethernet/chelsio/cxgb4/t4_pci_id_tbl.h |
188 |
+@@ -219,6 +219,7 @@ CH_PCI_DEVICE_ID_TABLE_DEFINE_BEGIN |
189 |
+ CH_PCI_ID_TABLE_FENTRY(0x6089), /* Custom T62100-KR */ |
190 |
+ CH_PCI_ID_TABLE_FENTRY(0x608a), /* Custom T62100-CR */ |
191 |
+ CH_PCI_ID_TABLE_FENTRY(0x608b), /* Custom T6225-CR */ |
192 |
++ CH_PCI_ID_TABLE_FENTRY(0x6092), /* Custom T62100-CR-LOM */ |
193 |
+ CH_PCI_DEVICE_ID_TABLE_DEFINE_END; |
194 |
+ |
195 |
+ #endif /* __T4_PCI_ID_TBL_H__ */ |
196 |
+diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c |
197 |
+index ce73df4c137ea..b223536e07bed 100644 |
198 |
+--- a/drivers/net/usb/qmi_wwan.c |
199 |
++++ b/drivers/net/usb/qmi_wwan.c |
200 |
+@@ -1332,6 +1332,7 @@ static const struct usb_device_id products[] = { |
201 |
+ {QMI_FIXED_INTF(0x1e2d, 0x0082, 5)}, /* Cinterion PHxx,PXxx (2 RmNet) */ |
202 |
+ {QMI_FIXED_INTF(0x1e2d, 0x0083, 4)}, /* Cinterion PHxx,PXxx (1 RmNet + USB Audio)*/ |
203 |
+ {QMI_QUIRK_SET_DTR(0x1e2d, 0x00b0, 4)}, /* Cinterion CLS8 */ |
204 |
++ {QMI_FIXED_INTF(0x1e2d, 0x00b7, 0)}, /* Cinterion MV31 RmNet */ |
205 |
+ {QMI_FIXED_INTF(0x413c, 0x81a2, 8)}, /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */ |
206 |
+ {QMI_FIXED_INTF(0x413c, 0x81a3, 8)}, /* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card */ |
207 |
+ {QMI_FIXED_INTF(0x413c, 0x81a4, 8)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */ |
208 |
+diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c |
209 |
+index 493ed7ba86ed2..4eb867804b6ab 100644 |
210 |
+--- a/drivers/nvme/host/rdma.c |
211 |
++++ b/drivers/nvme/host/rdma.c |
212 |
+@@ -860,7 +860,7 @@ static int nvme_rdma_configure_admin_queue(struct nvme_rdma_ctrl *ctrl, |
213 |
+ return error; |
214 |
+ |
215 |
+ ctrl->device = ctrl->queues[0].device; |
216 |
+- ctrl->ctrl.numa_node = dev_to_node(ctrl->device->dev->dma_device); |
217 |
++ ctrl->ctrl.numa_node = ibdev_to_node(ctrl->device->dev); |
218 |
+ |
219 |
+ /* T10-PI support */ |
220 |
+ if (ctrl->device->dev->attrs.device_cap_flags & |
221 |
+diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c |
222 |
+index 1b4eb7046b078..6ade3daf78584 100644 |
223 |
+--- a/drivers/usb/core/quirks.c |
224 |
++++ b/drivers/usb/core/quirks.c |
225 |
+@@ -391,6 +391,9 @@ static const struct usb_device_id usb_quirk_list[] = { |
226 |
+ /* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */ |
227 |
+ { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF }, |
228 |
+ |
229 |
++ /* ELMO L-12F document camera */ |
230 |
++ { USB_DEVICE(0x09a1, 0x0028), .driver_info = USB_QUIRK_DELAY_CTRL_MSG }, |
231 |
++ |
232 |
+ /* Broadcom BCM92035DGROM BT dongle */ |
233 |
+ { USB_DEVICE(0x0a5c, 0x2021), .driver_info = USB_QUIRK_RESET_RESUME }, |
234 |
+ |
235 |
+@@ -415,6 +418,9 @@ static const struct usb_device_id usb_quirk_list[] = { |
236 |
+ { USB_DEVICE(0x10d6, 0x2200), .driver_info = |
237 |
+ USB_QUIRK_STRING_FETCH_255 }, |
238 |
+ |
239 |
++ /* novation SoundControl XL */ |
240 |
++ { USB_DEVICE(0x1235, 0x0061), .driver_info = USB_QUIRK_RESET_RESUME }, |
241 |
++ |
242 |
+ /* Huawei 4G LTE module */ |
243 |
+ { USB_DEVICE(0x12d1, 0x15bb), .driver_info = |
244 |
+ USB_QUIRK_DISCONNECT_SUSPEND }, |
245 |
+@@ -495,9 +501,6 @@ static const struct usb_device_id usb_quirk_list[] = { |
246 |
+ /* INTEL VALUE SSD */ |
247 |
+ { USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME }, |
248 |
+ |
249 |
+- /* novation SoundControl XL */ |
250 |
+- { USB_DEVICE(0x1235, 0x0061), .driver_info = USB_QUIRK_RESET_RESUME }, |
251 |
+- |
252 |
+ { } /* terminating entry must be last */ |
253 |
+ }; |
254 |
+ |
255 |
+diff --git a/fs/ceph/mdsmap.c b/fs/ceph/mdsmap.c |
256 |
+index e4aba6c6d3b59..1096d1d3a84c4 100644 |
257 |
+--- a/fs/ceph/mdsmap.c |
258 |
++++ b/fs/ceph/mdsmap.c |
259 |
+@@ -243,8 +243,8 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end) |
260 |
+ } |
261 |
+ |
262 |
+ if (state <= 0) { |
263 |
+- pr_warn("mdsmap_decode got incorrect state(%s)\n", |
264 |
+- ceph_mds_state_name(state)); |
265 |
++ dout("mdsmap_decode got incorrect state(%s)\n", |
266 |
++ ceph_mds_state_name(state)); |
267 |
+ continue; |
268 |
+ } |
269 |
+ |
270 |
+diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c |
271 |
+index 44f9cce570995..ad3ecda1314d9 100644 |
272 |
+--- a/fs/cifs/connect.c |
273 |
++++ b/fs/cifs/connect.c |
274 |
+@@ -4007,6 +4007,7 @@ int cifs_setup_cifs_sb(struct smb_vol *pvolume_info, |
275 |
+ cifs_sb->prepath = kstrdup(pvolume_info->prepath, GFP_KERNEL); |
276 |
+ if (cifs_sb->prepath == NULL) |
277 |
+ return -ENOMEM; |
278 |
++ cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_USE_PREFIX_PATH; |
279 |
+ } |
280 |
+ |
281 |
+ return 0; |
282 |
+diff --git a/fs/dax.c b/fs/dax.c |
283 |
+index 5b47834f2e1bb..b3d27fdc67752 100644 |
284 |
+--- a/fs/dax.c |
285 |
++++ b/fs/dax.c |
286 |
+@@ -810,12 +810,12 @@ static void dax_entry_mkclean(struct address_space *mapping, pgoff_t index, |
287 |
+ address = pgoff_address(index, vma); |
288 |
+ |
289 |
+ /* |
290 |
+- * Note because we provide range to follow_pte_pmd it will |
291 |
+- * call mmu_notifier_invalidate_range_start() on our behalf |
292 |
+- * before taking any lock. |
293 |
++ * follow_invalidate_pte() will use the range to call |
294 |
++ * mmu_notifier_invalidate_range_start() on our behalf before |
295 |
++ * taking any lock. |
296 |
+ */ |
297 |
+- if (follow_pte_pmd(vma->vm_mm, address, &range, |
298 |
+- &ptep, &pmdp, &ptl)) |
299 |
++ if (follow_invalidate_pte(vma->vm_mm, address, &range, &ptep, |
300 |
++ &pmdp, &ptl)) |
301 |
+ continue; |
302 |
+ |
303 |
+ /* |
304 |
+diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c |
305 |
+index caf563981532b..e9d5c8e638b01 100644 |
306 |
+--- a/fs/ntfs/inode.c |
307 |
++++ b/fs/ntfs/inode.c |
308 |
+@@ -629,6 +629,12 @@ static int ntfs_read_locked_inode(struct inode *vi) |
309 |
+ } |
310 |
+ a = ctx->attr; |
311 |
+ /* Get the standard information attribute value. */ |
312 |
++ if ((u8 *)a + le16_to_cpu(a->data.resident.value_offset) |
313 |
++ + le32_to_cpu(a->data.resident.value_length) > |
314 |
++ (u8 *)ctx->mrec + vol->mft_record_size) { |
315 |
++ ntfs_error(vi->i_sb, "Corrupt standard information attribute in inode."); |
316 |
++ goto unm_err_out; |
317 |
++ } |
318 |
+ si = (STANDARD_INFORMATION*)((u8*)a + |
319 |
+ le16_to_cpu(a->data.resident.value_offset)); |
320 |
+ |
321 |
+diff --git a/include/linux/mm.h b/include/linux/mm.h |
322 |
+index cd5c313729ea1..b8eadd9f96802 100644 |
323 |
+--- a/include/linux/mm.h |
324 |
++++ b/include/linux/mm.h |
325 |
+@@ -1655,9 +1655,11 @@ void free_pgd_range(struct mmu_gather *tlb, unsigned long addr, |
326 |
+ unsigned long end, unsigned long floor, unsigned long ceiling); |
327 |
+ int |
328 |
+ copy_page_range(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma); |
329 |
+-int follow_pte_pmd(struct mm_struct *mm, unsigned long address, |
330 |
+- struct mmu_notifier_range *range, |
331 |
+- pte_t **ptepp, pmd_t **pmdpp, spinlock_t **ptlp); |
332 |
++int follow_invalidate_pte(struct mm_struct *mm, unsigned long address, |
333 |
++ struct mmu_notifier_range *range, pte_t **ptepp, |
334 |
++ pmd_t **pmdpp, spinlock_t **ptlp); |
335 |
++int follow_pte(struct mm_struct *mm, unsigned long address, |
336 |
++ pte_t **ptepp, spinlock_t **ptlp); |
337 |
+ int follow_pfn(struct vm_area_struct *vma, unsigned long address, |
338 |
+ unsigned long *pfn); |
339 |
+ int follow_phys(struct vm_area_struct *vma, unsigned long address, |
340 |
+diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h |
341 |
+index 65771bef5e654..ac6ffa5618843 100644 |
342 |
+--- a/include/rdma/ib_verbs.h |
343 |
++++ b/include/rdma/ib_verbs.h |
344 |
+@@ -4642,6 +4642,19 @@ static inline struct ib_device *rdma_device_to_ibdev(struct device *device) |
345 |
+ return coredev->owner; |
346 |
+ } |
347 |
+ |
348 |
++/** |
349 |
++ * ibdev_to_node - return the NUMA node for a given ib_device |
350 |
++ * @dev: device to get the NUMA node for. |
351 |
++ */ |
352 |
++static inline int ibdev_to_node(struct ib_device *ibdev) |
353 |
++{ |
354 |
++ struct device *parent = ibdev->dev.parent; |
355 |
++ |
356 |
++ if (!parent) |
357 |
++ return NUMA_NO_NODE; |
358 |
++ return dev_to_node(parent); |
359 |
++} |
360 |
++ |
361 |
+ /** |
362 |
+ * rdma_device_to_drv_device - Helper macro to reach back to driver's |
363 |
+ * ib_device holder structure from device pointer. |
364 |
+diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c |
365 |
+index 8c017f8c0c6d6..c09594e70f90a 100644 |
366 |
+--- a/kernel/bpf/verifier.c |
367 |
++++ b/kernel/bpf/verifier.c |
368 |
+@@ -10869,7 +10869,7 @@ static int fixup_bpf_calls(struct bpf_verifier_env *env) |
369 |
+ bool isdiv = BPF_OP(insn->code) == BPF_DIV; |
370 |
+ struct bpf_insn *patchlet; |
371 |
+ struct bpf_insn chk_and_div[] = { |
372 |
+- /* Rx div 0 -> 0 */ |
373 |
++ /* [R,W]x div 0 -> 0 */ |
374 |
+ BPF_RAW_INSN((is64 ? BPF_JMP : BPF_JMP32) | |
375 |
+ BPF_JNE | BPF_K, insn->src_reg, |
376 |
+ 0, 2, 0), |
377 |
+@@ -10878,16 +10878,18 @@ static int fixup_bpf_calls(struct bpf_verifier_env *env) |
378 |
+ *insn, |
379 |
+ }; |
380 |
+ struct bpf_insn chk_and_mod[] = { |
381 |
+- /* Rx mod 0 -> Rx */ |
382 |
++ /* [R,W]x mod 0 -> [R,W]x */ |
383 |
+ BPF_RAW_INSN((is64 ? BPF_JMP : BPF_JMP32) | |
384 |
+ BPF_JEQ | BPF_K, insn->src_reg, |
385 |
+- 0, 1, 0), |
386 |
++ 0, 1 + (is64 ? 0 : 1), 0), |
387 |
+ *insn, |
388 |
++ BPF_JMP_IMM(BPF_JA, 0, 0, 1), |
389 |
++ BPF_MOV32_REG(insn->dst_reg, insn->dst_reg), |
390 |
+ }; |
391 |
+ |
392 |
+ patchlet = isdiv ? chk_and_div : chk_and_mod; |
393 |
+ cnt = isdiv ? ARRAY_SIZE(chk_and_div) : |
394 |
+- ARRAY_SIZE(chk_and_mod); |
395 |
++ ARRAY_SIZE(chk_and_mod) - (is64 ? 2 : 0); |
396 |
+ |
397 |
+ new_prog = bpf_patch_insn_data(env, i + delta, patchlet, cnt); |
398 |
+ if (!new_prog) |
399 |
+diff --git a/mm/memory.c b/mm/memory.c |
400 |
+index 50632c4366b8a..eb5722027160a 100644 |
401 |
+--- a/mm/memory.c |
402 |
++++ b/mm/memory.c |
403 |
+@@ -4707,9 +4707,9 @@ int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address) |
404 |
+ } |
405 |
+ #endif /* __PAGETABLE_PMD_FOLDED */ |
406 |
+ |
407 |
+-static int __follow_pte_pmd(struct mm_struct *mm, unsigned long address, |
408 |
+- struct mmu_notifier_range *range, |
409 |
+- pte_t **ptepp, pmd_t **pmdpp, spinlock_t **ptlp) |
410 |
++int follow_invalidate_pte(struct mm_struct *mm, unsigned long address, |
411 |
++ struct mmu_notifier_range *range, pte_t **ptepp, |
412 |
++ pmd_t **pmdpp, spinlock_t **ptlp) |
413 |
+ { |
414 |
+ pgd_t *pgd; |
415 |
+ p4d_t *p4d; |
416 |
+@@ -4774,31 +4774,33 @@ out: |
417 |
+ return -EINVAL; |
418 |
+ } |
419 |
+ |
420 |
+-static inline int follow_pte(struct mm_struct *mm, unsigned long address, |
421 |
+- pte_t **ptepp, spinlock_t **ptlp) |
422 |
+-{ |
423 |
+- int res; |
424 |
+- |
425 |
+- /* (void) is needed to make gcc happy */ |
426 |
+- (void) __cond_lock(*ptlp, |
427 |
+- !(res = __follow_pte_pmd(mm, address, NULL, |
428 |
+- ptepp, NULL, ptlp))); |
429 |
+- return res; |
430 |
+-} |
431 |
+- |
432 |
+-int follow_pte_pmd(struct mm_struct *mm, unsigned long address, |
433 |
+- struct mmu_notifier_range *range, |
434 |
+- pte_t **ptepp, pmd_t **pmdpp, spinlock_t **ptlp) |
435 |
++/** |
436 |
++ * follow_pte - look up PTE at a user virtual address |
437 |
++ * @mm: the mm_struct of the target address space |
438 |
++ * @address: user virtual address |
439 |
++ * @ptepp: location to store found PTE |
440 |
++ * @ptlp: location to store the lock for the PTE |
441 |
++ * |
442 |
++ * On a successful return, the pointer to the PTE is stored in @ptepp; |
443 |
++ * the corresponding lock is taken and its location is stored in @ptlp. |
444 |
++ * The contents of the PTE are only stable until @ptlp is released; |
445 |
++ * any further use, if any, must be protected against invalidation |
446 |
++ * with MMU notifiers. |
447 |
++ * |
448 |
++ * Only IO mappings and raw PFN mappings are allowed. The mmap semaphore |
449 |
++ * should be taken for read. |
450 |
++ * |
451 |
++ * KVM uses this function. While it is arguably less bad than ``follow_pfn``, |
452 |
++ * it is not a good general-purpose API. |
453 |
++ * |
454 |
++ * Return: zero on success, -ve otherwise. |
455 |
++ */ |
456 |
++int follow_pte(struct mm_struct *mm, unsigned long address, |
457 |
++ pte_t **ptepp, spinlock_t **ptlp) |
458 |
+ { |
459 |
+- int res; |
460 |
+- |
461 |
+- /* (void) is needed to make gcc happy */ |
462 |
+- (void) __cond_lock(*ptlp, |
463 |
+- !(res = __follow_pte_pmd(mm, address, range, |
464 |
+- ptepp, pmdpp, ptlp))); |
465 |
+- return res; |
466 |
++ return follow_invalidate_pte(mm, address, NULL, ptepp, NULL, ptlp); |
467 |
+ } |
468 |
+-EXPORT_SYMBOL(follow_pte_pmd); |
469 |
++EXPORT_SYMBOL_GPL(follow_pte); |
470 |
+ |
471 |
+ /** |
472 |
+ * follow_pfn - look up PFN at a user virtual address |
473 |
+@@ -4808,6 +4810,9 @@ EXPORT_SYMBOL(follow_pte_pmd); |
474 |
+ * |
475 |
+ * Only IO mappings and raw PFN mappings are allowed. |
476 |
+ * |
477 |
++ * This function does not allow the caller to read the permissions |
478 |
++ * of the PTE. Do not use it. |
479 |
++ * |
480 |
+ * Return: zero and the pfn at @pfn on success, -ve otherwise. |
481 |
+ */ |
482 |
+ int follow_pfn(struct vm_area_struct *vma, unsigned long address, |
483 |
+diff --git a/net/rds/ib.h b/net/rds/ib.h |
484 |
+index 8dfff43cf07f4..c23a11d9ad362 100644 |
485 |
+--- a/net/rds/ib.h |
486 |
++++ b/net/rds/ib.h |
487 |
+@@ -264,13 +264,6 @@ struct rds_ib_device { |
488 |
+ int *vector_load; |
489 |
+ }; |
490 |
+ |
491 |
+-static inline int ibdev_to_node(struct ib_device *ibdev) |
492 |
+-{ |
493 |
+- struct device *parent; |
494 |
+- |
495 |
+- parent = ibdev->dev.parent; |
496 |
+- return parent ? dev_to_node(parent) : NUMA_NO_NODE; |
497 |
+-} |
498 |
+ #define rdsibdev_to_node(rdsibdev) ibdev_to_node(rdsibdev->dev) |
499 |
+ |
500 |
+ /* bits for i_ack_flags */ |
501 |
+diff --git a/scripts/gen_autoksyms.sh b/scripts/gen_autoksyms.sh |
502 |
+index 16c0b2ddaa4c9..d54dfba15bf25 100755 |
503 |
+--- a/scripts/gen_autoksyms.sh |
504 |
++++ b/scripts/gen_autoksyms.sh |
505 |
+@@ -43,6 +43,9 @@ EOT |
506 |
+ sed 's/ko$/mod/' $modlist | |
507 |
+ xargs -n1 sed -n -e '2{s/ /\n/g;/^$/!p;}' -- | |
508 |
+ cat - "$ksym_wl" | |
509 |
++# Remove the dot prefix for ppc64; symbol names with a dot (.) hold entry |
510 |
++# point addresses. |
511 |
++sed -e 's/^\.//' | |
512 |
+ sort -u | |
513 |
+ sed -e 's/\(.*\)/#define __KSYM_\1 1/' >> "$output_file" |
514 |
+ |
515 |
+diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl |
516 |
+index 3f77a5d695c13..0bafed857e171 100755 |
517 |
+--- a/scripts/recordmcount.pl |
518 |
++++ b/scripts/recordmcount.pl |
519 |
+@@ -268,7 +268,11 @@ if ($arch eq "x86_64") { |
520 |
+ |
521 |
+ # force flags for this arch |
522 |
+ $ld .= " -m shlelf_linux"; |
523 |
+- $objcopy .= " -O elf32-sh-linux"; |
524 |
++ if ($endian eq "big") { |
525 |
++ $objcopy .= " -O elf32-shbig-linux"; |
526 |
++ } else { |
527 |
++ $objcopy .= " -O elf32-sh-linux"; |
528 |
++ } |
529 |
+ |
530 |
+ } elsif ($arch eq "powerpc") { |
531 |
+ my $ldemulation; |
532 |
+diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c |
533 |
+index cf9cc0ed7e995..ed4d2e3a00718 100644 |
534 |
+--- a/virt/kvm/kvm_main.c |
535 |
++++ b/virt/kvm/kvm_main.c |
536 |
+@@ -1888,10 +1888,12 @@ static int hva_to_pfn_remapped(struct vm_area_struct *vma, |
537 |
+ bool write_fault, bool *writable, |
538 |
+ kvm_pfn_t *p_pfn) |
539 |
+ { |
540 |
+- unsigned long pfn; |
541 |
++ kvm_pfn_t pfn; |
542 |
++ pte_t *ptep; |
543 |
++ spinlock_t *ptl; |
544 |
+ int r; |
545 |
+ |
546 |
+- r = follow_pfn(vma, addr, &pfn); |
547 |
++ r = follow_pte(vma->vm_mm, addr, &ptep, &ptl); |
548 |
+ if (r) { |
549 |
+ /* |
550 |
+ * get_user_pages fails for VM_IO and VM_PFNMAP vmas and does |
551 |
+@@ -1906,14 +1908,19 @@ static int hva_to_pfn_remapped(struct vm_area_struct *vma, |
552 |
+ if (r) |
553 |
+ return r; |
554 |
+ |
555 |
+- r = follow_pfn(vma, addr, &pfn); |
556 |
++ r = follow_pte(vma->vm_mm, addr, &ptep, &ptl); |
557 |
+ if (r) |
558 |
+ return r; |
559 |
++ } |
560 |
+ |
561 |
++ if (write_fault && !pte_write(*ptep)) { |
562 |
++ pfn = KVM_PFN_ERR_RO_FAULT; |
563 |
++ goto out; |
564 |
+ } |
565 |
+ |
566 |
+ if (writable) |
567 |
+- *writable = true; |
568 |
++ *writable = pte_write(*ptep); |
569 |
++ pfn = pte_pfn(*ptep); |
570 |
+ |
571 |
+ /* |
572 |
+ * Get a reference here because callers of *hva_to_pfn* and |
573 |
+@@ -1928,6 +1935,8 @@ static int hva_to_pfn_remapped(struct vm_area_struct *vma, |
574 |
+ */ |
575 |
+ kvm_get_pfn(pfn); |
576 |
+ |
577 |
++out: |
578 |
++ pte_unmap_unlock(ptep, ptl); |
579 |
+ *p_pfn = pfn; |
580 |
+ return 0; |
581 |
+ } |