Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-patchset:master commit in: 4.5.5/
Date: Mon, 30 May 2016 07:59:31
Message-Id: 1464595217.91c3b96e63792590118e17193061908a07017497.blueness@gentoo
1 commit: 91c3b96e63792590118e17193061908a07017497
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 30 08:00:17 2016 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Mon May 30 08:00:17 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/hardened-patchset.git/commit/?id=91c3b96e
7
8 grsecurity-3.1-4.5.5-201605291201
9
10 4.5.5/0000_README | 2 +-
11 ...> 4420_grsecurity-3.1-4.5.5-201605291201.patch} | 18852 ++++++++++---------
12 2 files changed, 9793 insertions(+), 9061 deletions(-)
13
14 diff --git a/4.5.5/0000_README b/4.5.5/0000_README
15 index febdb77..71dba33 100644
16 --- a/4.5.5/0000_README
17 +++ b/4.5.5/0000_README
18 @@ -2,7 +2,7 @@ README
19 -----------------------------------------------------------------------------
20 Individual Patch Descriptions:
21 -----------------------------------------------------------------------------
22 -Patch: 4420_grsecurity-3.1-4.5.5-201605211442.patch
23 +Patch: 4420_grsecurity-3.1-4.5.5-201605291201.patch
24 From: http://www.grsecurity.net
25 Desc: hardened-sources base patch from upstream grsecurity
26
27
28 diff --git a/4.5.5/4420_grsecurity-3.1-4.5.5-201605211442.patch b/4.5.5/4420_grsecurity-3.1-4.5.5-201605291201.patch
29 similarity index 99%
30 rename from 4.5.5/4420_grsecurity-3.1-4.5.5-201605211442.patch
31 rename to 4.5.5/4420_grsecurity-3.1-4.5.5-201605291201.patch
32 index 7202c18..1fb08ce 100644
33 --- a/4.5.5/4420_grsecurity-3.1-4.5.5-201605211442.patch
34 +++ b/4.5.5/4420_grsecurity-3.1-4.5.5-201605291201.patch
35 @@ -408,7 +408,7 @@ index a93b414..f50a50b 100644
36
37 A toggle value indicating if modules are allowed to be loaded
38 diff --git a/Makefile b/Makefile
39 -index a23df41..314f8da 100644
40 +index a23df41..db4f30b 100644
41 --- a/Makefile
42 +++ b/Makefile
43 @@ -298,7 +298,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
44 @@ -422,27 +422,41 @@ index a23df41..314f8da 100644
45
46 ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1)
47 HOSTCFLAGS += -Wno-unused-value -Wno-unused-parameter \
48 -@@ -434,8 +436,8 @@ export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \
49 - # Rules shared between *config targets and build targets
50 -
51 - # Basic helpers built in scripts/
52 --PHONY += scripts_basic
53 --scripts_basic:
54 -+PHONY += scripts_basic gcc-plugins
55 -+scripts_basic: gcc-plugins
56 - $(Q)$(MAKE) $(build)=scripts/basic
57 - $(Q)rm -f .tmp_quiet_recordmcount
58 -
59 -@@ -622,6 +624,8 @@ endif
60 +@@ -417,6 +419,8 @@ export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
61 + export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
62 + export KBUILD_ARFLAGS
63 +
64 ++export PLUGINCC GCC_PLUGINS_CFLAGS GCC_PLUGINS_AFLAGS
65 ++
66 + # When compiling out-of-tree modules, put MODVERDIR in the module
67 + # tree rather than in the kernel tree. The kernel tree might
68 + # even be read-only.
69 +@@ -547,7 +551,7 @@ ifeq ($(KBUILD_EXTMOD),)
70 + # in parallel
71 + PHONY += scripts
72 + scripts: scripts_basic include/config/auto.conf include/config/tristate.conf \
73 +- asm-generic
74 ++ asm-generic gcc-plugins
75 + $(Q)$(MAKE) $(build)=$(@)
76 +
77 + # Objects we will link into vmlinux / subdirs we need to visit
78 +@@ -622,6 +626,15 @@ endif
79 # Tell gcc to never replace conditional load with a non-conditional one
80 KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
81
82 ++PHONY += gcc-plugins
83 ++gcc-plugins: scripts_basic
84 ++ifdef CONFIG_GCC_PLUGINS
85 ++ $(Q)$(MAKE) $(build)=scripts/gcc-plugins
86 ++endif
87 ++ @:
88 ++
89 +include scripts/Makefile.gcc-plugins
90 +
91 ifdef CONFIG_READABLE_ASM
92 # Disable optimizations that make assembler listings hard to read.
93 # reorder blocks reorders the control in the function
94 -@@ -714,7 +718,7 @@ KBUILD_CFLAGS += $(call cc-option, -gsplit-dwarf, -g)
95 +@@ -714,7 +727,7 @@ KBUILD_CFLAGS += $(call cc-option, -gsplit-dwarf, -g)
96 else
97 KBUILD_CFLAGS += -g
98 endif
99 @@ -451,7 +465,7 @@ index a23df41..314f8da 100644
100 endif
101 ifdef CONFIG_DEBUG_INFO_DWARF4
102 KBUILD_CFLAGS += $(call cc-option, -gdwarf-4,)
103 -@@ -886,7 +890,7 @@ export mod_sign_cmd
104 +@@ -886,7 +899,7 @@ export mod_sign_cmd
105
106
107 ifeq ($(KBUILD_EXTMOD),)
108 @@ -460,57 +474,16 @@ index a23df41..314f8da 100644
109
110 vmlinux-dirs := $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
111 $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
112 -@@ -937,6 +941,8 @@ endif
113 -
114 - # The actual objects are generated when descending,
115 - # make sure no implicit rule kicks in
116 -+$(filter-out $(init-y),$(vmlinux-deps)): KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS)
117 -+$(filter-out $(init-y),$(vmlinux-deps)): KBUILD_AFLAGS += $(GCC_PLUGINS_AFLAGS)
118 - $(sort $(vmlinux-deps)): $(vmlinux-dirs) ;
119 -
120 - # Handle descending into subdirectories listed in $(vmlinux-dirs)
121 -@@ -946,7 +952,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ;
122 - # Error messages still appears in the original language
123 -
124 - PHONY += $(vmlinux-dirs)
125 --$(vmlinux-dirs): prepare scripts
126 -+$(vmlinux-dirs): gcc-plugins prepare scripts
127 - $(Q)$(MAKE) $(build)=$@
128 -
129 - define filechk_kernel.release
130 -@@ -989,10 +995,13 @@ prepare1: prepare2 $(version_h) include/generated/utsrelease.h \
131 +@@ -989,7 +1002,7 @@ prepare1: prepare2 $(version_h) include/generated/utsrelease.h \
132
133 archprepare: archheaders archscripts prepare1 scripts_basic
134
135 -+prepare0: KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS)
136 -+prepare0: KBUILD_AFLAGS += $(GCC_PLUGINS_AFLAGS)
137 - prepare0: archprepare FORCE
138 +-prepare0: archprepare FORCE
139 ++prepare0: archprepare gcc-plugins FORCE
140 $(Q)$(MAKE) $(build)=.
141
142 # All the preparing..
143 -+prepare: KBUILD_CFLAGS := $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS))
144 - prepare: prepare0
145 -
146 - # Generate some files
147 -@@ -1103,6 +1112,8 @@ all: modules
148 - # using awk while concatenating to the final file.
149 -
150 - PHONY += modules
151 -+modules: KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS)
152 -+modules: KBUILD_AFLAGS += $(GCC_PLUGINS_AFLAGS)
153 - modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
154 - $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
155 - @$(kecho) ' Building modules, stage 2.';
156 -@@ -1118,7 +1129,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
157 -
158 - # Target to prepare building external modules
159 - PHONY += modules_prepare
160 --modules_prepare: prepare scripts
161 -+modules_prepare: gcc-plugins prepare scripts
162 -
163 - # Target to install modules
164 - PHONY += modules_install
165 -@@ -1184,7 +1195,11 @@ MRPROPER_FILES += .config .config.old .version .old_version \
166 +@@ -1184,7 +1197,11 @@ MRPROPER_FILES += .config .config.old .version .old_version \
167 Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
168 signing_key.pem signing_key.priv signing_key.x509 \
169 x509.genkey extra_certificates signing_key.x509.keyid \
170 @@ -523,7 +496,7 @@ index a23df41..314f8da 100644
171
172 # clean - Delete most, but leave enough to build external modules
173 #
174 -@@ -1223,7 +1238,7 @@ distclean: mrproper
175 +@@ -1223,7 +1240,7 @@ distclean: mrproper
176 @find $(srctree) $(RCS_FIND_IGNORE) \
177 \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
178 -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
179 @@ -532,59 +505,31 @@ index a23df41..314f8da 100644
180 -type f -print | xargs rm -f
181
182
183 -@@ -1390,6 +1405,8 @@ PHONY += $(module-dirs) modules
184 - $(module-dirs): crmodverdir $(objtree)/Module.symvers
185 - $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@)
186 +diff --git a/arch/Kconfig b/arch/Kconfig
187 +index f6b649d..5ba628b 100644
188 +--- a/arch/Kconfig
189 ++++ b/arch/Kconfig
190 +@@ -353,6 +353,20 @@ config SECCOMP_FILTER
191
192 -+modules: KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS)
193 -+modules: KBUILD_AFLAGS += $(GCC_PLUGINS_AFLAGS)
194 - modules: $(module-dirs)
195 - @$(kecho) ' Building modules, stage 2.';
196 - $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
197 -@@ -1531,17 +1548,21 @@ else
198 - target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@))
199 - endif
200 + See Documentation/prctl/seccomp_filter.txt for details.
201
202 --%.s: %.c prepare scripts FORCE
203 -+%.s: KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS)
204 -+%.s: KBUILD_AFLAGS += $(GCC_PLUGINS_AFLAGS)
205 -+%.s: %.c gcc-plugins prepare scripts FORCE
206 - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
207 - %.i: %.c prepare scripts FORCE
208 - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
209 --%.o: %.c prepare scripts FORCE
210 -+%.o: KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS)
211 -+%.o: KBUILD_AFLAGS += $(GCC_PLUGINS_AFLAGS)
212 -+%.o: %.c gcc-plugins prepare scripts FORCE
213 - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
214 - %.lst: %.c prepare scripts FORCE
215 - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
216 --%.s: %.S prepare scripts FORCE
217 -+%.s: %.S gcc-plugins prepare scripts FORCE
218 - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
219 --%.o: %.S prepare scripts FORCE
220 -+%.o: %.S gcc-plugins prepare scripts FORCE
221 - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
222 - %.symtypes: %.c prepare scripts FORCE
223 - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
224 -@@ -1553,11 +1574,15 @@ endif
225 - $(build)=$(build-dir)
226 - # Make sure the latest headers are built for Documentation
227 - Documentation/: headers_install
228 --%/: prepare scripts FORCE
229 -+%/: KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS)
230 -+%/: KBUILD_AFLAGS += $(GCC_PLUGINS_AFLAGS)
231 -+%/: gcc-plugins prepare scripts FORCE
232 - $(cmd_crmodverdir)
233 - $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
234 - $(build)=$(build-dir)
235 --%.ko: prepare scripts FORCE
236 -+%.ko: KBUILD_CFLAGS += $(GCC_PLUGINS_CFLAGS)
237 -+%.ko: KBUILD_AFLAGS += $(GCC_PLUGINS_AFLAGS)
238 -+%.ko: gcc-plugins prepare scripts FORCE
239 - $(cmd_crmodverdir)
240 - $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
241 - $(build)=$(build-dir) $(@:.ko=.o)
242 ++config HAVE_GCC_PLUGINS
243 ++ bool
244 ++ help
245 ++ An arch should select this symbol if it supports building with
246 ++ GCC plugins.
247 ++
248 ++menuconfig GCC_PLUGINS
249 ++ bool "GCC plugins"
250 ++ depends on HAVE_GCC_PLUGINS
251 ++ default y
252 ++ help
253 ++ GCC plugins are loadable modules that provide extra features to the
254 ++ compiler. They are useful for runtime instrumentation and static analysis.
255 ++
256 + config HAVE_CC_STACKPROTECTOR
257 + bool
258 + help
259 diff --git a/arch/alpha/include/asm/atomic.h b/arch/alpha/include/asm/atomic.h
260 index 572b228..e03acdd 100644
261 --- a/arch/alpha/include/asm/atomic.h
262 @@ -928,10 +873,18 @@ index 8a188bc..26608f1 100644
263 Counts number of I and D TLB Misses and exports them via Debugfs
264 The counters can be cleared via Debugfs as well
265 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
266 -index 4f799e5..cc1200e 100644
267 +index 4f799e5..c1e2b95 100644
268 --- a/arch/arm/Kconfig
269 +++ b/arch/arm/Kconfig
270 -@@ -1622,6 +1622,7 @@ config HIGHPTE
271 +@@ -53,6 +53,7 @@ config ARM
272 + select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
273 + select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL)
274 + select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
275 ++ select HAVE_GCC_PLUGINS
276 + select HAVE_GENERIC_DMA_COHERENT
277 + select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
278 + select HAVE_IDE if PCI || ISA || PCMCIA
279 +@@ -1622,6 +1623,7 @@ config HIGHPTE
280 config CPU_SW_DOMAIN_PAN
281 bool "Enable use of CPU domains to implement privileged no-access"
282 depends on MMU && !ARM_LPAE
283 @@ -939,7 +892,7 @@ index 4f799e5..cc1200e 100644
284 default y
285 help
286 Increase kernel security by ensuring that normal kernel accesses
287 -@@ -1698,7 +1699,7 @@ config ALIGNMENT_TRAP
288 +@@ -1698,7 +1700,7 @@ config ALIGNMENT_TRAP
289
290 config UACCESS_WITH_MEMCPY
291 bool "Use kernel mem{cpy,set}() for {copy_to,clear}_user()"
292 @@ -948,7 +901,7 @@ index 4f799e5..cc1200e 100644
293 default y if CPU_FEROCEON
294 help
295 Implement faster copy_to_user and clear_user methods for CPU
296 -@@ -1953,6 +1954,7 @@ config KEXEC
297 +@@ -1953,6 +1955,7 @@ config KEXEC
298 depends on (!SMP || PM_SLEEP_SMP)
299 depends on !CPU_V7M
300 select KEXEC_CORE
301 @@ -956,7 +909,7 @@ index 4f799e5..cc1200e 100644
302 help
303 kexec is a system call that implements the ability to shutdown your
304 current kernel, and to start another kernel. It is like a reboot
305 -@@ -1997,7 +1999,7 @@ config EFI_STUB
306 +@@ -1997,7 +2000,7 @@ config EFI_STUB
307
308 config EFI
309 bool "UEFI runtime support"
310 @@ -977,6 +930,19 @@ index c6b6175..2884505 100644
311 ---help---
312 Say Y here if you want to show the kernel pagetable layout in a
313 debugfs file. This information is only useful for kernel developers
314 +diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
315 +index 43788b1..2efefcf 100644
316 +--- a/arch/arm/boot/compressed/Makefile
317 ++++ b/arch/arm/boot/compressed/Makefile
318 +@@ -106,6 +106,8 @@ ORIG_CFLAGS := $(KBUILD_CFLAGS)
319 + KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
320 + endif
321 +
322 ++KBUILD_CFLAGS := $(filter-out $(GCC_PLUGINS_CFLAGS),$(KBUILD_CFLAGS))
323 ++
324 + # -fstack-protector-strong triggers protection checks in this code,
325 + # but it is being used too early to link to meaningful stack_chk logic.
326 + nossp_flags := $(call cc-option, -fno-stack-protector)
327 diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h
328 index 9e10c45..24a14ce 100644
329 --- a/arch/arm/include/asm/atomic.h
330 @@ -3357,7 +3323,7 @@ index 6bd1089..e999400 100644
331 {
332 unsigned long ua_flags;
333 diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c
334 -index c169cc3..f290a77 100644
335 +index c169cc3..b007ec6 100644
336 --- a/arch/arm/mach-exynos/suspend.c
337 +++ b/arch/arm/mach-exynos/suspend.c
338 @@ -734,8 +734,10 @@ void __init exynos_pm_init(void)
339 @@ -3367,8 +3333,8 @@ index c169cc3..f290a77 100644
340 - exynos_pm_syscore_ops.suspend = pm_data->pm_suspend;
341 - exynos_pm_syscore_ops.resume = pm_data->pm_resume;
342 + pax_open_kernel();
343 -+ *(void **)&exynos_pm_syscore_ops.suspend = pm_data->pm_suspend;
344 -+ *(void **)&exynos_pm_syscore_ops.resume = pm_data->pm_resume;
345 ++ const_cast(exynos_pm_syscore_ops.suspend) = pm_data->pm_suspend;
346 ++ const_cast(exynos_pm_syscore_ops.resume) = pm_data->pm_resume;
347 + pax_close_kernel();
348
349 register_syscore_ops(&exynos_pm_syscore_ops);
350 @@ -3501,7 +3467,7 @@ index 2af6ff6..1f2959f 100644
351 /* omap_hwmod_list contains all registered struct omap_hwmods */
352 static LIST_HEAD(omap_hwmod_list);
353 diff --git a/arch/arm/mach-omap2/powerdomains43xx_data.c b/arch/arm/mach-omap2/powerdomains43xx_data.c
354 -index 95fee54..cfa9cf1 100644
355 +index 95fee54..b5dd79d 100644
356 --- a/arch/arm/mach-omap2/powerdomains43xx_data.c
357 +++ b/arch/arm/mach-omap2/powerdomains43xx_data.c
358 @@ -10,6 +10,7 @@
359 @@ -3518,7 +3484,7 @@ index 95fee54..cfa9cf1 100644
360 {
361 - omap4_pwrdm_operations.pwrdm_has_voltdm = am43xx_check_vcvp;
362 + pax_open_kernel();
363 -+ *(void **)&omap4_pwrdm_operations.pwrdm_has_voltdm = am43xx_check_vcvp;
364 ++ const_cast(omap4_pwrdm_operations.pwrdm_has_voltdm) = am43xx_check_vcvp;
365 + pax_close_kernel();
366 pwrdm_register_platform_funcs(&omap4_pwrdm_operations);
367 pwrdm_register_pwrdms(powerdomains_am43xx);
368 @@ -3548,7 +3514,7 @@ index ff0a68c..b312aa0 100644
369 sizeof(struct omap_wd_timer_platform_data));
370 WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s.\n",
371 diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c
372 -index aba75c8..b55a9d7 100644
373 +index aba75c8..b2b340f 100644
374 --- a/arch/arm/mach-shmobile/platsmp-apmu.c
375 +++ b/arch/arm/mach-shmobile/platsmp-apmu.c
376 @@ -22,6 +22,7 @@
377 @@ -3565,7 +3531,7 @@ index aba75c8..b55a9d7 100644
378 {
379 - shmobile_suspend_ops.enter = shmobile_smp_apmu_enter_suspend;
380 + pax_open_kernel();
381 -+ *(void **)&shmobile_suspend_ops.enter = shmobile_smp_apmu_enter_suspend;
382 ++ const_cast(shmobile_suspend_ops.enter) = shmobile_smp_apmu_enter_suspend;
383 + pax_close_kernel();
384 }
385 #endif
386 @@ -3727,7 +3693,7 @@ index c8c8b9e..c55cc79 100644
387 atomic64_set(&mm->context.id, asid);
388 }
389 diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
390 -index daafcf1..8205ed6 100644
391 +index daafcf1..a04e1fd 100644
392 --- a/arch/arm/mm/fault.c
393 +++ b/arch/arm/mm/fault.c
394 @@ -25,6 +25,7 @@
395 @@ -3841,7 +3807,7 @@ index daafcf1..8205ed6 100644
396 pr_alert("Unhandled fault: %s (0x%03x) at 0x%08lx\n",
397 inf->name, fsr, addr);
398 show_pte(current->mm, addr);
399 -@@ -574,15 +647,104 @@ hook_ifault_code(int nr, int (*fn)(unsigned long, unsigned int, struct pt_regs *
400 +@@ -574,15 +647,118 @@ hook_ifault_code(int nr, int (*fn)(unsigned long, unsigned int, struct pt_regs *
401 ifsr_info[nr].name = name;
402 }
403
404 @@ -3879,6 +3845,13 @@ index daafcf1..8205ed6 100644
405 + */
406 + // dmb(); implied by the exception
407 + regs->ARM_pc = regs->ARM_lr;
408 ++#ifdef CONFIG_ARM_THUMB
409 ++ if (regs->ARM_lr & 1) {
410 ++ regs->ARM_cpsr |= PSR_T_BIT;
411 ++ regs->ARM_pc &= ~0x1U;
412 ++ } else
413 ++ regs->ARM_cpsr &= ~PSR_T_BIT;
414 ++#endif
415 + return;
416 + }
417 + if (pc == 0xffff0fc0UL) {
418 @@ -3901,6 +3874,13 @@ index daafcf1..8205ed6 100644
419 + */
420 + regs->ARM_r0 = current_thread_info()->tp_value[0];
421 + regs->ARM_pc = regs->ARM_lr;
422 ++#ifdef CONFIG_ARM_THUMB
423 ++ if (regs->ARM_lr & 1) {
424 ++ regs->ARM_cpsr |= PSR_T_BIT;
425 ++ regs->ARM_pc &= ~0x1U;
426 ++ } else
427 ++ regs->ARM_cpsr &= ~PSR_T_BIT;
428 ++#endif
429 + return;
430 + }
431 + }
432 @@ -4655,6 +4635,18 @@ index a5bc92d..0bb4730 100644
433 omap_sram_size - omap_sram_skip);
434 + pax_close_kernel();
435 }
436 +diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
437 +index 8cc6228..6d6e4f8 100644
438 +--- a/arch/arm64/Kconfig
439 ++++ b/arch/arm64/Kconfig
440 +@@ -70,6 +70,7 @@ config ARM64
441 + select HAVE_FTRACE_MCOUNT_RECORD
442 + select HAVE_FUNCTION_TRACER
443 + select HAVE_FUNCTION_GRAPH_TRACER
444 ++ select HAVE_GCC_PLUGINS
445 + select HAVE_GENERIC_DMA_COHERENT
446 + select HAVE_HW_BREAKPOINT if PERF_EVENTS
447 + select HAVE_IRQ_TIME_ACCOUNTING
448 diff --git a/arch/arm64/Kconfig.debug b/arch/arm64/Kconfig.debug
449 index e13c4bf..3feaea7 100644
450 --- a/arch/arm64/Kconfig.debug
451 @@ -5602,10 +5594,18 @@ index 4efe96a..60e8699 100644
452 #define SMP_CACHE_BYTES L1_CACHE_BYTES
453
454 diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
455 -index d3da79d..e607104 100644
456 +index d3da79d..e317c97 100644
457 --- a/arch/mips/Kconfig
458 +++ b/arch/mips/Kconfig
459 -@@ -2656,6 +2656,7 @@ source "kernel/Kconfig.preempt"
460 +@@ -49,6 +49,7 @@ config MIPS
461 + select GENERIC_CMOS_UPDATE
462 + select HAVE_MOD_ARCH_SPECIFIC
463 + select VIRT_TO_BUS
464 ++ select HAVE_GCC_PLUGINS
465 + select MODULES_USE_ELF_REL if MODULES
466 + select MODULES_USE_ELF_RELA if MODULES && 64BIT
467 + select CLONE_BACKWARDS
468 +@@ -2656,6 +2657,7 @@ source "kernel/Kconfig.preempt"
469 config KEXEC
470 bool "Kexec system call"
471 select KEXEC_CORE
472 @@ -7607,10 +7607,18 @@ index f906444..0bb73ae 100644
473 /*
474 * If for any reason at all we couldn't handle the fault, make
475 diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
476 -index 9faa18c..6061610 100644
477 +index 9faa18c..b24277a 100644
478 --- a/arch/powerpc/Kconfig
479 +++ b/arch/powerpc/Kconfig
480 -@@ -419,6 +419,7 @@ config KEXEC
481 +@@ -143,6 +143,7 @@ config PPC
482 + select ARCH_USE_BUILTIN_BSWAP
483 + select OLD_SIGSUSPEND
484 + select OLD_SIGACTION if PPC32
485 ++ select HAVE_GCC_PLUGINS
486 + select HAVE_DEBUG_STACKOVERFLOW
487 + select HAVE_IRQ_EXIT_ON_IRQ_STACK
488 + select ARCH_USE_CMPXCHG_LOCKREF if PPC64
489 +@@ -419,6 +420,7 @@ config KEXEC
490 bool "kexec system call"
491 depends on (PPC_BOOK3S || FSL_BOOKE || (44x && !SMP)) || PPC_BOOK3E
492 select KEXEC_CORE
493 @@ -7619,7 +7627,7 @@ index 9faa18c..6061610 100644
494 kexec is a system call that implements the ability to shutdown your
495 current kernel, and to start another kernel. It is like a reboot
496 diff --git a/arch/powerpc/include/asm/atomic.h b/arch/powerpc/include/asm/atomic.h
497 -index 55f106e..70cc82a 100644
498 +index 55f106e..5968afb 100644
499 --- a/arch/powerpc/include/asm/atomic.h
500 +++ b/arch/powerpc/include/asm/atomic.h
501 @@ -12,6 +12,11 @@
502 @@ -7886,19 +7894,7 @@ index 55f106e..70cc82a 100644
503 PPC_ATOMIC_EXIT_BARRIER
504 " subf %0,%2,%0 \n\
505 2:"
506 -@@ -252,6 +299,11 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v)
507 - }
508 - #define atomic_dec_if_positive atomic_dec_if_positive
509 -
510 -+#define smp_mb__before_atomic_dec() smp_mb()
511 -+#define smp_mb__after_atomic_dec() smp_mb()
512 -+#define smp_mb__before_atomic_inc() smp_mb()
513 -+#define smp_mb__after_atomic_inc() smp_mb()
514 -+
515 - #ifdef __powerpc64__
516 -
517 - #define ATOMIC64_INIT(i) { (i) }
518 -@@ -265,37 +317,60 @@ static __inline__ long atomic64_read(const atomic64_t *v)
519 +@@ -265,37 +312,60 @@ static __inline__ long atomic64_read(const atomic64_t *v)
520 return t;
521 }
522
523 @@ -7963,7 +7959,7 @@ index 55f106e..70cc82a 100644
524 PPC_ATOMIC_EXIT_BARRIER \
525 : "=&r" (t) \
526 : "r" (a), "r" (&v->counter) \
527 -@@ -304,6 +379,9 @@ static __inline__ long atomic64_##op##_return(long a, atomic64_t *v) \
528 +@@ -304,6 +374,9 @@ static __inline__ long atomic64_##op##_return(long a, atomic64_t *v) \
529 return t; \
530 }
531
532 @@ -7973,7 +7969,7 @@ index 55f106e..70cc82a 100644
533 #define ATOMIC64_OPS(op, asm_op) ATOMIC64_OP(op, asm_op) ATOMIC64_OP_RETURN(op, asm_op)
534
535 ATOMIC64_OPS(add, add)
536 -@@ -314,40 +392,33 @@ ATOMIC64_OP(xor, xor)
537 +@@ -314,40 +387,33 @@ ATOMIC64_OP(xor, xor)
538
539 #undef ATOMIC64_OPS
540 #undef ATOMIC64_OP_RETURN
541 @@ -8033,7 +8029,7 @@ index 55f106e..70cc82a 100644
542 }
543
544 /*
545 -@@ -360,36 +431,18 @@ static __inline__ long atomic64_inc_return(atomic64_t *v)
546 +@@ -360,36 +426,18 @@ static __inline__ long atomic64_inc_return(atomic64_t *v)
547 */
548 #define atomic64_inc_and_test(v) (atomic64_inc_return(v) == 0)
549
550 @@ -8081,7 +8077,7 @@ index 55f106e..70cc82a 100644
551 }
552
553 #define atomic64_sub_and_test(a, v) (atomic64_sub_return((a), (v)) == 0)
554 -@@ -422,6 +475,16 @@ static __inline__ long atomic64_dec_if_positive(atomic64_t *v)
555 +@@ -422,6 +470,16 @@ static __inline__ long atomic64_dec_if_positive(atomic64_t *v)
556 #define atomic64_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n)))
557 #define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
558
559 @@ -8090,7 +8086,7 @@ index 55f106e..70cc82a 100644
560 + return cmpxchg(&(v->counter), old, new);
561 +}
562 +
563 -+static inline long atomic64_xchg_unchecked(atomic64_unchecked_t *v, long new)
564 ++static inline long atomic64_xchg_unchecked(atomic64_unchecked_t *v, long new)
565 +{
566 + return xchg(&(v->counter), new);
567 +}
568 @@ -8098,7 +8094,7 @@ index 55f106e..70cc82a 100644
569 /**
570 * atomic64_add_unless - add unless the number is a given value
571 * @v: pointer of type atomic64_t
572 -@@ -437,13 +500,29 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
573 +@@ -437,13 +495,29 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
574
575 __asm__ __volatile__ (
576 PPC_ATOMIC_ENTRY_BARRIER
577 @@ -8698,17 +8694,17 @@ index b7c20f0..4adc0f1 100644
578
579 static inline unsigned long clear_user(void __user *addr, unsigned long size)
580 diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
581 -index 794f22a..f8de42b 100644
582 +index 794f22a..9a76447 100644
583 --- a/arch/powerpc/kernel/Makefile
584 +++ b/arch/powerpc/kernel/Makefile
585 @@ -14,6 +14,11 @@ CFLAGS_prom_init.o += -fPIC
586 CFLAGS_btext.o += -fPIC
587 endif
588
589 -+CFLAGS_REMOVE_cputable.o = $(LATENT_ENTROPY_PLUGIN_CFLAGS)
590 -+CFLAGS_REMOVE_prom_init.o = $(LATENT_ENTROPY_PLUGIN_CFLAGS)
591 -+CFLAGS_REMOVE_btext.o = $(LATENT_ENTROPY_PLUGIN_CFLAGS)
592 -+CFLAGS_REMOVE_prom.o = $(LATENT_ENTROPY_PLUGIN_CFLAGS)
593 ++CFLAGS_cputable.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
594 ++CFLAGS_prom_init.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
595 ++CFLAGS_btext.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
596 ++CFLAGS_prom.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
597 +
598 ifdef CONFIG_FUNCTION_TRACER
599 # Do not trace early boot code
600 @@ -9678,6 +9674,18 @@ index 6777177..d44b592 100644
601 info.high_limit = TASK_SIZE;
602 addr = vm_unmapped_area(&info);
603 }
604 +diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
605 +index 57ffaf2..4d1fe9a 100644
606 +--- a/arch/sparc/Kconfig
607 ++++ b/arch/sparc/Kconfig
608 +@@ -39,6 +39,7 @@ config SPARC
609 + select GENERIC_STRNCPY_FROM_USER
610 + select GENERIC_STRNLEN_USER
611 + select MODULES_USE_ELF_RELA
612 ++ select HAVE_GCC_PLUGINS
613 + select ODD_RT_SIGACTION
614 + select OLD_SIGSUSPEND
615 + select ARCH_HAS_SG_CHAIN
616 diff --git a/arch/sparc/include/asm/atomic_64.h b/arch/sparc/include/asm/atomic_64.h
617 index f2fbf9e..fea461e 100644
618 --- a/arch/sparc/include/asm/atomic_64.h
619 @@ -12221,16 +12229,14 @@ index c034dc3..cf1cc96 100644
620
621 /*
622 diff --git a/arch/um/Makefile b/arch/um/Makefile
623 -index e3abe6f..ae224ef 100644
624 +index e3abe6f..33a363c 100644
625 --- a/arch/um/Makefile
626 +++ b/arch/um/Makefile
627 -@@ -73,6 +73,10 @@ USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -I%,,$(KBUILD_CFLAGS))) \
628 +@@ -73,6 +73,8 @@ USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -I%,,$(KBUILD_CFLAGS))) \
629 -D_FILE_OFFSET_BITS=64 -idirafter $(srctree)/include \
630 -idirafter $(obj)/include -D__KERNEL__ -D__UM_HOST__
631
632 -+ifdef CONSTIFY_PLUGIN
633 -+USER_CFLAGS += -fplugin-arg-constify_plugin-no-constify
634 -+endif
635 ++USER_CFLAGS := $(filter-out $(GCC_PLUGINS_CFLAGS),$(USER_CFLAGS))
636 +
637 #This will adjust *FLAGS accordingly to the platform.
638 include $(ARCH_DIR)/Makefile-os-$(OS)
639 @@ -12338,7 +12344,7 @@ index ad8f795..2c7eec6 100644
640 /*
641 * Memory returned by kmalloc() may be used for DMA, so we must make
642 diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
643 -index 3bf45a0..7b04039 100644
644 +index 3bf45a0..25ca7da 100644
645 --- a/arch/x86/Kconfig
646 +++ b/arch/x86/Kconfig
647 @@ -38,14 +38,13 @@ config X86
648 @@ -12366,7 +12372,15 @@ index 3bf45a0..7b04039 100644
649 select HAVE_CMPXCHG_DOUBLE
650 select HAVE_CMPXCHG_LOCAL
651 select HAVE_CONTEXT_TRACKING if X86_64
652 -@@ -290,7 +289,7 @@ config X86_64_SMP
653 +@@ -109,6 +108,7 @@ config X86
654 + select HAVE_FUNCTION_GRAPH_FP_TEST
655 + select HAVE_FUNCTION_GRAPH_TRACER
656 + select HAVE_FUNCTION_TRACER
657 ++ select HAVE_GCC_PLUGINS
658 + select HAVE_GENERIC_DMA_COHERENT if X86_32
659 + select HAVE_HW_BREAKPOINT
660 + select HAVE_IDE
661 +@@ -290,7 +290,7 @@ config X86_64_SMP
662
663 config X86_32_LAZY_GS
664 def_bool y
665 @@ -12375,7 +12389,7 @@ index 3bf45a0..7b04039 100644
666
667 config ARCH_HWEIGHT_CFLAGS
668 string
669 -@@ -674,6 +673,7 @@ config SCHED_OMIT_FRAME_POINTER
670 +@@ -674,6 +674,7 @@ config SCHED_OMIT_FRAME_POINTER
671
672 menuconfig HYPERVISOR_GUEST
673 bool "Linux guest support"
674 @@ -12383,7 +12397,7 @@ index 3bf45a0..7b04039 100644
675 ---help---
676 Say Y here to enable options for running Linux under various hyper-
677 visors. This option enables basic hypervisor detection and platform
678 -@@ -1073,6 +1073,7 @@ config VM86
679 +@@ -1073,6 +1074,7 @@ config VM86
680
681 config X86_16BIT
682 bool "Enable support for 16-bit segments" if EXPERT
683 @@ -12391,7 +12405,7 @@ index 3bf45a0..7b04039 100644
684 default y
685 depends on MODIFY_LDT_SYSCALL
686 ---help---
687 -@@ -1227,6 +1228,7 @@ choice
688 +@@ -1227,6 +1229,7 @@ choice
689
690 config NOHIGHMEM
691 bool "off"
692 @@ -12399,7 +12413,7 @@ index 3bf45a0..7b04039 100644
693 ---help---
694 Linux can use up to 64 Gigabytes of physical memory on x86 systems.
695 However, the address space of 32-bit x86 processors is only 4
696 -@@ -1263,6 +1265,7 @@ config NOHIGHMEM
697 +@@ -1263,6 +1266,7 @@ config NOHIGHMEM
698
699 config HIGHMEM4G
700 bool "4GB"
701 @@ -12407,7 +12421,7 @@ index 3bf45a0..7b04039 100644
702 ---help---
703 Select this if you have a 32-bit processor and between 1 and 4
704 gigabytes of physical RAM.
705 -@@ -1315,7 +1318,7 @@ config PAGE_OFFSET
706 +@@ -1315,7 +1319,7 @@ config PAGE_OFFSET
707 hex
708 default 0xB0000000 if VMSPLIT_3G_OPT
709 default 0x80000000 if VMSPLIT_2G
710 @@ -12416,7 +12430,7 @@ index 3bf45a0..7b04039 100644
711 default 0x40000000 if VMSPLIT_1G
712 default 0xC0000000
713 depends on X86_32
714 -@@ -1336,7 +1339,6 @@ config X86_PAE
715 +@@ -1336,7 +1340,6 @@ config X86_PAE
716
717 config ARCH_PHYS_ADDR_T_64BIT
718 def_bool y
719 @@ -12424,7 +12438,7 @@ index 3bf45a0..7b04039 100644
720
721 config ARCH_DMA_ADDR_T_64BIT
722 def_bool y
723 -@@ -1467,7 +1469,7 @@ config ARCH_PROC_KCORE_TEXT
724 +@@ -1467,7 +1470,7 @@ config ARCH_PROC_KCORE_TEXT
725
726 config ILLEGAL_POINTER_VALUE
727 hex
728 @@ -12433,7 +12447,7 @@ index 3bf45a0..7b04039 100644
729 default 0xdead000000000000 if X86_64
730
731 source "mm/Kconfig"
732 -@@ -1776,6 +1778,7 @@ source kernel/Kconfig.hz
733 +@@ -1776,6 +1779,7 @@ source kernel/Kconfig.hz
734 config KEXEC
735 bool "kexec system call"
736 select KEXEC_CORE
737 @@ -12441,7 +12455,7 @@ index 3bf45a0..7b04039 100644
738 ---help---
739 kexec is a system call that implements the ability to shutdown your
740 current kernel, and to start another kernel. It is like a reboot
741 -@@ -1958,7 +1961,9 @@ config X86_NEED_RELOCS
742 +@@ -1958,7 +1962,9 @@ config X86_NEED_RELOCS
743
744 config PHYSICAL_ALIGN
745 hex "Alignment value to which kernel should be aligned"
746 @@ -12452,7 +12466,7 @@ index 3bf45a0..7b04039 100644
747 range 0x2000 0x1000000 if X86_32
748 range 0x200000 0x1000000 if X86_64
749 ---help---
750 -@@ -2041,6 +2046,7 @@ config COMPAT_VDSO
751 +@@ -2041,6 +2047,7 @@ config COMPAT_VDSO
752 def_bool n
753 prompt "Disable the 32-bit vDSO (needed for glibc 2.3.3)"
754 depends on X86_32 || IA32_EMULATION
755 @@ -12460,7 +12474,7 @@ index 3bf45a0..7b04039 100644
756 ---help---
757 Certain buggy versions of glibc will crash if they are
758 presented with a 32-bit vDSO that is not mapped at the address
759 -@@ -2081,15 +2087,6 @@ choice
760 +@@ -2081,15 +2088,6 @@ choice
761
762 If unsure, select "Emulate".
763
764 @@ -12476,7 +12490,7 @@ index 3bf45a0..7b04039 100644
765 config LEGACY_VSYSCALL_EMULATE
766 bool "Emulate"
767 help
768 -@@ -2170,6 +2167,22 @@ config MODIFY_LDT_SYSCALL
769 +@@ -2170,6 +2168,22 @@ config MODIFY_LDT_SYSCALL
770
771 Saying 'N' here may make sense for embedded or server kernels.
772
773 @@ -12610,20 +12624,6 @@ index 4086abc..52a0a9b 100644
774 +*** ${VERSION}.${PATCHLEVEL} PaX kernels no longer build correctly with old versions of binutils.
775 +*** Please upgrade your binutils to 2.18 or newer
776 +endef
777 -diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
778 -index bbe1a62..ec6a3ec 100644
779 ---- a/arch/x86/boot/Makefile
780 -+++ b/arch/x86/boot/Makefile
781 -@@ -58,6 +58,9 @@ clean-files += cpustr.h
782 - # ---------------------------------------------------------------------------
783 -
784 - KBUILD_CFLAGS := $(USERINCLUDE) $(REALMODE_CFLAGS) -D_SETUP
785 -+ifdef CONSTIFY_PLUGIN
786 -+KBUILD_CFLAGS += -fplugin-arg-constify_plugin-no-constify
787 -+endif
788 - KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
789 - GCOV_PROFILE := n
790 - UBSAN_SANITIZE := n
791 diff --git a/arch/x86/boot/bitops.h b/arch/x86/boot/bitops.h
792 index 878e4b9..20537ab 100644
793 --- a/arch/x86/boot/bitops.h
794 @@ -12660,17 +12660,13 @@ index 9011a88..06aa820 100644
795 }
796
797 diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
798 -index f9ce75d..0b1600d 100644
799 +index f9ce75d..245ea76 100644
800 --- a/arch/x86/boot/compressed/Makefile
801 +++ b/arch/x86/boot/compressed/Makefile
802 -@@ -30,6 +30,26 @@ KBUILD_CFLAGS += $(cflags-y)
803 - KBUILD_CFLAGS += -mno-mmx -mno-sse
804 +@@ -31,6 +31,23 @@ KBUILD_CFLAGS += -mno-mmx -mno-sse
805 KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
806 KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
807 -+ifdef CONSTIFY_PLUGIN
808 -+KBUILD_CFLAGS += -fplugin-arg-constify_plugin-no-constify
809 -+endif
810 -+
811 +
812 +ifdef CONFIG_DEBUG_INFO
813 +ifdef CONFIG_DEBUG_INFO_SPLIT
814 +KBUILD_CFLAGS += $(call cc-option, -gsplit-dwarf, -g)
815 @@ -12687,9 +12683,10 @@ index f9ce75d..0b1600d 100644
816 +KBUILD_CFLAGS += $(call cc-option, -femit-struct-debug-baseonly) \
817 + $(call cc-option,-fno-var-tracking)
818 +endif
819 -
820 ++
821 KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
822 GCOV_PROFILE := n
823 + UBSAN_SANITIZE :=n
824 diff --git a/arch/x86/boot/compressed/efi_stub_32.S b/arch/x86/boot/compressed/efi_stub_32.S
825 index a53440e..c3dbf1e 100644
826 --- a/arch/x86/boot/compressed/efi_stub_32.S
827 @@ -15756,7 +15753,7 @@ index e32206e0..809adae 100644
828
829 .macro REMOVE_PT_GPREGS_FROM_STACK addskip=0
830 diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c
831 -index 1a4477c..95199ec4 100644
832 +index 1a4477c..7061819 100644
833 --- a/arch/x86/entry/common.c
834 +++ b/arch/x86/entry/common.c
835 @@ -32,9 +32,7 @@
836 @@ -15869,7 +15866,7 @@ index 1a4477c..95199ec4 100644
837 + [param4] "m" (regs->si),
838 + [param5] "m" (regs->di),
839 + [param6] "m" (regs->bp)
840 -+ : "di", "si", "dx", "cx", "r8", "r9", "memory");
841 ++ : "ax", "di", "si", "dx", "cx", "r8", "r9", "r10", "r11", "memory");
842 +#else
843 + asm volatile("pushl %[param6]\n\t"
844 + "pushl %[param5]\n\t"
845 @@ -22879,7 +22876,7 @@ index 82c34ee..940fa40 100644
846 unsigned, unsigned, unsigned);
847
848 diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
849 -index c7b5510..2ab8977 100644
850 +index c7b5510..f6d5ca4 100644
851 --- a/arch/x86/include/asm/thread_info.h
852 +++ b/arch/x86/include/asm/thread_info.h
853 @@ -39,7 +39,7 @@
854 @@ -22961,7 +22958,7 @@ index c7b5510..2ab8977 100644
855 }
856
857 static inline unsigned long current_stack_pointer(void)
858 -@@ -179,14 +182,9 @@ static inline unsigned long current_stack_pointer(void)
859 +@@ -179,41 +182,9 @@ static inline unsigned long current_stack_pointer(void)
860
861 #else /* !__ASSEMBLY__ */
862
863 @@ -22973,11 +22970,38 @@ index c7b5510..2ab8977 100644
864 #define GET_THREAD_INFO(reg) \
865 - _ASM_MOV PER_CPU_VAR(cpu_current_top_of_stack),reg ; \
866 - _ASM_SUB $(THREAD_SIZE),reg ;
867 +-
868 +-/*
869 +- * ASM operand which evaluates to a 'thread_info' address of
870 +- * the current task, if it is known that "reg" is exactly "off"
871 +- * bytes below the top of the stack currently.
872 +- *
873 +- * ( The kernel stack's size is known at build time, it is usually
874 +- * 2 or 4 pages, and the bottom of the kernel stack contains
875 +- * the thread_info structure. So to access the thread_info very
876 +- * quickly from assembly code we can calculate down from the
877 +- * top of the kernel stack to the bottom, using constant,
878 +- * build-time calculations only. )
879 +- *
880 +- * For example, to fetch the current thread_info->flags value into %eax
881 +- * on x86-64 defconfig kernels, in syscall entry code where RSP is
882 +- * currently at exactly SIZEOF_PTREGS bytes away from the top of the
883 +- * stack:
884 +- *
885 +- * mov ASM_THREAD_INFO(TI_flags, %rsp, SIZEOF_PTREGS), %eax
886 +- *
887 +- * will translate to:
888 +- *
889 +- * 8b 84 24 b8 c0 ff ff mov -0x3f48(%rsp), %eax
890 +- *
891 +- * which is below the current RSP by almost 16K.
892 +- */
893 +-#define ASM_THREAD_INFO(field, reg, off) ((field)+(off)-THREAD_SIZE)(reg)
894 + _ASM_MOV PER_CPU_VAR(current_tinfo),reg ;
895
896 - /*
897 - * ASM operand which evaluates to a 'thread_info' address of
898 -@@ -279,5 +277,12 @@ static inline bool is_ia32_task(void)
899 + #endif
900 +
901 +@@ -279,5 +250,12 @@ static inline bool is_ia32_task(void)
902 extern void arch_task_cache_init(void);
903 extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
904 extern void arch_release_task_struct(struct task_struct *tsk);
905 @@ -25722,7 +25746,7 @@ index 2cad71d..5f1baf2 100644
906 __bts_event_stop(event);
907
908 diff --git a/arch/x86/kernel/cpu/perf_event_intel_cqm.c b/arch/x86/kernel/cpu/perf_event_intel_cqm.c
909 -index a316ca9..99344f4 100644
910 +index a316ca9..07e219e 100644
911 --- a/arch/x86/kernel/cpu/perf_event_intel_cqm.c
912 +++ b/arch/x86/kernel/cpu/perf_event_intel_cqm.c
913 @@ -1364,7 +1364,9 @@ static int __init intel_cqm_init(void)
914 @@ -25731,7 +25755,7 @@ index a316ca9..99344f4 100644
915
916 - event_attr_intel_cqm_llc_scale.event_str = str;
917 + pax_open_kernel();
918 -+ *(const char **)&event_attr_intel_cqm_llc_scale.event_str = str;
919 ++ const_cast(event_attr_intel_cqm_llc_scale.event_str) = str;
920 + pax_close_kernel();
921
922 ret = intel_cqm_setup_rmid_cache();
923 @@ -25798,7 +25822,7 @@ index 653f88d..11b6b78 100644
924 if (!insn.opcode.got)
925 return X86_BR_ABORT;
926 diff --git a/arch/x86/kernel/cpu/perf_event_intel_pt.c b/arch/x86/kernel/cpu/perf_event_intel_pt.c
927 -index c0bbd10..727ae15e 100644
928 +index c0bbd10..53a5dc6 100644
929 --- a/arch/x86/kernel/cpu/perf_event_intel_pt.c
930 +++ b/arch/x86/kernel/cpu/perf_event_intel_pt.c
931 @@ -133,14 +133,10 @@ static const struct attribute_group *pt_attr_groups[] = {
932 @@ -25839,22 +25863,22 @@ index c0bbd10..727ae15e 100644
933 + struct dev_ext_attribute *de_attr = &de_attrs[i];
934
935 - de_attr->attr.attr.name = pt_caps[i].name;
936 -+ *(const char **)&de_attr->attr.attr.name = pt_caps[i].name;
937 ++ const_cast(de_attr->attr.attr.name) = pt_caps[i].name;
938
939 sysfs_attr_init(&de_attr->attr.attr);
940
941 - de_attr->attr.attr.mode = S_IRUGO;
942 - de_attr->attr.show = pt_cap_show;
943 - de_attr->var = (void *)i;
944 -+ *(umode_t *)&de_attr->attr.attr.mode = S_IRUGO;
945 -+ *(void **)&de_attr->attr.show = pt_cap_show;
946 -+ *(void **)&de_attr->var = (void *)i;
947 ++ const_cast(de_attr->attr.attr.mode) = S_IRUGO;
948 ++ const_cast(de_attr->attr.show) = pt_cap_show;
949 ++ const_cast(de_attr->var) = (void *)i;
950
951 attrs[i] = &de_attr->attr.attr;
952 }
953
954 - pt_cap_group.attrs = attrs;
955 -+ *(struct attribute ***)&pt_cap_group.attrs = attrs;
956 ++ const_cast(pt_cap_group.attrs) = attrs;
957 + pax_close_kernel();
958
959 return 0;
960 @@ -27813,7 +27837,7 @@ index 64341aa..b1e6632 100644
961 +EXPORT_SYMBOL(cpu_pgd);
962 +#endif
963 diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c
964 -index be22f5a..c5d0e1f 100644
965 +index be22f5a..a04fa14 100644
966 --- a/arch/x86/kernel/i8259.c
967 +++ b/arch/x86/kernel/i8259.c
968 @@ -110,7 +110,7 @@ static int i8259A_irq_pending(unsigned int irq)
969 @@ -27845,10 +27869,10 @@ index be22f5a..c5d0e1f 100644
970 * when acking.
971 */
972 - i8259A_chip.irq_mask_ack = disable_8259A_irq;
973 -+ *(void **)&i8259A_chip.irq_mask_ack = disable_8259A_irq;
974 ++ const_cast(i8259A_chip.irq_mask_ack) = disable_8259A_irq;
975 else
976 - i8259A_chip.irq_mask_ack = mask_and_ack_8259A;
977 -+ *(void **)&i8259A_chip.irq_mask_ack = mask_and_ack_8259A;
978 ++ const_cast(i8259A_chip.irq_mask_ack) = mask_and_ack_8259A;
979 + pax_close_kernel();
980
981 udelay(100); /* wait for 8259A to initialize */
982 @@ -29041,7 +29065,7 @@ index 6d9582e..f746287 100644
983 return;
984 }
985 diff --git a/arch/x86/kernel/paravirt-spinlocks.c b/arch/x86/kernel/paravirt-spinlocks.c
986 -index 33ee3e0..ca43dee 100644
987 +index 33ee3e0..6d23e5c 100644
988 --- a/arch/x86/kernel/paravirt-spinlocks.c
989 +++ b/arch/x86/kernel/paravirt-spinlocks.c
990 @@ -23,16 +23,32 @@ bool pv_is_native_spin_unlock(void)
991 @@ -29058,7 +29082,7 @@ index 33ee3e0..ca43dee 100644
992 +static void native_kick(int cpu)
993 +{
994 +}
995 -+//#else /* !CONFIG_QUEUED_SPINLOCKS */
996 ++#else /* !CONFIG_QUEUED_SPINLOCKS */
997 +static void native_unlock_kick(struct arch_spinlock *lock, __ticket_t ticket)
998 +{
999 +}
1000 @@ -37439,7 +37463,7 @@ index 4e664bd..2beeaa2 100644
1001 return NULL;
1002
1003 diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
1004 -index 1d2e639..d7f0e67 100644
1005 +index 1d2e639..6473b8a 100644
1006 --- a/arch/x86/oprofile/nmi_int.c
1007 +++ b/arch/x86/oprofile/nmi_int.c
1008 @@ -23,6 +23,7 @@
1009 @@ -37467,14 +37491,14 @@ index 1d2e639..d7f0e67 100644
1010 - model->num_virt_counters = model->num_counters;
1011 + if (!model->num_virt_counters) {
1012 + pax_open_kernel();
1013 -+ *(unsigned int *)&model->num_virt_counters = model->num_counters;
1014 ++ const_cast(model->num_virt_counters) = model->num_counters;
1015 + pax_close_kernel();
1016 + }
1017
1018 mux_init(ops);
1019
1020 diff --git a/arch/x86/oprofile/op_model_amd.c b/arch/x86/oprofile/op_model_amd.c
1021 -index 50d86c0..7985318 100644
1022 +index 50d86c0..b0b9ae0 100644
1023 --- a/arch/x86/oprofile/op_model_amd.c
1024 +++ b/arch/x86/oprofile/op_model_amd.c
1025 @@ -519,9 +519,11 @@ static int op_amd_init(struct oprofile_operations *ops)
1026 @@ -37485,15 +37509,15 @@ index 50d86c0..7985318 100644
1027 - op_amd_spec.num_controls = num_counters;
1028 - op_amd_spec.num_virt_counters = max(num_counters, NUM_VIRT_COUNTERS);
1029 + pax_open_kernel();
1030 -+ *(unsigned int *)&op_amd_spec.num_counters = num_counters;
1031 -+ *(unsigned int *)&op_amd_spec.num_controls = num_counters;
1032 -+ *(unsigned int *)&op_amd_spec.num_virt_counters = max(num_counters, NUM_VIRT_COUNTERS);
1033 ++ const_cast(op_amd_spec.num_counters) = num_counters;
1034 ++ const_cast(op_amd_spec.num_controls) = num_counters;
1035 ++ const_cast(op_amd_spec.num_virt_counters) = max(num_counters, NUM_VIRT_COUNTERS);
1036 + pax_close_kernel();
1037
1038 return 0;
1039 }
1040 diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c
1041 -index d90528e..0127e2b 100644
1042 +index d90528e..a44aa09 100644
1043 --- a/arch/x86/oprofile/op_model_ppro.c
1044 +++ b/arch/x86/oprofile/op_model_ppro.c
1045 @@ -19,6 +19,7 @@
1046 @@ -37511,8 +37535,8 @@ index d90528e..0127e2b 100644
1047 - op_arch_perfmon_spec.num_counters = num_counters;
1048 - op_arch_perfmon_spec.num_controls = num_counters;
1049 + pax_open_kernel();
1050 -+ *(unsigned int *)&op_arch_perfmon_spec.num_counters = num_counters;
1051 -+ *(unsigned int *)&op_arch_perfmon_spec.num_controls = num_counters;
1052 ++ const_cast(op_arch_perfmon_spec.num_counters) = num_counters;
1053 ++ const_cast(op_arch_perfmon_spec.num_controls) = num_counters;
1054 + pax_close_kernel();
1055 }
1056
1057 @@ -37808,7 +37832,7 @@ index 9770e55..76067ec 100644
1058 }
1059 EXPORT_SYMBOL(pcibios_set_irq_routing);
1060 diff --git a/arch/x86/pci/vmd.c b/arch/x86/pci/vmd.c
1061 -index d57e480..20eb97a 100644
1062 +index d57e480..fc4db30 100644
1063 --- a/arch/x86/pci/vmd.c
1064 +++ b/arch/x86/pci/vmd.c
1065 @@ -374,7 +374,7 @@ static void vmd_teardown_dma_ops(struct vmd_dev *vmd)
1066 @@ -37816,7 +37840,7 @@ index d57e480..20eb97a 100644
1067 do { \
1068 if (source->fn) \
1069 - dest->fn = vmd_##fn; \
1070 -+ *(void **)&dest->fn = vmd_##fn; \
1071 ++ const_cast(dest->fn) = vmd_##fn; \
1072 } while (0)
1073
1074 static void vmd_setup_dma_ops(struct vmd_dev *vmd)
1075 @@ -38238,20 +38262,6 @@ index 0b7a63d..dff2199 100644
1076 trampoline_pgd[511] = init_level4_pgt[511].pgd;
1077 #endif
1078 }
1079 -diff --git a/arch/x86/realmode/rm/Makefile b/arch/x86/realmode/rm/Makefile
1080 -index 3e75fcf..4cfefb8 100644
1081 ---- a/arch/x86/realmode/rm/Makefile
1082 -+++ b/arch/x86/realmode/rm/Makefile
1083 -@@ -68,6 +68,9 @@ $(obj)/realmode.relocs: $(obj)/realmode.elf FORCE
1084 -
1085 - KBUILD_CFLAGS := $(LINUXINCLUDE) $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \
1086 - -I$(srctree)/arch/x86/boot
1087 -+ifdef CONSTIFY_PLUGIN
1088 -+KBUILD_CFLAGS += -fplugin-arg-constify_plugin-no-constify
1089 -+endif
1090 - KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
1091 - GCOV_PROFILE := n
1092 - UBSAN_SANITIZE := n
1093 diff --git a/arch/x86/realmode/rm/header.S b/arch/x86/realmode/rm/header.S
1094 index a28221d..93c40f1 100644
1095 --- a/arch/x86/realmode/rm/header.S
1096 @@ -39659,7 +39669,7 @@ index b719ab3..371e2a6 100644
1097 enum acpi_battery_files {
1098 info_tag = 0,
1099 diff --git a/drivers/acpi/bgrt.c b/drivers/acpi/bgrt.c
1100 -index a83e3c6..c3d617f 100644
1101 +index a83e3c6..7f4a90b 100644
1102 --- a/drivers/acpi/bgrt.c
1103 +++ b/drivers/acpi/bgrt.c
1104 @@ -86,8 +86,10 @@ static int __init bgrt_init(void)
1105 @@ -39669,8 +39679,8 @@ index a83e3c6..c3d617f 100644
1106 - bin_attr_image.private = bgrt_image;
1107 - bin_attr_image.size = bgrt_image_size;
1108 + pax_open_kernel();
1109 -+ *(void **)&bin_attr_image.private = bgrt_image;
1110 -+ *(size_t *)&bin_attr_image.size = bgrt_image_size;
1111 ++ const_cast(bin_attr_image.private) = bgrt_image;
1112 ++ const_cast(bin_attr_image.size) = bgrt_image_size;
1113 + pax_close_kernel();
1114
1115 bgrt_kobj = kobject_create_and_add("bgrt", acpi_kobj);
1116 @@ -39966,7 +39976,7 @@ index 7d00b7a..d5fd80d 100644
1117 int ret;
1118
1119 diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
1120 -index 55e257c..28b9a25 100644
1121 +index 55e257c..554c697 100644
1122 --- a/drivers/ata/libata-core.c
1123 +++ b/drivers/ata/libata-core.c
1124 @@ -103,7 +103,7 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev);
1125 @@ -40009,7 +40019,7 @@ index 55e257c..28b9a25 100644
1126 *pp = NULL;
1127
1128 - ops->inherits = NULL;
1129 -+ *(struct ata_port_operations **)&ops->inherits = NULL;
1130 ++ const_cast(ops->inherits) = NULL;
1131
1132 + pax_close_kernel();
1133 spin_unlock(&lock);
1134 @@ -40051,7 +40061,7 @@ index f840ca1..edd6ef3 100644
1135 extern int libata_fua;
1136 extern int libata_noacpi;
1137 diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
1138 -index 80fe0f6..8c0fa3f 100644
1139 +index 80fe0f6..d95a192 100644
1140 --- a/drivers/ata/pata_arasan_cf.c
1141 +++ b/drivers/ata/pata_arasan_cf.c
1142 @@ -864,7 +864,9 @@ static int arasan_cf_probe(struct platform_device *pdev)
1143 @@ -40060,7 +40070,7 @@ index 80fe0f6..8c0fa3f 100644
1144 if (quirk & CF_BROKEN_PIO) {
1145 - ap->ops->set_piomode = NULL;
1146 + pax_open_kernel();
1147 -+ *(void **)&ap->ops->set_piomode = NULL;
1148 ++ const_cast(ap->ops->set_piomode) = NULL;
1149 + pax_close_kernel();
1150 ap->pio_mask = 0;
1151 }
1152 @@ -41138,7 +41148,7 @@ index 560751b..3a4847a 100644
1153 static ssize_t show_node_state(struct device *dev,
1154 struct device_attribute *attr, char *buf)
1155 diff --git a/drivers/base/platform-msi.c b/drivers/base/platform-msi.c
1156 -index 279e539..b87ed03 100644
1157 +index 279e539..4c9d7fb 100644
1158 --- a/drivers/base/platform-msi.c
1159 +++ b/drivers/base/platform-msi.c
1160 @@ -24,6 +24,8 @@
1161 @@ -41157,10 +41167,10 @@ index 279e539..b87ed03 100644
1162 + pax_open_kernel();
1163 if (ops->msi_init == NULL)
1164 - ops->msi_init = platform_msi_init;
1165 -+ *(void **)&ops->msi_init = platform_msi_init;
1166 ++ const_cast(ops->msi_init) = platform_msi_init;
1167 if (ops->set_desc == NULL)
1168 - ops->set_desc = platform_msi_set_desc;
1169 -+ *(void **)&ops->set_desc = platform_msi_set_desc;
1170 ++ const_cast(ops->set_desc) = platform_msi_set_desc;
1171 + pax_close_kernel();
1172 }
1173
1174 @@ -41172,25 +41182,25 @@ index 279e539..b87ed03 100644
1175 + pax_open_kernel();
1176 if (!chip->irq_mask)
1177 - chip->irq_mask = irq_chip_mask_parent;
1178 -+ *(void **)&chip->irq_mask = irq_chip_mask_parent;
1179 ++ const_cast(chip->irq_mask) = irq_chip_mask_parent;
1180 if (!chip->irq_unmask)
1181 - chip->irq_unmask = irq_chip_unmask_parent;
1182 -+ *(void **)&chip->irq_unmask = irq_chip_unmask_parent;
1183 ++ const_cast(chip->irq_unmask) = irq_chip_unmask_parent;
1184 if (!chip->irq_eoi)
1185 - chip->irq_eoi = irq_chip_eoi_parent;
1186 -+ *(void **)&chip->irq_eoi = irq_chip_eoi_parent;
1187 ++ const_cast(chip->irq_eoi) = irq_chip_eoi_parent;
1188 if (!chip->irq_set_affinity)
1189 - chip->irq_set_affinity = msi_domain_set_affinity;
1190 -+ *(void **)&chip->irq_set_affinity = msi_domain_set_affinity;
1191 ++ const_cast(chip->irq_set_affinity) = msi_domain_set_affinity;
1192 if (!chip->irq_write_msi_msg)
1193 - chip->irq_write_msi_msg = platform_msi_write_msg;
1194 -+ *(void **)&chip->irq_write_msi_msg = platform_msi_write_msg;
1195 ++ const_cast(chip->irq_write_msi_msg) = platform_msi_write_msg;
1196 + pax_close_kernel();
1197 }
1198
1199 static void platform_msi_free_descs(struct device *dev, int base, int nvec)
1200 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
1201 -index 0caf92a..cff4879 100644
1202 +index 0caf92a..62c184c 100644
1203 --- a/drivers/base/power/domain.c
1204 +++ b/drivers/base/power/domain.c
1205 @@ -1804,8 +1804,10 @@ int genpd_dev_pm_attach(struct device *dev)
1206 @@ -41200,8 +41210,8 @@ index 0caf92a..cff4879 100644
1207 - dev->pm_domain->detach = genpd_dev_pm_detach;
1208 - dev->pm_domain->sync = genpd_dev_pm_sync;
1209 + pax_open_kernel();
1210 -+ *(void **)&dev->pm_domain->detach = genpd_dev_pm_detach;
1211 -+ *(void **)&dev->pm_domain->sync = genpd_dev_pm_sync;
1212 ++ const_cast(dev->pm_domain->detach) = genpd_dev_pm_detach;
1213 ++ const_cast(dev->pm_domain->sync) = genpd_dev_pm_sync;
1214 + pax_close_kernel();
1215
1216 mutex_lock(&pd->lock);
1217 @@ -42349,7 +42359,7 @@ index 24a652f..2dffae6 100644
1218 int err;
1219
1220 diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c
1221 -index 577cc4b..bfe0c2d 100644
1222 +index 577cc4b..129a13e 100644
1223 --- a/drivers/bus/arm-cci.c
1224 +++ b/drivers/bus/arm-cci.c
1225 @@ -1249,16 +1249,22 @@ static int cci_pmu_init_attrs(struct cci_pmu *cci_pmu, struct platform_device *p
1226 @@ -42358,7 +42368,7 @@ index 577cc4b..bfe0c2d 100644
1227 return -ENOMEM;
1228 - pmu_event_attr_group.attrs = attrs;
1229 + pax_open_kernel();
1230 -+ *(struct attribute ***)&pmu_event_attr_group.attrs = attrs;
1231 ++ const_cast(pmu_event_attr_group.attrs) = attrs;
1232 + pax_close_kernel();
1233 }
1234 if (model->nformat_attrs) {
1235 @@ -42368,18 +42378,18 @@ index 577cc4b..bfe0c2d 100644
1236 return -ENOMEM;
1237 - pmu_format_attr_group.attrs = attrs;
1238 + pax_open_kernel();
1239 -+ *(struct attribute ***)&pmu_format_attr_group.attrs = attrs;
1240 ++ const_cast(pmu_format_attr_group.attrs) = attrs;
1241 + pax_close_kernel();
1242 }
1243 - pmu_cpumask_attr.var = cci_pmu;
1244 + pax_open_kernel();
1245 -+ *(void **)&pmu_cpumask_attr.var = cci_pmu;
1246 ++ const_cast(pmu_cpumask_attr.var) = cci_pmu;
1247 + pax_close_kernel();
1248
1249 return 0;
1250 }
1251 diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
1252 -index 1b257ea..ea76b22 100644
1253 +index 1b257ea..2280898 100644
1254 --- a/drivers/cdrom/cdrom.c
1255 +++ b/drivers/cdrom/cdrom.c
1256 @@ -610,7 +610,6 @@ int register_cdrom(struct cdrom_device_info *cdi)
1257 @@ -42398,7 +42408,7 @@ index 1b257ea..ea76b22 100644
1258 - cdo->generic_packet = cdrom_dummy_generic_packet;
1259 + if (!cdo->generic_packet) {
1260 + pax_open_kernel();
1261 -+ *(void **)&cdo->generic_packet = cdrom_dummy_generic_packet;
1262 ++ const_cast(cdo->generic_packet) = cdrom_dummy_generic_packet;
1263 + pax_close_kernel();
1264 + }
1265
1266 @@ -43150,7 +43160,7 @@ index aa872d2..afeae37 100644
1267 /**
1268 * struct samsung_clk_reg_dump: register dump of clock controller registers.
1269 diff --git a/drivers/clk/socfpga/clk-gate.c b/drivers/clk/socfpga/clk-gate.c
1270 -index aa7a6e6..e67210d 100644
1271 +index aa7a6e6..1e9b426 100644
1272 --- a/drivers/clk/socfpga/clk-gate.c
1273 +++ b/drivers/clk/socfpga/clk-gate.c
1274 @@ -21,6 +21,7 @@
1275 @@ -43177,14 +43187,14 @@ index aa7a6e6..e67210d 100644
1276 - gateclk_ops.enable = clk_gate_ops.enable;
1277 - gateclk_ops.disable = clk_gate_ops.disable;
1278 + pax_open_kernel();
1279 -+ *(void **)&gateclk_ops.enable = clk_gate_ops.enable;
1280 -+ *(void **)&gateclk_ops.disable = clk_gate_ops.disable;
1281 ++ const_cast(gateclk_ops.enable) = clk_gate_ops.enable;
1282 ++ const_cast(gateclk_ops.disable) = clk_gate_ops.disable;
1283 + pax_close_kernel();
1284 }
1285
1286 rc = of_property_read_u32(node, "fixed-divider", &fixed_div);
1287 diff --git a/drivers/clk/socfpga/clk-pll.c b/drivers/clk/socfpga/clk-pll.c
1288 -index c7f4631..463813a 100644
1289 +index c7f4631..8d1b7d0 100644
1290 --- a/drivers/clk/socfpga/clk-pll.c
1291 +++ b/drivers/clk/socfpga/clk-pll.c
1292 @@ -20,6 +20,7 @@
1293 @@ -43211,14 +43221,14 @@ index c7f4631..463813a 100644
1294 - clk_pll_ops.enable = clk_gate_ops.enable;
1295 - clk_pll_ops.disable = clk_gate_ops.disable;
1296 + pax_open_kernel();
1297 -+ *(void **)&clk_pll_ops.enable = clk_gate_ops.enable;
1298 -+ *(void **)&clk_pll_ops.disable = clk_gate_ops.disable;
1299 ++ const_cast(clk_pll_ops.enable) = clk_gate_ops.enable;
1300 ++ const_cast(clk_pll_ops.disable) = clk_gate_ops.disable;
1301 + pax_close_kernel();
1302
1303 clk = clk_register(NULL, &pll_clk->hw.hw);
1304 if (WARN_ON(IS_ERR(clk))) {
1305 diff --git a/drivers/clk/ti/clk.c b/drivers/clk/ti/clk.c
1306 -index b5bcd77..0f7bd99 100644
1307 +index b5bcd77..fc230cb 100644
1308 --- a/drivers/clk/ti/clk.c
1309 +++ b/drivers/clk/ti/clk.c
1310 @@ -25,6 +25,8 @@
1311 @@ -43237,14 +43247,14 @@ index b5bcd77..0f7bd99 100644
1312 - ops->clk_readl = clk_memmap_readl;
1313 - ops->clk_writel = clk_memmap_writel;
1314 + pax_open_kernel();
1315 -+ *(void **)&ops->clk_readl = clk_memmap_readl;
1316 -+ *(void **)&ops->clk_writel = clk_memmap_writel;
1317 ++ const_cast(ops->clk_readl) = clk_memmap_readl;
1318 ++ const_cast(ops->clk_writel) = clk_memmap_writel;
1319 + pax_close_kernel();
1320
1321 return 0;
1322 }
1323 diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
1324 -index 51eef87..d944fa7 100644
1325 +index 51eef87..f530cf9 100644
1326 --- a/drivers/cpufreq/acpi-cpufreq.c
1327 +++ b/drivers/cpufreq/acpi-cpufreq.c
1328 @@ -682,8 +682,11 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
1329 @@ -43255,7 +43265,7 @@ index 51eef87..d944fa7 100644
1330 - acpi_cpufreq_driver.flags |= CPUFREQ_CONST_LOOPS;
1331 + if (cpu_has(c, X86_FEATURE_CONSTANT_TSC)) {
1332 + pax_open_kernel();
1333 -+ *(u8 *)&acpi_cpufreq_driver.flags |= CPUFREQ_CONST_LOOPS;
1334 ++ const_cast(acpi_cpufreq_driver.flags) |= CPUFREQ_CONST_LOOPS;
1335 + pax_close_kernel();
1336 + }
1337
1338 @@ -43267,7 +43277,7 @@ index 51eef87..d944fa7 100644
1339 case ACPI_ADR_SPACE_FIXED_HARDWARE:
1340 - acpi_cpufreq_driver.get = get_cur_freq_on_cpu;
1341 + pax_open_kernel();
1342 -+ *(void **)&acpi_cpufreq_driver.get = get_cur_freq_on_cpu;
1343 ++ const_cast(acpi_cpufreq_driver.get) = get_cur_freq_on_cpu;
1344 + pax_close_kernel();
1345 break;
1346 default:
1347 @@ -43279,14 +43289,14 @@ index 51eef87..d944fa7 100644
1348 - acpi_cpufreq_driver.set_boost = set_boost;
1349 - acpi_cpufreq_driver.boost_enabled = boost_state(0);
1350 + pax_open_kernel();
1351 -+ *(void **)&acpi_cpufreq_driver.set_boost = set_boost;
1352 -+ *(bool *)&acpi_cpufreq_driver.boost_enabled = boost_state(0);
1353 ++ const_cast(acpi_cpufreq_driver.set_boost) = set_boost;
1354 ++ const_cast(acpi_cpufreq_driver.boost_enabled) = boost_state(0);
1355 + pax_close_kernel();
1356
1357 cpu_notifier_register_begin();
1358
1359 diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
1360 -index 0ca74d0..15705fb 100644
1361 +index 0ca74d0..1a0d302 100644
1362 --- a/drivers/cpufreq/cpufreq-dt.c
1363 +++ b/drivers/cpufreq/cpufreq-dt.c
1364 @@ -461,7 +461,9 @@ static int dt_cpufreq_probe(struct platform_device *pdev)
1365 @@ -43295,13 +43305,13 @@ index 0ca74d0..15705fb 100644
1366
1367 - dt_cpufreq_driver.driver_data = dev_get_platdata(&pdev->dev);
1368 + pax_open_kernel();
1369 -+ *(void **)&dt_cpufreq_driver.driver_data = dev_get_platdata(&pdev->dev);
1370 ++ const_cast(dt_cpufreq_driver.driver_data) = dev_get_platdata(&pdev->dev);
1371 + pax_close_kernel();
1372
1373 ret = cpufreq_register_driver(&dt_cpufreq_driver);
1374 if (ret)
1375 diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
1376 -index e979ec7..a024e16 100644
1377 +index e979ec7..a76375c 100644
1378 --- a/drivers/cpufreq/cpufreq.c
1379 +++ b/drivers/cpufreq/cpufreq.c
1380 @@ -474,12 +474,12 @@ EXPORT_SYMBOL_GPL(cpufreq_freq_transition_end);
1381 @@ -43343,7 +43353,7 @@ index e979ec7..a024e16 100644
1382 write_lock_irqsave(&cpufreq_driver_lock, flags);
1383 - cpufreq_driver->boost_enabled = state;
1384 + pax_open_kernel();
1385 -+ *(bool *)&cpufreq_driver->boost_enabled = state;
1386 ++ const_cast(cpufreq_driver->boost_enabled) = state;
1387 + pax_close_kernel();
1388 write_unlock_irqrestore(&cpufreq_driver_lock, flags);
1389
1390 @@ -43352,7 +43362,7 @@ index e979ec7..a024e16 100644
1391 write_lock_irqsave(&cpufreq_driver_lock, flags);
1392 - cpufreq_driver->boost_enabled = !state;
1393 + pax_open_kernel();
1394 -+ *(bool *)&cpufreq_driver->boost_enabled = !state;
1395 ++ const_cast(cpufreq_driver->boost_enabled) = !state;
1396 + pax_close_kernel();
1397 write_unlock_irqrestore(&cpufreq_driver_lock, flags);
1398
1399 @@ -43363,7 +43373,7 @@ index e979ec7..a024e16 100644
1400
1401 - cpufreq_driver->set_boost = cpufreq_boost_set_sw;
1402 + pax_open_kernel();
1403 -+ *(void **)&cpufreq_driver->set_boost = cpufreq_boost_set_sw;
1404 ++ const_cast(cpufreq_driver->set_boost) = cpufreq_boost_set_sw;
1405 + pax_close_kernel();
1406
1407 /* This will get removed on driver unregister */
1408 @@ -43376,7 +43386,7 @@ index e979ec7..a024e16 100644
1409 - driver_data->flags |= CPUFREQ_CONST_LOOPS;
1410 + if (driver_data->setpolicy) {
1411 + pax_open_kernel();
1412 -+ *(u8 *)&driver_data->flags |= CPUFREQ_CONST_LOOPS;
1413 ++ const_cast(driver_data->flags) |= CPUFREQ_CONST_LOOPS;
1414 + pax_close_kernel();
1415 + }
1416
1417 @@ -43445,7 +43455,7 @@ index 91e767a0..3b40724 100644
1418 struct dbs_data *dbs_data = _gov##_dbs_cdata.gdbs_data; \
1419 return sprintf(buf, "%u\n", dbs_data->min_sampling_rate); \
1420 diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
1421 -index eae5107..26e7a39 100644
1422 +index eae5107..3dd6408 100644
1423 --- a/drivers/cpufreq/cpufreq_ondemand.c
1424 +++ b/drivers/cpufreq/cpufreq_ondemand.c
1425 @@ -534,7 +534,7 @@ static void od_exit(struct dbs_data *dbs_data, bool notify)
1426 @@ -43463,7 +43473,7 @@ index eae5107..26e7a39 100644
1427 {
1428 - od_ops.powersave_bias_target = f;
1429 + pax_open_kernel();
1430 -+ *(void **)&od_ops.powersave_bias_target = f;
1431 ++ const_cast(od_ops.powersave_bias_target) = f;
1432 + pax_close_kernel();
1433 od_set_powersave_bias(powersave_bias);
1434 }
1435 @@ -43473,7 +43483,7 @@ index eae5107..26e7a39 100644
1436 {
1437 - od_ops.powersave_bias_target = generic_powersave_bias_target;
1438 + pax_open_kernel();
1439 -+ *(void **)&od_ops.powersave_bias_target = generic_powersave_bias_target;
1440 ++ const_cast(od_ops.powersave_bias_target) = generic_powersave_bias_target;
1441 + pax_close_kernel();
1442 od_set_powersave_bias(0);
1443 }
1444 @@ -43634,7 +43644,7 @@ index e895123..05de99b 100644
1445
1446 #if IS_ENABLED(CONFIG_ACPI)
1447 diff --git a/drivers/cpufreq/p4-clockmod.c b/drivers/cpufreq/p4-clockmod.c
1448 -index 5dd95da..abc3837 100644
1449 +index 5dd95da..ac41e5e 100644
1450 --- a/drivers/cpufreq/p4-clockmod.c
1451 +++ b/drivers/cpufreq/p4-clockmod.c
1452 @@ -134,10 +134,14 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c)
1453 @@ -43643,13 +43653,13 @@ index 5dd95da..abc3837 100644
1454 case 0x1C: /* Atom */
1455 - p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS;
1456 + pax_open_kernel();
1457 -+ *(u8 *)&p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS;
1458 ++ const_cast(p4clockmod_driver.flags) |= CPUFREQ_CONST_LOOPS;
1459 + pax_close_kernel();
1460 return speedstep_get_frequency(SPEEDSTEP_CPU_PCORE);
1461 case 0x0D: /* Pentium M (Dothan) */
1462 - p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS;
1463 + pax_open_kernel();
1464 -+ *(u8 *)&p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS;
1465 ++ const_cast(p4clockmod_driver.flags) |= CPUFREQ_CONST_LOOPS;
1466 + pax_close_kernel();
1467 /* fall through */
1468 case 0x09: /* Pentium M (Banias) */
1469 @@ -43660,7 +43670,7 @@ index 5dd95da..abc3837 100644
1470 * throttling is active or not. */
1471 - p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS;
1472 + pax_open_kernel();
1473 -+ *(u8 *)&p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS;
1474 ++ const_cast(p4clockmod_driver.flags) |= CPUFREQ_CONST_LOOPS;
1475 + pax_close_kernel();
1476
1477 if (speedstep_detect_processor() == SPEEDSTEP_CPU_P4M) {
1478 @@ -43776,7 +43786,7 @@ index 9bb42ba..b01b4a2 100644
1479
1480 MODULE_AUTHOR("David S. Miller <davem@××××××.com>");
1481 diff --git a/drivers/cpufreq/speedstep-centrino.c b/drivers/cpufreq/speedstep-centrino.c
1482 -index 7d4a315..21bb886 100644
1483 +index 7d4a315..ce41fb3 100644
1484 --- a/drivers/cpufreq/speedstep-centrino.c
1485 +++ b/drivers/cpufreq/speedstep-centrino.c
1486 @@ -351,8 +351,11 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)
1487 @@ -43787,7 +43797,7 @@ index 7d4a315..21bb886 100644
1488 - centrino_driver.flags |= CPUFREQ_CONST_LOOPS;
1489 + if (cpu_has(cpu, X86_FEATURE_CONSTANT_TSC)) {
1490 + pax_open_kernel();
1491 -+ *(u8 *)&centrino_driver.flags |= CPUFREQ_CONST_LOOPS;
1492 ++ const_cast(centrino_driver.flags) |= CPUFREQ_CONST_LOOPS;
1493 + pax_close_kernel();
1494 + }
1495
1496 @@ -44575,7 +44585,7 @@ index 94a58a0..5b8dd03 100644
1497 };
1498
1499 diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
1500 -index 88bebe1..c7b636f 100644
1501 +index 88bebe1..e599fad 100644
1502 --- a/drivers/firmware/dmi_scan.c
1503 +++ b/drivers/firmware/dmi_scan.c
1504 @@ -712,14 +712,18 @@ static int __init dmi_init(void)
1505 @@ -44585,8 +44595,8 @@ index 88bebe1..c7b636f 100644
1506 - bin_attr_smbios_entry_point.size = smbios_entry_point_size;
1507 - bin_attr_smbios_entry_point.private = smbios_entry_point;
1508 + pax_open_kernel();
1509 -+ *(size_t *)&bin_attr_smbios_entry_point.size = smbios_entry_point_size;
1510 -+ *(void **)&bin_attr_smbios_entry_point.private = smbios_entry_point;
1511 ++ const_cast(bin_attr_smbios_entry_point.size) = smbios_entry_point_size;
1512 ++ const_cast(bin_attr_smbios_entry_point.private) = smbios_entry_point;
1513 + pax_close_kernel();
1514 ret = sysfs_create_bin_file(tables_kobj, &bin_attr_smbios_entry_point);
1515 if (ret)
1516 @@ -44595,8 +44605,8 @@ index 88bebe1..c7b636f 100644
1517 - bin_attr_DMI.size = dmi_len;
1518 - bin_attr_DMI.private = dmi_table;
1519 + pax_open_kernel();
1520 -+ *(size_t *)&bin_attr_DMI.size = dmi_len;
1521 -+ *(void **)&bin_attr_DMI.private = dmi_table;
1522 ++ const_cast(bin_attr_DMI.size) = dmi_len;
1523 ++ const_cast(bin_attr_DMI.private) = dmi_table;
1524 + pax_close_kernel();
1525 ret = sysfs_create_bin_file(tables_kobj, &bin_attr_DMI);
1526 if (!ret)
1527 @@ -44623,7 +44633,7 @@ index d425374..1da1716 100644
1528 EXPORT_SYMBOL_GPL(cper_next_record_id);
1529
1530 diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
1531 -index c51f3b2..d1cc54e 100644
1532 +index c51f3b2..54523fd 100644
1533 --- a/drivers/firmware/efi/efi.c
1534 +++ b/drivers/firmware/efi/efi.c
1535 @@ -176,15 +176,17 @@ static struct attribute_group efi_subsys_attr_group = {
1536 @@ -44641,11 +44651,11 @@ index c51f3b2..d1cc54e 100644
1537 - generic_ops.get_next_variable = efi.get_next_variable;
1538 - generic_ops.query_variable_store = efi_query_variable_store;
1539 + pax_open_kernel();
1540 -+ *(void **)&generic_ops.get_variable = efi.get_variable;
1541 -+ *(void **)&generic_ops.set_variable = efi.set_variable;
1542 -+ *(void **)&generic_ops.set_variable_nonblocking = efi.set_variable_nonblocking;
1543 -+ *(void **)&generic_ops.get_next_variable = efi.get_next_variable;
1544 -+ *(void **)&generic_ops.query_variable_store = efi_query_variable_store;
1545 ++ const_cast(generic_ops.get_variable) = efi.get_variable;
1546 ++ const_cast(generic_ops.set_variable) = efi.set_variable;
1547 ++ const_cast(generic_ops.set_variable_nonblocking) = efi.set_variable_nonblocking;
1548 ++ const_cast(generic_ops.get_next_variable) = efi.get_next_variable;
1549 ++ const_cast(generic_ops.query_variable_store) = efi_query_variable_store;
1550 + pax_close_kernel();
1551
1552 return efivars_register(&generic_efivars, &generic_ops, efi_kobj);
1553 @@ -44690,7 +44700,7 @@ index f1ab05e..ab51228 100644
1554 .ident = "Google Board",
1555 .matches = {
1556 diff --git a/drivers/firmware/google/memconsole.c b/drivers/firmware/google/memconsole.c
1557 -index 2f569aa..26e4f39 100644
1558 +index 2f569aa..3af5497 100644
1559 --- a/drivers/firmware/google/memconsole.c
1560 +++ b/drivers/firmware/google/memconsole.c
1561 @@ -136,7 +136,7 @@ static bool __init found_memconsole(void)
1562 @@ -44708,7 +44718,7 @@ index 2f569aa..26e4f39 100644
1563
1564 - memconsole_bin_attr.size = memconsole_length;
1565 + pax_open_kernel();
1566 -+ *(size_t *)&memconsole_bin_attr.size = memconsole_length;
1567 ++ const_cast(memconsole_bin_attr.size) = memconsole_length;
1568 + pax_close_kernel();
1569 +
1570 return sysfs_create_bin_file(firmware_kobj, &memconsole_bin_attr);
1571 @@ -44840,7 +44850,7 @@ index ac8deb0..f3caa10 100644
1572 return -EINVAL;
1573 }
1574 diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
1575 -index 5c1ba87..ab4a059 100644
1576 +index 5c1ba87..f711915 100644
1577 --- a/drivers/gpio/gpiolib.c
1578 +++ b/drivers/gpio/gpiolib.c
1579 @@ -669,8 +669,10 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip)
1580 @@ -44850,8 +44860,8 @@ index 5c1ba87..ab4a059 100644
1581 - gpiochip->irqchip->irq_request_resources = NULL;
1582 - gpiochip->irqchip->irq_release_resources = NULL;
1583 + pax_open_kernel();
1584 -+ *(void **)&gpiochip->irqchip->irq_request_resources = NULL;
1585 -+ *(void **)&gpiochip->irqchip->irq_release_resources = NULL;
1586 ++ const_cast(gpiochip->irqchip->irq_request_resources) = NULL;
1587 ++ const_cast(gpiochip->irqchip->irq_release_resources) = NULL;
1588 + pax_close_kernel();
1589 gpiochip->irqchip = NULL;
1590 }
1591 @@ -44863,8 +44873,8 @@ index 5c1ba87..ab4a059 100644
1592 - irqchip->irq_request_resources = gpiochip_irq_reqres;
1593 - irqchip->irq_release_resources = gpiochip_irq_relres;
1594 + pax_open_kernel();
1595 -+ *(void **)&irqchip->irq_request_resources = gpiochip_irq_reqres;
1596 -+ *(void **)&irqchip->irq_release_resources = gpiochip_irq_relres;
1597 ++ const_cast(irqchip->irq_request_resources) = gpiochip_irq_reqres;
1598 ++ const_cast(irqchip->irq_release_resources) = gpiochip_irq_relres;
1599 + pax_close_kernel();
1600 }
1601
1602 @@ -45050,7 +45060,7 @@ index 51bfc11..4d4112a 100644
1603
1604 static const struct vga_switcheroo_client_ops amdgpu_switcheroo_ops = {
1605 diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
1606 -index 9ef1db8..bfd5d78 100644
1607 +index 9ef1db8..5eec19b 100644
1608 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
1609 +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
1610 @@ -495,7 +495,7 @@ static struct drm_driver kms_driver = {
1611 @@ -45082,7 +45092,7 @@ index 9ef1db8..bfd5d78 100644
1612 - driver->num_ioctls = amdgpu_max_kms_ioctl;
1613 +
1614 + pax_open_kernel();
1615 -+ *(int *)&kms_driver.num_ioctls = amdgpu_max_kms_ioctl;
1616 ++ const_cast(kms_driver.num_ioctls) = amdgpu_max_kms_ioctl;
1617 + pax_close_kernel();
1618 +
1619 amdgpu_register_atpx_handler();
1620 @@ -46288,7 +46298,7 @@ index d918567..6cfd904 100644
1621 /**
1622 * Determine if the device really is AGP or not.
1623 diff --git a/drivers/gpu/drm/i810/i810_drv.c b/drivers/gpu/drm/i810/i810_drv.c
1624 -index 44f4a13..0063c1b 100644
1625 +index 44f4a13..af9f6f5 100644
1626 --- a/drivers/gpu/drm/i810/i810_drv.c
1627 +++ b/drivers/gpu/drm/i810/i810_drv.c
1628 @@ -87,7 +87,11 @@ static int __init i810_init(void)
1629 @@ -46298,7 +46308,7 @@ index 44f4a13..0063c1b 100644
1630 - driver.num_ioctls = i810_max_ioctl;
1631 +
1632 + pax_open_kernel();
1633 -+ *(int *)&driver.num_ioctls = i810_max_ioctl;
1634 ++ const_cast(driver.num_ioctls) = i810_max_ioctl;
1635 + pax_close_kernel();
1636 +
1637 return drm_pci_init(&driver, &i810_pci_driver);
1638 @@ -46547,7 +46557,7 @@ index 97f3a56..32c712e 100644
1639 ret = drm_ioctl(filp, cmd, arg);
1640
1641 diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
1642 -index fa8afa7..0bac957 100644
1643 +index fa8afa7..7375300 100644
1644 --- a/drivers/gpu/drm/i915/i915_irq.c
1645 +++ b/drivers/gpu/drm/i915/i915_irq.c
1646 @@ -4490,14 +4490,15 @@ void intel_irq_init(struct drm_i915_private *dev_priv)
1647 @@ -46558,14 +46568,14 @@ index fa8afa7..0bac957 100644
1648 if (IS_GEN2(dev_priv)) {
1649 dev->max_vblank_count = 0;
1650 - dev->driver->get_vblank_counter = i8xx_get_vblank_counter;
1651 -+ *(void **)&dev->driver->get_vblank_counter = i8xx_get_vblank_counter;
1652 ++ const_cast(dev->driver->get_vblank_counter) = i8xx_get_vblank_counter;
1653 } else if (IS_G4X(dev_priv) || INTEL_INFO(dev_priv)->gen >= 5) {
1654 dev->max_vblank_count = 0xffffffff; /* full 32 bit counter */
1655 - dev->driver->get_vblank_counter = g4x_get_vblank_counter;
1656 -+ *(void **)&dev->driver->get_vblank_counter = g4x_get_vblank_counter;
1657 ++ const_cast(dev->driver->get_vblank_counter) = g4x_get_vblank_counter;
1658 } else {
1659 - dev->driver->get_vblank_counter = i915_get_vblank_counter;
1660 -+ *(void **)&dev->driver->get_vblank_counter = i915_get_vblank_counter;
1661 ++ const_cast(dev->driver->get_vblank_counter) = i915_get_vblank_counter;
1662 dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */
1663 }
1664
1665 @@ -46575,8 +46585,8 @@ index fa8afa7..0bac957 100644
1666
1667 - dev->driver->get_vblank_timestamp = i915_get_vblank_timestamp;
1668 - dev->driver->get_scanout_position = i915_get_crtc_scanoutpos;
1669 -+ *(void **)&dev->driver->get_vblank_timestamp = i915_get_vblank_timestamp;
1670 -+ *(void **)&dev->driver->get_scanout_position = i915_get_crtc_scanoutpos;
1671 ++ const_cast(dev->driver->get_vblank_timestamp) = i915_get_vblank_timestamp;
1672 ++ const_cast(dev->driver->get_scanout_position) = i915_get_crtc_scanoutpos;
1673
1674 if (IS_CHERRYVIEW(dev_priv)) {
1675 - dev->driver->irq_handler = cherryview_irq_handler;
1676 @@ -46585,12 +46595,12 @@ index fa8afa7..0bac957 100644
1677 - dev->driver->irq_uninstall = cherryview_irq_uninstall;
1678 - dev->driver->enable_vblank = valleyview_enable_vblank;
1679 - dev->driver->disable_vblank = valleyview_disable_vblank;
1680 -+ *(void **)&dev->driver->irq_handler = cherryview_irq_handler;
1681 -+ *(void **)&dev->driver->irq_preinstall = cherryview_irq_preinstall;
1682 -+ *(void **)&dev->driver->irq_postinstall = cherryview_irq_postinstall;
1683 -+ *(void **)&dev->driver->irq_uninstall = cherryview_irq_uninstall;
1684 -+ *(void **)&dev->driver->enable_vblank = valleyview_enable_vblank;
1685 -+ *(void **)&dev->driver->disable_vblank = valleyview_disable_vblank;
1686 ++ const_cast(dev->driver->irq_handler) = cherryview_irq_handler;
1687 ++ const_cast(dev->driver->irq_preinstall) = cherryview_irq_preinstall;
1688 ++ const_cast(dev->driver->irq_postinstall) = cherryview_irq_postinstall;
1689 ++ const_cast(dev->driver->irq_uninstall) = cherryview_irq_uninstall;
1690 ++ const_cast(dev->driver->enable_vblank) = valleyview_enable_vblank;
1691 ++ const_cast(dev->driver->disable_vblank) = valleyview_disable_vblank;
1692 dev_priv->display.hpd_irq_setup = i915_hpd_irq_setup;
1693 } else if (IS_VALLEYVIEW(dev_priv)) {
1694 - dev->driver->irq_handler = valleyview_irq_handler;
1695 @@ -46599,12 +46609,12 @@ index fa8afa7..0bac957 100644
1696 - dev->driver->irq_uninstall = valleyview_irq_uninstall;
1697 - dev->driver->enable_vblank = valleyview_enable_vblank;
1698 - dev->driver->disable_vblank = valleyview_disable_vblank;
1699 -+ *(void **)&dev->driver->irq_handler = valleyview_irq_handler;
1700 -+ *(void **)&dev->driver->irq_preinstall = valleyview_irq_preinstall;
1701 -+ *(void **)&dev->driver->irq_postinstall = valleyview_irq_postinstall;
1702 -+ *(void **)&dev->driver->irq_uninstall = valleyview_irq_uninstall;
1703 -+ *(void **)&dev->driver->enable_vblank = valleyview_enable_vblank;
1704 -+ *(void **)&dev->driver->disable_vblank = valleyview_disable_vblank;
1705 ++ const_cast(dev->driver->irq_handler) = valleyview_irq_handler;
1706 ++ const_cast(dev->driver->irq_preinstall) = valleyview_irq_preinstall;
1707 ++ const_cast(dev->driver->irq_postinstall) = valleyview_irq_postinstall;
1708 ++ const_cast(dev->driver->irq_uninstall) = valleyview_irq_uninstall;
1709 ++ const_cast(dev->driver->enable_vblank) = valleyview_enable_vblank;
1710 ++ const_cast(dev->driver->disable_vblank) = valleyview_disable_vblank;
1711 dev_priv->display.hpd_irq_setup = i915_hpd_irq_setup;
1712 } else if (INTEL_INFO(dev_priv)->gen >= 8) {
1713 - dev->driver->irq_handler = gen8_irq_handler;
1714 @@ -46613,12 +46623,12 @@ index fa8afa7..0bac957 100644
1715 - dev->driver->irq_uninstall = gen8_irq_uninstall;
1716 - dev->driver->enable_vblank = gen8_enable_vblank;
1717 - dev->driver->disable_vblank = gen8_disable_vblank;
1718 -+ *(void **)&dev->driver->irq_handler = gen8_irq_handler;
1719 -+ *(void **)&dev->driver->irq_preinstall = gen8_irq_reset;
1720 -+ *(void **)&dev->driver->irq_postinstall = gen8_irq_postinstall;
1721 -+ *(void **)&dev->driver->irq_uninstall = gen8_irq_uninstall;
1722 -+ *(void **)&dev->driver->enable_vblank = gen8_enable_vblank;
1723 -+ *(void **)&dev->driver->disable_vblank = gen8_disable_vblank;
1724 ++ const_cast(dev->driver->irq_handler) = gen8_irq_handler;
1725 ++ const_cast(dev->driver->irq_preinstall) = gen8_irq_reset;
1726 ++ const_cast(dev->driver->irq_postinstall) = gen8_irq_postinstall;
1727 ++ const_cast(dev->driver->irq_uninstall) = gen8_irq_uninstall;
1728 ++ const_cast(dev->driver->enable_vblank) = gen8_enable_vblank;
1729 ++ const_cast(dev->driver->disable_vblank) = gen8_disable_vblank;
1730 if (IS_BROXTON(dev))
1731 dev_priv->display.hpd_irq_setup = bxt_hpd_irq_setup;
1732 else if (HAS_PCH_SPT(dev))
1733 @@ -46632,12 +46642,12 @@ index fa8afa7..0bac957 100644
1734 - dev->driver->irq_uninstall = ironlake_irq_uninstall;
1735 - dev->driver->enable_vblank = ironlake_enable_vblank;
1736 - dev->driver->disable_vblank = ironlake_disable_vblank;
1737 -+ *(void **)&dev->driver->irq_handler = ironlake_irq_handler;
1738 -+ *(void **)&dev->driver->irq_preinstall = ironlake_irq_reset;
1739 -+ *(void **)&dev->driver->irq_postinstall = ironlake_irq_postinstall;
1740 -+ *(void **)&dev->driver->irq_uninstall = ironlake_irq_uninstall;
1741 -+ *(void **)&dev->driver->enable_vblank = ironlake_enable_vblank;
1742 -+ *(void **)&dev->driver->disable_vblank = ironlake_disable_vblank;
1743 ++ const_cast(dev->driver->irq_handler) = ironlake_irq_handler;
1744 ++ const_cast(dev->driver->irq_preinstall) = ironlake_irq_reset;
1745 ++ const_cast(dev->driver->irq_postinstall) = ironlake_irq_postinstall;
1746 ++ const_cast(dev->driver->irq_uninstall) = ironlake_irq_uninstall;
1747 ++ const_cast(dev->driver->enable_vblank) = ironlake_enable_vblank;
1748 ++ const_cast(dev->driver->disable_vblank) = ironlake_disable_vblank;
1749 dev_priv->display.hpd_irq_setup = ilk_hpd_irq_setup;
1750 } else {
1751 if (INTEL_INFO(dev_priv)->gen == 2) {
1752 @@ -46645,42 +46655,42 @@ index fa8afa7..0bac957 100644
1753 - dev->driver->irq_postinstall = i8xx_irq_postinstall;
1754 - dev->driver->irq_handler = i8xx_irq_handler;
1755 - dev->driver->irq_uninstall = i8xx_irq_uninstall;
1756 -+ *(void **)&dev->driver->irq_preinstall = i8xx_irq_preinstall;
1757 -+ *(void **)&dev->driver->irq_postinstall = i8xx_irq_postinstall;
1758 -+ *(void **)&dev->driver->irq_handler = i8xx_irq_handler;
1759 -+ *(void **)&dev->driver->irq_uninstall = i8xx_irq_uninstall;
1760 ++ const_cast(dev->driver->irq_preinstall) = i8xx_irq_preinstall;
1761 ++ const_cast(dev->driver->irq_postinstall) = i8xx_irq_postinstall;
1762 ++ const_cast(dev->driver->irq_handler) = i8xx_irq_handler;
1763 ++ const_cast(dev->driver->irq_uninstall) = i8xx_irq_uninstall;
1764 } else if (INTEL_INFO(dev_priv)->gen == 3) {
1765 - dev->driver->irq_preinstall = i915_irq_preinstall;
1766 - dev->driver->irq_postinstall = i915_irq_postinstall;
1767 - dev->driver->irq_uninstall = i915_irq_uninstall;
1768 - dev->driver->irq_handler = i915_irq_handler;
1769 -+ *(void **)&dev->driver->irq_preinstall = i915_irq_preinstall;
1770 -+ *(void **)&dev->driver->irq_postinstall = i915_irq_postinstall;
1771 -+ *(void **)&dev->driver->irq_uninstall = i915_irq_uninstall;
1772 -+ *(void **)&dev->driver->irq_handler = i915_irq_handler;
1773 ++ const_cast(dev->driver->irq_preinstall) = i915_irq_preinstall;
1774 ++ const_cast(dev->driver->irq_postinstall) = i915_irq_postinstall;
1775 ++ const_cast(dev->driver->irq_uninstall) = i915_irq_uninstall;
1776 ++ const_cast(dev->driver->irq_handler) = i915_irq_handler;
1777 } else {
1778 - dev->driver->irq_preinstall = i965_irq_preinstall;
1779 - dev->driver->irq_postinstall = i965_irq_postinstall;
1780 - dev->driver->irq_uninstall = i965_irq_uninstall;
1781 - dev->driver->irq_handler = i965_irq_handler;
1782 -+ *(void **)&dev->driver->irq_preinstall = i965_irq_preinstall;
1783 -+ *(void **)&dev->driver->irq_postinstall = i965_irq_postinstall;
1784 -+ *(void **)&dev->driver->irq_uninstall = i965_irq_uninstall;
1785 -+ *(void **)&dev->driver->irq_handler = i965_irq_handler;
1786 ++ const_cast(dev->driver->irq_preinstall) = i965_irq_preinstall;
1787 ++ const_cast(dev->driver->irq_postinstall) = i965_irq_postinstall;
1788 ++ const_cast(dev->driver->irq_uninstall) = i965_irq_uninstall;
1789 ++ const_cast(dev->driver->irq_handler) = i965_irq_handler;
1790 }
1791 if (I915_HAS_HOTPLUG(dev_priv))
1792 dev_priv->display.hpd_irq_setup = i915_hpd_irq_setup;
1793 - dev->driver->enable_vblank = i915_enable_vblank;
1794 - dev->driver->disable_vblank = i915_disable_vblank;
1795 -+ *(void **)&dev->driver->enable_vblank = i915_enable_vblank;
1796 -+ *(void **)&dev->driver->disable_vblank = i915_disable_vblank;
1797 ++ const_cast(dev->driver->enable_vblank) = i915_enable_vblank;
1798 ++ const_cast(dev->driver->disable_vblank) = i915_disable_vblank;
1799 }
1800 + pax_close_kernel();
1801 }
1802
1803 /**
1804 diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
1805 -index 39b00b9..aa9fc8a 100644
1806 +index 39b00b9..244538d 100644
1807 --- a/drivers/gpu/drm/i915/intel_display.c
1808 +++ b/drivers/gpu/drm/i915/intel_display.c
1809 @@ -15111,13 +15111,13 @@ struct intel_quirk {
1810 @@ -46693,8 +46703,9 @@ index 39b00b9..aa9fc8a 100644
1811 /* For systems that don't have a meaningful PCI subdevice/subvendor ID */
1812 struct intel_dmi_quirk {
1813 void (*hook)(struct drm_device *dev);
1814 - const struct dmi_system_id (*dmi_id_list)[];
1815 +- const struct dmi_system_id (*dmi_id_list)[];
1816 -};
1817 ++ const struct dmi_system_id *dmi_id_list;
1818 +} __do_const;
1819
1820 static int intel_dmi_reverse_brightness(const struct dmi_system_id *id)
1821 @@ -46726,10 +46737,19 @@ index 39b00b9..aa9fc8a 100644
1822 +
1823 +static const struct intel_dmi_quirk intel_dmi_quirks[] = {
1824 + {
1825 -+ .dmi_id_list = &intel_dmi_quirks_table,
1826 ++ .dmi_id_list = intel_dmi_quirks_table,
1827 .hook = quirk_invert_brightness,
1828 },
1829 };
1830 +@@ -15219,7 +15221,7 @@ static void intel_init_quirks(struct drm_device *dev)
1831 + q->hook(dev);
1832 + }
1833 + for (i = 0; i < ARRAY_SIZE(intel_dmi_quirks); i++) {
1834 +- if (dmi_check_system(*intel_dmi_quirks[i].dmi_id_list) != 0)
1835 ++ if (dmi_check_system(intel_dmi_quirks[i].dmi_id_list) != 0)
1836 + intel_dmi_quirks[i].hook(dev);
1837 + }
1838 + }
1839 diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
1840 index 2f57d79..7152e6e 100644
1841 --- a/drivers/gpu/drm/imx/imx-drm-core.c
1842 @@ -46744,7 +46764,7 @@ index 2f57d79..7152e6e 100644
1843
1844 imx_drm_crtc = kzalloc(sizeof(*imx_drm_crtc), GFP_KERNEL);
1845 diff --git a/drivers/gpu/drm/mga/mga_drv.c b/drivers/gpu/drm/mga/mga_drv.c
1846 -index 5e2f131..d227dbc 100644
1847 +index 5e2f131..c134c7c 100644
1848 --- a/drivers/gpu/drm/mga/mga_drv.c
1849 +++ b/drivers/gpu/drm/mga/mga_drv.c
1850 @@ -92,7 +92,10 @@ static struct pci_driver mga_pci_driver = {
1851 @@ -46753,7 +46773,7 @@ index 5e2f131..d227dbc 100644
1852 {
1853 - driver.num_ioctls = mga_max_ioctl;
1854 + pax_open_kernel();
1855 -+ *(int *)&driver.num_ioctls = mga_max_ioctl;
1856 ++ const_cast(driver.num_ioctls) = mga_max_ioctl;
1857 + pax_close_kernel();
1858 +
1859 return drm_pci_init(&driver, &mga_pci_driver);
1860 @@ -47140,7 +47160,7 @@ index fe4c222..48b7b75 100644
1861 omap_irq.o \
1862 omap_debugfs.o \
1863 diff --git a/drivers/gpu/drm/omapdrm/dss/display.c b/drivers/gpu/drm/omapdrm/dss/display.c
1864 -index ef5b902..47cf7f5 100644
1865 +index ef5b902..2ae011b 100644
1866 --- a/drivers/gpu/drm/omapdrm/dss/display.c
1867 +++ b/drivers/gpu/drm/omapdrm/dss/display.c
1868 @@ -161,12 +161,14 @@ int omapdss_register_display(struct omap_dss_device *dssdev)
1869 @@ -47150,13 +47170,13 @@ index ef5b902..47cf7f5 100644
1870 + pax_open_kernel();
1871 if (drv && drv->get_resolution == NULL)
1872 - drv->get_resolution = omapdss_default_get_resolution;
1873 -+ *(void **)&drv->get_resolution = omapdss_default_get_resolution;
1874 ++ const_cast(drv->get_resolution) = omapdss_default_get_resolution;
1875 if (drv && drv->get_recommended_bpp == NULL)
1876 - drv->get_recommended_bpp = omapdss_default_get_recommended_bpp;
1877 -+ *(void **)&drv->get_recommended_bpp = omapdss_default_get_recommended_bpp;
1878 ++ const_cast(drv->get_recommended_bpp) = omapdss_default_get_recommended_bpp;
1879 if (drv && drv->get_timings == NULL)
1880 - drv->get_timings = omapdss_default_get_timings;
1881 -+ *(void **)&drv->get_timings = omapdss_default_get_timings;
1882 ++ const_cast(drv->get_timings) = omapdss_default_get_timings;
1883 + pax_close_kernel();
1884
1885 mutex_lock(&panel_list_mutex);
1886 @@ -47232,7 +47252,7 @@ index 47e5264..3393741 100644
1887 {
1888 struct drm_device *ddev = connector->dev;
1889 diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c
1890 -index 7307b07..8eecdd0 100644
1891 +index 7307b07..3346540 100644
1892 --- a/drivers/gpu/drm/qxl/qxl_drv.c
1893 +++ b/drivers/gpu/drm/qxl/qxl_drv.c
1894 @@ -37,7 +37,7 @@
1895 @@ -47251,7 +47271,7 @@ index 7307b07..8eecdd0 100644
1896 - qxl_driver.num_ioctls = qxl_max_ioctls;
1897 +
1898 + pax_open_kernel();
1899 -+ *(int *)&qxl_driver.num_ioctls = qxl_max_ioctls;
1900 ++ const_cast(qxl_driver.num_ioctls) = qxl_max_ioctls;
1901 + pax_close_kernel();
1902 +
1903 return drm_pci_init(&qxl_driver, &qxl_pci_driver);
1904 @@ -47362,7 +47382,7 @@ index 0bf1e20..42a7310 100644
1905 ret = drm_irq_install(qdev->ddev, qdev->ddev->pdev->irq);
1906 qdev->ram_header->int_mask = QXL_INTERRUPT_MASK;
1907 diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c
1908 -index 9534127..3fbab8c 100644
1909 +index 9534127..1d17b3f 100644
1910 --- a/drivers/gpu/drm/qxl/qxl_ttm.c
1911 +++ b/drivers/gpu/drm/qxl/qxl_ttm.c
1912 @@ -103,7 +103,7 @@ static void qxl_ttm_global_fini(struct qxl_device *qdev)
1913 @@ -47416,8 +47436,8 @@ index 9534127..3fbab8c 100644
1914 - else
1915 - qxl_mem_types_list[i].data = qdev->mman.bdev.man[TTM_PL_PRIV0].priv;
1916 + pax_open_kernel();
1917 -+ *(void **)&qxl_mem_types_list[0].data = qdev->mman.bdev.man[TTM_PL_VRAM].priv;
1918 -+ *(void **)&qxl_mem_types_list[1].data = qdev->mman.bdev.man[TTM_PL_PRIV0].priv;
1919 ++ const_cast(qxl_mem_types_list[0].data) = qdev->mman.bdev.man[TTM_PL_VRAM].priv;
1920 ++ const_cast(qxl_mem_types_list[1].data) = qdev->mman.bdev.man[TTM_PL_PRIV0].priv;
1921 + pax_close_kernel();
1922
1923 - }
1924 @@ -47440,7 +47460,7 @@ index 14fd83b5f..b2acbd19 100644
1925 /* We don't support anything other than bus-mastering ring mode,
1926 * but the ring can be in either AGP or PCI space for the ring
1927 diff --git a/drivers/gpu/drm/r128/r128_drv.c b/drivers/gpu/drm/r128/r128_drv.c
1928 -index c57b4de..2614d79 100644
1929 +index c57b4de..1a875fb 100644
1930 --- a/drivers/gpu/drm/r128/r128_drv.c
1931 +++ b/drivers/gpu/drm/r128/r128_drv.c
1932 @@ -94,7 +94,9 @@ static struct pci_driver r128_pci_driver = {
1933 @@ -47449,7 +47469,7 @@ index c57b4de..2614d79 100644
1934 {
1935 - driver.num_ioctls = r128_max_ioctl;
1936 + pax_open_kernel();
1937 -+ *(int *)&driver.num_ioctls = r128_max_ioctl;
1938 ++ const_cast(driver.num_ioctls) = r128_max_ioctl;
1939 + pax_close_kernel();
1940
1941 return drm_pci_init(&driver, &r128_pci_driver);
1942 @@ -47659,7 +47679,7 @@ index 4197ca1..f07709e 100644
1943
1944 static const struct vga_switcheroo_client_ops radeon_switcheroo_ops = {
1945 diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
1946 -index e266ffc..0392d08 100644
1947 +index e266ffc..e510e3f 100644
1948 --- a/drivers/gpu/drm/radeon/radeon_drv.c
1949 +++ b/drivers/gpu/drm/radeon/radeon_drv.c
1950 @@ -130,7 +130,7 @@ extern int radeon_get_crtc_scanoutpos(struct drm_device *dev, unsigned int crtc,
1951 @@ -47688,7 +47708,7 @@ index e266ffc..0392d08 100644
1952 - driver->num_ioctls = radeon_max_kms_ioctl;
1953 +
1954 + pax_open_kernel();
1955 -+ *(int *)&driver->num_ioctls = radeon_max_kms_ioctl;
1956 ++ const_cast(driver->num_ioctls) = radeon_max_kms_ioctl;
1957 + pax_close_kernel();
1958 +
1959 radeon_register_atpx_handler();
1960 @@ -47808,7 +47828,7 @@ index d47dff9..0752202 100644
1961 -int savage_max_ioctl = ARRAY_SIZE(savage_ioctls);
1962 +const int savage_max_ioctl = ARRAY_SIZE(savage_ioctls);
1963 diff --git a/drivers/gpu/drm/savage/savage_drv.c b/drivers/gpu/drm/savage/savage_drv.c
1964 -index 21aed1f..5db7419 100644
1965 +index 21aed1f..85d23a0 100644
1966 --- a/drivers/gpu/drm/savage/savage_drv.c
1967 +++ b/drivers/gpu/drm/savage/savage_drv.c
1968 @@ -76,7 +76,10 @@ static struct pci_driver savage_pci_driver = {
1969 @@ -47817,7 +47837,7 @@ index 21aed1f..5db7419 100644
1970 {
1971 - driver.num_ioctls = savage_max_ioctl;
1972 + pax_open_kernel();
1973 -+ *(int *)&driver.num_ioctls = savage_max_ioctl;
1974 ++ const_cast(driver.num_ioctls) = savage_max_ioctl;
1975 + pax_close_kernel();
1976 +
1977 return drm_pci_init(&driver, &savage_pci_driver);
1978 @@ -47837,7 +47857,7 @@ index 37b6995..9b31aaf 100644
1979 #define S3_SAVAGE3D_SERIES(chip) ((chip>=S3_SAVAGE3D) && (chip<=S3_SAVAGE_MX))
1980
1981 diff --git a/drivers/gpu/drm/sis/sis_drv.c b/drivers/gpu/drm/sis/sis_drv.c
1982 -index 79bce76..4fd9a20 100644
1983 +index 79bce76..6c02219 100644
1984 --- a/drivers/gpu/drm/sis/sis_drv.c
1985 +++ b/drivers/gpu/drm/sis/sis_drv.c
1986 @@ -128,7 +128,10 @@ static struct pci_driver sis_pci_driver = {
1987 @@ -47846,7 +47866,7 @@ index 79bce76..4fd9a20 100644
1988 {
1989 - driver.num_ioctls = sis_max_ioctl;
1990 + pax_open_kernel();
1991 -+ *(int *)&driver.num_ioctls = sis_max_ioctl;
1992 ++ const_cast(driver.num_ioctls) = sis_max_ioctl;
1993 + pax_close_kernel();
1994 +
1995 return drm_pci_init(&driver, &sis_pci_driver);
1996 @@ -47875,7 +47895,7 @@ index 93ad8a5..48f0a57 100644
1997 -int sis_max_ioctl = ARRAY_SIZE(sis_ioctls);
1998 +const int sis_max_ioctl = ARRAY_SIZE(sis_ioctls);
1999 diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
2000 -index dde6f20..1969ca6 100644
2001 +index dde6f20..a74f8b9 100644
2002 --- a/drivers/gpu/drm/tegra/dc.c
2003 +++ b/drivers/gpu/drm/tegra/dc.c
2004 @@ -1657,7 +1657,7 @@ static int tegra_dc_debugfs_init(struct tegra_dc *dc, struct drm_minor *minor)
2005 @@ -47883,7 +47903,7 @@ index dde6f20..1969ca6 100644
2006
2007 for (i = 0; i < ARRAY_SIZE(debugfs_files); i++)
2008 - dc->debugfs_files[i].data = dc;
2009 -+ *(void **)&dc->debugfs_files[i].data = dc;
2010 ++ const_cast(dc->debugfs_files[i].data) = dc;
2011
2012 err = drm_debugfs_create_files(dc->debugfs_files,
2013 ARRAY_SIZE(debugfs_files),
2014 @@ -47914,7 +47934,7 @@ index b7ef492..8968507 100644
2015 struct dentry *debugfs;
2016 };
2017 diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
2018 -index 757c6e8..710a6ff 100644
2019 +index 757c6e8..36532d6 100644
2020 --- a/drivers/gpu/drm/tegra/sor.c
2021 +++ b/drivers/gpu/drm/tegra/sor.c
2022 @@ -1003,8 +1003,11 @@ static int tegra_sor_debugfs_init(struct tegra_sor *sor,
2023 @@ -47925,7 +47945,7 @@ index 757c6e8..710a6ff 100644
2024 - sor->debugfs_files[i].data = sor;
2025 + for (i = 0; i < ARRAY_SIZE(debugfs_files); i++) {
2026 + pax_open_kernel();
2027 -+ *(void **)&sor->debugfs_files[i].data = sor;
2028 ++ const_cast(sor->debugfs_files[i].data) = sor;
2029 + pax_close_kernel();
2030 + }
2031
2032 @@ -48205,7 +48225,7 @@ index d17d8f2..67e8e48b 100644
2033 -int via_max_ioctl = ARRAY_SIZE(via_ioctls);
2034 +const int via_max_ioctl = ARRAY_SIZE(via_ioctls);
2035 diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
2036 -index ed8aa8f..16c84fc 100644
2037 +index ed8aa8f..114cc8d 100644
2038 --- a/drivers/gpu/drm/via/via_drv.c
2039 +++ b/drivers/gpu/drm/via/via_drv.c
2040 @@ -107,7 +107,10 @@ static struct pci_driver via_pci_driver = {
2041 @@ -48214,7 +48234,7 @@ index ed8aa8f..16c84fc 100644
2042 {
2043 - driver.num_ioctls = via_max_ioctl;
2044 + pax_open_kernel();
2045 -+ *(int *)&driver.num_ioctls = via_max_ioctl;
2046 ++ const_cast(driver.num_ioctls) = via_max_ioctl;
2047 + pax_close_kernel();
2048 +
2049 via_init_command_verifier();
2050 @@ -49094,7 +49114,7 @@ index d127ace..6ee866f 100644
2051 int i, j = 1;
2052
2053 diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
2054 -index 146eed70b..7679efd 100644
2055 +index 146eed70b..7312f08 100644
2056 --- a/drivers/idle/intel_idle.c
2057 +++ b/drivers/idle/intel_idle.c
2058 @@ -1060,8 +1060,10 @@ static void sklh_idle_state_table_update(void)
2059 @@ -49104,8 +49124,8 @@ index 146eed70b..7679efd 100644
2060 - skl_cstates[5].disabled = 1; /* C8-SKL */
2061 - skl_cstates[6].disabled = 1; /* C9-SKL */
2062 + pax_open_kernel();
2063 -+ *(bool *)&skl_cstates[5].disabled = 1; /* C8-SKL */
2064 -+ *(bool *)&skl_cstates[6].disabled = 1; /* C9-SKL */
2065 ++ const_cast(skl_cstates[5].disabled) = 1; /* C8-SKL */
2066 ++ const_cast(skl_cstates[6].disabled) = 1; /* C9-SKL */
2067 + pax_close_kernel();
2068 }
2069 /*
2070 @@ -50103,18 +50123,6 @@ index 8c4daf7..77a87ab 100644
2071 nesqp->destroyed = 1;
2072
2073 /* Blow away the connection if it exists. */
2074 -diff --git a/drivers/infiniband/hw/qib/qib.h b/drivers/infiniband/hw/qib/qib.h
2075 -index 7df16f7..7e1b21e 100644
2076 ---- a/drivers/infiniband/hw/qib/qib.h
2077 -+++ b/drivers/infiniband/hw/qib/qib.h
2078 -@@ -52,6 +52,7 @@
2079 - #include <linux/kref.h>
2080 - #include <linux/sched.h>
2081 - #include <linux/kthread.h>
2082 -+#include <linux/slab.h>
2083 -
2084 - #include "qib_common.h"
2085 - #include "qib_verbs.h"
2086 diff --git a/drivers/infiniband/hw/qib/qib_iba7322.c b/drivers/infiniband/hw/qib/qib_iba7322.c
2087 index 6c8ff10..73cfbb6 100644
2088 --- a/drivers/infiniband/hw/qib/qib_iba7322.c
2089 @@ -50492,7 +50500,7 @@ index 2087534..c3f6b6c 100644
2090 return -ENOMEM;
2091
2092 diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
2093 -index 59ee4b8..6632759 100644
2094 +index 59ee4b8..e4b6234 100644
2095 --- a/drivers/iommu/arm-smmu.c
2096 +++ b/drivers/iommu/arm-smmu.c
2097 @@ -341,7 +341,7 @@ enum arm_smmu_domain_stage {
2098 @@ -50528,7 +50536,7 @@ index 59ee4b8..6632759 100644
2099 /* Update our support page sizes to reflect the page table format */
2100 - arm_smmu_ops.pgsize_bitmap = pgtbl_cfg.pgsize_bitmap;
2101 + pax_open_kernel();
2102 -+ *(unsigned long *)&arm_smmu_ops.pgsize_bitmap = pgtbl_cfg.pgsize_bitmap;
2103 ++ const_cast(arm_smmu_ops.pgsize_bitmap) = pgtbl_cfg.pgsize_bitmap;
2104 + pax_close_kernel();
2105
2106 /* Initialise the context bank with our page table cfg */
2107 @@ -50630,7 +50638,7 @@ index 59ee4b8..6632759 100644
2108
2109 - arm_smmu_ops.pgsize_bitmap &= size;
2110 + pax_open_kernel();
2111 -+ *(unsigned long *)&arm_smmu_ops.pgsize_bitmap &= size;
2112 ++ const_cast(arm_smmu_ops.pgsize_bitmap) &= size;
2113 + pax_close_kernel();
2114 dev_notice(smmu->dev, "\tSupported page sizes: 0x%08lx\n", size);
2115
2116 @@ -51582,7 +51590,7 @@ index fef6586..22353ff 100644
2117 } else if ((DIDD_Table[x].type > 0)
2118 && (DIDD_Table[x].type < 16)) { /* IDI Adapter found */
2119 diff --git a/drivers/isdn/hardware/eicon/mntfunc.c b/drivers/isdn/hardware/eicon/mntfunc.c
2120 -index 1cd9aff..1a3e2b6 100644
2121 +index 1cd9aff..3775d52 100644
2122 --- a/drivers/isdn/hardware/eicon/mntfunc.c
2123 +++ b/drivers/isdn/hardware/eicon/mntfunc.c
2124 @@ -26,8 +26,13 @@ extern void DIVA_DIDD_Read(void *, int);
2125 @@ -51592,7 +51600,7 @@ index 1cd9aff..1a3e2b6 100644
2126 +
2127 +static void didd_nothing(ENTITY IDI_CALL_ENTITY_T *e)
2128 +{
2129 -+ diva_maint_prtComp(e);
2130 ++ diva_maint_prtComp((char *)e);
2131 +}
2132 static DESCRIPTOR MaintDescriptor =
2133 -{ IDI_DIMAINT, 0, 0, (IDI_CALL) diva_maint_prtComp };
2134 @@ -52967,10 +52975,50 @@ index 6b420a5..d5acb8f 100644
2135
2136 struct gc_stat {
2137 diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
2138 -index 22b9e34..ac456ec 100644
2139 +index 22b9e34..d8406e7 100644
2140 --- a/drivers/md/bcache/btree.c
2141 +++ b/drivers/md/bcache/btree.c
2142 -@@ -468,7 +468,7 @@ void __bch_btree_node_write(struct btree *b, struct closure *parent)
2143 +@@ -337,15 +337,17 @@ static void btree_complete_write(struct btree *b, struct btree_write *w)
2144 + w->journal = NULL;
2145 + }
2146 +
2147 +-static void btree_node_write_unlock(struct closure *cl)
2148 ++static void btree_node_write_unlock(struct work_struct *work)
2149 + {
2150 ++ struct closure *cl = container_of(work, struct closure, work);
2151 + struct btree *b = container_of(cl, struct btree, io);
2152 +
2153 + up(&b->io_mutex);
2154 + }
2155 +
2156 +-static void __btree_node_write_done(struct closure *cl)
2157 ++static void __btree_node_write_done(struct work_struct *work)
2158 + {
2159 ++ struct closure *cl = container_of(work, struct closure, work);
2160 + struct btree *b = container_of(cl, struct btree, io);
2161 + struct btree_write *w = btree_prev_write(b);
2162 +
2163 +@@ -359,8 +361,9 @@ static void __btree_node_write_done(struct closure *cl)
2164 + closure_return_with_destructor(cl, btree_node_write_unlock);
2165 + }
2166 +
2167 +-static void btree_node_write_done(struct closure *cl)
2168 ++static void btree_node_write_done(struct work_struct *work)
2169 + {
2170 ++ struct closure *cl = container_of(work, struct closure, work);
2171 + struct btree *b = container_of(cl, struct btree, io);
2172 + struct bio_vec *bv;
2173 + int n;
2174 +@@ -368,7 +371,7 @@ static void btree_node_write_done(struct closure *cl)
2175 + bio_for_each_segment_all(bv, b->bio, n)
2176 + __free_page(bv->bv_page);
2177 +
2178 +- __btree_node_write_done(cl);
2179 ++ __btree_node_write_done(&cl->work);
2180 + }
2181 +
2182 + static void btree_node_write_endio(struct bio *bio)
2183 +@@ -468,7 +471,7 @@ void __bch_btree_node_write(struct btree *b, struct closure *parent)
2184
2185 do_btree_node_write(b);
2186
2187 @@ -52979,12 +53027,44 @@ index 22b9e34..ac456ec 100644
2188 &PTR_CACHE(b->c, &b->key, 0)->btree_sectors_written);
2189
2190 b->written += set_blocks(i, block_bytes(b->c));
2191 +diff --git a/drivers/md/bcache/closure.c b/drivers/md/bcache/closure.c
2192 +index 9eaf1d6..86e6fa1 100644
2193 +--- a/drivers/md/bcache/closure.c
2194 ++++ b/drivers/md/bcache/closure.c
2195 +@@ -29,12 +29,12 @@ static inline void closure_put_after_sub(struct closure *cl, int flags)
2196 + closure_queue(cl);
2197 + } else {
2198 + struct closure *parent = cl->parent;
2199 +- closure_fn *destructor = cl->fn;
2200 ++ work_func_t destructor = cl->fn;
2201 +
2202 + closure_debug_destroy(cl);
2203 +
2204 + if (destructor)
2205 +- destructor(cl);
2206 ++ destructor(&cl->work);
2207 +
2208 + if (parent)
2209 + closure_put(parent);
2210 diff --git a/drivers/md/bcache/closure.h b/drivers/md/bcache/closure.h
2211 -index 782cc2c..4fdd593 100644
2212 +index 782cc2c..34864f4 100644
2213 --- a/drivers/md/bcache/closure.h
2214 +++ b/drivers/md/bcache/closure.h
2215 -@@ -238,7 +238,7 @@ static inline void closure_set_stopped(struct closure *cl)
2216 - static inline void set_closure_fn(struct closure *cl, closure_fn *fn,
2217 +@@ -151,7 +151,7 @@ struct closure {
2218 + struct workqueue_struct *wq;
2219 + struct task_struct *task;
2220 + struct llist_node list;
2221 +- closure_fn *fn;
2222 ++ work_func_t fn;
2223 + };
2224 + struct work_struct work;
2225 + };
2226 +@@ -235,10 +235,10 @@ static inline void closure_set_stopped(struct closure *cl)
2227 + atomic_sub(CLOSURE_RUNNING, &cl->remaining);
2228 + }
2229 +
2230 +-static inline void set_closure_fn(struct closure *cl, closure_fn *fn,
2231 ++static inline void set_closure_fn(struct closure *cl, work_func_t fn,
2232 struct workqueue_struct *wq)
2233 {
2234 - BUG_ON(object_is_on_stack(cl));
2235 @@ -52992,6 +53072,24 @@ index 782cc2c..4fdd593 100644
2236 closure_set_ip(cl);
2237 cl->fn = fn;
2238 cl->wq = wq;
2239 +@@ -253,7 +253,7 @@ static inline void closure_queue(struct closure *cl)
2240 + INIT_WORK(&cl->work, cl->work.func);
2241 + BUG_ON(!queue_work(wq, &cl->work));
2242 + } else
2243 +- cl->fn(cl);
2244 ++ cl->fn(&cl->work);
2245 + }
2246 +
2247 + /**
2248 +@@ -372,7 +372,7 @@ do { \
2249 + * asynchronously out of a new closure - @parent will then wait for @cl to
2250 + * finish.
2251 + */
2252 +-static inline void closure_call(struct closure *cl, closure_fn fn,
2253 ++static inline void closure_call(struct closure *cl, work_func_t fn,
2254 + struct workqueue_struct *wq,
2255 + struct closure *parent)
2256 + {
2257 diff --git a/drivers/md/bcache/io.c b/drivers/md/bcache/io.c
2258 index 86a0bb8..0832b32 100644
2259 --- a/drivers/md/bcache/io.c
2260 @@ -53035,10 +53133,46 @@ index 86a0bb8..0832b32 100644
2261 errors >>= IO_ERROR_SHIFT;
2262
2263 diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c
2264 -index 29eba72..348efc9 100644
2265 +index 29eba72..1d0108a 100644
2266 --- a/drivers/md/bcache/journal.c
2267 +++ b/drivers/md/bcache/journal.c
2268 -@@ -621,7 +621,7 @@ static void journal_write_unlocked(struct closure *cl)
2269 +@@ -555,10 +555,11 @@ static void journal_write_endio(struct bio *bio)
2270 + closure_put(&w->c->journal.io);
2271 + }
2272 +
2273 +-static void journal_write(struct closure *);
2274 ++static void journal_write(struct work_struct *);
2275 +
2276 +-static void journal_write_done(struct closure *cl)
2277 ++static void journal_write_done(struct work_struct *work)
2278 + {
2279 ++ struct closure *cl = container_of(work, struct closure, work);
2280 + struct journal *j = container_of(cl, struct journal, io);
2281 + struct journal_write *w = (j->cur == j->w)
2282 + ? &j->w[1]
2283 +@@ -568,17 +569,19 @@ static void journal_write_done(struct closure *cl)
2284 + continue_at_nobarrier(cl, journal_write, system_wq);
2285 + }
2286 +
2287 +-static void journal_write_unlock(struct closure *cl)
2288 ++static void journal_write_unlock(struct work_struct *work)
2289 + {
2290 ++ struct closure *cl = container_of(work, struct closure, work);
2291 + struct cache_set *c = container_of(cl, struct cache_set, journal.io);
2292 +
2293 + c->journal.io_in_flight = 0;
2294 + spin_unlock(&c->journal.lock);
2295 + }
2296 +
2297 +-static void journal_write_unlocked(struct closure *cl)
2298 ++static void journal_write_unlocked(struct work_struct *work)
2299 + __releases(c->journal.lock)
2300 + {
2301 ++ struct closure *cl = container_of(work, struct closure, work);
2302 + struct cache_set *c = container_of(cl, struct cache_set, journal.io);
2303 + struct cache *ca;
2304 + struct journal_write *w = c->journal.cur;
2305 +@@ -621,7 +624,7 @@ static void journal_write_unlocked(struct closure *cl)
2306 ca = PTR_CACHE(c, k, i);
2307 bio = &ca->journal.bio;
2308
2309 @@ -53047,6 +53181,278 @@ index 29eba72..348efc9 100644
2310
2311 bio_reset(bio);
2312 bio->bi_iter.bi_sector = PTR_OFFSET(k, i);
2313 +@@ -653,12 +656,13 @@ static void journal_write_unlocked(struct closure *cl)
2314 + continue_at(cl, journal_write_done, NULL);
2315 + }
2316 +
2317 +-static void journal_write(struct closure *cl)
2318 ++static void journal_write(struct work_struct *work)
2319 + {
2320 ++ struct closure *cl = container_of(work, struct closure, work);
2321 + struct cache_set *c = container_of(cl, struct cache_set, journal.io);
2322 +
2323 + spin_lock(&c->journal.lock);
2324 +- journal_write_unlocked(cl);
2325 ++ journal_write_unlocked(&cl->work);
2326 + }
2327 +
2328 + static void journal_try_write(struct cache_set *c)
2329 +diff --git a/drivers/md/bcache/movinggc.c b/drivers/md/bcache/movinggc.c
2330 +index b929fc9..4557031 100644
2331 +--- a/drivers/md/bcache/movinggc.c
2332 ++++ b/drivers/md/bcache/movinggc.c
2333 +@@ -34,14 +34,16 @@ static bool moving_pred(struct keybuf *buf, struct bkey *k)
2334 +
2335 + /* Moving GC - IO loop */
2336 +
2337 +-static void moving_io_destructor(struct closure *cl)
2338 ++static void moving_io_destructor(struct work_struct *work)
2339 + {
2340 ++ struct closure *cl = container_of(work, struct closure, work);
2341 + struct moving_io *io = container_of(cl, struct moving_io, cl);
2342 + kfree(io);
2343 + }
2344 +
2345 +-static void write_moving_finish(struct closure *cl)
2346 ++static void write_moving_finish(struct work_struct *work)
2347 + {
2348 ++ struct closure *cl = container_of(work, struct closure, work);
2349 + struct moving_io *io = container_of(cl, struct moving_io, cl);
2350 + struct bio *bio = &io->bio.bio;
2351 + struct bio_vec *bv;
2352 +@@ -92,8 +94,9 @@ static void moving_init(struct moving_io *io)
2353 + bch_bio_map(bio, NULL);
2354 + }
2355 +
2356 +-static void write_moving(struct closure *cl)
2357 ++static void write_moving(struct work_struct *work)
2358 + {
2359 ++ struct closure *cl = container_of(work, struct closure, work);
2360 + struct moving_io *io = container_of(cl, struct moving_io, cl);
2361 + struct data_insert_op *op = &io->op;
2362 +
2363 +@@ -116,8 +119,9 @@ static void write_moving(struct closure *cl)
2364 + continue_at(cl, write_moving_finish, op->wq);
2365 + }
2366 +
2367 +-static void read_moving_submit(struct closure *cl)
2368 ++static void read_moving_submit(struct work_struct *work)
2369 + {
2370 ++ struct closure *cl = container_of(work, struct closure, work);
2371 + struct moving_io *io = container_of(cl, struct moving_io, cl);
2372 + struct bio *bio = &io->bio.bio;
2373 +
2374 +diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
2375 +index 25fa844..8181a97 100644
2376 +--- a/drivers/md/bcache/request.c
2377 ++++ b/drivers/md/bcache/request.c
2378 +@@ -24,7 +24,7 @@
2379 +
2380 + struct kmem_cache *bch_search_cache;
2381 +
2382 +-static void bch_data_insert_start(struct closure *);
2383 ++static void bch_data_insert_start(struct work_struct *);
2384 +
2385 + static unsigned cache_mode(struct cached_dev *dc, struct bio *bio)
2386 + {
2387 +@@ -53,8 +53,9 @@ static void bio_csum(struct bio *bio, struct bkey *k)
2388 +
2389 + /* Insert data into cache */
2390 +
2391 +-static void bch_data_insert_keys(struct closure *cl)
2392 ++static void bch_data_insert_keys(struct work_struct *work)
2393 + {
2394 ++ struct closure *cl = container_of(work, struct closure, work);
2395 + struct data_insert_op *op = container_of(cl, struct data_insert_op, cl);
2396 + atomic_t *journal_ref = NULL;
2397 + struct bkey *replace_key = op->replace ? &op->replace_key : NULL;
2398 +@@ -143,8 +144,9 @@ out:
2399 + continue_at(cl, bch_data_insert_keys, op->wq);
2400 + }
2401 +
2402 +-static void bch_data_insert_error(struct closure *cl)
2403 ++static void bch_data_insert_error(struct work_struct *work)
2404 + {
2405 ++ struct closure *cl = container_of(work, struct closure, work);
2406 + struct data_insert_op *op = container_of(cl, struct data_insert_op, cl);
2407 +
2408 + /*
2409 +@@ -170,7 +172,7 @@ static void bch_data_insert_error(struct closure *cl)
2410 +
2411 + op->insert_keys.top = dst;
2412 +
2413 +- bch_data_insert_keys(cl);
2414 ++ bch_data_insert_keys(&cl->work);
2415 + }
2416 +
2417 + static void bch_data_insert_endio(struct bio *bio)
2418 +@@ -191,8 +193,9 @@ static void bch_data_insert_endio(struct bio *bio)
2419 + bch_bbio_endio(op->c, bio, bio->bi_error, "writing data to cache");
2420 + }
2421 +
2422 +-static void bch_data_insert_start(struct closure *cl)
2423 ++static void bch_data_insert_start(struct work_struct *work)
2424 + {
2425 ++ struct closure *cl = container_of(work, struct closure, work);
2426 + struct data_insert_op *op = container_of(cl, struct data_insert_op, cl);
2427 + struct bio *bio = op->bio, *n;
2428 +
2429 +@@ -313,8 +316,9 @@ err:
2430 + * If s->bypass is true, instead of inserting the data it invalidates the
2431 + * region of the cache represented by s->cache_bio and op->inode.
2432 + */
2433 +-void bch_data_insert(struct closure *cl)
2434 ++void bch_data_insert(struct work_struct *work)
2435 + {
2436 ++ struct closure *cl = container_of(work, struct closure, work);
2437 + struct data_insert_op *op = container_of(cl, struct data_insert_op, cl);
2438 +
2439 + trace_bcache_write(op->c, op->inode, op->bio,
2440 +@@ -322,7 +326,7 @@ void bch_data_insert(struct closure *cl)
2441 +
2442 + bch_keylist_init(&op->insert_keys);
2443 + bio_get(op->bio);
2444 +- bch_data_insert_start(cl);
2445 ++ bch_data_insert_start(&cl->work);
2446 + }
2447 +
2448 + /* Congested? */
2449 +@@ -570,8 +574,9 @@ static int cache_lookup_fn(struct btree_op *op, struct btree *b, struct bkey *k)
2450 + return n == bio ? MAP_DONE : MAP_CONTINUE;
2451 + }
2452 +
2453 +-static void cache_lookup(struct closure *cl)
2454 ++static void cache_lookup(struct work_struct *work)
2455 + {
2456 ++ struct closure *cl = container_of(work, struct closure, work);
2457 + struct search *s = container_of(cl, struct search, iop.cl);
2458 + struct bio *bio = &s->bio.bio;
2459 + int ret;
2460 +@@ -631,8 +636,9 @@ static void do_bio_hook(struct search *s, struct bio *orig_bio)
2461 + bio_cnt_set(bio, 3);
2462 + }
2463 +
2464 +-static void search_free(struct closure *cl)
2465 ++static void search_free(struct work_struct *work)
2466 + {
2467 ++ struct closure *cl = container_of(work, struct closure, work);
2468 + struct search *s = container_of(cl, struct search, cl);
2469 + bio_complete(s);
2470 +
2471 +@@ -676,19 +682,21 @@ static inline struct search *search_alloc(struct bio *bio,
2472 +
2473 + /* Cached devices */
2474 +
2475 +-static void cached_dev_bio_complete(struct closure *cl)
2476 ++static void cached_dev_bio_complete(struct work_struct *work)
2477 + {
2478 ++ struct closure *cl = container_of(work, struct closure, work);
2479 + struct search *s = container_of(cl, struct search, cl);
2480 + struct cached_dev *dc = container_of(s->d, struct cached_dev, disk);
2481 +
2482 +- search_free(cl);
2483 ++ search_free(&cl->work);
2484 + cached_dev_put(dc);
2485 + }
2486 +
2487 + /* Process reads */
2488 +
2489 +-static void cached_dev_cache_miss_done(struct closure *cl)
2490 ++static void cached_dev_cache_miss_done(struct work_struct *work)
2491 + {
2492 ++ struct closure *cl = container_of(work, struct closure, work);
2493 + struct search *s = container_of(cl, struct search, cl);
2494 +
2495 + if (s->iop.replace_collision)
2496 +@@ -702,11 +710,12 @@ static void cached_dev_cache_miss_done(struct closure *cl)
2497 + __free_page(bv->bv_page);
2498 + }
2499 +
2500 +- cached_dev_bio_complete(cl);
2501 ++ cached_dev_bio_complete(&cl->work);
2502 + }
2503 +
2504 +-static void cached_dev_read_error(struct closure *cl)
2505 ++static void cached_dev_read_error(struct work_struct *work)
2506 + {
2507 ++ struct closure *cl = container_of(work, struct closure, work);
2508 + struct search *s = container_of(cl, struct search, cl);
2509 + struct bio *bio = &s->bio.bio;
2510 +
2511 +@@ -725,8 +734,9 @@ static void cached_dev_read_error(struct closure *cl)
2512 + continue_at(cl, cached_dev_cache_miss_done, NULL);
2513 + }
2514 +
2515 +-static void cached_dev_read_done(struct closure *cl)
2516 ++static void cached_dev_read_done(struct work_struct *work)
2517 + {
2518 ++ struct closure *cl = container_of(work, struct closure, work);
2519 + struct search *s = container_of(cl, struct search, cl);