diff options
Diffstat (limited to 'arch')
420 files changed, 7627 insertions, 5627 deletions
diff --git a/arch/alpha/include/asm/Kbuild b/arch/alpha/include/asm/Kbuild index a73a8e208a4a..96e54bed5088 100644 --- a/arch/alpha/include/asm/Kbuild +++ b/arch/alpha/include/asm/Kbuild | |||
| @@ -1,7 +1,9 @@ | |||
| 1 | 1 | ||
| 2 | generic-y += clkdev.h | ||
| 3 | 2 | ||
| 3 | generic-y += clkdev.h | ||
| 4 | generic-y += cputime.h | ||
| 4 | generic-y += exec.h | 5 | generic-y += exec.h |
| 5 | generic-y += trace_clock.h | ||
| 6 | generic-y += preempt.h | ||
| 7 | generic-y += hash.h | 6 | generic-y += hash.h |
| 7 | generic-y += mcs_spinlock.h | ||
| 8 | generic-y += preempt.h | ||
| 9 | generic-y += trace_clock.h | ||
diff --git a/arch/alpha/include/asm/cputime.h b/arch/alpha/include/asm/cputime.h deleted file mode 100644 index 19577fd93230..000000000000 --- a/arch/alpha/include/asm/cputime.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __ALPHA_CPUTIME_H | ||
| 2 | #define __ALPHA_CPUTIME_H | ||
| 3 | |||
| 4 | #include <asm-generic/cputime.h> | ||
| 5 | |||
| 6 | #endif /* __ALPHA_CPUTIME_H */ | ||
diff --git a/arch/arc/include/asm/Kbuild b/arch/arc/include/asm/Kbuild index 0d3362991c31..e76fd79f32b0 100644 --- a/arch/arc/include/asm/Kbuild +++ b/arch/arc/include/asm/Kbuild | |||
| @@ -1,15 +1,15 @@ | |||
| 1 | generic-y += auxvec.h | 1 | generic-y += auxvec.h |
| 2 | generic-y += barrier.h | 2 | generic-y += barrier.h |
| 3 | generic-y += bugs.h | ||
| 4 | generic-y += bitsperlong.h | 3 | generic-y += bitsperlong.h |
| 4 | generic-y += bugs.h | ||
| 5 | generic-y += clkdev.h | 5 | generic-y += clkdev.h |
| 6 | generic-y += cputime.h | 6 | generic-y += cputime.h |
| 7 | generic-y += device.h | 7 | generic-y += device.h |
| 8 | generic-y += div64.h | 8 | generic-y += div64.h |
| 9 | generic-y += emergency-restart.h | 9 | generic-y += emergency-restart.h |
| 10 | generic-y += errno.h | 10 | generic-y += errno.h |
| 11 | generic-y += fcntl.h | ||
| 12 | generic-y += fb.h | 11 | generic-y += fb.h |
| 12 | generic-y += fcntl.h | ||
| 13 | generic-y += ftrace.h | 13 | generic-y += ftrace.h |
| 14 | generic-y += hardirq.h | 14 | generic-y += hardirq.h |
| 15 | generic-y += hash.h | 15 | generic-y += hash.h |
| @@ -22,6 +22,7 @@ generic-y += kmap_types.h | |||
| 22 | generic-y += kvm_para.h | 22 | generic-y += kvm_para.h |
| 23 | generic-y += local.h | 23 | generic-y += local.h |
| 24 | generic-y += local64.h | 24 | generic-y += local64.h |
| 25 | generic-y += mcs_spinlock.h | ||
| 25 | generic-y += mman.h | 26 | generic-y += mman.h |
| 26 | generic-y += msgbuf.h | 27 | generic-y += msgbuf.h |
| 27 | generic-y += param.h | 28 | generic-y += param.h |
| @@ -30,6 +31,7 @@ generic-y += pci.h | |||
| 30 | generic-y += percpu.h | 31 | generic-y += percpu.h |
| 31 | generic-y += poll.h | 32 | generic-y += poll.h |
| 32 | generic-y += posix_types.h | 33 | generic-y += posix_types.h |
| 34 | generic-y += preempt.h | ||
| 33 | generic-y += resource.h | 35 | generic-y += resource.h |
| 34 | generic-y += scatterlist.h | 36 | generic-y += scatterlist.h |
| 35 | generic-y += sembuf.h | 37 | generic-y += sembuf.h |
| @@ -48,4 +50,3 @@ generic-y += ucontext.h | |||
| 48 | generic-y += user.h | 50 | generic-y += user.h |
| 49 | generic-y += vga.h | 51 | generic-y += vga.h |
| 50 | generic-y += xor.h | 52 | generic-y += xor.h |
| 51 | generic-y += preempt.h | ||
diff --git a/arch/arc/mm/cache_arc700.c b/arch/arc/mm/cache_arc700.c index 6b58c1de7577..400c663b21c2 100644 --- a/arch/arc/mm/cache_arc700.c +++ b/arch/arc/mm/cache_arc700.c | |||
| @@ -282,7 +282,7 @@ static inline void __cache_line_loop(unsigned long paddr, unsigned long vaddr, | |||
| 282 | #else | 282 | #else |
| 283 | /* if V-P const for loop, PTAG can be written once outside loop */ | 283 | /* if V-P const for loop, PTAG can be written once outside loop */ |
| 284 | if (full_page_op) | 284 | if (full_page_op) |
| 285 | write_aux_reg(ARC_REG_DC_PTAG, paddr); | 285 | write_aux_reg(aux_tag, paddr); |
| 286 | #endif | 286 | #endif |
| 287 | 287 | ||
| 288 | while (num_lines-- > 0) { | 288 | while (num_lines-- > 0) { |
| @@ -296,7 +296,7 @@ static inline void __cache_line_loop(unsigned long paddr, unsigned long vaddr, | |||
| 296 | write_aux_reg(aux_cmd, vaddr); | 296 | write_aux_reg(aux_cmd, vaddr); |
| 297 | vaddr += L1_CACHE_BYTES; | 297 | vaddr += L1_CACHE_BYTES; |
| 298 | #else | 298 | #else |
| 299 | write_aux_reg(aux, paddr); | 299 | write_aux_reg(aux_cmd, paddr); |
| 300 | paddr += L1_CACHE_BYTES; | 300 | paddr += L1_CACHE_BYTES; |
| 301 | #endif | 301 | #endif |
| 302 | } | 302 | } |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index e25419817791..15949459611f 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
| @@ -1578,6 +1578,7 @@ config BL_SWITCHER_DUMMY_IF | |||
| 1578 | 1578 | ||
| 1579 | choice | 1579 | choice |
| 1580 | prompt "Memory split" | 1580 | prompt "Memory split" |
| 1581 | depends on MMU | ||
| 1581 | default VMSPLIT_3G | 1582 | default VMSPLIT_3G |
| 1582 | help | 1583 | help |
| 1583 | Select the desired split between kernel and user memory. | 1584 | Select the desired split between kernel and user memory. |
| @@ -1595,6 +1596,7 @@ endchoice | |||
| 1595 | 1596 | ||
| 1596 | config PAGE_OFFSET | 1597 | config PAGE_OFFSET |
| 1597 | hex | 1598 | hex |
| 1599 | default PHYS_OFFSET if !MMU | ||
| 1598 | default 0x40000000 if VMSPLIT_1G | 1600 | default 0x40000000 if VMSPLIT_1G |
| 1599 | default 0x80000000 if VMSPLIT_2G | 1601 | default 0x80000000 if VMSPLIT_2G |
| 1600 | default 0xC0000000 | 1602 | default 0xC0000000 |
| @@ -1903,6 +1905,7 @@ config XEN | |||
| 1903 | depends on ARM && AEABI && OF | 1905 | depends on ARM && AEABI && OF |
| 1904 | depends on CPU_V7 && !CPU_V6 | 1906 | depends on CPU_V7 && !CPU_V6 |
| 1905 | depends on !GENERIC_ATOMIC64 | 1907 | depends on !GENERIC_ATOMIC64 |
| 1908 | depends on MMU | ||
| 1906 | select ARM_PSCI | 1909 | select ARM_PSCI |
| 1907 | select SWIOTLB_XEN | 1910 | select SWIOTLB_XEN |
| 1908 | select ARCH_DMA_ADDR_T_64BIT | 1911 | select ARCH_DMA_ADDR_T_64BIT |
diff --git a/arch/arm/boot/compressed/.gitignore b/arch/arm/boot/compressed/.gitignore index 47279aa96a6a..0714e0334e33 100644 --- a/arch/arm/boot/compressed/.gitignore +++ b/arch/arm/boot/compressed/.gitignore | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | ashldi3.S | 1 | ashldi3.S |
| 2 | bswapsdi2.S | ||
| 2 | font.c | 3 | font.c |
| 3 | lib1funcs.S | 4 | lib1funcs.S |
| 4 | hyp-stub.S | 5 | hyp-stub.S |
diff --git a/arch/arm/boot/dts/bcm11351.dtsi b/arch/arm/boot/dts/bcm11351.dtsi index e491b82f8d67..792fde1b7f75 100644 --- a/arch/arm/boot/dts/bcm11351.dtsi +++ b/arch/arm/boot/dts/bcm11351.dtsi | |||
| @@ -147,7 +147,7 @@ | |||
| 147 | }; | 147 | }; |
| 148 | 148 | ||
| 149 | pinctrl@35004800 { | 149 | pinctrl@35004800 { |
| 150 | compatible = "brcm,capri-pinctrl"; | 150 | compatible = "brcm,bcm11351-pinctrl"; |
| 151 | reg = <0x35004800 0x430>; | 151 | reg = <0x35004800 0x430>; |
| 152 | }; | 152 | }; |
| 153 | 153 | ||
diff --git a/arch/arm/boot/dts/keystone-clocks.dtsi b/arch/arm/boot/dts/keystone-clocks.dtsi index 2363593e1050..ef58d1c24313 100644 --- a/arch/arm/boot/dts/keystone-clocks.dtsi +++ b/arch/arm/boot/dts/keystone-clocks.dtsi | |||
| @@ -612,7 +612,7 @@ clocks { | |||
| 612 | compatible = "ti,keystone,psc-clock"; | 612 | compatible = "ti,keystone,psc-clock"; |
| 613 | clocks = <&chipclk13>; | 613 | clocks = <&chipclk13>; |
| 614 | clock-output-names = "vcp-3"; | 614 | clock-output-names = "vcp-3"; |
| 615 | reg = <0x0235000a8 0xb00>, <0x02350060 0x400>; | 615 | reg = <0x023500a8 0xb00>, <0x02350060 0x400>; |
| 616 | reg-names = "control", "domain"; | 616 | reg-names = "control", "domain"; |
| 617 | domain-id = <24>; | 617 | domain-id = <24>; |
| 618 | }; | 618 | }; |
diff --git a/arch/arm/boot/dts/omap3-gta04.dts b/arch/arm/boot/dts/omap3-gta04.dts index c551e4af4d83..d3b253bbc885 100644 --- a/arch/arm/boot/dts/omap3-gta04.dts +++ b/arch/arm/boot/dts/omap3-gta04.dts | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | / { | 14 | / { |
| 15 | model = "OMAP3 GTA04"; | 15 | model = "OMAP3 GTA04"; |
| 16 | compatible = "ti,omap3-gta04", "ti,omap3"; | 16 | compatible = "ti,omap3-gta04", "ti,omap36xx", "ti,omap3"; |
| 17 | 17 | ||
| 18 | cpus { | 18 | cpus { |
| 19 | cpu@0 { | 19 | cpu@0 { |
diff --git a/arch/arm/boot/dts/omap3-igep0020.dts b/arch/arm/boot/dts/omap3-igep0020.dts index 25a2b5f652fd..f2779ac75872 100644 --- a/arch/arm/boot/dts/omap3-igep0020.dts +++ b/arch/arm/boot/dts/omap3-igep0020.dts | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | / { | 15 | / { |
| 16 | model = "IGEPv2 (TI OMAP AM/DM37x)"; | 16 | model = "IGEPv2 (TI OMAP AM/DM37x)"; |
| 17 | compatible = "isee,omap3-igep0020", "ti,omap3"; | 17 | compatible = "isee,omap3-igep0020", "ti,omap36xx", "ti,omap3"; |
| 18 | 18 | ||
| 19 | leds { | 19 | leds { |
| 20 | pinctrl-names = "default"; | 20 | pinctrl-names = "default"; |
diff --git a/arch/arm/boot/dts/omap3-igep0030.dts b/arch/arm/boot/dts/omap3-igep0030.dts index 145c58cfc8ac..2793749eb1ba 100644 --- a/arch/arm/boot/dts/omap3-igep0030.dts +++ b/arch/arm/boot/dts/omap3-igep0030.dts | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | / { | 14 | / { |
| 15 | model = "IGEP COM MODULE (TI OMAP AM/DM37x)"; | 15 | model = "IGEP COM MODULE (TI OMAP AM/DM37x)"; |
| 16 | compatible = "isee,omap3-igep0030", "ti,omap3"; | 16 | compatible = "isee,omap3-igep0030", "ti,omap36xx", "ti,omap3"; |
| 17 | 17 | ||
| 18 | leds { | 18 | leds { |
| 19 | pinctrl-names = "default"; | 19 | pinctrl-names = "default"; |
diff --git a/arch/arm/boot/dts/sama5d36.dtsi b/arch/arm/boot/dts/sama5d36.dtsi index 6c31c26e6cc0..db58cad6acd3 100644 --- a/arch/arm/boot/dts/sama5d36.dtsi +++ b/arch/arm/boot/dts/sama5d36.dtsi | |||
| @@ -8,8 +8,8 @@ | |||
| 8 | */ | 8 | */ |
| 9 | #include "sama5d3.dtsi" | 9 | #include "sama5d3.dtsi" |
| 10 | #include "sama5d3_can.dtsi" | 10 | #include "sama5d3_can.dtsi" |
| 11 | #include "sama5d3_emac.dtsi" | ||
| 12 | #include "sama5d3_gmac.dtsi" | 11 | #include "sama5d3_gmac.dtsi" |
| 12 | #include "sama5d3_emac.dtsi" | ||
| 13 | #include "sama5d3_lcd.dtsi" | 13 | #include "sama5d3_lcd.dtsi" |
| 14 | #include "sama5d3_mci2.dtsi" | 14 | #include "sama5d3_mci2.dtsi" |
| 15 | #include "sama5d3_tcb1.dtsi" | 15 | #include "sama5d3_tcb1.dtsi" |
diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi index 10666ca8aee1..249b6e0ba737 100644 --- a/arch/arm/boot/dts/sun4i-a10.dtsi +++ b/arch/arm/boot/dts/sun4i-a10.dtsi | |||
| @@ -331,7 +331,7 @@ | |||
| 331 | }; | 331 | }; |
| 332 | 332 | ||
| 333 | intc: interrupt-controller@01c20400 { | 333 | intc: interrupt-controller@01c20400 { |
| 334 | compatible = "allwinner,sun4i-ic"; | 334 | compatible = "allwinner,sun4i-a10-ic"; |
| 335 | reg = <0x01c20400 0x400>; | 335 | reg = <0x01c20400 0x400>; |
| 336 | interrupt-controller; | 336 | interrupt-controller; |
| 337 | #interrupt-cells = <1>; | 337 | #interrupt-cells = <1>; |
| @@ -403,7 +403,7 @@ | |||
| 403 | }; | 403 | }; |
| 404 | 404 | ||
| 405 | timer@01c20c00 { | 405 | timer@01c20c00 { |
| 406 | compatible = "allwinner,sun4i-timer"; | 406 | compatible = "allwinner,sun4i-a10-timer"; |
| 407 | reg = <0x01c20c00 0x90>; | 407 | reg = <0x01c20c00 0x90>; |
| 408 | interrupts = <22>; | 408 | interrupts = <22>; |
| 409 | clocks = <&osc24M>; | 409 | clocks = <&osc24M>; |
| @@ -426,7 +426,7 @@ | |||
| 426 | }; | 426 | }; |
| 427 | 427 | ||
| 428 | rtp: rtp@01c25000 { | 428 | rtp: rtp@01c25000 { |
| 429 | compatible = "allwinner,sun4i-ts"; | 429 | compatible = "allwinner,sun4i-a10-ts"; |
| 430 | reg = <0x01c25000 0x100>; | 430 | reg = <0x01c25000 0x100>; |
| 431 | interrupts = <29>; | 431 | interrupts = <29>; |
| 432 | }; | 432 | }; |
diff --git a/arch/arm/boot/dts/sun5i-a10s.dtsi b/arch/arm/boot/dts/sun5i-a10s.dtsi index 64961595e8d6..ddb25452d78e 100644 --- a/arch/arm/boot/dts/sun5i-a10s.dtsi +++ b/arch/arm/boot/dts/sun5i-a10s.dtsi | |||
| @@ -294,7 +294,7 @@ | |||
| 294 | }; | 294 | }; |
| 295 | 295 | ||
| 296 | intc: interrupt-controller@01c20400 { | 296 | intc: interrupt-controller@01c20400 { |
| 297 | compatible = "allwinner,sun4i-ic"; | 297 | compatible = "allwinner,sun4i-a10-ic"; |
| 298 | reg = <0x01c20400 0x400>; | 298 | reg = <0x01c20400 0x400>; |
| 299 | interrupt-controller; | 299 | interrupt-controller; |
| 300 | #interrupt-cells = <1>; | 300 | #interrupt-cells = <1>; |
| @@ -366,7 +366,7 @@ | |||
| 366 | }; | 366 | }; |
| 367 | 367 | ||
| 368 | timer@01c20c00 { | 368 | timer@01c20c00 { |
| 369 | compatible = "allwinner,sun4i-timer"; | 369 | compatible = "allwinner,sun4i-a10-timer"; |
| 370 | reg = <0x01c20c00 0x90>; | 370 | reg = <0x01c20c00 0x90>; |
| 371 | interrupts = <22>; | 371 | interrupts = <22>; |
| 372 | clocks = <&osc24M>; | 372 | clocks = <&osc24M>; |
| @@ -383,7 +383,7 @@ | |||
| 383 | }; | 383 | }; |
| 384 | 384 | ||
| 385 | rtp: rtp@01c25000 { | 385 | rtp: rtp@01c25000 { |
| 386 | compatible = "allwinner,sun4i-ts"; | 386 | compatible = "allwinner,sun4i-a10-ts"; |
| 387 | reg = <0x01c25000 0x100>; | 387 | reg = <0x01c25000 0x100>; |
| 388 | interrupts = <29>; | 388 | interrupts = <29>; |
| 389 | }; | 389 | }; |
diff --git a/arch/arm/boot/dts/sun5i-a13.dtsi b/arch/arm/boot/dts/sun5i-a13.dtsi index 320335abfccd..b373c74a9b3d 100644 --- a/arch/arm/boot/dts/sun5i-a13.dtsi +++ b/arch/arm/boot/dts/sun5i-a13.dtsi | |||
| @@ -275,7 +275,7 @@ | |||
| 275 | ranges; | 275 | ranges; |
| 276 | 276 | ||
| 277 | intc: interrupt-controller@01c20400 { | 277 | intc: interrupt-controller@01c20400 { |
| 278 | compatible = "allwinner,sun4i-ic"; | 278 | compatible = "allwinner,sun4i-a10-ic"; |
| 279 | reg = <0x01c20400 0x400>; | 279 | reg = <0x01c20400 0x400>; |
| 280 | interrupt-controller; | 280 | interrupt-controller; |
| 281 | #interrupt-cells = <1>; | 281 | #interrupt-cells = <1>; |
| @@ -329,7 +329,7 @@ | |||
| 329 | }; | 329 | }; |
| 330 | 330 | ||
| 331 | timer@01c20c00 { | 331 | timer@01c20c00 { |
| 332 | compatible = "allwinner,sun4i-timer"; | 332 | compatible = "allwinner,sun4i-a10-timer"; |
| 333 | reg = <0x01c20c00 0x90>; | 333 | reg = <0x01c20c00 0x90>; |
| 334 | interrupts = <22>; | 334 | interrupts = <22>; |
| 335 | clocks = <&osc24M>; | 335 | clocks = <&osc24M>; |
| @@ -346,7 +346,7 @@ | |||
| 346 | }; | 346 | }; |
| 347 | 347 | ||
| 348 | rtp: rtp@01c25000 { | 348 | rtp: rtp@01c25000 { |
| 349 | compatible = "allwinner,sun4i-ts"; | 349 | compatible = "allwinner,sun4i-a10-ts"; |
| 350 | reg = <0x01c25000 0x100>; | 350 | reg = <0x01c25000 0x100>; |
| 351 | interrupts = <29>; | 351 | interrupts = <29>; |
| 352 | }; | 352 | }; |
diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi index 5256ad9be52c..38d43febda4c 100644 --- a/arch/arm/boot/dts/sun6i-a31.dtsi +++ b/arch/arm/boot/dts/sun6i-a31.dtsi | |||
| @@ -190,6 +190,14 @@ | |||
| 190 | #size-cells = <1>; | 190 | #size-cells = <1>; |
| 191 | ranges; | 191 | ranges; |
| 192 | 192 | ||
| 193 | nmi_intc: interrupt-controller@01f00c0c { | ||
| 194 | compatible = "allwinner,sun6i-a31-sc-nmi"; | ||
| 195 | interrupt-controller; | ||
| 196 | #interrupt-cells = <2>; | ||
| 197 | reg = <0x01f00c0c 0x38>; | ||
| 198 | interrupts = <0 32 4>; | ||
| 199 | }; | ||
| 200 | |||
| 193 | pio: pinctrl@01c20800 { | 201 | pio: pinctrl@01c20800 { |
| 194 | compatible = "allwinner,sun6i-a31-pinctrl"; | 202 | compatible = "allwinner,sun6i-a31-pinctrl"; |
| 195 | reg = <0x01c20800 0x400>; | 203 | reg = <0x01c20800 0x400>; |
| @@ -231,7 +239,7 @@ | |||
| 231 | }; | 239 | }; |
| 232 | 240 | ||
| 233 | timer@01c20c00 { | 241 | timer@01c20c00 { |
| 234 | compatible = "allwinner,sun4i-timer"; | 242 | compatible = "allwinner,sun4i-a10-timer"; |
| 235 | reg = <0x01c20c00 0xa0>; | 243 | reg = <0x01c20c00 0xa0>; |
| 236 | interrupts = <0 18 4>, | 244 | interrupts = <0 18 4>, |
| 237 | <0 19 4>, | 245 | <0 19 4>, |
diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi index 9ff09484847b..cadcf2f9881d 100644 --- a/arch/arm/boot/dts/sun7i-a20.dtsi +++ b/arch/arm/boot/dts/sun7i-a20.dtsi | |||
| @@ -339,6 +339,14 @@ | |||
| 339 | #size-cells = <1>; | 339 | #size-cells = <1>; |
| 340 | ranges; | 340 | ranges; |
| 341 | 341 | ||
| 342 | nmi_intc: interrupt-controller@01c00030 { | ||
| 343 | compatible = "allwinner,sun7i-a20-sc-nmi"; | ||
| 344 | interrupt-controller; | ||
| 345 | #interrupt-cells = <2>; | ||
| 346 | reg = <0x01c00030 0x0c>; | ||
| 347 | interrupts = <0 0 4>; | ||
| 348 | }; | ||
| 349 | |||
| 342 | emac: ethernet@01c0b000 { | 350 | emac: ethernet@01c0b000 { |
| 343 | compatible = "allwinner,sun4i-a10-emac"; | 351 | compatible = "allwinner,sun4i-a10-emac"; |
| 344 | reg = <0x01c0b000 0x1000>; | 352 | reg = <0x01c0b000 0x1000>; |
| @@ -435,7 +443,7 @@ | |||
| 435 | }; | 443 | }; |
| 436 | 444 | ||
| 437 | timer@01c20c00 { | 445 | timer@01c20c00 { |
| 438 | compatible = "allwinner,sun4i-timer"; | 446 | compatible = "allwinner,sun4i-a10-timer"; |
| 439 | reg = <0x01c20c00 0x90>; | 447 | reg = <0x01c20c00 0x90>; |
| 440 | interrupts = <0 22 4>, | 448 | interrupts = <0 22 4>, |
| 441 | <0 23 4>, | 449 | <0 23 4>, |
| @@ -454,7 +462,7 @@ | |||
| 454 | rtc: rtc@01c20d00 { | 462 | rtc: rtc@01c20d00 { |
| 455 | compatible = "allwinner,sun7i-a20-rtc"; | 463 | compatible = "allwinner,sun7i-a20-rtc"; |
| 456 | reg = <0x01c20d00 0x20>; | 464 | reg = <0x01c20d00 0x20>; |
| 457 | interrupts = <0 24 1>; | 465 | interrupts = <0 24 4>; |
| 458 | }; | 466 | }; |
| 459 | 467 | ||
| 460 | sid: eeprom@01c23800 { | 468 | sid: eeprom@01c23800 { |
| @@ -463,7 +471,7 @@ | |||
| 463 | }; | 471 | }; |
| 464 | 472 | ||
| 465 | rtp: rtp@01c25000 { | 473 | rtp: rtp@01c25000 { |
| 466 | compatible = "allwinner,sun4i-ts"; | 474 | compatible = "allwinner,sun4i-a10-ts"; |
| 467 | reg = <0x01c25000 0x100>; | 475 | reg = <0x01c25000 0x100>; |
| 468 | interrupts = <0 29 4>; | 476 | interrupts = <0 29 4>; |
| 469 | }; | 477 | }; |
| @@ -596,10 +604,10 @@ | |||
| 596 | hstimer@01c60000 { | 604 | hstimer@01c60000 { |
| 597 | compatible = "allwinner,sun7i-a20-hstimer"; | 605 | compatible = "allwinner,sun7i-a20-hstimer"; |
| 598 | reg = <0x01c60000 0x1000>; | 606 | reg = <0x01c60000 0x1000>; |
| 599 | interrupts = <0 81 1>, | 607 | interrupts = <0 81 4>, |
| 600 | <0 82 1>, | 608 | <0 82 4>, |
| 601 | <0 83 1>, | 609 | <0 83 4>, |
| 602 | <0 84 1>; | 610 | <0 84 4>; |
| 603 | clocks = <&ahb_gates 28>; | 611 | clocks = <&ahb_gates 28>; |
| 604 | }; | 612 | }; |
| 605 | 613 | ||
diff --git a/arch/arm/boot/dts/zynq-7000.dtsi b/arch/arm/boot/dts/zynq-7000.dtsi index 8b67b19392ec..789d0bacc110 100644 --- a/arch/arm/boot/dts/zynq-7000.dtsi +++ b/arch/arm/boot/dts/zynq-7000.dtsi | |||
| @@ -24,6 +24,12 @@ | |||
| 24 | device_type = "cpu"; | 24 | device_type = "cpu"; |
| 25 | reg = <0>; | 25 | reg = <0>; |
| 26 | clocks = <&clkc 3>; | 26 | clocks = <&clkc 3>; |
| 27 | operating-points = < | ||
| 28 | /* kHz uV */ | ||
| 29 | 666667 1000000 | ||
| 30 | 333334 1000000 | ||
| 31 | 222223 1000000 | ||
| 32 | >; | ||
| 27 | }; | 33 | }; |
| 28 | 34 | ||
| 29 | cpu@1 { | 35 | cpu@1 { |
diff --git a/arch/arm/configs/tegra_defconfig b/arch/arm/configs/tegra_defconfig index 00fe9e9710fd..27d69b558c5d 100644 --- a/arch/arm/configs/tegra_defconfig +++ b/arch/arm/configs/tegra_defconfig | |||
| @@ -204,7 +204,10 @@ CONFIG_MMC_BLOCK_MINORS=16 | |||
| 204 | CONFIG_MMC_SDHCI=y | 204 | CONFIG_MMC_SDHCI=y |
| 205 | CONFIG_MMC_SDHCI_PLTFM=y | 205 | CONFIG_MMC_SDHCI_PLTFM=y |
| 206 | CONFIG_MMC_SDHCI_TEGRA=y | 206 | CONFIG_MMC_SDHCI_TEGRA=y |
| 207 | CONFIG_NEW_LEDS=y | ||
| 208 | CONFIG_LEDS_CLASS=y | ||
| 207 | CONFIG_LEDS_GPIO=y | 209 | CONFIG_LEDS_GPIO=y |
| 210 | CONFIG_LEDS_TRIGGERS=y | ||
| 208 | CONFIG_LEDS_TRIGGER_TIMER=y | 211 | CONFIG_LEDS_TRIGGER_TIMER=y |
| 209 | CONFIG_LEDS_TRIGGER_ONESHOT=y | 212 | CONFIG_LEDS_TRIGGER_ONESHOT=y |
| 210 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | 213 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y |
diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild index 3278afe2c3ab..23e728ecf8ab 100644 --- a/arch/arm/include/asm/Kbuild +++ b/arch/arm/include/asm/Kbuild | |||
| @@ -7,16 +7,19 @@ generic-y += current.h | |||
| 7 | generic-y += emergency-restart.h | 7 | generic-y += emergency-restart.h |
| 8 | generic-y += errno.h | 8 | generic-y += errno.h |
| 9 | generic-y += exec.h | 9 | generic-y += exec.h |
| 10 | generic-y += hash.h | ||
| 10 | generic-y += ioctl.h | 11 | generic-y += ioctl.h |
| 11 | generic-y += ipcbuf.h | 12 | generic-y += ipcbuf.h |
| 12 | generic-y += irq_regs.h | 13 | generic-y += irq_regs.h |
| 13 | generic-y += kdebug.h | 14 | generic-y += kdebug.h |
| 14 | generic-y += local.h | 15 | generic-y += local.h |
| 15 | generic-y += local64.h | 16 | generic-y += local64.h |
| 17 | generic-y += mcs_spinlock.h | ||
| 16 | generic-y += msgbuf.h | 18 | generic-y += msgbuf.h |
| 17 | generic-y += param.h | 19 | generic-y += param.h |
| 18 | generic-y += parport.h | 20 | generic-y += parport.h |
| 19 | generic-y += poll.h | 21 | generic-y += poll.h |
| 22 | generic-y += preempt.h | ||
| 20 | generic-y += resource.h | 23 | generic-y += resource.h |
| 21 | generic-y += sections.h | 24 | generic-y += sections.h |
| 22 | generic-y += segment.h | 25 | generic-y += segment.h |
| @@ -33,5 +36,3 @@ generic-y += termios.h | |||
| 33 | generic-y += timex.h | 36 | generic-y += timex.h |
| 34 | generic-y += trace_clock.h | 37 | generic-y += trace_clock.h |
| 35 | generic-y += unaligned.h | 38 | generic-y += unaligned.h |
| 36 | generic-y += preempt.h | ||
| 37 | generic-y += hash.h | ||
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index 8756e4bcdba0..4afb376d9c7c 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h | |||
| @@ -30,14 +30,15 @@ | |||
| 30 | */ | 30 | */ |
| 31 | #define UL(x) _AC(x, UL) | 31 | #define UL(x) _AC(x, UL) |
| 32 | 32 | ||
| 33 | /* PAGE_OFFSET - the virtual address of the start of the kernel image */ | ||
| 34 | #define PAGE_OFFSET UL(CONFIG_PAGE_OFFSET) | ||
| 35 | |||
| 33 | #ifdef CONFIG_MMU | 36 | #ifdef CONFIG_MMU |
| 34 | 37 | ||
| 35 | /* | 38 | /* |
| 36 | * PAGE_OFFSET - the virtual address of the start of the kernel image | ||
| 37 | * TASK_SIZE - the maximum size of a user space task. | 39 | * TASK_SIZE - the maximum size of a user space task. |
| 38 | * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area | 40 | * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area |
| 39 | */ | 41 | */ |
| 40 | #define PAGE_OFFSET UL(CONFIG_PAGE_OFFSET) | ||
| 41 | #define TASK_SIZE (UL(CONFIG_PAGE_OFFSET) - UL(SZ_16M)) | 42 | #define TASK_SIZE (UL(CONFIG_PAGE_OFFSET) - UL(SZ_16M)) |
| 42 | #define TASK_UNMAPPED_BASE ALIGN(TASK_SIZE / 3, SZ_16M) | 43 | #define TASK_UNMAPPED_BASE ALIGN(TASK_SIZE / 3, SZ_16M) |
| 43 | 44 | ||
| @@ -104,10 +105,6 @@ | |||
| 104 | #define END_MEM (UL(CONFIG_DRAM_BASE) + CONFIG_DRAM_SIZE) | 105 | #define END_MEM (UL(CONFIG_DRAM_BASE) + CONFIG_DRAM_SIZE) |
| 105 | #endif | 106 | #endif |
| 106 | 107 | ||
| 107 | #ifndef PAGE_OFFSET | ||
| 108 | #define PAGE_OFFSET PLAT_PHYS_OFFSET | ||
| 109 | #endif | ||
| 110 | |||
| 111 | /* | 108 | /* |
| 112 | * The module can be at any place in ram in nommu mode. | 109 | * The module can be at any place in ram in nommu mode. |
| 113 | */ | 110 | */ |
diff --git a/arch/arm/include/asm/topology.h b/arch/arm/include/asm/topology.h index 58b8b84adcd2..2fe85fff5cca 100644 --- a/arch/arm/include/asm/topology.h +++ b/arch/arm/include/asm/topology.h | |||
| @@ -20,9 +20,6 @@ extern struct cputopo_arm cpu_topology[NR_CPUS]; | |||
| 20 | #define topology_core_cpumask(cpu) (&cpu_topology[cpu].core_sibling) | 20 | #define topology_core_cpumask(cpu) (&cpu_topology[cpu].core_sibling) |
| 21 | #define topology_thread_cpumask(cpu) (&cpu_topology[cpu].thread_sibling) | 21 | #define topology_thread_cpumask(cpu) (&cpu_topology[cpu].thread_sibling) |
| 22 | 22 | ||
| 23 | #define mc_capable() (cpu_topology[0].socket_id != -1) | ||
| 24 | #define smt_capable() (cpu_topology[0].thread_id != -1) | ||
| 25 | |||
| 26 | void init_cpu_topology(void); | 23 | void init_cpu_topology(void); |
| 27 | void store_cpu_topology(unsigned int cpuid); | 24 | void store_cpu_topology(unsigned int cpuid); |
| 28 | const struct cpumask *cpu_coregroup_mask(int cpu); | 25 | const struct cpumask *cpu_coregroup_mask(int cpu); |
diff --git a/arch/arm/kernel/head-common.S b/arch/arm/kernel/head-common.S index 47cd974e57ea..c96ecacb2021 100644 --- a/arch/arm/kernel/head-common.S +++ b/arch/arm/kernel/head-common.S | |||
| @@ -177,6 +177,18 @@ __lookup_processor_type_data: | |||
| 177 | .long __proc_info_end | 177 | .long __proc_info_end |
| 178 | .size __lookup_processor_type_data, . - __lookup_processor_type_data | 178 | .size __lookup_processor_type_data, . - __lookup_processor_type_data |
| 179 | 179 | ||
| 180 | __error_lpae: | ||
| 181 | #ifdef CONFIG_DEBUG_LL | ||
| 182 | adr r0, str_lpae | ||
| 183 | bl printascii | ||
| 184 | b __error | ||
| 185 | str_lpae: .asciz "\nError: Kernel with LPAE support, but CPU does not support LPAE.\n" | ||
| 186 | #else | ||
| 187 | b __error | ||
| 188 | #endif | ||
| 189 | .align | ||
| 190 | ENDPROC(__error_lpae) | ||
| 191 | |||
| 180 | __error_p: | 192 | __error_p: |
| 181 | #ifdef CONFIG_DEBUG_LL | 193 | #ifdef CONFIG_DEBUG_LL |
| 182 | adr r0, str_p1 | 194 | adr r0, str_p1 |
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 914616e0bdcd..f5f381d91556 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S | |||
| @@ -102,7 +102,7 @@ ENTRY(stext) | |||
| 102 | and r3, r3, #0xf @ extract VMSA support | 102 | and r3, r3, #0xf @ extract VMSA support |
| 103 | cmp r3, #5 @ long-descriptor translation table format? | 103 | cmp r3, #5 @ long-descriptor translation table format? |
| 104 | THUMB( it lo ) @ force fixup-able long branch encoding | 104 | THUMB( it lo ) @ force fixup-able long branch encoding |
| 105 | blo __error_p @ only classic page table format | 105 | blo __error_lpae @ only classic page table format |
| 106 | #endif | 106 | #endif |
| 107 | 107 | ||
| 108 | #ifndef CONFIG_XIP_KERNEL | 108 | #ifndef CONFIG_XIP_KERNEL |
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 92f7b15dd221..adabeababeb0 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
| @@ -30,7 +30,6 @@ | |||
| 30 | #include <linux/uaccess.h> | 30 | #include <linux/uaccess.h> |
| 31 | #include <linux/random.h> | 31 | #include <linux/random.h> |
| 32 | #include <linux/hw_breakpoint.h> | 32 | #include <linux/hw_breakpoint.h> |
| 33 | #include <linux/cpuidle.h> | ||
| 34 | #include <linux/leds.h> | 33 | #include <linux/leds.h> |
| 35 | #include <linux/reboot.h> | 34 | #include <linux/reboot.h> |
| 36 | 35 | ||
| @@ -133,7 +132,11 @@ EXPORT_SYMBOL_GPL(arm_pm_restart); | |||
| 133 | 132 | ||
| 134 | void (*arm_pm_idle)(void); | 133 | void (*arm_pm_idle)(void); |
| 135 | 134 | ||
| 136 | static void default_idle(void) | 135 | /* |
| 136 | * Called from the core idle loop. | ||
| 137 | */ | ||
| 138 | |||
| 139 | void arch_cpu_idle(void) | ||
| 137 | { | 140 | { |
| 138 | if (arm_pm_idle) | 141 | if (arm_pm_idle) |
| 139 | arm_pm_idle(); | 142 | arm_pm_idle(); |
| @@ -168,15 +171,6 @@ void arch_cpu_idle_dead(void) | |||
| 168 | #endif | 171 | #endif |
| 169 | 172 | ||
| 170 | /* | 173 | /* |
| 171 | * Called from the core idle loop. | ||
| 172 | */ | ||
| 173 | void arch_cpu_idle(void) | ||
| 174 | { | ||
| 175 | if (cpuidle_idle_call()) | ||
| 176 | default_idle(); | ||
| 177 | } | ||
| 178 | |||
| 179 | /* | ||
| 180 | * Called by kexec, immediately prior to machine_kexec(). | 174 | * Called by kexec, immediately prior to machine_kexec(). |
| 181 | * | 175 | * |
| 182 | * This must completely disable all secondary CPUs; simply causing those CPUs | 176 | * This must completely disable all secondary CPUs; simply causing those CPUs |
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index 1d8248ea5669..bd18bb8b2770 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c | |||
| @@ -878,7 +878,8 @@ static int hyp_init_cpu_pm_notifier(struct notifier_block *self, | |||
| 878 | unsigned long cmd, | 878 | unsigned long cmd, |
| 879 | void *v) | 879 | void *v) |
| 880 | { | 880 | { |
| 881 | if (cmd == CPU_PM_EXIT) { | 881 | if (cmd == CPU_PM_EXIT && |
| 882 | __hyp_get_vectors() == hyp_default_vectors) { | ||
| 882 | cpu_init_hyp_mode(NULL); | 883 | cpu_init_hyp_mode(NULL); |
| 883 | return NOTIFY_OK; | 884 | return NOTIFY_OK; |
| 884 | } | 885 | } |
diff --git a/arch/arm/kvm/interrupts.S b/arch/arm/kvm/interrupts.S index ddc15539bad2..0d68d4073068 100644 --- a/arch/arm/kvm/interrupts.S +++ b/arch/arm/kvm/interrupts.S | |||
| @@ -220,6 +220,10 @@ after_vfp_restore: | |||
| 220 | * in Hyp mode (see init_hyp_mode in arch/arm/kvm/arm.c). Return values are | 220 | * in Hyp mode (see init_hyp_mode in arch/arm/kvm/arm.c). Return values are |
| 221 | * passed in r0 and r1. | 221 | * passed in r0 and r1. |
| 222 | * | 222 | * |
| 223 | * A function pointer with a value of 0xffffffff has a special meaning, | ||
| 224 | * and is used to implement __hyp_get_vectors in the same way as in | ||
| 225 | * arch/arm/kernel/hyp_stub.S. | ||
| 226 | * | ||
| 223 | * The calling convention follows the standard AAPCS: | 227 | * The calling convention follows the standard AAPCS: |
| 224 | * r0 - r3: caller save | 228 | * r0 - r3: caller save |
| 225 | * r12: caller save | 229 | * r12: caller save |
| @@ -363,6 +367,11 @@ hyp_hvc: | |||
| 363 | host_switch_to_hyp: | 367 | host_switch_to_hyp: |
| 364 | pop {r0, r1, r2} | 368 | pop {r0, r1, r2} |
| 365 | 369 | ||
| 370 | /* Check for __hyp_get_vectors */ | ||
| 371 | cmp r0, #-1 | ||
| 372 | mrceq p15, 4, r0, c12, c0, 0 @ get HVBAR | ||
| 373 | beq 1f | ||
| 374 | |||
| 366 | push {lr} | 375 | push {lr} |
| 367 | mrs lr, SPSR | 376 | mrs lr, SPSR |
| 368 | push {lr} | 377 | push {lr} |
| @@ -378,7 +387,7 @@ THUMB( orr lr, #1) | |||
| 378 | pop {lr} | 387 | pop {lr} |
| 379 | msr SPSR_csxf, lr | 388 | msr SPSR_csxf, lr |
| 380 | pop {lr} | 389 | pop {lr} |
| 381 | eret | 390 | 1: eret |
| 382 | 391 | ||
| 383 | guest_trap: | 392 | guest_trap: |
| 384 | load_vcpu @ Load VCPU pointer to r0 | 393 | load_vcpu @ Load VCPU pointer to r0 |
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 2ab00434b2eb..85399c98f84a 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c | |||
| @@ -472,7 +472,7 @@ static struct clk_lookup da850_clks[] = { | |||
| 472 | CLK("spi_davinci.0", NULL, &spi0_clk), | 472 | CLK("spi_davinci.0", NULL, &spi0_clk), |
| 473 | CLK("spi_davinci.1", NULL, &spi1_clk), | 473 | CLK("spi_davinci.1", NULL, &spi1_clk), |
| 474 | CLK("vpif", NULL, &vpif_clk), | 474 | CLK("vpif", NULL, &vpif_clk), |
| 475 | CLK("ahci", NULL, &sata_clk), | 475 | CLK("ahci_da850", NULL, &sata_clk), |
| 476 | CLK("davinci-rproc.0", NULL, &dsp_clk), | 476 | CLK("davinci-rproc.0", NULL, &dsp_clk), |
| 477 | CLK("ehrpwm", "fck", &ehrpwm_clk), | 477 | CLK("ehrpwm", "fck", &ehrpwm_clk), |
| 478 | CLK("ehrpwm", "tbclk", &ehrpwm_tbclk), | 478 | CLK("ehrpwm", "tbclk", &ehrpwm_tbclk), |
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index 0486cdf28c8d..56ea41d5f849 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c | |||
| @@ -1020,7 +1020,6 @@ int __init da8xx_register_spi_bus(int instance, unsigned num_chipselect) | |||
| 1020 | } | 1020 | } |
| 1021 | 1021 | ||
| 1022 | #ifdef CONFIG_ARCH_DAVINCI_DA850 | 1022 | #ifdef CONFIG_ARCH_DAVINCI_DA850 |
| 1023 | |||
| 1024 | static struct resource da850_sata_resources[] = { | 1023 | static struct resource da850_sata_resources[] = { |
| 1025 | { | 1024 | { |
| 1026 | .start = DA850_SATA_BASE, | 1025 | .start = DA850_SATA_BASE, |
| @@ -1028,103 +1027,22 @@ static struct resource da850_sata_resources[] = { | |||
| 1028 | .flags = IORESOURCE_MEM, | 1027 | .flags = IORESOURCE_MEM, |
| 1029 | }, | 1028 | }, |
| 1030 | { | 1029 | { |
| 1030 | .start = DA8XX_SYSCFG1_BASE + DA8XX_PWRDN_REG, | ||
| 1031 | .end = DA8XX_SYSCFG1_BASE + DA8XX_PWRDN_REG + 0x3, | ||
| 1032 | .flags = IORESOURCE_MEM, | ||
| 1033 | }, | ||
| 1034 | { | ||
| 1031 | .start = IRQ_DA850_SATAINT, | 1035 | .start = IRQ_DA850_SATAINT, |
| 1032 | .flags = IORESOURCE_IRQ, | 1036 | .flags = IORESOURCE_IRQ, |
| 1033 | }, | 1037 | }, |
| 1034 | }; | 1038 | }; |
| 1035 | 1039 | ||
| 1036 | /* SATA PHY Control Register offset from AHCI base */ | ||
| 1037 | #define SATA_P0PHYCR_REG 0x178 | ||
| 1038 | |||
| 1039 | #define SATA_PHY_MPY(x) ((x) << 0) | ||
| 1040 | #define SATA_PHY_LOS(x) ((x) << 6) | ||
| 1041 | #define SATA_PHY_RXCDR(x) ((x) << 10) | ||
| 1042 | #define SATA_PHY_RXEQ(x) ((x) << 13) | ||
| 1043 | #define SATA_PHY_TXSWING(x) ((x) << 19) | ||
| 1044 | #define SATA_PHY_ENPLL(x) ((x) << 31) | ||
| 1045 | |||
| 1046 | static struct clk *da850_sata_clk; | ||
| 1047 | static unsigned long da850_sata_refclkpn; | ||
| 1048 | |||
| 1049 | /* Supported DA850 SATA crystal frequencies */ | ||
| 1050 | #define KHZ_TO_HZ(freq) ((freq) * 1000) | ||
| 1051 | static unsigned long da850_sata_xtal[] = { | ||
| 1052 | KHZ_TO_HZ(300000), | ||
| 1053 | KHZ_TO_HZ(250000), | ||
| 1054 | 0, /* Reserved */ | ||
| 1055 | KHZ_TO_HZ(187500), | ||
| 1056 | KHZ_TO_HZ(150000), | ||
| 1057 | KHZ_TO_HZ(125000), | ||
| 1058 | KHZ_TO_HZ(120000), | ||
| 1059 | KHZ_TO_HZ(100000), | ||
| 1060 | KHZ_TO_HZ(75000), | ||
| 1061 | KHZ_TO_HZ(60000), | ||
| 1062 | }; | ||
| 1063 | |||
| 1064 | static int da850_sata_init(struct device *dev, void __iomem *addr) | ||
| 1065 | { | ||
| 1066 | int i, ret; | ||
| 1067 | unsigned int val; | ||
| 1068 | |||
| 1069 | da850_sata_clk = clk_get(dev, NULL); | ||
| 1070 | if (IS_ERR(da850_sata_clk)) | ||
| 1071 | return PTR_ERR(da850_sata_clk); | ||
| 1072 | |||
| 1073 | ret = clk_prepare_enable(da850_sata_clk); | ||
| 1074 | if (ret) | ||
| 1075 | goto err0; | ||
| 1076 | |||
| 1077 | /* Enable SATA clock receiver */ | ||
| 1078 | val = __raw_readl(DA8XX_SYSCFG1_VIRT(DA8XX_PWRDN_REG)); | ||
| 1079 | val &= ~BIT(0); | ||
| 1080 | __raw_writel(val, DA8XX_SYSCFG1_VIRT(DA8XX_PWRDN_REG)); | ||
| 1081 | |||
| 1082 | /* Get the multiplier needed for 1.5GHz PLL output */ | ||
| 1083 | for (i = 0; i < ARRAY_SIZE(da850_sata_xtal); i++) | ||
| 1084 | if (da850_sata_xtal[i] == da850_sata_refclkpn) | ||
| 1085 | break; | ||
| 1086 | |||
| 1087 | if (i == ARRAY_SIZE(da850_sata_xtal)) { | ||
| 1088 | ret = -EINVAL; | ||
| 1089 | goto err1; | ||
| 1090 | } | ||
| 1091 | |||
| 1092 | val = SATA_PHY_MPY(i + 1) | | ||
| 1093 | SATA_PHY_LOS(1) | | ||
| 1094 | SATA_PHY_RXCDR(4) | | ||
| 1095 | SATA_PHY_RXEQ(1) | | ||
| 1096 | SATA_PHY_TXSWING(3) | | ||
| 1097 | SATA_PHY_ENPLL(1); | ||
| 1098 | |||
| 1099 | __raw_writel(val, addr + SATA_P0PHYCR_REG); | ||
| 1100 | |||
| 1101 | return 0; | ||
| 1102 | |||
| 1103 | err1: | ||
| 1104 | clk_disable_unprepare(da850_sata_clk); | ||
| 1105 | err0: | ||
| 1106 | clk_put(da850_sata_clk); | ||
| 1107 | return ret; | ||
| 1108 | } | ||
| 1109 | |||
| 1110 | static void da850_sata_exit(struct device *dev) | ||
| 1111 | { | ||
| 1112 | clk_disable_unprepare(da850_sata_clk); | ||
| 1113 | clk_put(da850_sata_clk); | ||
| 1114 | } | ||
| 1115 | |||
| 1116 | static struct ahci_platform_data da850_sata_pdata = { | ||
| 1117 | .init = da850_sata_init, | ||
| 1118 | .exit = da850_sata_exit, | ||
| 1119 | }; | ||
| 1120 | |||
| 1121 | static u64 da850_sata_dmamask = DMA_BIT_MASK(32); | 1040 | static u64 da850_sata_dmamask = DMA_BIT_MASK(32); |
| 1122 | 1041 | ||
| 1123 | static struct platform_device da850_sata_device = { | 1042 | static struct platform_device da850_sata_device = { |
| 1124 | .name = "ahci", | 1043 | .name = "ahci_da850", |
| 1125 | .id = -1, | 1044 | .id = -1, |
| 1126 | .dev = { | 1045 | .dev = { |
| 1127 | .platform_data = &da850_sata_pdata, | ||
| 1128 | .dma_mask = &da850_sata_dmamask, | 1046 | .dma_mask = &da850_sata_dmamask, |
| 1129 | .coherent_dma_mask = DMA_BIT_MASK(32), | 1047 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 1130 | }, | 1048 | }, |
| @@ -1134,9 +1052,8 @@ static struct platform_device da850_sata_device = { | |||
| 1134 | 1052 | ||
| 1135 | int __init da850_register_sata(unsigned long refclkpn) | 1053 | int __init da850_register_sata(unsigned long refclkpn) |
| 1136 | { | 1054 | { |
| 1137 | da850_sata_refclkpn = refclkpn; | 1055 | /* please see comment in drivers/ata/ahci_da850.c */ |
| 1138 | if (!da850_sata_refclkpn) | 1056 | BUG_ON(refclkpn != 100 * 1000 * 1000); |
| 1139 | return -EINVAL; | ||
| 1140 | 1057 | ||
| 1141 | return platform_device_register(&da850_sata_device); | 1058 | return platform_device_register(&da850_sata_device); |
| 1142 | } | 1059 | } |
diff --git a/arch/arm/mach-imx/pm-imx6q.c b/arch/arm/mach-imx/pm-imx6q.c index 7a9b98589db7..29e3fe6a6669 100644 --- a/arch/arm/mach-imx/pm-imx6q.c +++ b/arch/arm/mach-imx/pm-imx6q.c | |||
| @@ -120,7 +120,7 @@ static void imx6q_enable_wb(bool enable) | |||
| 120 | 120 | ||
| 121 | int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode) | 121 | int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode) |
| 122 | { | 122 | { |
| 123 | struct irq_desc *iomuxc_irq_desc; | 123 | struct irq_data *iomuxc_irq_data = irq_get_irq_data(32); |
| 124 | u32 val = readl_relaxed(ccm_base + CLPCR); | 124 | u32 val = readl_relaxed(ccm_base + CLPCR); |
| 125 | 125 | ||
| 126 | val &= ~BM_CLPCR_LPM; | 126 | val &= ~BM_CLPCR_LPM; |
| @@ -167,10 +167,9 @@ int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode) | |||
| 167 | * 3) Software should mask IRQ #32 right after CCM Low-Power mode | 167 | * 3) Software should mask IRQ #32 right after CCM Low-Power mode |
| 168 | * is set (set bits 0-1 of CCM_CLPCR). | 168 | * is set (set bits 0-1 of CCM_CLPCR). |
| 169 | */ | 169 | */ |
| 170 | iomuxc_irq_desc = irq_to_desc(32); | 170 | imx_gpc_irq_unmask(iomuxc_irq_data); |
| 171 | imx_gpc_irq_unmask(&iomuxc_irq_desc->irq_data); | ||
| 172 | writel_relaxed(val, ccm_base + CLPCR); | 171 | writel_relaxed(val, ccm_base + CLPCR); |
| 173 | imx_gpc_irq_mask(&iomuxc_irq_desc->irq_data); | 172 | imx_gpc_irq_mask(iomuxc_irq_data); |
| 174 | 173 | ||
| 175 | return 0; | 174 | return 0; |
| 176 | } | 175 | } |
diff --git a/arch/arm/mach-mmp/pm-mmp2.c b/arch/arm/mach-mmp/pm-mmp2.c index 461a191a32d2..43b1a516957f 100644 --- a/arch/arm/mach-mmp/pm-mmp2.c +++ b/arch/arm/mach-mmp/pm-mmp2.c | |||
| @@ -27,22 +27,8 @@ | |||
| 27 | 27 | ||
| 28 | int mmp2_set_wake(struct irq_data *d, unsigned int on) | 28 | int mmp2_set_wake(struct irq_data *d, unsigned int on) |
| 29 | { | 29 | { |
| 30 | int irq = d->irq; | ||
| 31 | struct irq_desc *desc = irq_to_desc(irq); | ||
| 32 | unsigned long data = 0; | 30 | unsigned long data = 0; |
| 33 | 31 | int irq = d->irq; | |
| 34 | if (unlikely(irq >= nr_irqs)) { | ||
| 35 | pr_err("IRQ nubmers are out of boundary!\n"); | ||
| 36 | return -EINVAL; | ||
| 37 | } | ||
| 38 | |||
| 39 | if (on) { | ||
| 40 | if (desc->action) | ||
| 41 | desc->action->flags |= IRQF_NO_SUSPEND; | ||
| 42 | } else { | ||
| 43 | if (desc->action) | ||
| 44 | desc->action->flags &= ~IRQF_NO_SUSPEND; | ||
| 45 | } | ||
| 46 | 32 | ||
| 47 | /* enable wakeup sources */ | 33 | /* enable wakeup sources */ |
| 48 | switch (irq) { | 34 | switch (irq) { |
diff --git a/arch/arm/mach-mmp/pm-pxa910.c b/arch/arm/mach-mmp/pm-pxa910.c index 48981ca801a5..04c9daf9f8d7 100644 --- a/arch/arm/mach-mmp/pm-pxa910.c +++ b/arch/arm/mach-mmp/pm-pxa910.c | |||
| @@ -27,22 +27,8 @@ | |||
| 27 | 27 | ||
| 28 | int pxa910_set_wake(struct irq_data *data, unsigned int on) | 28 | int pxa910_set_wake(struct irq_data *data, unsigned int on) |
| 29 | { | 29 | { |
| 30 | int irq = data->irq; | ||
| 31 | struct irq_desc *desc = irq_to_desc(data->irq); | ||
| 32 | uint32_t awucrm = 0, apcr = 0; | 30 | uint32_t awucrm = 0, apcr = 0; |
| 33 | 31 | int irq = data->irq; | |
| 34 | if (unlikely(irq >= nr_irqs)) { | ||
| 35 | pr_err("IRQ nubmers are out of boundary!\n"); | ||
| 36 | return -EINVAL; | ||
| 37 | } | ||
| 38 | |||
| 39 | if (on) { | ||
| 40 | if (desc->action) | ||
| 41 | desc->action->flags |= IRQF_NO_SUSPEND; | ||
| 42 | } else { | ||
| 43 | if (desc->action) | ||
| 44 | desc->action->flags &= ~IRQF_NO_SUSPEND; | ||
| 45 | } | ||
| 46 | 32 | ||
| 47 | /* setting wakeup sources */ | 33 | /* setting wakeup sources */ |
| 48 | switch (irq) { | 34 | switch (irq) { |
| @@ -115,9 +101,11 @@ int pxa910_set_wake(struct irq_data *data, unsigned int on) | |||
| 115 | if (irq >= IRQ_GPIO_START && irq < IRQ_BOARD_START) { | 101 | if (irq >= IRQ_GPIO_START && irq < IRQ_BOARD_START) { |
| 116 | awucrm = MPMU_AWUCRM_WAKEUP(2); | 102 | awucrm = MPMU_AWUCRM_WAKEUP(2); |
| 117 | apcr |= MPMU_APCR_SLPWP2; | 103 | apcr |= MPMU_APCR_SLPWP2; |
| 118 | } else | 104 | } else { |
| 105 | /* FIXME: This should return a proper error code ! */ | ||
| 119 | printk(KERN_ERR "Error: no defined wake up source irq: %d\n", | 106 | printk(KERN_ERR "Error: no defined wake up source irq: %d\n", |
| 120 | irq); | 107 | irq); |
| 108 | } | ||
| 121 | } | 109 | } |
| 122 | 110 | ||
| 123 | if (on) { | 111 | if (on) { |
diff --git a/arch/arm/mach-omap1/ams-delta-fiq.c b/arch/arm/mach-omap1/ams-delta-fiq.c index f12a12af3523..d1f12095f315 100644 --- a/arch/arm/mach-omap1/ams-delta-fiq.c +++ b/arch/arm/mach-omap1/ams-delta-fiq.c | |||
| @@ -44,13 +44,10 @@ static unsigned int irq_counter[16]; | |||
| 44 | 44 | ||
| 45 | static irqreturn_t deferred_fiq(int irq, void *dev_id) | 45 | static irqreturn_t deferred_fiq(int irq, void *dev_id) |
| 46 | { | 46 | { |
| 47 | struct irq_desc *irq_desc; | ||
| 48 | struct irq_chip *irq_chip = NULL; | ||
| 49 | int gpio, irq_num, fiq_count; | 47 | int gpio, irq_num, fiq_count; |
| 48 | struct irq_chip *irq_chip; | ||
| 50 | 49 | ||
| 51 | irq_desc = irq_to_desc(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK)); | 50 | irq_chip = irq_get_chip(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK)); |
| 52 | if (irq_desc) | ||
| 53 | irq_chip = irq_desc->irq_data.chip; | ||
| 54 | 51 | ||
| 55 | /* | 52 | /* |
| 56 | * For each handled GPIO interrupt, keep calling its interrupt handler | 53 | * For each handled GPIO interrupt, keep calling its interrupt handler |
diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c index 3b05aea56d1f..11ed9152e665 100644 --- a/arch/arm/mach-omap2/cclock3xxx_data.c +++ b/arch/arm/mach-omap2/cclock3xxx_data.c | |||
| @@ -433,7 +433,9 @@ static const struct clk_ops dpll4_m5x2_ck_ops = { | |||
| 433 | .enable = &omap2_dflt_clk_enable, | 433 | .enable = &omap2_dflt_clk_enable, |
| 434 | .disable = &omap2_dflt_clk_disable, | 434 | .disable = &omap2_dflt_clk_disable, |
| 435 | .is_enabled = &omap2_dflt_clk_is_enabled, | 435 | .is_enabled = &omap2_dflt_clk_is_enabled, |
| 436 | .set_rate = &omap3_clkoutx2_set_rate, | ||
| 436 | .recalc_rate = &omap3_clkoutx2_recalc, | 437 | .recalc_rate = &omap3_clkoutx2_recalc, |
| 438 | .round_rate = &omap3_clkoutx2_round_rate, | ||
| 437 | }; | 439 | }; |
| 438 | 440 | ||
| 439 | static const struct clk_ops dpll4_m5x2_ck_3630_ops = { | 441 | static const struct clk_ops dpll4_m5x2_ck_3630_ops = { |
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c index 4c158c838d40..01fc710c8181 100644 --- a/arch/arm/mach-omap2/cpuidle44xx.c +++ b/arch/arm/mach-omap2/cpuidle44xx.c | |||
| @@ -23,6 +23,8 @@ | |||
| 23 | #include "prm.h" | 23 | #include "prm.h" |
| 24 | #include "clockdomain.h" | 24 | #include "clockdomain.h" |
| 25 | 25 | ||
| 26 | #define MAX_CPUS 2 | ||
| 27 | |||
| 26 | /* Machine specific information */ | 28 | /* Machine specific information */ |
| 27 | struct idle_statedata { | 29 | struct idle_statedata { |
| 28 | u32 cpu_state; | 30 | u32 cpu_state; |
| @@ -48,11 +50,11 @@ static struct idle_statedata omap4_idle_data[] = { | |||
| 48 | }, | 50 | }, |
| 49 | }; | 51 | }; |
| 50 | 52 | ||
| 51 | static struct powerdomain *mpu_pd, *cpu_pd[NR_CPUS]; | 53 | static struct powerdomain *mpu_pd, *cpu_pd[MAX_CPUS]; |
| 52 | static struct clockdomain *cpu_clkdm[NR_CPUS]; | 54 | static struct clockdomain *cpu_clkdm[MAX_CPUS]; |
| 53 | 55 | ||
| 54 | static atomic_t abort_barrier; | 56 | static atomic_t abort_barrier; |
| 55 | static bool cpu_done[NR_CPUS]; | 57 | static bool cpu_done[MAX_CPUS]; |
| 56 | static struct idle_statedata *state_ptr = &omap4_idle_data[0]; | 58 | static struct idle_statedata *state_ptr = &omap4_idle_data[0]; |
| 57 | 59 | ||
| 58 | /* Private functions */ | 60 | /* Private functions */ |
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c index 3185ced807c9..3c418ea54bbe 100644 --- a/arch/arm/mach-omap2/dpll3xxx.c +++ b/arch/arm/mach-omap2/dpll3xxx.c | |||
| @@ -623,6 +623,32 @@ void omap3_dpll_deny_idle(struct clk_hw_omap *clk) | |||
| 623 | 623 | ||
| 624 | /* Clock control for DPLL outputs */ | 624 | /* Clock control for DPLL outputs */ |
| 625 | 625 | ||
| 626 | /* Find the parent DPLL for the given clkoutx2 clock */ | ||
| 627 | static struct clk_hw_omap *omap3_find_clkoutx2_dpll(struct clk_hw *hw) | ||
| 628 | { | ||
| 629 | struct clk_hw_omap *pclk = NULL; | ||
| 630 | struct clk *parent; | ||
| 631 | |||
| 632 | /* Walk up the parents of clk, looking for a DPLL */ | ||
| 633 | do { | ||
| 634 | do { | ||
| 635 | parent = __clk_get_parent(hw->clk); | ||
| 636 | hw = __clk_get_hw(parent); | ||
| 637 | } while (hw && (__clk_get_flags(hw->clk) & CLK_IS_BASIC)); | ||
| 638 | if (!hw) | ||
| 639 | break; | ||
| 640 | pclk = to_clk_hw_omap(hw); | ||
| 641 | } while (pclk && !pclk->dpll_data); | ||
| 642 | |||
| 643 | /* clk does not have a DPLL as a parent? error in the clock data */ | ||
| 644 | if (!pclk) { | ||
| 645 | WARN_ON(1); | ||
| 646 | return NULL; | ||
| 647 | } | ||
| 648 | |||
| 649 | return pclk; | ||
| 650 | } | ||
| 651 | |||
| 626 | /** | 652 | /** |
| 627 | * omap3_clkoutx2_recalc - recalculate DPLL X2 output virtual clock rate | 653 | * omap3_clkoutx2_recalc - recalculate DPLL X2 output virtual clock rate |
| 628 | * @clk: DPLL output struct clk | 654 | * @clk: DPLL output struct clk |
| @@ -637,27 +663,14 @@ unsigned long omap3_clkoutx2_recalc(struct clk_hw *hw, | |||
| 637 | unsigned long rate; | 663 | unsigned long rate; |
| 638 | u32 v; | 664 | u32 v; |
| 639 | struct clk_hw_omap *pclk = NULL; | 665 | struct clk_hw_omap *pclk = NULL; |
| 640 | struct clk *parent; | ||
| 641 | 666 | ||
| 642 | if (!parent_rate) | 667 | if (!parent_rate) |
| 643 | return 0; | 668 | return 0; |
| 644 | 669 | ||
| 645 | /* Walk up the parents of clk, looking for a DPLL */ | 670 | pclk = omap3_find_clkoutx2_dpll(hw); |
| 646 | do { | ||
| 647 | do { | ||
| 648 | parent = __clk_get_parent(hw->clk); | ||
| 649 | hw = __clk_get_hw(parent); | ||
| 650 | } while (hw && (__clk_get_flags(hw->clk) & CLK_IS_BASIC)); | ||
| 651 | if (!hw) | ||
| 652 | break; | ||
| 653 | pclk = to_clk_hw_omap(hw); | ||
| 654 | } while (pclk && !pclk->dpll_data); | ||
| 655 | 671 | ||
| 656 | /* clk does not have a DPLL as a parent? error in the clock data */ | 672 | if (!pclk) |
| 657 | if (!pclk) { | ||
| 658 | WARN_ON(1); | ||
| 659 | return 0; | 673 | return 0; |
| 660 | } | ||
| 661 | 674 | ||
| 662 | dd = pclk->dpll_data; | 675 | dd = pclk->dpll_data; |
| 663 | 676 | ||
| @@ -672,6 +685,55 @@ unsigned long omap3_clkoutx2_recalc(struct clk_hw *hw, | |||
| 672 | return rate; | 685 | return rate; |
| 673 | } | 686 | } |
| 674 | 687 | ||
| 688 | int omap3_clkoutx2_set_rate(struct clk_hw *hw, unsigned long rate, | ||
| 689 | unsigned long parent_rate) | ||
| 690 | { | ||
| 691 | return 0; | ||
| 692 | } | ||
| 693 | |||
| 694 | long omap3_clkoutx2_round_rate(struct clk_hw *hw, unsigned long rate, | ||
| 695 | unsigned long *prate) | ||
| 696 | { | ||
| 697 | const struct dpll_data *dd; | ||
| 698 | u32 v; | ||
| 699 | struct clk_hw_omap *pclk = NULL; | ||
| 700 | |||
| 701 | if (!*prate) | ||
| 702 | return 0; | ||
| 703 | |||
| 704 | pclk = omap3_find_clkoutx2_dpll(hw); | ||
| 705 | |||
| 706 | if (!pclk) | ||
| 707 | return 0; | ||
| 708 | |||
| 709 | dd = pclk->dpll_data; | ||
| 710 | |||
| 711 | /* TYPE J does not have a clkoutx2 */ | ||
| 712 | if (dd->flags & DPLL_J_TYPE) { | ||
| 713 | *prate = __clk_round_rate(__clk_get_parent(pclk->hw.clk), rate); | ||
| 714 | return *prate; | ||
| 715 | } | ||
| 716 | |||
| 717 | WARN_ON(!dd->enable_mask); | ||
| 718 | |||
| 719 | v = omap2_clk_readl(pclk, dd->control_reg) & dd->enable_mask; | ||
| 720 | v >>= __ffs(dd->enable_mask); | ||
| 721 | |||
| 722 | /* If in bypass, the rate is fixed to the bypass rate*/ | ||
| 723 | if (v != OMAP3XXX_EN_DPLL_LOCKED) | ||
| 724 | return *prate; | ||
| 725 | |||
| 726 | if (__clk_get_flags(hw->clk) & CLK_SET_RATE_PARENT) { | ||
| 727 | unsigned long best_parent; | ||
| 728 | |||
| 729 | best_parent = (rate / 2); | ||
| 730 | *prate = __clk_round_rate(__clk_get_parent(hw->clk), | ||
| 731 | best_parent); | ||
| 732 | } | ||
| 733 | |||
| 734 | return *prate * 2; | ||
| 735 | } | ||
| 736 | |||
| 675 | /* OMAP3/4 non-CORE DPLL clkops */ | 737 | /* OMAP3/4 non-CORE DPLL clkops */ |
| 676 | const struct clk_hw_omap_ops clkhwops_omap3_dpll = { | 738 | const struct clk_hw_omap_ops clkhwops_omap3_dpll = { |
| 677 | .allow_idle = omap3_dpll_allow_idle, | 739 | .allow_idle = omap3_dpll_allow_idle, |
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 42d81885c700..1f33f5db10d5 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
| @@ -1947,29 +1947,31 @@ static int _ocp_softreset(struct omap_hwmod *oh) | |||
| 1947 | goto dis_opt_clks; | 1947 | goto dis_opt_clks; |
| 1948 | 1948 | ||
| 1949 | _write_sysconfig(v, oh); | 1949 | _write_sysconfig(v, oh); |
| 1950 | ret = _clear_softreset(oh, &v); | ||
| 1951 | if (ret) | ||
| 1952 | goto dis_opt_clks; | ||
| 1953 | |||
| 1954 | _write_sysconfig(v, oh); | ||
| 1955 | 1950 | ||
| 1956 | if (oh->class->sysc->srst_udelay) | 1951 | if (oh->class->sysc->srst_udelay) |
| 1957 | udelay(oh->class->sysc->srst_udelay); | 1952 | udelay(oh->class->sysc->srst_udelay); |
| 1958 | 1953 | ||
| 1959 | c = _wait_softreset_complete(oh); | 1954 | c = _wait_softreset_complete(oh); |
| 1960 | if (c == MAX_MODULE_SOFTRESET_WAIT) | 1955 | if (c == MAX_MODULE_SOFTRESET_WAIT) { |
| 1961 | pr_warning("omap_hwmod: %s: softreset failed (waited %d usec)\n", | 1956 | pr_warning("omap_hwmod: %s: softreset failed (waited %d usec)\n", |
| 1962 | oh->name, MAX_MODULE_SOFTRESET_WAIT); | 1957 | oh->name, MAX_MODULE_SOFTRESET_WAIT); |
| 1963 | else | 1958 | ret = -ETIMEDOUT; |
| 1959 | goto dis_opt_clks; | ||
| 1960 | } else { | ||
| 1964 | pr_debug("omap_hwmod: %s: softreset in %d usec\n", oh->name, c); | 1961 | pr_debug("omap_hwmod: %s: softreset in %d usec\n", oh->name, c); |
| 1962 | } | ||
| 1963 | |||
| 1964 | ret = _clear_softreset(oh, &v); | ||
| 1965 | if (ret) | ||
| 1966 | goto dis_opt_clks; | ||
| 1967 | |||
| 1968 | _write_sysconfig(v, oh); | ||
| 1965 | 1969 | ||
| 1966 | /* | 1970 | /* |
| 1967 | * XXX add _HWMOD_STATE_WEDGED for modules that don't come back from | 1971 | * XXX add _HWMOD_STATE_WEDGED for modules that don't come back from |
| 1968 | * _wait_target_ready() or _reset() | 1972 | * _wait_target_ready() or _reset() |
| 1969 | */ | 1973 | */ |
| 1970 | 1974 | ||
| 1971 | ret = (c == MAX_MODULE_SOFTRESET_WAIT) ? -ETIMEDOUT : 0; | ||
| 1972 | |||
| 1973 | dis_opt_clks: | 1975 | dis_opt_clks: |
| 1974 | if (oh->flags & HWMOD_CONTROL_OPT_CLKS_IN_RESET) | 1976 | if (oh->flags & HWMOD_CONTROL_OPT_CLKS_IN_RESET) |
| 1975 | _disable_optional_clocks(oh); | 1977 | _disable_optional_clocks(oh); |
diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c index 18f333c440db..810c205d668b 100644 --- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c | |||
| @@ -1365,11 +1365,10 @@ static struct omap_hwmod_class_sysconfig dra7xx_spinlock_sysc = { | |||
| 1365 | .rev_offs = 0x0000, | 1365 | .rev_offs = 0x0000, |
| 1366 | .sysc_offs = 0x0010, | 1366 | .sysc_offs = 0x0010, |
| 1367 | .syss_offs = 0x0014, | 1367 | .syss_offs = 0x0014, |
| 1368 | .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY | | 1368 | .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_ENAWAKEUP | |
| 1369 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | | 1369 | SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET | |
| 1370 | SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS), | 1370 | SYSS_HAS_RESET_STATUS), |
| 1371 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | | 1371 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), |
| 1372 | SIDLE_SMART_WKUP), | ||
| 1373 | .sysc_fields = &omap_hwmod_sysc_type1, | 1372 | .sysc_fields = &omap_hwmod_sysc_type1, |
| 1374 | }; | 1373 | }; |
| 1375 | 1374 | ||
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c index 3d5b24dcd9a4..c33e07e2f0d4 100644 --- a/arch/arm/mach-omap2/pdata-quirks.c +++ b/arch/arm/mach-omap2/pdata-quirks.c | |||
| @@ -22,6 +22,8 @@ | |||
| 22 | #include "common-board-devices.h" | 22 | #include "common-board-devices.h" |
| 23 | #include "dss-common.h" | 23 | #include "dss-common.h" |
| 24 | #include "control.h" | 24 | #include "control.h" |
| 25 | #include "omap-secure.h" | ||
| 26 | #include "soc.h" | ||
| 25 | 27 | ||
| 26 | struct pdata_init { | 28 | struct pdata_init { |
| 27 | const char *compatible; | 29 | const char *compatible; |
| @@ -169,6 +171,22 @@ static void __init am3517_evm_legacy_init(void) | |||
| 169 | omap_ctrl_writel(v, AM35XX_CONTROL_IP_SW_RESET); | 171 | omap_ctrl_writel(v, AM35XX_CONTROL_IP_SW_RESET); |
| 170 | omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); /* OCP barrier */ | 172 | omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); /* OCP barrier */ |
| 171 | } | 173 | } |
| 174 | |||
| 175 | static void __init nokia_n900_legacy_init(void) | ||
| 176 | { | ||
| 177 | hsmmc2_internal_input_clk(); | ||
| 178 | |||
| 179 | if (omap_type() == OMAP2_DEVICE_TYPE_SEC) { | ||
| 180 | if (IS_ENABLED(CONFIG_ARM_ERRATA_430973)) { | ||
| 181 | pr_info("RX-51: Enabling ARM errata 430973 workaround\n"); | ||
| 182 | /* set IBE to 1 */ | ||
| 183 | rx51_secure_update_aux_cr(BIT(6), 0); | ||
| 184 | } else { | ||
| 185 | pr_warning("RX-51: Not enabling ARM errata 430973 workaround\n"); | ||
| 186 | pr_warning("Thumb binaries may crash randomly without this workaround\n"); | ||
| 187 | } | ||
| 188 | } | ||
| 189 | } | ||
| 172 | #endif /* CONFIG_ARCH_OMAP3 */ | 190 | #endif /* CONFIG_ARCH_OMAP3 */ |
| 173 | 191 | ||
| 174 | #ifdef CONFIG_ARCH_OMAP4 | 192 | #ifdef CONFIG_ARCH_OMAP4 |
| @@ -239,6 +257,7 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = { | |||
| 239 | #endif | 257 | #endif |
| 240 | #ifdef CONFIG_ARCH_OMAP3 | 258 | #ifdef CONFIG_ARCH_OMAP3 |
| 241 | OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata), | 259 | OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata), |
| 260 | OF_DEV_AUXDATA("ti,omap3-padconf", 0x480025a0, "480025a0.pinmux", &pcs_pdata), | ||
| 242 | OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata), | 261 | OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata), |
| 243 | /* Only on am3517 */ | 262 | /* Only on am3517 */ |
| 244 | OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL), | 263 | OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL), |
| @@ -259,7 +278,7 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = { | |||
| 259 | static struct pdata_init pdata_quirks[] __initdata = { | 278 | static struct pdata_init pdata_quirks[] __initdata = { |
| 260 | #ifdef CONFIG_ARCH_OMAP3 | 279 | #ifdef CONFIG_ARCH_OMAP3 |
| 261 | { "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, }, | 280 | { "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, }, |
| 262 | { "nokia,omap3-n900", hsmmc2_internal_input_clk, }, | 281 | { "nokia,omap3-n900", nokia_n900_legacy_init, }, |
| 263 | { "nokia,omap3-n9", hsmmc2_internal_input_clk, }, | 282 | { "nokia,omap3-n9", hsmmc2_internal_input_clk, }, |
| 264 | { "nokia,omap3-n950", hsmmc2_internal_input_clk, }, | 283 | { "nokia,omap3-n950", hsmmc2_internal_input_clk, }, |
| 265 | { "isee,omap3-igep0020", omap3_igep0020_legacy_init, }, | 284 | { "isee,omap3-igep0020", omap3_igep0020_legacy_init, }, |
diff --git a/arch/arm/mach-omap2/prminst44xx.c b/arch/arm/mach-omap2/prminst44xx.c index 6334b96b4097..280f3c58abe5 100644 --- a/arch/arm/mach-omap2/prminst44xx.c +++ b/arch/arm/mach-omap2/prminst44xx.c | |||
| @@ -183,11 +183,11 @@ void omap4_prminst_global_warm_sw_reset(void) | |||
| 183 | OMAP4_PRM_RSTCTRL_OFFSET); | 183 | OMAP4_PRM_RSTCTRL_OFFSET); |
| 184 | v |= OMAP4430_RST_GLOBAL_WARM_SW_MASK; | 184 | v |= OMAP4430_RST_GLOBAL_WARM_SW_MASK; |
| 185 | omap4_prminst_write_inst_reg(v, OMAP4430_PRM_PARTITION, | 185 | omap4_prminst_write_inst_reg(v, OMAP4430_PRM_PARTITION, |
| 186 | OMAP4430_PRM_DEVICE_INST, | 186 | dev_inst, |
| 187 | OMAP4_PRM_RSTCTRL_OFFSET); | 187 | OMAP4_PRM_RSTCTRL_OFFSET); |
| 188 | 188 | ||
| 189 | /* OCP barrier */ | 189 | /* OCP barrier */ |
| 190 | v = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION, | 190 | v = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION, |
| 191 | OMAP4430_PRM_DEVICE_INST, | 191 | dev_inst, |
| 192 | OMAP4_PRM_RSTCTRL_OFFSET); | 192 | OMAP4_PRM_RSTCTRL_OFFSET); |
| 193 | } | 193 | } |
diff --git a/arch/arm/mach-sa1100/include/mach/collie.h b/arch/arm/mach-sa1100/include/mach/collie.h index f33679d2d3ee..50e1d850ee2e 100644 --- a/arch/arm/mach-sa1100/include/mach/collie.h +++ b/arch/arm/mach-sa1100/include/mach/collie.h | |||
| @@ -13,6 +13,8 @@ | |||
| 13 | #ifndef __ASM_ARCH_COLLIE_H | 13 | #ifndef __ASM_ARCH_COLLIE_H |
| 14 | #define __ASM_ARCH_COLLIE_H | 14 | #define __ASM_ARCH_COLLIE_H |
| 15 | 15 | ||
| 16 | #include "hardware.h" /* Gives GPIO_MAX */ | ||
| 17 | |||
| 16 | extern void locomolcd_power(int on); | 18 | extern void locomolcd_power(int on); |
| 17 | 19 | ||
| 18 | #define COLLIE_SCOOP_GPIO_BASE (GPIO_MAX + 1) | 20 | #define COLLIE_SCOOP_GPIO_BASE (GPIO_MAX + 1) |
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index 05fa505df585..f6db7dcae3f4 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig | |||
| @@ -24,17 +24,21 @@ comment "Renesas ARM SoCs System Type" | |||
| 24 | 24 | ||
| 25 | config ARCH_EMEV2 | 25 | config ARCH_EMEV2 |
| 26 | bool "Emma Mobile EV2" | 26 | bool "Emma Mobile EV2" |
| 27 | select SYS_SUPPORTS_EM_STI | ||
| 27 | 28 | ||
| 28 | config ARCH_R7S72100 | 29 | config ARCH_R7S72100 |
| 29 | bool "RZ/A1H (R7S72100)" | 30 | bool "RZ/A1H (R7S72100)" |
| 31 | select SYS_SUPPORTS_SH_MTU2 | ||
| 30 | 32 | ||
| 31 | config ARCH_R8A7790 | 33 | config ARCH_R8A7790 |
| 32 | bool "R-Car H2 (R8A77900)" | 34 | bool "R-Car H2 (R8A77900)" |
| 33 | select RENESAS_IRQC | 35 | select RENESAS_IRQC |
| 36 | select SYS_SUPPORTS_SH_CMT | ||
| 34 | 37 | ||
| 35 | config ARCH_R8A7791 | 38 | config ARCH_R8A7791 |
| 36 | bool "R-Car M2 (R8A77910)" | 39 | bool "R-Car M2 (R8A77910)" |
| 37 | select RENESAS_IRQC | 40 | select RENESAS_IRQC |
| 41 | select SYS_SUPPORTS_SH_CMT | ||
| 38 | 42 | ||
| 39 | comment "Renesas ARM SoCs Board Type" | 43 | comment "Renesas ARM SoCs Board Type" |
| 40 | 44 | ||
| @@ -68,6 +72,8 @@ config ARCH_SH7372 | |||
| 68 | select ARM_CPU_SUSPEND if PM || CPU_IDLE | 72 | select ARM_CPU_SUSPEND if PM || CPU_IDLE |
| 69 | select CPU_V7 | 73 | select CPU_V7 |
| 70 | select SH_CLK_CPG | 74 | select SH_CLK_CPG |
| 75 | select SYS_SUPPORTS_SH_CMT | ||
| 76 | select SYS_SUPPORTS_SH_TMU | ||
| 71 | 77 | ||
| 72 | config ARCH_SH73A0 | 78 | config ARCH_SH73A0 |
| 73 | bool "SH-Mobile AG5 (R8A73A00)" | 79 | bool "SH-Mobile AG5 (R8A73A00)" |
| @@ -77,6 +83,8 @@ config ARCH_SH73A0 | |||
| 77 | select I2C | 83 | select I2C |
| 78 | select SH_CLK_CPG | 84 | select SH_CLK_CPG |
| 79 | select RENESAS_INTC_IRQPIN | 85 | select RENESAS_INTC_IRQPIN |
| 86 | select SYS_SUPPORTS_SH_CMT | ||
| 87 | select SYS_SUPPORTS_SH_TMU | ||
| 80 | 88 | ||
| 81 | config ARCH_R8A73A4 | 89 | config ARCH_R8A73A4 |
| 82 | bool "R-Mobile APE6 (R8A73A40)" | 90 | bool "R-Mobile APE6 (R8A73A40)" |
| @@ -87,6 +95,8 @@ config ARCH_R8A73A4 | |||
| 87 | select RENESAS_IRQC | 95 | select RENESAS_IRQC |
| 88 | select ARCH_HAS_CPUFREQ | 96 | select ARCH_HAS_CPUFREQ |
| 89 | select ARCH_HAS_OPP | 97 | select ARCH_HAS_OPP |
| 98 | select SYS_SUPPORTS_SH_CMT | ||
| 99 | select SYS_SUPPORTS_SH_TMU | ||
| 90 | 100 | ||
| 91 | config ARCH_R8A7740 | 101 | config ARCH_R8A7740 |
| 92 | bool "R-Mobile A1 (R8A77400)" | 102 | bool "R-Mobile A1 (R8A77400)" |
| @@ -95,6 +105,8 @@ config ARCH_R8A7740 | |||
| 95 | select CPU_V7 | 105 | select CPU_V7 |
| 96 | select SH_CLK_CPG | 106 | select SH_CLK_CPG |
| 97 | select RENESAS_INTC_IRQPIN | 107 | select RENESAS_INTC_IRQPIN |
| 108 | select SYS_SUPPORTS_SH_CMT | ||
| 109 | select SYS_SUPPORTS_SH_TMU | ||
| 98 | 110 | ||
| 99 | config ARCH_R8A7778 | 111 | config ARCH_R8A7778 |
| 100 | bool "R-Car M1A (R8A77781)" | 112 | bool "R-Car M1A (R8A77781)" |
| @@ -104,6 +116,7 @@ config ARCH_R8A7778 | |||
| 104 | select ARM_GIC | 116 | select ARM_GIC |
| 105 | select USB_ARCH_HAS_EHCI | 117 | select USB_ARCH_HAS_EHCI |
| 106 | select USB_ARCH_HAS_OHCI | 118 | select USB_ARCH_HAS_OHCI |
| 119 | select SYS_SUPPORTS_SH_TMU | ||
| 107 | 120 | ||
| 108 | config ARCH_R8A7779 | 121 | config ARCH_R8A7779 |
| 109 | bool "R-Car H1 (R8A77790)" | 122 | bool "R-Car H1 (R8A77790)" |
| @@ -114,6 +127,7 @@ config ARCH_R8A7779 | |||
| 114 | select USB_ARCH_HAS_EHCI | 127 | select USB_ARCH_HAS_EHCI |
| 115 | select USB_ARCH_HAS_OHCI | 128 | select USB_ARCH_HAS_OHCI |
| 116 | select RENESAS_INTC_IRQPIN | 129 | select RENESAS_INTC_IRQPIN |
| 130 | select SYS_SUPPORTS_SH_TMU | ||
| 117 | 131 | ||
| 118 | config ARCH_R8A7790 | 132 | config ARCH_R8A7790 |
| 119 | bool "R-Car H2 (R8A77900)" | 133 | bool "R-Car H2 (R8A77900)" |
| @@ -123,6 +137,7 @@ config ARCH_R8A7790 | |||
| 123 | select MIGHT_HAVE_PCI | 137 | select MIGHT_HAVE_PCI |
| 124 | select SH_CLK_CPG | 138 | select SH_CLK_CPG |
| 125 | select RENESAS_IRQC | 139 | select RENESAS_IRQC |
| 140 | select SYS_SUPPORTS_SH_CMT | ||
| 126 | 141 | ||
| 127 | config ARCH_R8A7791 | 142 | config ARCH_R8A7791 |
| 128 | bool "R-Car M2 (R8A77910)" | 143 | bool "R-Car M2 (R8A77910)" |
| @@ -132,6 +147,7 @@ config ARCH_R8A7791 | |||
| 132 | select MIGHT_HAVE_PCI | 147 | select MIGHT_HAVE_PCI |
| 133 | select SH_CLK_CPG | 148 | select SH_CLK_CPG |
| 134 | select RENESAS_IRQC | 149 | select RENESAS_IRQC |
| 150 | select SYS_SUPPORTS_SH_CMT | ||
| 135 | 151 | ||
| 136 | config ARCH_EMEV2 | 152 | config ARCH_EMEV2 |
| 137 | bool "Emma Mobile EV2" | 153 | bool "Emma Mobile EV2" |
| @@ -141,6 +157,7 @@ config ARCH_EMEV2 | |||
| 141 | select MIGHT_HAVE_PCI | 157 | select MIGHT_HAVE_PCI |
| 142 | select USE_OF | 158 | select USE_OF |
| 143 | select AUTO_ZRELADDR | 159 | select AUTO_ZRELADDR |
| 160 | select SYS_SUPPORTS_EM_STI | ||
| 144 | 161 | ||
| 145 | config ARCH_R7S72100 | 162 | config ARCH_R7S72100 |
| 146 | bool "RZ/A1H (R7S72100)" | 163 | bool "RZ/A1H (R7S72100)" |
| @@ -148,6 +165,7 @@ config ARCH_R7S72100 | |||
| 148 | select ARM_GIC | 165 | select ARM_GIC |
| 149 | select CPU_V7 | 166 | select CPU_V7 |
| 150 | select SH_CLK_CPG | 167 | select SH_CLK_CPG |
| 168 | select SYS_SUPPORTS_SH_MTU2 | ||
| 151 | 169 | ||
| 152 | comment "Renesas ARM SoCs Board Type" | 170 | comment "Renesas ARM SoCs Board Type" |
| 153 | 171 | ||
| @@ -321,24 +339,6 @@ config SHMOBILE_TIMER_HZ | |||
| 321 | want to select a HZ value such as 128 that can evenly divide RCLK. | 339 | want to select a HZ value such as 128 that can evenly divide RCLK. |
| 322 | A HZ value that does not divide evenly may cause timer drift. | 340 | A HZ value that does not divide evenly may cause timer drift. |
| 323 | 341 | ||
| 324 | config SH_TIMER_CMT | ||
| 325 | bool "CMT timer driver" | ||
| 326 | default y | ||
| 327 | help | ||
| 328 | This enables build of the CMT timer driver. | ||
| 329 | |||
| 330 | config SH_TIMER_TMU | ||
| 331 | bool "TMU timer driver" | ||
| 332 | default y | ||
| 333 | help | ||
| 334 | This enables build of the TMU timer driver. | ||
| 335 | |||
| 336 | config EM_TIMER_STI | ||
| 337 | bool "STI timer driver" | ||
| 338 | default y | ||
| 339 | help | ||
| 340 | This enables build of the STI timer driver. | ||
| 341 | |||
| 342 | endmenu | 342 | endmenu |
| 343 | 343 | ||
| 344 | endif | 344 | endif |
diff --git a/arch/arm/mach-u300/Makefile b/arch/arm/mach-u300/Makefile index 0f362b64fb87..3ec74ac95bc1 100644 --- a/arch/arm/mach-u300/Makefile +++ b/arch/arm/mach-u300/Makefile | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | # Makefile for the linux kernel, U300 machine. | 2 | # Makefile for the linux kernel, U300 machine. |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | obj-y := core.o timer.o | 5 | obj-y := core.o |
| 6 | obj-m := | 6 | obj-m := |
| 7 | obj-n := | 7 | obj-n := |
| 8 | obj- := | 8 | obj- := |
diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c deleted file mode 100644 index fe08fd34c0ce..000000000000 --- a/arch/arm/mach-u300/timer.c +++ /dev/null | |||
| @@ -1,451 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * | ||
| 3 | * arch/arm/mach-u300/timer.c | ||
| 4 | * | ||
| 5 | * | ||
| 6 | * Copyright (C) 2007-2009 ST-Ericsson AB | ||
| 7 | * License terms: GNU General Public License (GPL) version 2 | ||
| 8 | * Timer COH 901 328, runs the OS timer interrupt. | ||
| 9 | * Author: Linus Walleij <linus.walleij@stericsson.com> | ||
| 10 | */ | ||
| 11 | #include <linux/interrupt.h> | ||
| 12 | #include <linux/time.h> | ||
| 13 | #include <linux/timex.h> | ||
| 14 | #include <linux/clockchips.h> | ||
| 15 | #include <linux/clocksource.h> | ||
| 16 | #include <linux/types.h> | ||
| 17 | #include <linux/io.h> | ||
| 18 | #include <linux/clk.h> | ||
| 19 | #include <linux/err.h> | ||
| 20 | #include <linux/irq.h> | ||
| 21 | #include <linux/delay.h> | ||
| 22 | #include <linux/of_address.h> | ||
| 23 | #include <linux/of_irq.h> | ||
| 24 | #include <linux/sched_clock.h> | ||
| 25 | |||
| 26 | /* Generic stuff */ | ||
| 27 | #include <asm/mach/map.h> | ||
| 28 | #include <asm/mach/time.h> | ||
| 29 | |||
| 30 | /* | ||
| 31 | * APP side special timer registers | ||
| 32 | * This timer contains four timers which can fire an interrupt each. | ||
| 33 | * OS (operating system) timer @ 32768 Hz | ||
| 34 | * DD (device driver) timer @ 1 kHz | ||
| 35 | * GP1 (general purpose 1) timer @ 1MHz | ||
| 36 | * GP2 (general purpose 2) timer @ 1MHz | ||
| 37 | */ | ||
| 38 | |||
| 39 | /* Reset OS Timer 32bit (-/W) */ | ||
| 40 | #define U300_TIMER_APP_ROST (0x0000) | ||
| 41 | #define U300_TIMER_APP_ROST_TIMER_RESET (0x00000000) | ||
| 42 | /* Enable OS Timer 32bit (-/W) */ | ||
| 43 | #define U300_TIMER_APP_EOST (0x0004) | ||
| 44 | #define U300_TIMER_APP_EOST_TIMER_ENABLE (0x00000000) | ||
| 45 | /* Disable OS Timer 32bit (-/W) */ | ||
| 46 | #define U300_TIMER_APP_DOST (0x0008) | ||
| 47 | #define U300_TIMER_APP_DOST_TIMER_DISABLE (0x00000000) | ||
| 48 | /* OS Timer Mode Register 32bit (-/W) */ | ||
| 49 | #define U300_TIMER_APP_SOSTM (0x000c) | ||
| 50 | #define U300_TIMER_APP_SOSTM_MODE_CONTINUOUS (0x00000000) | ||
| 51 | #define U300_TIMER_APP_SOSTM_MODE_ONE_SHOT (0x00000001) | ||
| 52 | /* OS Timer Status Register 32bit (R/-) */ | ||
| 53 | #define U300_TIMER_APP_OSTS (0x0010) | ||
| 54 | #define U300_TIMER_APP_OSTS_TIMER_STATE_MASK (0x0000000F) | ||
| 55 | #define U300_TIMER_APP_OSTS_TIMER_STATE_IDLE (0x00000001) | ||
| 56 | #define U300_TIMER_APP_OSTS_TIMER_STATE_ACTIVE (0x00000002) | ||
| 57 | #define U300_TIMER_APP_OSTS_ENABLE_IND (0x00000010) | ||
| 58 | #define U300_TIMER_APP_OSTS_MODE_MASK (0x00000020) | ||
| 59 | #define U300_TIMER_APP_OSTS_MODE_CONTINUOUS (0x00000000) | ||
| 60 | #define U300_TIMER_APP_OSTS_MODE_ONE_SHOT (0x00000020) | ||
| 61 | #define U300_TIMER_APP_OSTS_IRQ_ENABLED_IND (0x00000040) | ||
| 62 | #define U300_TIMER_APP_OSTS_IRQ_PENDING_IND (0x00000080) | ||
| 63 | /* OS Timer Current Count Register 32bit (R/-) */ | ||
| 64 | #define U300_TIMER_APP_OSTCC (0x0014) | ||
| 65 | /* OS Timer Terminal Count Register 32bit (R/W) */ | ||
| 66 | #define U300_TIMER_APP_OSTTC (0x0018) | ||
| 67 | /* OS Timer Interrupt Enable Register 32bit (-/W) */ | ||
| 68 | #define U300_TIMER_APP_OSTIE (0x001c) | ||
| 69 | #define U300_TIMER_APP_OSTIE_IRQ_DISABLE (0x00000000) | ||
| 70 | #define U300_TIMER_APP_OSTIE_IRQ_ENABLE (0x00000001) | ||
| 71 | /* OS Timer Interrupt Acknowledge Register 32bit (-/W) */ | ||
| 72 | #define U300_TIMER_APP_OSTIA (0x0020) | ||
| 73 | #define U300_TIMER_APP_OSTIA_IRQ_ACK (0x00000080) | ||
| 74 | |||
| 75 | /* Reset DD Timer 32bit (-/W) */ | ||
| 76 | #define U300_TIMER_APP_RDDT (0x0040) | ||
| 77 | #define U300_TIMER_APP_RDDT_TIMER_RESET (0x00000000) | ||
| 78 | /* Enable DD Timer 32bit (-/W) */ | ||
| 79 | #define U300_TIMER_APP_EDDT (0x0044) | ||
| 80 | #define U300_TIMER_APP_EDDT_TIMER_ENABLE (0x00000000) | ||
| 81 | /* Disable DD Timer 32bit (-/W) */ | ||
| 82 | #define U300_TIMER_APP_DDDT (0x0048) | ||
| 83 | #define U300_TIMER_APP_DDDT_TIMER_DISABLE (0x00000000) | ||
| 84 | /* DD Timer Mode Register 32bit (-/W) */ | ||
| 85 | #define U300_TIMER_APP_SDDTM (0x004c) | ||
| 86 | #define U300_TIMER_APP_SDDTM_MODE_CONTINUOUS (0x00000000) | ||
| 87 | #define U300_TIMER_APP_SDDTM_MODE_ONE_SHOT (0x00000001) | ||
| 88 | /* DD Timer Status Register 32bit (R/-) */ | ||
| 89 | #define U300_TIMER_APP_DDTS (0x0050) | ||
| 90 | #define U300_TIMER_APP_DDTS_TIMER_STATE_MASK (0x0000000F) | ||
| 91 | #define U300_TIMER_APP_DDTS_TIMER_STATE_IDLE (0x00000001) | ||
| 92 | #define U300_TIMER_APP_DDTS_TIMER_STATE_ACTIVE (0x00000002) | ||
| 93 | #define U300_TIMER_APP_DDTS_ENABLE_IND (0x00000010) | ||
| 94 | #define U300_TIMER_APP_DDTS_MODE_MASK (0x00000020) | ||
| 95 | #define U300_TIMER_APP_DDTS_MODE_CONTINUOUS (0x00000000) | ||
| 96 | #define U300_TIMER_APP_DDTS_MODE_ONE_SHOT (0x00000020) | ||
| 97 | #define U300_TIMER_APP_DDTS_IRQ_ENABLED_IND (0x00000040) | ||
| 98 | #define U300_TIMER_APP_DDTS_IRQ_PENDING_IND (0x00000080) | ||
| 99 | /* DD Timer Current Count Register 32bit (R/-) */ | ||
| 100 | #define U300_TIMER_APP_DDTCC (0x0054) | ||
| 101 | /* DD Timer Terminal Count Register 32bit (R/W) */ | ||
| 102 | #define U300_TIMER_APP_DDTTC (0x0058) | ||
| 103 | /* DD Timer Interrupt Enable Register 32bit (-/W) */ | ||
| 104 | #define U300_TIMER_APP_DDTIE (0x005c) | ||
| 105 | #define U300_TIMER_APP_DDTIE_IRQ_DISABLE (0x00000000) | ||
| 106 | #define U300_TIMER_APP_DDTIE_IRQ_ENABLE (0x00000001) | ||
| 107 | /* DD Timer Interrupt Acknowledge Register 32bit (-/W) */ | ||
| 108 | #define U300_TIMER_APP_DDTIA (0x0060) | ||
| 109 | #define U300_TIMER_APP_DDTIA_IRQ_ACK (0x00000080) | ||
| 110 | |||
| 111 | /* Reset GP1 Timer 32bit (-/W) */ | ||
| 112 | #define U300_TIMER_APP_RGPT1 (0x0080) | ||
| 113 | #define U300_TIMER_APP_RGPT1_TIMER_RESET (0x00000000) | ||
| 114 | /* Enable GP1 Timer 32bit (-/W) */ | ||
| 115 | #define U300_TIMER_APP_EGPT1 (0x0084) | ||
| 116 | #define U300_TIMER_APP_EGPT1_TIMER_ENABLE (0x00000000) | ||
| 117 | /* Disable GP1 Timer 32bit (-/W) */ | ||
| 118 | #define U300_TIMER_APP_DGPT1 (0x0088) | ||
| 119 | #define U300_TIMER_APP_DGPT1_TIMER_DISABLE (0x00000000) | ||
| 120 | /* GP1 Timer Mode Register 32bit (-/W) */ | ||
| 121 | #define U300_TIMER_APP_SGPT1M (0x008c) | ||
| 122 | #define U300_TIMER_APP_SGPT1M_MODE_CONTINUOUS (0x00000000) | ||
| 123 | #define U300_TIMER_APP_SGPT1M_MODE_ONE_SHOT (0x00000001) | ||
| 124 | /* GP1 Timer Status Register 32bit (R/-) */ | ||
| 125 | #define U300_TIMER_APP_GPT1S (0x0090) | ||
| 126 | #define U300_TIMER_APP_GPT1S_TIMER_STATE_MASK (0x0000000F) | ||
| 127 | #define U300_TIMER_APP_GPT1S_TIMER_STATE_IDLE (0x00000001) | ||
| 128 | #define U300_TIMER_APP_GPT1S_TIMER_STATE_ACTIVE (0x00000002) | ||
| 129 | #define U300_TIMER_APP_GPT1S_ENABLE_IND (0x00000010) | ||
| 130 | #define U300_TIMER_APP_GPT1S_MODE_MASK (0x00000020) | ||
| 131 | #define U300_TIMER_APP_GPT1S_MODE_CONTINUOUS (0x00000000) | ||
| 132 | #define U300_TIMER_APP_GPT1S_MODE_ONE_SHOT (0x00000020) | ||
| 133 | #define U300_TIMER_APP_GPT1S_IRQ_ENABLED_IND (0x00000040) | ||
| 134 | #define U300_TIMER_APP_GPT1S_IRQ_PENDING_IND (0x00000080) | ||
| 135 | /* GP1 Timer Current Count Register 32bit (R/-) */ | ||
| 136 | #define U300_TIMER_APP_GPT1CC (0x0094) | ||
| 137 | /* GP1 Timer Terminal Count Register 32bit (R/W) */ | ||
| 138 | #define U300_TIMER_APP_GPT1TC (0x0098) | ||
| 139 | /* GP1 Timer Interrupt Enable Register 32bit (-/W) */ | ||
| 140 | #define U300_TIMER_APP_GPT1IE (0x009c) | ||
| 141 | #define U300_TIMER_APP_GPT1IE_IRQ_DISABLE (0x00000000) | ||
| 142 | #define U300_TIMER_APP_GPT1IE_IRQ_ENABLE (0x00000001) | ||
| 143 | /* GP1 Timer Interrupt Acknowledge Register 32bit (-/W) */ | ||
| 144 | #define U300_TIMER_APP_GPT1IA (0x00a0) | ||
| 145 | #define U300_TIMER_APP_GPT1IA_IRQ_ACK (0x00000080) | ||
| 146 | |||
| 147 | /* Reset GP2 Timer 32bit (-/W) */ | ||
| 148 | #define U300_TIMER_APP_RGPT2 (0x00c0) | ||
| 149 | #define U300_TIMER_APP_RGPT2_TIMER_RESET (0x00000000) | ||
| 150 | /* Enable GP2 Timer 32bit (-/W) */ | ||
| 151 | #define U300_TIMER_APP_EGPT2 (0x00c4) | ||
| 152 | #define U300_TIMER_APP_EGPT2_TIMER_ENABLE (0x00000000) | ||
| 153 | /* Disable GP2 Timer 32bit (-/W) */ | ||
| 154 | #define U300_TIMER_APP_DGPT2 (0x00c8) | ||
| 155 | #define U300_TIMER_APP_DGPT2_TIMER_DISABLE (0x00000000) | ||
| 156 | /* GP2 Timer Mode Register 32bit (-/W) */ | ||
| 157 | #define U300_TIMER_APP_SGPT2M (0x00cc) | ||
| 158 | #define U300_TIMER_APP_SGPT2M_MODE_CONTINUOUS (0x00000000) | ||
| 159 | #define U300_TIMER_APP_SGPT2M_MODE_ONE_SHOT (0x00000001) | ||
| 160 | /* GP2 Timer Status Register 32bit (R/-) */ | ||
| 161 | #define U300_TIMER_APP_GPT2S (0x00d0) | ||
| 162 | #define U300_TIMER_APP_GPT2S_TIMER_STATE_MASK (0x0000000F) | ||
| 163 | #define U300_TIMER_APP_GPT2S_TIMER_STATE_IDLE (0x00000001) | ||
| 164 | #define U300_TIMER_APP_GPT2S_TIMER_STATE_ACTIVE (0x00000002) | ||
| 165 | #define U300_TIMER_APP_GPT2S_ENABLE_IND (0x00000010) | ||
| 166 | #define U300_TIMER_APP_GPT2S_MODE_MASK (0x00000020) | ||
| 167 | #define U300_TIMER_APP_GPT2S_MODE_CONTINUOUS (0x00000000) | ||
| 168 | #define U300_TIMER_APP_GPT2S_MODE_ONE_SHOT (0x00000020) | ||
| 169 | #define U300_TIMER_APP_GPT2S_IRQ_ENABLED_IND (0x00000040) | ||
| 170 | #define U300_TIMER_APP_GPT2S_IRQ_PENDING_IND (0x00000080) | ||
| 171 | /* GP2 Timer Current Count Register 32bit (R/-) */ | ||
| 172 | #define U300_TIMER_APP_GPT2CC (0x00d4) | ||
| 173 | /* GP2 Timer Terminal Count Register 32bit (R/W) */ | ||
| 174 | #define U300_TIMER_APP_GPT2TC (0x00d8) | ||
| 175 | /* GP2 Timer Interrupt Enable Register 32bit (-/W) */ | ||
| 176 | #define U300_TIMER_APP_GPT2IE (0x00dc) | ||
| 177 | #define U300_TIMER_APP_GPT2IE_IRQ_DISABLE (0x00000000) | ||
| 178 | #define U300_TIMER_APP_GPT2IE_IRQ_ENABLE (0x00000001) | ||
| 179 | /* GP2 Timer Interrupt Acknowledge Register 32bit (-/W) */ | ||
| 180 | #define U300_TIMER_APP_GPT2IA (0x00e0) | ||
| 181 | #define U300_TIMER_APP_GPT2IA_IRQ_ACK (0x00000080) | ||
| 182 | |||
| 183 | /* Clock request control register - all four timers */ | ||
| 184 | #define U300_TIMER_APP_CRC (0x100) | ||
| 185 | #define U300_TIMER_APP_CRC_CLOCK_REQUEST_ENABLE (0x00000001) | ||
| 186 | |||
| 187 | static void __iomem *u300_timer_base; | ||
| 188 | |||
| 189 | struct u300_clockevent_data { | ||
| 190 | struct clock_event_device cevd; | ||
| 191 | unsigned ticks_per_jiffy; | ||
| 192 | }; | ||
| 193 | |||
| 194 | /* | ||
| 195 | * The u300_set_mode() function is always called first, if we | ||
| 196 | * have oneshot timer active, the oneshot scheduling function | ||
| 197 | * u300_set_next_event() is called immediately after. | ||
| 198 | */ | ||
| 199 | static void u300_set_mode(enum clock_event_mode mode, | ||
| 200 | struct clock_event_device *evt) | ||
| 201 | { | ||
| 202 | struct u300_clockevent_data *cevdata = | ||
| 203 | container_of(evt, struct u300_clockevent_data, cevd); | ||
| 204 | |||
| 205 | switch (mode) { | ||
| 206 | case CLOCK_EVT_MODE_PERIODIC: | ||
| 207 | /* Disable interrupts on GPT1 */ | ||
| 208 | writel(U300_TIMER_APP_GPT1IE_IRQ_DISABLE, | ||
| 209 | u300_timer_base + U300_TIMER_APP_GPT1IE); | ||
| 210 | /* Disable GP1 while we're reprogramming it. */ | ||
| 211 | writel(U300_TIMER_APP_DGPT1_TIMER_DISABLE, | ||
| 212 | u300_timer_base + U300_TIMER_APP_DGPT1); | ||
| 213 | /* | ||
| 214 | * Set the periodic mode to a certain number of ticks per | ||
| 215 | * jiffy. | ||
| 216 | */ | ||
| 217 | writel(cevdata->ticks_per_jiffy, | ||
| 218 | u300_timer_base + U300_TIMER_APP_GPT1TC); | ||
| 219 | /* | ||
| 220 | * Set continuous mode, so the timer keeps triggering | ||
| 221 | * interrupts. | ||
| 222 | */ | ||
| 223 | writel(U300_TIMER_APP_SGPT1M_MODE_CONTINUOUS, | ||
| 224 | u300_timer_base + U300_TIMER_APP_SGPT1M); | ||
| 225 | /* Enable timer interrupts */ | ||
| 226 | writel(U300_TIMER_APP_GPT1IE_IRQ_ENABLE, | ||
| 227 | u300_timer_base + U300_TIMER_APP_GPT1IE); | ||
| 228 | /* Then enable the OS timer again */ | ||
| 229 | writel(U300_TIMER_APP_EGPT1_TIMER_ENABLE, | ||
| 230 | u300_timer_base + U300_TIMER_APP_EGPT1); | ||
| 231 | break; | ||
| 232 | case CLOCK_EVT_MODE_ONESHOT: | ||
| 233 | /* Just break; here? */ | ||
| 234 | /* | ||
| 235 | * The actual event will be programmed by the next event hook, | ||
| 236 | * so we just set a dummy value somewhere at the end of the | ||
| 237 | * universe here. | ||
| 238 | */ | ||
| 239 | /* Disable interrupts on GPT1 */ | ||
| 240 | writel(U300_TIMER_APP_GPT1IE_IRQ_DISABLE, | ||
| 241 | u300_timer_base + U300_TIMER_APP_GPT1IE); | ||
| 242 | /* Disable GP1 while we're reprogramming it. */ | ||
| 243 | writel(U300_TIMER_APP_DGPT1_TIMER_DISABLE, | ||
| 244 | u300_timer_base + U300_TIMER_APP_DGPT1); | ||
| 245 | /* | ||
| 246 | * Expire far in the future, u300_set_next_event() will be | ||
| 247 | * called soon... | ||
| 248 | */ | ||
| 249 | writel(0xFFFFFFFF, u300_timer_base + U300_TIMER_APP_GPT1TC); | ||
| 250 | /* We run one shot per tick here! */ | ||
| 251 | writel(U300_TIMER_APP_SGPT1M_MODE_ONE_SHOT, | ||
| 252 | u300_timer_base + U300_TIMER_APP_SGPT1M); | ||
| 253 | /* Enable interrupts for this timer */ | ||
| 254 | writel(U300_TIMER_APP_GPT1IE_IRQ_ENABLE, | ||
| 255 | u300_timer_base + U300_TIMER_APP_GPT1IE); | ||
| 256 | /* Enable timer */ | ||
| 257 | writel(U300_TIMER_APP_EGPT1_TIMER_ENABLE, | ||
| 258 | u300_timer_base + U300_TIMER_APP_EGPT1); | ||
| 259 | break; | ||
| 260 | case CLOCK_EVT_MODE_UNUSED: | ||
| 261 | case CLOCK_EVT_MODE_SHUTDOWN: | ||
| 262 | /* Disable interrupts on GP1 */ | ||
| 263 | writel(U300_TIMER_APP_GPT1IE_IRQ_DISABLE, | ||
| 264 | u300_timer_base + U300_TIMER_APP_GPT1IE); | ||
| 265 | /* Disable GP1 */ | ||
| 266 | writel(U300_TIMER_APP_DGPT1_TIMER_DISABLE, | ||
| 267 | u300_timer_base + U300_TIMER_APP_DGPT1); | ||
| 268 | break; | ||
| 269 | case CLOCK_EVT_MODE_RESUME: | ||
| 270 | /* Ignore this call */ | ||
| 271 | break; | ||
| 272 | } | ||
| 273 | } | ||
| 274 | |||
| 275 | /* | ||
| 276 | * The app timer in one shot mode obviously has to be reprogrammed | ||
| 277 | * in EXACTLY this sequence to work properly. Do NOT try to e.g. replace | ||
| 278 | * the interrupt disable + timer disable commands with a reset command, | ||
| 279 | * it will fail miserably. Apparently (and I found this the hard way) | ||
| 280 | * the timer is very sensitive to the instruction order, though you don't | ||
| 281 | * get that impression from the data sheet. | ||
| 282 | */ | ||
| 283 | static int u300_set_next_event(unsigned long cycles, | ||
| 284 | struct clock_event_device *evt) | ||
| 285 | |||
| 286 | { | ||
| 287 | /* Disable interrupts on GPT1 */ | ||
| 288 | writel(U300_TIMER_APP_GPT1IE_IRQ_DISABLE, | ||
| 289 | u300_timer_base + U300_TIMER_APP_GPT1IE); | ||
| 290 | /* Disable GP1 while we're reprogramming it. */ | ||
| 291 | writel(U300_TIMER_APP_DGPT1_TIMER_DISABLE, | ||
| 292 | u300_timer_base + U300_TIMER_APP_DGPT1); | ||
| 293 | /* Reset the General Purpose timer 1. */ | ||
| 294 | writel(U300_TIMER_APP_RGPT1_TIMER_RESET, | ||
| 295 | u300_timer_base + U300_TIMER_APP_RGPT1); | ||
| 296 | /* IRQ in n * cycles */ | ||
| 297 | writel(cycles, u300_timer_base + U300_TIMER_APP_GPT1TC); | ||
| 298 | /* | ||
| 299 | * We run one shot per tick here! (This is necessary to reconfigure, | ||
| 300 | * the timer will tilt if you don't!) | ||
| 301 | */ | ||
| 302 | writel(U300_TIMER_APP_SGPT1M_MODE_ONE_SHOT, | ||
| 303 | u300_timer_base + U300_TIMER_APP_SGPT1M); | ||
| 304 | /* Enable timer interrupts */ | ||
| 305 | writel(U300_TIMER_APP_GPT1IE_IRQ_ENABLE, | ||
| 306 | u300_timer_base + U300_TIMER_APP_GPT1IE); | ||
| 307 | /* Then enable the OS timer again */ | ||
| 308 | writel(U300_TIMER_APP_EGPT1_TIMER_ENABLE, | ||
| 309 | u300_timer_base + U300_TIMER_APP_EGPT1); | ||
| 310 | return 0; | ||
| 311 | } | ||
| 312 | |||
| 313 | static struct u300_clockevent_data u300_clockevent_data = { | ||
| 314 | /* Use general purpose timer 1 as clock event */ | ||
| 315 | .cevd = { | ||
| 316 | .name = "GPT1", | ||
| 317 | /* Reasonably fast and accurate clock event */ | ||
| 318 | .rating = 300, | ||
| 319 | .features = CLOCK_EVT_FEAT_PERIODIC | | ||
| 320 | CLOCK_EVT_FEAT_ONESHOT, | ||
| 321 | .set_next_event = u300_set_next_event, | ||
| 322 | .set_mode = u300_set_mode, | ||
| 323 | }, | ||
| 324 | }; | ||
| 325 | |||
| 326 | /* Clock event timer interrupt handler */ | ||
| 327 | static irqreturn_t u300_timer_interrupt(int irq, void *dev_id) | ||
| 328 | { | ||
| 329 | struct clock_event_device *evt = &u300_clockevent_data.cevd; | ||
| 330 | /* ACK/Clear timer IRQ for the APP GPT1 Timer */ | ||
| 331 | |||
| 332 | writel(U300_TIMER_APP_GPT1IA_IRQ_ACK, | ||
| 333 | u300_timer_base + U300_TIMER_APP_GPT1IA); | ||
| 334 | evt->event_handler(evt); | ||
| 335 | return IRQ_HANDLED; | ||
| 336 | } | ||
| 337 | |||
| 338 | static struct irqaction u300_timer_irq = { | ||
| 339 | .name = "U300 Timer Tick", | ||
| 340 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | ||
| 341 | .handler = u300_timer_interrupt, | ||
| 342 | }; | ||
| 343 | |||
| 344 | /* | ||
| 345 | * Override the global weak sched_clock symbol with this | ||
| 346 | * local implementation which uses the clocksource to get some | ||
| 347 | * better resolution when scheduling the kernel. We accept that | ||
| 348 | * this wraps around for now, since it is just a relative time | ||
| 349 | * stamp. (Inspired by OMAP implementation.) | ||
| 350 | */ | ||
| 351 | |||
| 352 | static u64 notrace u300_read_sched_clock(void) | ||
| 353 | { | ||
| 354 | return readl(u300_timer_base + U300_TIMER_APP_GPT2CC); | ||
| 355 | } | ||
| 356 | |||
| 357 | static unsigned long u300_read_current_timer(void) | ||
| 358 | { | ||
| 359 | return readl(u300_timer_base + U300_TIMER_APP_GPT2CC); | ||
| 360 | } | ||
| 361 | |||
| 362 | static struct delay_timer u300_delay_timer; | ||
| 363 | |||
| 364 | /* | ||
| 365 | * This sets up the system timers, clock source and clock event. | ||
| 366 | */ | ||
| 367 | static void __init u300_timer_init_of(struct device_node *np) | ||
| 368 | { | ||
| 369 | unsigned int irq; | ||
| 370 | struct clk *clk; | ||
| 371 | unsigned long rate; | ||
| 372 | |||
| 373 | u300_timer_base = of_iomap(np, 0); | ||
| 374 | if (!u300_timer_base) | ||
| 375 | panic("could not ioremap system timer\n"); | ||
| 376 | |||
| 377 | /* Get the IRQ for the GP1 timer */ | ||
| 378 | irq = irq_of_parse_and_map(np, 2); | ||
| 379 | if (!irq) | ||
| 380 | panic("no IRQ for system timer\n"); | ||
| 381 | |||
| 382 | pr_info("U300 GP1 timer @ base: %p, IRQ: %u\n", u300_timer_base, irq); | ||
| 383 | |||
| 384 | /* Clock the interrupt controller */ | ||
| 385 | clk = of_clk_get(np, 0); | ||
| 386 | BUG_ON(IS_ERR(clk)); | ||
| 387 | clk_prepare_enable(clk); | ||
| 388 | rate = clk_get_rate(clk); | ||
| 389 | |||
| 390 | u300_clockevent_data.ticks_per_jiffy = DIV_ROUND_CLOSEST(rate, HZ); | ||
| 391 | |||
| 392 | sched_clock_register(u300_read_sched_clock, 32, rate); | ||
| 393 | |||
| 394 | u300_delay_timer.read_current_timer = &u300_read_current_timer; | ||
| 395 | u300_delay_timer.freq = rate; | ||
| 396 | register_current_timer_delay(&u300_delay_timer); | ||
| 397 | |||
| 398 | /* | ||
| 399 | * Disable the "OS" and "DD" timers - these are designed for Symbian! | ||
| 400 | * Example usage in cnh1601578 cpu subsystem pd_timer_app.c | ||
| 401 | */ | ||
| 402 | writel(U300_TIMER_APP_CRC_CLOCK_REQUEST_ENABLE, | ||
| 403 | u300_timer_base + U300_TIMER_APP_CRC); | ||
| 404 | writel(U300_TIMER_APP_ROST_TIMER_RESET, | ||
| 405 | u300_timer_base + U300_TIMER_APP_ROST); | ||
| 406 | writel(U300_TIMER_APP_DOST_TIMER_DISABLE, | ||
| 407 | u300_timer_base + U300_TIMER_APP_DOST); | ||
| 408 | writel(U300_TIMER_APP_RDDT_TIMER_RESET, | ||
| 409 | u300_timer_base + U300_TIMER_APP_RDDT); | ||
| 410 | writel(U300_TIMER_APP_DDDT_TIMER_DISABLE, | ||
| 411 | u300_timer_base + U300_TIMER_APP_DDDT); | ||
| 412 | |||
| 413 | /* Reset the General Purpose timer 1. */ | ||
| 414 | writel(U300_TIMER_APP_RGPT1_TIMER_RESET, | ||
| 415 | u300_timer_base + U300_TIMER_APP_RGPT1); | ||
| 416 | |||
| 417 | /* Set up the IRQ handler */ | ||
| 418 | setup_irq(irq, &u300_timer_irq); | ||
| 419 | |||
| 420 | /* Reset the General Purpose timer 2 */ | ||
| 421 | writel(U300_TIMER_APP_RGPT2_TIMER_RESET, | ||
| 422 | u300_timer_base + U300_TIMER_APP_RGPT2); | ||
| 423 | /* Set this timer to run around forever */ | ||
| 424 | writel(0xFFFFFFFFU, u300_timer_base + U300_TIMER_APP_GPT2TC); | ||
| 425 | /* Set continuous mode so it wraps around */ | ||
| 426 | writel(U300_TIMER_APP_SGPT2M_MODE_CONTINUOUS, | ||
| 427 | u300_timer_base + U300_TIMER_APP_SGPT2M); | ||
| 428 | /* Disable timer interrupts */ | ||
| 429 | writel(U300_TIMER_APP_GPT2IE_IRQ_DISABLE, | ||
| 430 | u300_timer_base + U300_TIMER_APP_GPT2IE); | ||
| 431 | /* Then enable the GP2 timer to use as a free running us counter */ | ||
| 432 | writel(U300_TIMER_APP_EGPT2_TIMER_ENABLE, | ||
| 433 | u300_timer_base + U300_TIMER_APP_EGPT2); | ||
| 434 | |||
| 435 | /* Use general purpose timer 2 as clock source */ | ||
| 436 | if (clocksource_mmio_init(u300_timer_base + U300_TIMER_APP_GPT2CC, | ||
| 437 | "GPT2", rate, 300, 32, clocksource_mmio_readl_up)) | ||
| 438 | pr_err("timer: failed to initialize U300 clock source\n"); | ||
| 439 | |||
| 440 | /* Configure and register the clockevent */ | ||
| 441 | clockevents_config_and_register(&u300_clockevent_data.cevd, rate, | ||
| 442 | 1, 0xffffffff); | ||
| 443 | |||
| 444 | /* | ||
| 445 | * TODO: init and register the rest of the timers too, they can be | ||
| 446 | * used by hrtimers! | ||
| 447 | */ | ||
| 448 | } | ||
| 449 | |||
| 450 | CLOCKSOURCE_OF_DECLARE(u300_timer, "stericsson,u300-apptimer", | ||
| 451 | u300_timer_init_of); | ||
diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig index 6b04260aa142..f03e75bd0b2b 100644 --- a/arch/arm/mach-zynq/Kconfig +++ b/arch/arm/mach-zynq/Kconfig | |||
| @@ -2,6 +2,8 @@ config ARCH_ZYNQ | |||
| 2 | bool "Xilinx Zynq ARM Cortex A9 Platform" if ARCH_MULTI_V7 | 2 | bool "Xilinx Zynq ARM Cortex A9 Platform" if ARCH_MULTI_V7 |
| 3 | select ARM_AMBA | 3 | select ARM_AMBA |
| 4 | select ARM_GIC | 4 | select ARM_GIC |
| 5 | select ARCH_HAS_CPUFREQ | ||
| 6 | select ARCH_HAS_OPP | ||
| 5 | select COMMON_CLK | 7 | select COMMON_CLK |
| 6 | select CPU_V7 | 8 | select CPU_V7 |
| 7 | select GENERIC_CLOCKEVENTS | 9 | select GENERIC_CLOCKEVENTS |
| @@ -13,6 +15,6 @@ config ARCH_ZYNQ | |||
| 13 | select HAVE_SMP | 15 | select HAVE_SMP |
| 14 | select SPARSE_IRQ | 16 | select SPARSE_IRQ |
| 15 | select CADENCE_TTC_TIMER | 17 | select CADENCE_TTC_TIMER |
| 16 | select ARM_GLOBAL_TIMER | 18 | select ARM_GLOBAL_TIMER if !CPU_FREQ |
| 17 | help | 19 | help |
| 18 | Support for Xilinx Zynq ARM Cortex A9 Platform | 20 | Support for Xilinx Zynq ARM Cortex A9 Platform |
diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index 8c09a8393fb6..a39be8e80856 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c | |||
| @@ -64,6 +64,8 @@ static struct platform_device zynq_cpuidle_device = { | |||
| 64 | */ | 64 | */ |
| 65 | static void __init zynq_init_machine(void) | 65 | static void __init zynq_init_machine(void) |
| 66 | { | 66 | { |
| 67 | struct platform_device_info devinfo = { .name = "cpufreq-cpu0", }; | ||
| 68 | |||
| 67 | /* | 69 | /* |
| 68 | * 64KB way size, 8-way associativity, parity disabled | 70 | * 64KB way size, 8-way associativity, parity disabled |
| 69 | */ | 71 | */ |
| @@ -72,6 +74,7 @@ static void __init zynq_init_machine(void) | |||
| 72 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 74 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
| 73 | 75 | ||
| 74 | platform_device_register(&zynq_cpuidle_device); | 76 | platform_device_register(&zynq_cpuidle_device); |
| 77 | platform_device_register_full(&devinfo); | ||
| 75 | } | 78 | } |
| 76 | 79 | ||
| 77 | static void __init zynq_timer_init(void) | 80 | static void __init zynq_timer_init(void) |
diff --git a/arch/arm/mm/dump.c b/arch/arm/mm/dump.c index 2b3a56414271..ef69152f9b52 100644 --- a/arch/arm/mm/dump.c +++ b/arch/arm/mm/dump.c | |||
| @@ -264,6 +264,9 @@ static void walk_pmd(struct pg_state *st, pud_t *pud, unsigned long start) | |||
| 264 | note_page(st, addr, 3, pmd_val(*pmd)); | 264 | note_page(st, addr, 3, pmd_val(*pmd)); |
| 265 | else | 265 | else |
| 266 | walk_pte(st, pmd, addr); | 266 | walk_pte(st, pmd, addr); |
| 267 | |||
| 268 | if (SECTION_SIZE < PMD_SIZE && pmd_large(pmd[1])) | ||
| 269 | note_page(st, addr + SECTION_SIZE, 3, pmd_val(pmd[1])); | ||
| 267 | } | 270 | } |
| 268 | } | 271 | } |
| 269 | 272 | ||
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 27bbcfc7202a..516d8a7ca697 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig | |||
| @@ -16,6 +16,7 @@ config ARM64 | |||
| 16 | select DCACHE_WORD_ACCESS | 16 | select DCACHE_WORD_ACCESS |
| 17 | select GENERIC_CLOCKEVENTS | 17 | select GENERIC_CLOCKEVENTS |
| 18 | select GENERIC_CLOCKEVENTS_BROADCAST if SMP | 18 | select GENERIC_CLOCKEVENTS_BROADCAST if SMP |
| 19 | select GENERIC_CPU_AUTOPROBE | ||
| 19 | select GENERIC_IOMAP | 20 | select GENERIC_IOMAP |
| 20 | select GENERIC_IRQ_PROBE | 21 | select GENERIC_IRQ_PROBE |
| 21 | select GENERIC_IRQ_SHOW | 22 | select GENERIC_IRQ_SHOW |
| @@ -26,6 +27,7 @@ config ARM64 | |||
| 26 | select GENERIC_TIME_VSYSCALL | 27 | select GENERIC_TIME_VSYSCALL |
| 27 | select HARDIRQS_SW_RESEND | 28 | select HARDIRQS_SW_RESEND |
| 28 | select HAVE_ARCH_JUMP_LABEL | 29 | select HAVE_ARCH_JUMP_LABEL |
| 30 | select HAVE_ARCH_KGDB | ||
| 29 | select HAVE_ARCH_TRACEHOOK | 31 | select HAVE_ARCH_TRACEHOOK |
| 30 | select HAVE_DEBUG_BUGVERBOSE | 32 | select HAVE_DEBUG_BUGVERBOSE |
| 31 | select HAVE_DEBUG_KMEMLEAK | 33 | select HAVE_DEBUG_KMEMLEAK |
| @@ -38,6 +40,8 @@ config ARM64 | |||
| 38 | select HAVE_MEMBLOCK | 40 | select HAVE_MEMBLOCK |
| 39 | select HAVE_PATA_PLATFORM | 41 | select HAVE_PATA_PLATFORM |
| 40 | select HAVE_PERF_EVENTS | 42 | select HAVE_PERF_EVENTS |
| 43 | select HAVE_PERF_REGS | ||
| 44 | select HAVE_PERF_USER_STACK_DUMP | ||
| 41 | select IRQ_DOMAIN | 45 | select IRQ_DOMAIN |
| 42 | select MODULES_USE_ELF_RELA | 46 | select MODULES_USE_ELF_RELA |
| 43 | select NO_BOOTMEM | 47 | select NO_BOOTMEM |
| @@ -73,7 +77,7 @@ config LOCKDEP_SUPPORT | |||
| 73 | config TRACE_IRQFLAGS_SUPPORT | 77 | config TRACE_IRQFLAGS_SUPPORT |
| 74 | def_bool y | 78 | def_bool y |
| 75 | 79 | ||
| 76 | config RWSEM_GENERIC_SPINLOCK | 80 | config RWSEM_XCHGADD_ALGORITHM |
| 77 | def_bool y | 81 | def_bool y |
| 78 | 82 | ||
| 79 | config GENERIC_HWEIGHT | 83 | config GENERIC_HWEIGHT |
| @@ -85,7 +89,7 @@ config GENERIC_CSUM | |||
| 85 | config GENERIC_CALIBRATE_DELAY | 89 | config GENERIC_CALIBRATE_DELAY |
| 86 | def_bool y | 90 | def_bool y |
| 87 | 91 | ||
| 88 | config ZONE_DMA32 | 92 | config ZONE_DMA |
| 89 | def_bool y | 93 | def_bool y |
| 90 | 94 | ||
| 91 | config ARCH_DMA_ADDR_T_64BIT | 95 | config ARCH_DMA_ADDR_T_64BIT |
| @@ -164,6 +168,22 @@ config SMP | |||
| 164 | 168 | ||
| 165 | If you don't know what to do here, say N. | 169 | If you don't know what to do here, say N. |
| 166 | 170 | ||
| 171 | config SCHED_MC | ||
| 172 | bool "Multi-core scheduler support" | ||
| 173 | depends on SMP | ||
| 174 | help | ||
| 175 | Multi-core scheduler support improves the CPU scheduler's decision | ||
| 176 | making when dealing with multi-core CPU chips at a cost of slightly | ||
| 177 | increased overhead in some places. If unsure say N here. | ||
| 178 | |||
| 179 | config SCHED_SMT | ||
| 180 | bool "SMT scheduler support" | ||
| 181 | depends on SMP | ||
| 182 | help | ||
| 183 | Improves the CPU scheduler's decision making when dealing with | ||
| 184 | MultiThreading at a cost of slightly increased overhead in some | ||
| 185 | places. If unsure say N here. | ||
| 186 | |||
| 167 | config NR_CPUS | 187 | config NR_CPUS |
| 168 | int "Maximum number of CPUs (2-32)" | 188 | int "Maximum number of CPUs (2-32)" |
| 169 | range 2 32 | 189 | range 2 32 |
| @@ -301,6 +321,8 @@ menu "CPU Power Management" | |||
| 301 | 321 | ||
| 302 | source "drivers/cpuidle/Kconfig" | 322 | source "drivers/cpuidle/Kconfig" |
| 303 | 323 | ||
| 324 | source "drivers/cpufreq/Kconfig" | ||
| 325 | |||
| 304 | endmenu | 326 | endmenu |
| 305 | 327 | ||
| 306 | source "net/Kconfig" | 328 | source "net/Kconfig" |
diff --git a/arch/arm64/boot/dts/apm-storm.dtsi b/arch/arm64/boot/dts/apm-storm.dtsi index d37d7369e260..93f4b2dd9248 100644 --- a/arch/arm64/boot/dts/apm-storm.dtsi +++ b/arch/arm64/boot/dts/apm-storm.dtsi | |||
| @@ -176,6 +176,87 @@ | |||
| 176 | reg-names = "csr-reg"; | 176 | reg-names = "csr-reg"; |
| 177 | clock-output-names = "eth8clk"; | 177 | clock-output-names = "eth8clk"; |
| 178 | }; | 178 | }; |
| 179 | |||
| 180 | sataphy1clk: sataphy1clk@1f21c000 { | ||
| 181 | compatible = "apm,xgene-device-clock"; | ||
| 182 | #clock-cells = <1>; | ||
| 183 | clocks = <&socplldiv2 0>; | ||
| 184 | reg = <0x0 0x1f21c000 0x0 0x1000>; | ||
| 185 | reg-names = "csr-reg"; | ||
| 186 | clock-output-names = "sataphy1clk"; | ||
| 187 | status = "disabled"; | ||
| 188 | csr-offset = <0x4>; | ||
| 189 | csr-mask = <0x00>; | ||
| 190 | enable-offset = <0x0>; | ||
| 191 | enable-mask = <0x06>; | ||
| 192 | }; | ||
| 193 | |||
| 194 | sataphy2clk: sataphy1clk@1f22c000 { | ||
| 195 | compatible = "apm,xgene-device-clock"; | ||
| 196 | #clock-cells = <1>; | ||
| 197 | clocks = <&socplldiv2 0>; | ||
| 198 | reg = <0x0 0x1f22c000 0x0 0x1000>; | ||
| 199 | reg-names = "csr-reg"; | ||
| 200 | clock-output-names = "sataphy2clk"; | ||
| 201 | status = "ok"; | ||
| 202 | csr-offset = <0x4>; | ||
| 203 | csr-mask = <0x3a>; | ||
| 204 | enable-offset = <0x0>; | ||
| 205 | enable-mask = <0x06>; | ||
| 206 | }; | ||
| 207 | |||
| 208 | sataphy3clk: sataphy1clk@1f23c000 { | ||
| 209 | compatible = "apm,xgene-device-clock"; | ||
| 210 | #clock-cells = <1>; | ||
| 211 | clocks = <&socplldiv2 0>; | ||
| 212 | reg = <0x0 0x1f23c000 0x0 0x1000>; | ||
| 213 | reg-names = "csr-reg"; | ||
| 214 | clock-output-names = "sataphy3clk"; | ||
| 215 | status = "ok"; | ||
| 216 | csr-offset = <0x4>; | ||
| 217 | csr-mask = <0x3a>; | ||
| 218 | enable-offset = <0x0>; | ||
| 219 | enable-mask = <0x06>; | ||
| 220 | }; | ||
| 221 | |||
| 222 | sata01clk: sata01clk@1f21c000 { | ||
| 223 | compatible = "apm,xgene-device-clock"; | ||
| 224 | #clock-cells = <1>; | ||
| 225 | clocks = <&socplldiv2 0>; | ||
| 226 | reg = <0x0 0x1f21c000 0x0 0x1000>; | ||
| 227 | reg-names = "csr-reg"; | ||
| 228 | clock-output-names = "sata01clk"; | ||
| 229 | csr-offset = <0x4>; | ||
| 230 | csr-mask = <0x05>; | ||
| 231 | enable-offset = <0x0>; | ||
| 232 | enable-mask = <0x39>; | ||
| 233 | }; | ||
| 234 | |||
| 235 | sata23clk: sata23clk@1f22c000 { | ||
| 236 | compatible = "apm,xgene-device-clock"; | ||
| 237 | #clock-cells = <1>; | ||
| 238 | clocks = <&socplldiv2 0>; | ||
| 239 | reg = <0x0 0x1f22c000 0x0 0x1000>; | ||
| 240 | reg-names = "csr-reg"; | ||
| 241 | clock-output-names = "sata23clk"; | ||
| 242 | csr-offset = <0x4>; | ||
| 243 | csr-mask = <0x05>; | ||
| 244 | enable-offset = <0x0>; | ||
| 245 | enable-mask = <0x39>; | ||
| 246 | }; | ||
| 247 | |||
| 248 | sata45clk: sata45clk@1f23c000 { | ||
| 249 | compatible = "apm,xgene-device-clock"; | ||
| 250 | #clock-cells = <1>; | ||
| 251 | clocks = <&socplldiv2 0>; | ||
| 252 | reg = <0x0 0x1f23c000 0x0 0x1000>; | ||
| 253 | reg-names = "csr-reg"; | ||
| 254 | clock-output-names = "sata45clk"; | ||
| 255 | csr-offset = <0x4>; | ||
| 256 | csr-mask = <0x05>; | ||
| 257 | enable-offset = <0x0>; | ||
| 258 | enable-mask = <0x39>; | ||
| 259 | }; | ||
| 179 | }; | 260 | }; |
| 180 | 261 | ||
| 181 | serial0: serial@1c020000 { | 262 | serial0: serial@1c020000 { |
| @@ -187,5 +268,76 @@ | |||
| 187 | interrupt-parent = <&gic>; | 268 | interrupt-parent = <&gic>; |
| 188 | interrupts = <0x0 0x4c 0x4>; | 269 | interrupts = <0x0 0x4c 0x4>; |
| 189 | }; | 270 | }; |
| 271 | |||
| 272 | phy1: phy@1f21a000 { | ||
| 273 | compatible = "apm,xgene-phy"; | ||
| 274 | reg = <0x0 0x1f21a000 0x0 0x100>; | ||
| 275 | #phy-cells = <1>; | ||
| 276 | clocks = <&sataphy1clk 0>; | ||
| 277 | status = "disabled"; | ||
| 278 | apm,tx-boost-gain = <30 30 30 30 30 30>; | ||
| 279 | apm,tx-eye-tuning = <2 10 10 2 10 10>; | ||
| 280 | }; | ||
| 281 | |||
| 282 | phy2: phy@1f22a000 { | ||
| 283 | compatible = "apm,xgene-phy"; | ||
| 284 | reg = <0x0 0x1f22a000 0x0 0x100>; | ||
| 285 | #phy-cells = <1>; | ||
| 286 | clocks = <&sataphy2clk 0>; | ||
| 287 | status = "ok"; | ||
| 288 | apm,tx-boost-gain = <30 30 30 30 30 30>; | ||
| 289 | apm,tx-eye-tuning = <1 10 10 2 10 10>; | ||
| 290 | }; | ||
| 291 | |||
| 292 | phy3: phy@1f23a000 { | ||
| 293 | compatible = "apm,xgene-phy"; | ||
| 294 | reg = <0x0 0x1f23a000 0x0 0x100>; | ||
| 295 | #phy-cells = <1>; | ||
| 296 | clocks = <&sataphy3clk 0>; | ||
| 297 | status = "ok"; | ||
| 298 | apm,tx-boost-gain = <31 31 31 31 31 31>; | ||
| 299 | apm,tx-eye-tuning = <2 10 10 2 10 10>; | ||
| 300 | }; | ||
| 301 | |||
| 302 | sata1: sata@1a000000 { | ||
| 303 | compatible = "apm,xgene-ahci"; | ||
| 304 | reg = <0x0 0x1a000000 0x0 0x1000>, | ||
| 305 | <0x0 0x1f210000 0x0 0x1000>, | ||
| 306 | <0x0 0x1f21d000 0x0 0x1000>, | ||
| 307 | <0x0 0x1f21e000 0x0 0x1000>, | ||
| 308 | <0x0 0x1f217000 0x0 0x1000>; | ||
| 309 | interrupts = <0x0 0x86 0x4>; | ||
| 310 | status = "disabled"; | ||
| 311 | clocks = <&sata01clk 0>; | ||
| 312 | phys = <&phy1 0>; | ||
| 313 | phy-names = "sata-phy"; | ||
| 314 | }; | ||
| 315 | |||
| 316 | sata2: sata@1a400000 { | ||
| 317 | compatible = "apm,xgene-ahci"; | ||
| 318 | reg = <0x0 0x1a400000 0x0 0x1000>, | ||
| 319 | <0x0 0x1f220000 0x0 0x1000>, | ||
| 320 | <0x0 0x1f22d000 0x0 0x1000>, | ||
| 321 | <0x0 0x1f22e000 0x0 0x1000>, | ||
| 322 | <0x0 0x1f227000 0x0 0x1000>; | ||
| 323 | interrupts = <0x0 0x87 0x4>; | ||
| 324 | status = "ok"; | ||
| 325 | clocks = <&sata23clk 0>; | ||
| 326 | phys = <&phy2 0>; | ||
| 327 | phy-names = "sata-phy"; | ||
| 328 | }; | ||
| 329 | |||
| 330 | sata3: sata@1a800000 { | ||
| 331 | compatible = "apm,xgene-ahci"; | ||
| 332 | reg = <0x0 0x1a800000 0x0 0x1000>, | ||
| 333 | <0x0 0x1f230000 0x0 0x1000>, | ||
| 334 | <0x0 0x1f23d000 0x0 0x1000>, | ||
| 335 | <0x0 0x1f23e000 0x0 0x1000>; | ||
| 336 | interrupts = <0x0 0x88 0x4>; | ||
| 337 | status = "ok"; | ||
| 338 | clocks = <&sata45clk 0>; | ||
| 339 | phys = <&phy3 0>; | ||
| 340 | phy-names = "sata-phy"; | ||
| 341 | }; | ||
| 190 | }; | 342 | }; |
| 191 | }; | 343 | }; |
diff --git a/arch/arm64/include/asm/Kbuild b/arch/arm64/include/asm/Kbuild index 71c53ecfcc3a..4bca4923fc0b 100644 --- a/arch/arm64/include/asm/Kbuild +++ b/arch/arm64/include/asm/Kbuild | |||
| @@ -12,6 +12,7 @@ generic-y += dma.h | |||
| 12 | generic-y += emergency-restart.h | 12 | generic-y += emergency-restart.h |
| 13 | generic-y += errno.h | 13 | generic-y += errno.h |
| 14 | generic-y += ftrace.h | 14 | generic-y += ftrace.h |
| 15 | generic-y += hash.h | ||
| 15 | generic-y += hw_irq.h | 16 | generic-y += hw_irq.h |
| 16 | generic-y += ioctl.h | 17 | generic-y += ioctl.h |
| 17 | generic-y += ioctls.h | 18 | generic-y += ioctls.h |
| @@ -22,13 +23,16 @@ generic-y += kmap_types.h | |||
| 22 | generic-y += kvm_para.h | 23 | generic-y += kvm_para.h |
| 23 | generic-y += local.h | 24 | generic-y += local.h |
| 24 | generic-y += local64.h | 25 | generic-y += local64.h |
| 26 | generic-y += mcs_spinlock.h | ||
| 25 | generic-y += mman.h | 27 | generic-y += mman.h |
| 26 | generic-y += msgbuf.h | 28 | generic-y += msgbuf.h |
| 27 | generic-y += mutex.h | 29 | generic-y += mutex.h |
| 28 | generic-y += pci.h | 30 | generic-y += pci.h |
| 29 | generic-y += poll.h | 31 | generic-y += poll.h |
| 30 | generic-y += posix_types.h | 32 | generic-y += posix_types.h |
| 33 | generic-y += preempt.h | ||
| 31 | generic-y += resource.h | 34 | generic-y += resource.h |
| 35 | generic-y += rwsem.h | ||
| 32 | generic-y += scatterlist.h | 36 | generic-y += scatterlist.h |
| 33 | generic-y += sections.h | 37 | generic-y += sections.h |
| 34 | generic-y += segment.h | 38 | generic-y += segment.h |
| @@ -38,8 +42,8 @@ generic-y += shmbuf.h | |||
| 38 | generic-y += sizes.h | 42 | generic-y += sizes.h |
| 39 | generic-y += socket.h | 43 | generic-y += socket.h |
| 40 | generic-y += sockios.h | 44 | generic-y += sockios.h |
| 41 | generic-y += switch_to.h | ||
| 42 | generic-y += swab.h | 45 | generic-y += swab.h |
| 46 | generic-y += switch_to.h | ||
| 43 | generic-y += termbits.h | 47 | generic-y += termbits.h |
| 44 | generic-y += termios.h | 48 | generic-y += termios.h |
| 45 | generic-y += topology.h | 49 | generic-y += topology.h |
| @@ -49,5 +53,3 @@ generic-y += unaligned.h | |||
| 49 | generic-y += user.h | 53 | generic-y += user.h |
| 50 | generic-y += vga.h | 54 | generic-y += vga.h |
| 51 | generic-y += xor.h | 55 | generic-y += xor.h |
| 52 | generic-y += preempt.h | ||
| 53 | generic-y += hash.h | ||
diff --git a/arch/arm64/include/asm/barrier.h b/arch/arm64/include/asm/barrier.h index 409ca370cfe2..66eb7648043b 100644 --- a/arch/arm64/include/asm/barrier.h +++ b/arch/arm64/include/asm/barrier.h | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #define wfi() asm volatile("wfi" : : : "memory") | 25 | #define wfi() asm volatile("wfi" : : : "memory") |
| 26 | 26 | ||
| 27 | #define isb() asm volatile("isb" : : : "memory") | 27 | #define isb() asm volatile("isb" : : : "memory") |
| 28 | #define dmb(opt) asm volatile("dmb sy" : : : "memory") | ||
| 28 | #define dsb(opt) asm volatile("dsb sy" : : : "memory") | 29 | #define dsb(opt) asm volatile("dsb sy" : : : "memory") |
| 29 | 30 | ||
| 30 | #define mb() dsb() | 31 | #define mb() dsb() |
diff --git a/arch/arm64/include/asm/cacheflush.h b/arch/arm64/include/asm/cacheflush.h index 889324981aa4..4c60e64a801c 100644 --- a/arch/arm64/include/asm/cacheflush.h +++ b/arch/arm64/include/asm/cacheflush.h | |||
| @@ -85,6 +85,13 @@ static inline void flush_cache_page(struct vm_area_struct *vma, | |||
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | /* | 87 | /* |
| 88 | * Cache maintenance functions used by the DMA API. No to be used directly. | ||
| 89 | */ | ||
| 90 | extern void __dma_map_area(const void *, size_t, int); | ||
| 91 | extern void __dma_unmap_area(const void *, size_t, int); | ||
| 92 | extern void __dma_flush_range(const void *, const void *); | ||
| 93 | |||
| 94 | /* | ||
| 88 | * Copy user data from/to a page which is mapped into a different | 95 | * Copy user data from/to a page which is mapped into a different |
| 89 | * processes address space. Really, we want to allow our "user | 96 | * processes address space. Really, we want to allow our "user |
| 90 | * space" model to handle this. | 97 | * space" model to handle this. |
diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h index fda2704b3f9f..e71f81fe127a 100644 --- a/arch/arm64/include/asm/compat.h +++ b/arch/arm64/include/asm/compat.h | |||
| @@ -228,7 +228,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr) | |||
| 228 | return (u32)(unsigned long)uptr; | 228 | return (u32)(unsigned long)uptr; |
| 229 | } | 229 | } |
| 230 | 230 | ||
| 231 | #define compat_user_stack_pointer() (current_pt_regs()->compat_sp) | 231 | #define compat_user_stack_pointer() (user_stack_pointer(current_pt_regs())) |
| 232 | 232 | ||
| 233 | static inline void __user *arch_compat_alloc_user_space(long len) | 233 | static inline void __user *arch_compat_alloc_user_space(long len) |
| 234 | { | 234 | { |
diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h new file mode 100644 index 000000000000..cd4ac0516488 --- /dev/null +++ b/arch/arm64/include/asm/cpufeature.h | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2014 Linaro Ltd. <ard.biesheuvel@linaro.org> | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License version 2 as | ||
| 6 | * published by the Free Software Foundation. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef __ASM_CPUFEATURE_H | ||
| 10 | #define __ASM_CPUFEATURE_H | ||
| 11 | |||
| 12 | #include <asm/hwcap.h> | ||
| 13 | |||
| 14 | /* | ||
| 15 | * In the arm64 world (as in the ARM world), elf_hwcap is used both internally | ||
| 16 | * in the kernel and for user space to keep track of which optional features | ||
| 17 | * are supported by the current system. So let's map feature 'x' to HWCAP_x. | ||
| 18 | * Note that HWCAP_x constants are bit fields so we need to take the log. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #define MAX_CPU_FEATURES (8 * sizeof(elf_hwcap)) | ||
| 22 | #define cpu_feature(x) ilog2(HWCAP_ ## x) | ||
| 23 | |||
| 24 | static inline bool cpu_have_feature(unsigned int num) | ||
| 25 | { | ||
| 26 | return elf_hwcap & (1UL << num); | ||
| 27 | } | ||
| 28 | |||
| 29 | #endif | ||
diff --git a/arch/arm64/include/asm/debug-monitors.h b/arch/arm64/include/asm/debug-monitors.h index 62314791570c..6e9b5b36921c 100644 --- a/arch/arm64/include/asm/debug-monitors.h +++ b/arch/arm64/include/asm/debug-monitors.h | |||
| @@ -26,6 +26,53 @@ | |||
| 26 | #define DBG_ESR_EVT_HWWP 0x2 | 26 | #define DBG_ESR_EVT_HWWP 0x2 |
| 27 | #define DBG_ESR_EVT_BRK 0x6 | 27 | #define DBG_ESR_EVT_BRK 0x6 |
| 28 | 28 | ||
| 29 | /* | ||
| 30 | * Break point instruction encoding | ||
| 31 | */ | ||
| 32 | #define BREAK_INSTR_SIZE 4 | ||
| 33 | |||
| 34 | /* | ||
| 35 | * ESR values expected for dynamic and compile time BRK instruction | ||
| 36 | */ | ||
| 37 | #define DBG_ESR_VAL_BRK(x) (0xf2000000 | ((x) & 0xfffff)) | ||
| 38 | |||
| 39 | /* | ||
| 40 | * #imm16 values used for BRK instruction generation | ||
| 41 | * Allowed values for kgbd are 0x400 - 0x7ff | ||
| 42 | * 0x400: for dynamic BRK instruction | ||
| 43 | * 0x401: for compile time BRK instruction | ||
| 44 | */ | ||
| 45 | #define KGDB_DYN_DGB_BRK_IMM 0x400 | ||
| 46 | #define KDBG_COMPILED_DBG_BRK_IMM 0x401 | ||
| 47 | |||
| 48 | /* | ||
| 49 | * BRK instruction encoding | ||
| 50 | * The #imm16 value should be placed at bits[20:5] within BRK ins | ||
| 51 | */ | ||
| 52 | #define AARCH64_BREAK_MON 0xd4200000 | ||
| 53 | |||
| 54 | /* | ||
| 55 | * Extract byte from BRK instruction | ||
| 56 | */ | ||
| 57 | #define KGDB_DYN_DGB_BRK_INS_BYTE(x) \ | ||
| 58 | ((((AARCH64_BREAK_MON) & 0xffe0001f) >> (x * 8)) & 0xff) | ||
| 59 | |||
| 60 | /* | ||
| 61 | * Extract byte from BRK #imm16 | ||
| 62 | */ | ||
| 63 | #define KGBD_DYN_DGB_BRK_IMM_BYTE(x) \ | ||
| 64 | (((((KGDB_DYN_DGB_BRK_IMM) & 0xffff) << 5) >> (x * 8)) & 0xff) | ||
| 65 | |||
| 66 | #define KGDB_DYN_DGB_BRK_BYTE(x) \ | ||
| 67 | (KGDB_DYN_DGB_BRK_INS_BYTE(x) | KGBD_DYN_DGB_BRK_IMM_BYTE(x)) | ||
| 68 | |||
| 69 | #define KGDB_DYN_BRK_INS_BYTE0 KGDB_DYN_DGB_BRK_BYTE(0) | ||
| 70 | #define KGDB_DYN_BRK_INS_BYTE1 KGDB_DYN_DGB_BRK_BYTE(1) | ||
| 71 | #define KGDB_DYN_BRK_INS_BYTE2 KGDB_DYN_DGB_BRK_BYTE(2) | ||
| 72 | #define KGDB_DYN_BRK_INS_BYTE3 KGDB_DYN_DGB_BRK_BYTE(3) | ||
| 73 | |||
| 74 | #define CACHE_FLUSH_IS_SAFE 1 | ||
| 75 | |||
| 29 | enum debug_el { | 76 | enum debug_el { |
| 30 | DBG_ACTIVE_EL0 = 0, | 77 | DBG_ACTIVE_EL0 = 0, |
| 31 | DBG_ACTIVE_EL1, | 78 | DBG_ACTIVE_EL1, |
| @@ -43,23 +90,6 @@ enum debug_el { | |||
| 43 | #ifndef __ASSEMBLY__ | 90 | #ifndef __ASSEMBLY__ |
| 44 | struct task_struct; | 91 | struct task_struct; |
| 45 | 92 | ||
| 46 | #define local_dbg_save(flags) \ | ||
| 47 | do { \ | ||
| 48 | typecheck(unsigned long, flags); \ | ||
| 49 | asm volatile( \ | ||
| 50 | "mrs %0, daif // local_dbg_save\n" \ | ||
| 51 | "msr daifset, #8" \ | ||
| 52 | : "=r" (flags) : : "memory"); \ | ||
| 53 | } while (0) | ||
| 54 | |||
| 55 | #define local_dbg_restore(flags) \ | ||
| 56 | do { \ | ||
| 57 | typecheck(unsigned long, flags); \ | ||
| 58 | asm volatile( \ | ||
| 59 | "msr daif, %0 // local_dbg_restore\n" \ | ||
| 60 | : : "r" (flags) : "memory"); \ | ||
| 61 | } while (0) | ||
| 62 | |||
| 63 | #define DBG_ARCH_ID_RESERVED 0 /* In case of ptrace ABI updates. */ | 93 | #define DBG_ARCH_ID_RESERVED 0 /* In case of ptrace ABI updates. */ |
| 64 | 94 | ||
| 65 | #define DBG_HOOK_HANDLED 0 | 95 | #define DBG_HOOK_HANDLED 0 |
diff --git a/arch/arm64/include/asm/dma-mapping.h b/arch/arm64/include/asm/dma-mapping.h index fd0c0c0e447a..3a4572ec3273 100644 --- a/arch/arm64/include/asm/dma-mapping.h +++ b/arch/arm64/include/asm/dma-mapping.h | |||
| @@ -30,6 +30,8 @@ | |||
| 30 | 30 | ||
| 31 | #define DMA_ERROR_CODE (~(dma_addr_t)0) | 31 | #define DMA_ERROR_CODE (~(dma_addr_t)0) |
| 32 | extern struct dma_map_ops *dma_ops; | 32 | extern struct dma_map_ops *dma_ops; |
| 33 | extern struct dma_map_ops coherent_swiotlb_dma_ops; | ||
| 34 | extern struct dma_map_ops noncoherent_swiotlb_dma_ops; | ||
| 33 | 35 | ||
| 34 | static inline struct dma_map_ops *__generic_dma_ops(struct device *dev) | 36 | static inline struct dma_map_ops *__generic_dma_ops(struct device *dev) |
| 35 | { | 37 | { |
| @@ -47,6 +49,11 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev) | |||
| 47 | return __generic_dma_ops(dev); | 49 | return __generic_dma_ops(dev); |
| 48 | } | 50 | } |
| 49 | 51 | ||
| 52 | static inline void set_dma_ops(struct device *dev, struct dma_map_ops *ops) | ||
| 53 | { | ||
| 54 | dev->archdata.dma_ops = ops; | ||
| 55 | } | ||
| 56 | |||
| 50 | #include <asm-generic/dma-mapping-common.h> | 57 | #include <asm-generic/dma-mapping-common.h> |
| 51 | 58 | ||
| 52 | static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) | 59 | static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) |
diff --git a/arch/arm64/include/asm/hwcap.h b/arch/arm64/include/asm/hwcap.h index 6cddbb0c9f54..024c46183c3c 100644 --- a/arch/arm64/include/asm/hwcap.h +++ b/arch/arm64/include/asm/hwcap.h | |||
| @@ -32,6 +32,12 @@ | |||
| 32 | #define COMPAT_HWCAP_IDIV (COMPAT_HWCAP_IDIVA|COMPAT_HWCAP_IDIVT) | 32 | #define COMPAT_HWCAP_IDIV (COMPAT_HWCAP_IDIVA|COMPAT_HWCAP_IDIVT) |
| 33 | #define COMPAT_HWCAP_EVTSTRM (1 << 21) | 33 | #define COMPAT_HWCAP_EVTSTRM (1 << 21) |
| 34 | 34 | ||
| 35 | #define COMPAT_HWCAP2_AES (1 << 0) | ||
| 36 | #define COMPAT_HWCAP2_PMULL (1 << 1) | ||
| 37 | #define COMPAT_HWCAP2_SHA1 (1 << 2) | ||
| 38 | #define COMPAT_HWCAP2_SHA2 (1 << 3) | ||
| 39 | #define COMPAT_HWCAP2_CRC32 (1 << 4) | ||
| 40 | |||
| 35 | #ifndef __ASSEMBLY__ | 41 | #ifndef __ASSEMBLY__ |
| 36 | /* | 42 | /* |
| 37 | * This yields a mask that user programs can use to figure out what | 43 | * This yields a mask that user programs can use to figure out what |
| @@ -41,7 +47,8 @@ | |||
| 41 | 47 | ||
| 42 | #ifdef CONFIG_COMPAT | 48 | #ifdef CONFIG_COMPAT |
| 43 | #define COMPAT_ELF_HWCAP (compat_elf_hwcap) | 49 | #define COMPAT_ELF_HWCAP (compat_elf_hwcap) |
| 44 | extern unsigned int compat_elf_hwcap; | 50 | #define COMPAT_ELF_HWCAP2 (compat_elf_hwcap2) |
| 51 | extern unsigned int compat_elf_hwcap, compat_elf_hwcap2; | ||
| 45 | #endif | 52 | #endif |
| 46 | 53 | ||
| 47 | extern unsigned long elf_hwcap; | 54 | extern unsigned long elf_hwcap; |
diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h index 4cc813eddacb..7846a6bb0833 100644 --- a/arch/arm64/include/asm/io.h +++ b/arch/arm64/include/asm/io.h | |||
| @@ -121,7 +121,7 @@ static inline u64 __raw_readq(const volatile void __iomem *addr) | |||
| 121 | * I/O port access primitives. | 121 | * I/O port access primitives. |
| 122 | */ | 122 | */ |
| 123 | #define IO_SPACE_LIMIT 0xffff | 123 | #define IO_SPACE_LIMIT 0xffff |
| 124 | #define PCI_IOBASE ((void __iomem *)(MODULES_VADDR - SZ_2M)) | 124 | #define PCI_IOBASE ((void __iomem *)(MODULES_VADDR - SZ_32M)) |
| 125 | 125 | ||
| 126 | static inline u8 inb(unsigned long addr) | 126 | static inline u8 inb(unsigned long addr) |
| 127 | { | 127 | { |
diff --git a/arch/arm64/include/asm/irqflags.h b/arch/arm64/include/asm/irqflags.h index b2fcfbc51ecc..11cc941bd107 100644 --- a/arch/arm64/include/asm/irqflags.h +++ b/arch/arm64/include/asm/irqflags.h | |||
| @@ -90,5 +90,28 @@ static inline int arch_irqs_disabled_flags(unsigned long flags) | |||
| 90 | return flags & PSR_I_BIT; | 90 | return flags & PSR_I_BIT; |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | /* | ||
| 94 | * save and restore debug state | ||
| 95 | */ | ||
| 96 | #define local_dbg_save(flags) \ | ||
| 97 | do { \ | ||
| 98 | typecheck(unsigned long, flags); \ | ||
| 99 | asm volatile( \ | ||
| 100 | "mrs %0, daif // local_dbg_save\n" \ | ||
| 101 | "msr daifset, #8" \ | ||
| 102 | : "=r" (flags) : : "memory"); \ | ||
| 103 | } while (0) | ||
| 104 | |||
| 105 | #define local_dbg_restore(flags) \ | ||
| 106 | do { \ | ||
| 107 | typecheck(unsigned long, flags); \ | ||
| 108 | asm volatile( \ | ||
| 109 | "msr daif, %0 // local_dbg_restore\n" \ | ||
| 110 | : : "r" (flags) : "memory"); \ | ||
| 111 | } while (0) | ||
| 112 | |||
| 113 | #define local_dbg_enable() asm("msr daifclr, #8" : : : "memory") | ||
| 114 | #define local_dbg_disable() asm("msr daifset, #8" : : : "memory") | ||
| 115 | |||
| 93 | #endif | 116 | #endif |
| 94 | #endif | 117 | #endif |
diff --git a/arch/arm64/include/asm/kgdb.h b/arch/arm64/include/asm/kgdb.h new file mode 100644 index 000000000000..3c8aafc1082f --- /dev/null +++ b/arch/arm64/include/asm/kgdb.h | |||
| @@ -0,0 +1,84 @@ | |||
| 1 | /* | ||
| 2 | * AArch64 KGDB support | ||
| 3 | * | ||
| 4 | * Based on arch/arm/include/kgdb.h | ||
| 5 | * | ||
| 6 | * Copyright (C) 2013 Cavium Inc. | ||
| 7 | * Author: Vijaya Kumar K <vijaya.kumar@caviumnetworks.com> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License version 2 as | ||
| 11 | * published by the Free Software Foundation. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License | ||
| 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #ifndef __ARM_KGDB_H | ||
| 23 | #define __ARM_KGDB_H | ||
| 24 | |||
| 25 | #include <linux/ptrace.h> | ||
| 26 | #include <asm/debug-monitors.h> | ||
| 27 | |||
| 28 | #ifndef __ASSEMBLY__ | ||
| 29 | |||
| 30 | static inline void arch_kgdb_breakpoint(void) | ||
| 31 | { | ||
| 32 | asm ("brk %0" : : "I" (KDBG_COMPILED_DBG_BRK_IMM)); | ||
| 33 | } | ||
| 34 | |||
| 35 | extern void kgdb_handle_bus_error(void); | ||
| 36 | extern int kgdb_fault_expected; | ||
| 37 | |||
| 38 | #endif /* !__ASSEMBLY__ */ | ||
| 39 | |||
| 40 | /* | ||
| 41 | * gdb is expecting the following registers layout. | ||
| 42 | * | ||
| 43 | * General purpose regs: | ||
| 44 | * r0-r30: 64 bit | ||
| 45 | * sp,pc : 64 bit | ||
| 46 | * pstate : 64 bit | ||
| 47 | * Total: 34 | ||
| 48 | * FPU regs: | ||
| 49 | * f0-f31: 128 bit | ||
| 50 | * Total: 32 | ||
| 51 | * Extra regs | ||
| 52 | * fpsr & fpcr: 32 bit | ||
| 53 | * Total: 2 | ||
| 54 | * | ||
| 55 | */ | ||
| 56 | |||
| 57 | #define _GP_REGS 34 | ||
| 58 | #define _FP_REGS 32 | ||
| 59 | #define _EXTRA_REGS 2 | ||
| 60 | /* | ||
| 61 | * general purpose registers size in bytes. | ||
| 62 | * pstate is only 4 bytes. subtract 4 bytes | ||
| 63 | */ | ||
| 64 | #define GP_REG_BYTES (_GP_REGS * 8) | ||
| 65 | #define DBG_MAX_REG_NUM (_GP_REGS + _FP_REGS + _EXTRA_REGS) | ||
| 66 | |||
| 67 | /* | ||
| 68 | * Size of I/O buffer for gdb packet. | ||
| 69 | * considering to hold all register contents, size is set | ||
| 70 | */ | ||
| 71 | |||
| 72 | #define BUFMAX 2048 | ||
| 73 | |||
| 74 | /* | ||
| 75 | * Number of bytes required for gdb_regs buffer. | ||
| 76 | * _GP_REGS: 8 bytes, _FP_REGS: 16 bytes and _EXTRA_REGS: 4 bytes each | ||
| 77 | * GDB fails to connect for size beyond this with error | ||
| 78 | * "'g' packet reply is too long" | ||
| 79 | */ | ||
| 80 | |||
| 81 | #define NUMREGBYTES ((_GP_REGS * 8) + (_FP_REGS * 16) + \ | ||
| 82 | (_EXTRA_REGS * 4)) | ||
| 83 | |||
| 84 | #endif /* __ASM_KGDB_H */ | ||
diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h index 0eb398655378..21ef48d32ff2 100644 --- a/arch/arm64/include/asm/kvm_arm.h +++ b/arch/arm64/include/asm/kvm_arm.h | |||
| @@ -106,7 +106,6 @@ | |||
| 106 | 106 | ||
| 107 | /* VTCR_EL2 Registers bits */ | 107 | /* VTCR_EL2 Registers bits */ |
| 108 | #define VTCR_EL2_PS_MASK (7 << 16) | 108 | #define VTCR_EL2_PS_MASK (7 << 16) |
| 109 | #define VTCR_EL2_PS_40B (2 << 16) | ||
| 110 | #define VTCR_EL2_TG0_MASK (1 << 14) | 109 | #define VTCR_EL2_TG0_MASK (1 << 14) |
| 111 | #define VTCR_EL2_TG0_4K (0 << 14) | 110 | #define VTCR_EL2_TG0_4K (0 << 14) |
| 112 | #define VTCR_EL2_TG0_64K (1 << 14) | 111 | #define VTCR_EL2_TG0_64K (1 << 14) |
| @@ -129,10 +128,9 @@ | |||
| 129 | * 64kB pages (TG0 = 1) | 128 | * 64kB pages (TG0 = 1) |
| 130 | * 2 level page tables (SL = 1) | 129 | * 2 level page tables (SL = 1) |
| 131 | */ | 130 | */ |
| 132 | #define VTCR_EL2_FLAGS (VTCR_EL2_PS_40B | VTCR_EL2_TG0_64K | \ | 131 | #define VTCR_EL2_FLAGS (VTCR_EL2_TG0_64K | VTCR_EL2_SH0_INNER | \ |
| 133 | VTCR_EL2_SH0_INNER | VTCR_EL2_ORGN0_WBWA | \ | 132 | VTCR_EL2_ORGN0_WBWA | VTCR_EL2_IRGN0_WBWA | \ |
| 134 | VTCR_EL2_IRGN0_WBWA | VTCR_EL2_SL0_LVL1 | \ | 133 | VTCR_EL2_SL0_LVL1 | VTCR_EL2_T0SZ_40B) |
| 135 | VTCR_EL2_T0SZ_40B) | ||
| 136 | #define VTTBR_X (38 - VTCR_EL2_T0SZ_40B) | 134 | #define VTTBR_X (38 - VTCR_EL2_T0SZ_40B) |
| 137 | #else | 135 | #else |
| 138 | /* | 136 | /* |
| @@ -142,10 +140,9 @@ | |||
| 142 | * 4kB pages (TG0 = 0) | 140 | * 4kB pages (TG0 = 0) |
| 143 | * 3 level page tables (SL = 1) | 141 | * 3 level page tables (SL = 1) |
| 144 | */ | 142 | */ |
| 145 | #define VTCR_EL2_FLAGS (VTCR_EL2_PS_40B | VTCR_EL2_TG0_4K | \ | 143 | #define VTCR_EL2_FLAGS (VTCR_EL2_TG0_4K | VTCR_EL2_SH0_INNER | \ |
| 146 | VTCR_EL2_SH0_INNER | VTCR_EL2_ORGN0_WBWA | \ | 144 | VTCR_EL2_ORGN0_WBWA | VTCR_EL2_IRGN0_WBWA | \ |
| 147 | VTCR_EL2_IRGN0_WBWA | VTCR_EL2_SL0_LVL1 | \ | 145 | VTCR_EL2_SL0_LVL1 | VTCR_EL2_T0SZ_40B) |
| 148 | VTCR_EL2_T0SZ_40B) | ||
| 149 | #define VTTBR_X (37 - VTCR_EL2_T0SZ_40B) | 146 | #define VTTBR_X (37 - VTCR_EL2_T0SZ_40B) |
| 150 | #endif | 147 | #endif |
| 151 | 148 | ||
diff --git a/arch/arm64/include/asm/percpu.h b/arch/arm64/include/asm/percpu.h index 13fb0b3efc5f..453a179469a3 100644 --- a/arch/arm64/include/asm/percpu.h +++ b/arch/arm64/include/asm/percpu.h | |||
| @@ -16,6 +16,8 @@ | |||
| 16 | #ifndef __ASM_PERCPU_H | 16 | #ifndef __ASM_PERCPU_H |
| 17 | #define __ASM_PERCPU_H | 17 | #define __ASM_PERCPU_H |
| 18 | 18 | ||
| 19 | #ifdef CONFIG_SMP | ||
| 20 | |||
| 19 | static inline void set_my_cpu_offset(unsigned long off) | 21 | static inline void set_my_cpu_offset(unsigned long off) |
| 20 | { | 22 | { |
| 21 | asm volatile("msr tpidr_el1, %0" :: "r" (off) : "memory"); | 23 | asm volatile("msr tpidr_el1, %0" :: "r" (off) : "memory"); |
| @@ -36,6 +38,12 @@ static inline unsigned long __my_cpu_offset(void) | |||
| 36 | } | 38 | } |
| 37 | #define __my_cpu_offset __my_cpu_offset() | 39 | #define __my_cpu_offset __my_cpu_offset() |
| 38 | 40 | ||
| 41 | #else /* !CONFIG_SMP */ | ||
| 42 | |||
| 43 | #define set_my_cpu_offset(x) do { } while (0) | ||
| 44 | |||
| 45 | #endif /* CONFIG_SMP */ | ||
| 46 | |||
| 39 | #include <asm-generic/percpu.h> | 47 | #include <asm-generic/percpu.h> |
| 40 | 48 | ||
| 41 | #endif /* __ASM_PERCPU_H */ | 49 | #endif /* __ASM_PERCPU_H */ |
diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h index b1d2e26c3c88..f7af66b54cb2 100644 --- a/arch/arm64/include/asm/pgtable-hwdef.h +++ b/arch/arm64/include/asm/pgtable-hwdef.h | |||
| @@ -100,9 +100,9 @@ | |||
| 100 | #define PTE_HYP PTE_USER | 100 | #define PTE_HYP PTE_USER |
| 101 | 101 | ||
| 102 | /* | 102 | /* |
| 103 | * 40-bit physical address supported. | 103 | * Highest possible physical address supported. |
| 104 | */ | 104 | */ |
| 105 | #define PHYS_MASK_SHIFT (40) | 105 | #define PHYS_MASK_SHIFT (48) |
| 106 | #define PHYS_MASK ((UL(1) << PHYS_MASK_SHIFT) - 1) | 106 | #define PHYS_MASK ((UL(1) << PHYS_MASK_SHIFT) - 1) |
| 107 | 107 | ||
| 108 | /* | 108 | /* |
| @@ -122,7 +122,6 @@ | |||
| 122 | #define TCR_SHARED ((UL(3) << 12) | (UL(3) << 28)) | 122 | #define TCR_SHARED ((UL(3) << 12) | (UL(3) << 28)) |
| 123 | #define TCR_TG0_64K (UL(1) << 14) | 123 | #define TCR_TG0_64K (UL(1) << 14) |
| 124 | #define TCR_TG1_64K (UL(1) << 30) | 124 | #define TCR_TG1_64K (UL(1) << 30) |
| 125 | #define TCR_IPS_40BIT (UL(2) << 32) | ||
| 126 | #define TCR_ASID16 (UL(1) << 36) | 125 | #define TCR_ASID16 (UL(1) << 36) |
| 127 | #define TCR_TBI0 (UL(1) << 37) | 126 | #define TCR_TBI0 (UL(1) << 37) |
| 128 | 127 | ||
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index b524dcd17243..90c811f05a2e 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h | |||
| @@ -136,11 +136,11 @@ extern struct page *empty_zero_page; | |||
| 136 | /* | 136 | /* |
| 137 | * The following only work if pte_present(). Undefined behaviour otherwise. | 137 | * The following only work if pte_present(). Undefined behaviour otherwise. |
| 138 | */ | 138 | */ |
| 139 | #define pte_present(pte) (pte_val(pte) & (PTE_VALID | PTE_PROT_NONE)) | 139 | #define pte_present(pte) (!!(pte_val(pte) & (PTE_VALID | PTE_PROT_NONE))) |
| 140 | #define pte_dirty(pte) (pte_val(pte) & PTE_DIRTY) | 140 | #define pte_dirty(pte) (!!(pte_val(pte) & PTE_DIRTY)) |
| 141 | #define pte_young(pte) (pte_val(pte) & PTE_AF) | 141 | #define pte_young(pte) (!!(pte_val(pte) & PTE_AF)) |
| 142 | #define pte_special(pte) (pte_val(pte) & PTE_SPECIAL) | 142 | #define pte_special(pte) (!!(pte_val(pte) & PTE_SPECIAL)) |
| 143 | #define pte_write(pte) (pte_val(pte) & PTE_WRITE) | 143 | #define pte_write(pte) (!!(pte_val(pte) & PTE_WRITE)) |
| 144 | #define pte_exec(pte) (!(pte_val(pte) & PTE_UXN)) | 144 | #define pte_exec(pte) (!(pte_val(pte) & PTE_UXN)) |
| 145 | 145 | ||
| 146 | #define pte_valid_user(pte) \ | 146 | #define pte_valid_user(pte) \ |
| @@ -199,7 +199,7 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, | |||
| 199 | pte_t *ptep, pte_t pte) | 199 | pte_t *ptep, pte_t pte) |
| 200 | { | 200 | { |
| 201 | if (pte_valid_user(pte)) { | 201 | if (pte_valid_user(pte)) { |
| 202 | if (pte_exec(pte)) | 202 | if (!pte_special(pte) && pte_exec(pte)) |
| 203 | __sync_icache_dcache(pte, addr); | 203 | __sync_icache_dcache(pte, addr); |
| 204 | if (pte_dirty(pte) && pte_write(pte)) | 204 | if (pte_dirty(pte) && pte_write(pte)) |
| 205 | pte_val(pte) &= ~PTE_RDONLY; | 205 | pte_val(pte) &= ~PTE_RDONLY; |
| @@ -227,36 +227,36 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, | |||
| 227 | 227 | ||
| 228 | #define __HAVE_ARCH_PTE_SPECIAL | 228 | #define __HAVE_ARCH_PTE_SPECIAL |
| 229 | 229 | ||
| 230 | /* | 230 | static inline pte_t pmd_pte(pmd_t pmd) |
| 231 | * Software PMD bits for THP | 231 | { |
| 232 | */ | 232 | return __pte(pmd_val(pmd)); |
| 233 | } | ||
| 233 | 234 | ||
| 234 | #define PMD_SECT_DIRTY (_AT(pmdval_t, 1) << 55) | 235 | static inline pmd_t pte_pmd(pte_t pte) |
| 235 | #define PMD_SECT_SPLITTING (_AT(pmdval_t, 1) << 57) | 236 | { |
| 237 | return __pmd(pte_val(pte)); | ||
| 238 | } | ||
| 236 | 239 | ||
| 237 | /* | 240 | /* |
| 238 | * THP definitions. | 241 | * THP definitions. |
| 239 | */ | 242 | */ |
| 240 | #define pmd_young(pmd) (pmd_val(pmd) & PMD_SECT_AF) | ||
| 241 | |||
| 242 | #define __HAVE_ARCH_PMD_WRITE | ||
| 243 | #define pmd_write(pmd) (!(pmd_val(pmd) & PMD_SECT_RDONLY)) | ||
| 244 | 243 | ||
| 245 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 244 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
| 246 | #define pmd_trans_huge(pmd) (pmd_val(pmd) && !(pmd_val(pmd) & PMD_TABLE_BIT)) | 245 | #define pmd_trans_huge(pmd) (pmd_val(pmd) && !(pmd_val(pmd) & PMD_TABLE_BIT)) |
| 247 | #define pmd_trans_splitting(pmd) (pmd_val(pmd) & PMD_SECT_SPLITTING) | 246 | #define pmd_trans_splitting(pmd) pte_special(pmd_pte(pmd)) |
| 248 | #endif | 247 | #endif |
| 249 | 248 | ||
| 250 | #define PMD_BIT_FUNC(fn,op) \ | 249 | #define pmd_young(pmd) pte_young(pmd_pte(pmd)) |
| 251 | static inline pmd_t pmd_##fn(pmd_t pmd) { pmd_val(pmd) op; return pmd; } | 250 | #define pmd_wrprotect(pmd) pte_pmd(pte_wrprotect(pmd_pte(pmd))) |
| 251 | #define pmd_mksplitting(pmd) pte_pmd(pte_mkspecial(pmd_pte(pmd))) | ||
| 252 | #define pmd_mkold(pmd) pte_pmd(pte_mkold(pmd_pte(pmd))) | ||
| 253 | #define pmd_mkwrite(pmd) pte_pmd(pte_mkwrite(pmd_pte(pmd))) | ||
| 254 | #define pmd_mkdirty(pmd) pte_pmd(pte_mkdirty(pmd_pte(pmd))) | ||
| 255 | #define pmd_mkyoung(pmd) pte_pmd(pte_mkyoung(pmd_pte(pmd))) | ||
| 256 | #define pmd_mknotpresent(pmd) (__pmd(pmd_val(pmd) &= ~PMD_TYPE_MASK)) | ||
| 252 | 257 | ||
| 253 | PMD_BIT_FUNC(wrprotect, |= PMD_SECT_RDONLY); | 258 | #define __HAVE_ARCH_PMD_WRITE |
| 254 | PMD_BIT_FUNC(mkold, &= ~PMD_SECT_AF); | 259 | #define pmd_write(pmd) pte_write(pmd_pte(pmd)) |
| 255 | PMD_BIT_FUNC(mksplitting, |= PMD_SECT_SPLITTING); | ||
| 256 | PMD_BIT_FUNC(mkwrite, &= ~PMD_SECT_RDONLY); | ||
| 257 | PMD_BIT_FUNC(mkdirty, |= PMD_SECT_DIRTY); | ||
| 258 | PMD_BIT_FUNC(mkyoung, |= PMD_SECT_AF); | ||
| 259 | PMD_BIT_FUNC(mknotpresent, &= ~PMD_TYPE_MASK); | ||
| 260 | 260 | ||
| 261 | #define pmd_mkhuge(pmd) (__pmd(pmd_val(pmd) & ~PMD_TABLE_BIT)) | 261 | #define pmd_mkhuge(pmd) (__pmd(pmd_val(pmd) & ~PMD_TABLE_BIT)) |
| 262 | 262 | ||
| @@ -266,15 +266,6 @@ PMD_BIT_FUNC(mknotpresent, &= ~PMD_TYPE_MASK); | |||
| 266 | 266 | ||
| 267 | #define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd) & PHYS_MASK)) | 267 | #define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd) & PHYS_MASK)) |
| 268 | 268 | ||
| 269 | static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot) | ||
| 270 | { | ||
| 271 | const pmdval_t mask = PMD_SECT_USER | PMD_SECT_PXN | PMD_SECT_UXN | | ||
| 272 | PMD_SECT_RDONLY | PMD_SECT_PROT_NONE | | ||
| 273 | PMD_SECT_VALID; | ||
| 274 | pmd_val(pmd) = (pmd_val(pmd) & ~mask) | (pgprot_val(newprot) & mask); | ||
| 275 | return pmd; | ||
| 276 | } | ||
| 277 | |||
| 278 | #define set_pmd_at(mm, addr, pmdp, pmd) set_pmd(pmdp, pmd) | 269 | #define set_pmd_at(mm, addr, pmdp, pmd) set_pmd(pmdp, pmd) |
| 279 | 270 | ||
| 280 | static inline int has_transparent_hugepage(void) | 271 | static inline int has_transparent_hugepage(void) |
| @@ -286,11 +277,9 @@ static inline int has_transparent_hugepage(void) | |||
| 286 | * Mark the prot value as uncacheable and unbufferable. | 277 | * Mark the prot value as uncacheable and unbufferable. |
| 287 | */ | 278 | */ |
| 288 | #define pgprot_noncached(prot) \ | 279 | #define pgprot_noncached(prot) \ |
| 289 | __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRnE)) | 280 | __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRnE) | PTE_PXN | PTE_UXN) |
| 290 | #define pgprot_writecombine(prot) \ | 281 | #define pgprot_writecombine(prot) \ |
| 291 | __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC)) | 282 | __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC) | PTE_PXN | PTE_UXN) |
| 292 | #define pgprot_dmacoherent(prot) \ | ||
| 293 | __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC)) | ||
| 294 | #define __HAVE_PHYS_MEM_ACCESS_PROT | 283 | #define __HAVE_PHYS_MEM_ACCESS_PROT |
| 295 | struct file; | 284 | struct file; |
| 296 | extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, | 285 | extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, |
| @@ -383,6 +372,11 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | |||
| 383 | return pte; | 372 | return pte; |
| 384 | } | 373 | } |
| 385 | 374 | ||
| 375 | static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot) | ||
| 376 | { | ||
| 377 | return pte_pmd(pte_modify(pmd_pte(pmd), newprot)); | ||
| 378 | } | ||
| 379 | |||
| 386 | extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; | 380 | extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; |
| 387 | extern pgd_t idmap_pg_dir[PTRS_PER_PGD]; | 381 | extern pgd_t idmap_pg_dir[PTRS_PER_PGD]; |
| 388 | 382 | ||
diff --git a/arch/arm64/include/asm/psci.h b/arch/arm64/include/asm/psci.h index e5312ea0ec1a..d15ab8b46336 100644 --- a/arch/arm64/include/asm/psci.h +++ b/arch/arm64/include/asm/psci.h | |||
| @@ -14,6 +14,6 @@ | |||
| 14 | #ifndef __ASM_PSCI_H | 14 | #ifndef __ASM_PSCI_H |
| 15 | #define __ASM_PSCI_H | 15 | #define __ASM_PSCI_H |
| 16 | 16 | ||
| 17 | int psci_init(void); | 17 | void psci_init(void); |
| 18 | 18 | ||
| 19 | #endif /* __ASM_PSCI_H */ | 19 | #endif /* __ASM_PSCI_H */ |
diff --git a/arch/arm64/include/asm/ptrace.h b/arch/arm64/include/asm/ptrace.h index 0e7fa4963735..c7ba261dd4b3 100644 --- a/arch/arm64/include/asm/ptrace.h +++ b/arch/arm64/include/asm/ptrace.h | |||
| @@ -68,6 +68,7 @@ | |||
| 68 | 68 | ||
| 69 | /* Architecturally defined mapping between AArch32 and AArch64 registers */ | 69 | /* Architecturally defined mapping between AArch32 and AArch64 registers */ |
| 70 | #define compat_usr(x) regs[(x)] | 70 | #define compat_usr(x) regs[(x)] |
| 71 | #define compat_fp regs[11] | ||
| 71 | #define compat_sp regs[13] | 72 | #define compat_sp regs[13] |
| 72 | #define compat_lr regs[14] | 73 | #define compat_lr regs[14] |
| 73 | #define compat_sp_hyp regs[15] | 74 | #define compat_sp_hyp regs[15] |
| @@ -132,7 +133,7 @@ struct pt_regs { | |||
| 132 | (!((regs)->pstate & PSR_F_BIT)) | 133 | (!((regs)->pstate & PSR_F_BIT)) |
| 133 | 134 | ||
| 134 | #define user_stack_pointer(regs) \ | 135 | #define user_stack_pointer(regs) \ |
| 135 | ((regs)->sp) | 136 | (!compat_user_mode(regs)) ? ((regs)->sp) : ((regs)->compat_sp) |
| 136 | 137 | ||
| 137 | /* | 138 | /* |
| 138 | * Are the current registers suitable for user mode? (used to maintain | 139 | * Are the current registers suitable for user mode? (used to maintain |
| @@ -164,7 +165,7 @@ static inline int valid_user_regs(struct user_pt_regs *regs) | |||
| 164 | return 0; | 165 | return 0; |
| 165 | } | 166 | } |
| 166 | 167 | ||
| 167 | #define instruction_pointer(regs) (regs)->pc | 168 | #define instruction_pointer(regs) ((unsigned long)(regs)->pc) |
| 168 | 169 | ||
| 169 | #ifdef CONFIG_SMP | 170 | #ifdef CONFIG_SMP |
| 170 | extern unsigned long profile_pc(struct pt_regs *regs); | 171 | extern unsigned long profile_pc(struct pt_regs *regs); |
diff --git a/arch/arm64/include/asm/tlb.h b/arch/arm64/include/asm/tlb.h index 717031a762c2..72cadf52ca80 100644 --- a/arch/arm64/include/asm/tlb.h +++ b/arch/arm64/include/asm/tlb.h | |||
| @@ -19,115 +19,44 @@ | |||
| 19 | #ifndef __ASM_TLB_H | 19 | #ifndef __ASM_TLB_H |
| 20 | #define __ASM_TLB_H | 20 | #define __ASM_TLB_H |
| 21 | 21 | ||
| 22 | #include <linux/pagemap.h> | ||
| 23 | #include <linux/swap.h> | ||
| 24 | 22 | ||
| 25 | #include <asm/pgalloc.h> | 23 | #include <asm-generic/tlb.h> |
| 26 | #include <asm/tlbflush.h> | ||
| 27 | |||
| 28 | #define MMU_GATHER_BUNDLE 8 | ||
| 29 | |||
| 30 | /* | ||
| 31 | * TLB handling. This allows us to remove pages from the page | ||
| 32 | * tables, and efficiently handle the TLB issues. | ||
| 33 | */ | ||
| 34 | struct mmu_gather { | ||
| 35 | struct mm_struct *mm; | ||
| 36 | unsigned int fullmm; | ||
| 37 | struct vm_area_struct *vma; | ||
| 38 | unsigned long start, end; | ||
| 39 | unsigned long range_start; | ||
| 40 | unsigned long range_end; | ||
| 41 | unsigned int nr; | ||
| 42 | unsigned int max; | ||
| 43 | struct page **pages; | ||
| 44 | struct page *local[MMU_GATHER_BUNDLE]; | ||
| 45 | }; | ||
| 46 | 24 | ||
| 47 | /* | 25 | /* |
| 48 | * This is unnecessarily complex. There's three ways the TLB shootdown | 26 | * There's three ways the TLB shootdown code is used: |
| 49 | * code is used: | ||
| 50 | * 1. Unmapping a range of vmas. See zap_page_range(), unmap_region(). | 27 | * 1. Unmapping a range of vmas. See zap_page_range(), unmap_region(). |
| 51 | * tlb->fullmm = 0, and tlb_start_vma/tlb_end_vma will be called. | 28 | * tlb->fullmm = 0, and tlb_start_vma/tlb_end_vma will be called. |
| 52 | * tlb->vma will be non-NULL. | ||
| 53 | * 2. Unmapping all vmas. See exit_mmap(). | 29 | * 2. Unmapping all vmas. See exit_mmap(). |
| 54 | * tlb->fullmm = 1, and tlb_start_vma/tlb_end_vma will be called. | 30 | * tlb->fullmm = 1, and tlb_start_vma/tlb_end_vma will be called. |
| 55 | * tlb->vma will be non-NULL. Additionally, page tables will be freed. | 31 | * Page tables will be freed. |
| 56 | * 3. Unmapping argument pages. See shift_arg_pages(). | 32 | * 3. Unmapping argument pages. See shift_arg_pages(). |
| 57 | * tlb->fullmm = 0, but tlb_start_vma/tlb_end_vma will not be called. | 33 | * tlb->fullmm = 0, but tlb_start_vma/tlb_end_vma will not be called. |
| 58 | * tlb->vma will be NULL. | ||
| 59 | */ | 34 | */ |
| 60 | static inline void tlb_flush(struct mmu_gather *tlb) | 35 | static inline void tlb_flush(struct mmu_gather *tlb) |
| 61 | { | 36 | { |
| 62 | if (tlb->fullmm || !tlb->vma) | 37 | if (tlb->fullmm) { |
| 63 | flush_tlb_mm(tlb->mm); | 38 | flush_tlb_mm(tlb->mm); |
| 64 | else if (tlb->range_end > 0) { | 39 | } else if (tlb->end > 0) { |
| 65 | flush_tlb_range(tlb->vma, tlb->range_start, tlb->range_end); | 40 | struct vm_area_struct vma = { .vm_mm = tlb->mm, }; |
| 66 | tlb->range_start = TASK_SIZE; | 41 | flush_tlb_range(&vma, tlb->start, tlb->end); |
| 67 | tlb->range_end = 0; | 42 | tlb->start = TASK_SIZE; |
| 43 | tlb->end = 0; | ||
| 68 | } | 44 | } |
| 69 | } | 45 | } |
| 70 | 46 | ||
| 71 | static inline void tlb_add_flush(struct mmu_gather *tlb, unsigned long addr) | 47 | static inline void tlb_add_flush(struct mmu_gather *tlb, unsigned long addr) |
| 72 | { | 48 | { |
| 73 | if (!tlb->fullmm) { | 49 | if (!tlb->fullmm) { |
| 74 | if (addr < tlb->range_start) | 50 | tlb->start = min(tlb->start, addr); |
| 75 | tlb->range_start = addr; | 51 | tlb->end = max(tlb->end, addr + PAGE_SIZE); |
| 76 | if (addr + PAGE_SIZE > tlb->range_end) | ||
| 77 | tlb->range_end = addr + PAGE_SIZE; | ||
| 78 | } | ||
| 79 | } | ||
| 80 | |||
| 81 | static inline void __tlb_alloc_page(struct mmu_gather *tlb) | ||
| 82 | { | ||
| 83 | unsigned long addr = __get_free_pages(GFP_NOWAIT | __GFP_NOWARN, 0); | ||
| 84 | |||
| 85 | if (addr) { | ||
| 86 | tlb->pages = (void *)addr; | ||
| 87 | tlb->max = PAGE_SIZE / sizeof(struct page *); | ||
| 88 | } | 52 | } |
| 89 | } | 53 | } |
| 90 | 54 | ||
| 91 | static inline void tlb_flush_mmu(struct mmu_gather *tlb) | ||
| 92 | { | ||
| 93 | tlb_flush(tlb); | ||
| 94 | free_pages_and_swap_cache(tlb->pages, tlb->nr); | ||
| 95 | tlb->nr = 0; | ||
| 96 | if (tlb->pages == tlb->local) | ||
| 97 | __tlb_alloc_page(tlb); | ||
| 98 | } | ||
| 99 | |||
| 100 | static inline void | ||
| 101 | tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, unsigned long start, unsigned long end) | ||
| 102 | { | ||
| 103 | tlb->mm = mm; | ||
| 104 | tlb->fullmm = !(start | (end+1)); | ||
| 105 | tlb->start = start; | ||
| 106 | tlb->end = end; | ||
| 107 | tlb->vma = NULL; | ||
| 108 | tlb->max = ARRAY_SIZE(tlb->local); | ||
| 109 | tlb->pages = tlb->local; | ||
| 110 | tlb->nr = 0; | ||
| 111 | __tlb_alloc_page(tlb); | ||
| 112 | } | ||
| 113 | |||
| 114 | static inline void | ||
| 115 | tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) | ||
| 116 | { | ||
| 117 | tlb_flush_mmu(tlb); | ||
| 118 | |||
| 119 | /* keep the page table cache within bounds */ | ||
| 120 | check_pgt_cache(); | ||
| 121 | |||
| 122 | if (tlb->pages != tlb->local) | ||
| 123 | free_pages((unsigned long)tlb->pages, 0); | ||
| 124 | } | ||
| 125 | |||
| 126 | /* | 55 | /* |
| 127 | * Memorize the range for the TLB flush. | 56 | * Memorize the range for the TLB flush. |
| 128 | */ | 57 | */ |
| 129 | static inline void | 58 | static inline void __tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep, |
| 130 | tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep, unsigned long addr) | 59 | unsigned long addr) |
| 131 | { | 60 | { |
| 132 | tlb_add_flush(tlb, addr); | 61 | tlb_add_flush(tlb, addr); |
| 133 | } | 62 | } |
| @@ -137,38 +66,24 @@ tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep, unsigned long addr) | |||
| 137 | * case where we're doing a full MM flush. When we're doing a munmap, | 66 | * case where we're doing a full MM flush. When we're doing a munmap, |
| 138 | * the vmas are adjusted to only cover the region to be torn down. | 67 | * the vmas are adjusted to only cover the region to be torn down. |
| 139 | */ | 68 | */ |
| 140 | static inline void | 69 | static inline void tlb_start_vma(struct mmu_gather *tlb, |
| 141 | tlb_start_vma(struct mmu_gather *tlb, struct vm_area_struct *vma) | 70 | struct vm_area_struct *vma) |
| 142 | { | 71 | { |
| 143 | if (!tlb->fullmm) { | 72 | if (!tlb->fullmm) { |
| 144 | tlb->vma = vma; | 73 | tlb->start = TASK_SIZE; |
| 145 | tlb->range_start = TASK_SIZE; | 74 | tlb->end = 0; |
| 146 | tlb->range_end = 0; | ||
| 147 | } | 75 | } |
| 148 | } | 76 | } |
| 149 | 77 | ||
| 150 | static inline void | 78 | static inline void tlb_end_vma(struct mmu_gather *tlb, |
| 151 | tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma) | 79 | struct vm_area_struct *vma) |
| 152 | { | 80 | { |
| 153 | if (!tlb->fullmm) | 81 | if (!tlb->fullmm) |
| 154 | tlb_flush(tlb); | 82 | tlb_flush(tlb); |
| 155 | } | 83 | } |
| 156 | 84 | ||
| 157 | static inline int __tlb_remove_page(struct mmu_gather *tlb, struct page *page) | ||
| 158 | { | ||
| 159 | tlb->pages[tlb->nr++] = page; | ||
| 160 | VM_BUG_ON(tlb->nr > tlb->max); | ||
| 161 | return tlb->max - tlb->nr; | ||
| 162 | } | ||
| 163 | |||
| 164 | static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page) | ||
| 165 | { | ||
| 166 | if (!__tlb_remove_page(tlb, page)) | ||
| 167 | tlb_flush_mmu(tlb); | ||
| 168 | } | ||
| 169 | |||
| 170 | static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte, | 85 | static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte, |
| 171 | unsigned long addr) | 86 | unsigned long addr) |
| 172 | { | 87 | { |
| 173 | pgtable_page_dtor(pte); | 88 | pgtable_page_dtor(pte); |
| 174 | tlb_add_flush(tlb, addr); | 89 | tlb_add_flush(tlb, addr); |
| @@ -184,16 +99,5 @@ static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmdp, | |||
| 184 | } | 99 | } |
| 185 | #endif | 100 | #endif |
| 186 | 101 | ||
| 187 | #define pte_free_tlb(tlb, ptep, addr) __pte_free_tlb(tlb, ptep, addr) | ||
| 188 | #define pmd_free_tlb(tlb, pmdp, addr) __pmd_free_tlb(tlb, pmdp, addr) | ||
| 189 | #define pud_free_tlb(tlb, pudp, addr) pud_free((tlb)->mm, pudp) | ||
| 190 | |||
| 191 | #define tlb_migrate_finish(mm) do { } while (0) | ||
| 192 | |||
| 193 | static inline void | ||
| 194 | tlb_remove_pmd_tlb_entry(struct mmu_gather *tlb, pmd_t *pmdp, unsigned long addr) | ||
| 195 | { | ||
| 196 | tlb_add_flush(tlb, addr); | ||
| 197 | } | ||
| 198 | 102 | ||
| 199 | #endif | 103 | #endif |
diff --git a/arch/arm64/include/asm/topology.h b/arch/arm64/include/asm/topology.h new file mode 100644 index 000000000000..0172e6d76bf3 --- /dev/null +++ b/arch/arm64/include/asm/topology.h | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | #ifndef __ASM_TOPOLOGY_H | ||
| 2 | #define __ASM_TOPOLOGY_H | ||
| 3 | |||
| 4 | #ifdef CONFIG_SMP | ||
| 5 | |||
| 6 | #include <linux/cpumask.h> | ||
| 7 | |||
| 8 | struct cpu_topology { | ||
| 9 | int thread_id; | ||
| 10 | int core_id; | ||
| 11 | int cluster_id; | ||
| 12 | cpumask_t thread_sibling; | ||
| 13 | cpumask_t core_sibling; | ||
| 14 | }; | ||
| 15 | |||
| 16 | extern struct cpu_topology cpu_topology[NR_CPUS]; | ||
| 17 | |||
| 18 | #define topology_physical_package_id(cpu) (cpu_topology[cpu].cluster_id) | ||
| 19 | #define topology_core_id(cpu) (cpu_topology[cpu].core_id) | ||
| 20 | #define topology_core_cpumask(cpu) (&cpu_topology[cpu].core_sibling) | ||
| 21 | #define topology_thread_cpumask(cpu) (&cpu_topology[cpu].thread_sibling) | ||
| 22 | |||
| 23 | #define mc_capable() (cpu_topology[0].cluster_id != -1) | ||
| 24 | #define smt_capable() (cpu_topology[0].thread_id != -1) | ||
| 25 | |||
| 26 | void init_cpu_topology(void); | ||
| 27 | void store_cpu_topology(unsigned int cpuid); | ||
| 28 | const struct cpumask *cpu_coregroup_mask(int cpu); | ||
| 29 | |||
| 30 | #else | ||
| 31 | |||
| 32 | static inline void init_cpu_topology(void) { } | ||
| 33 | static inline void store_cpu_topology(unsigned int cpuid) { } | ||
| 34 | |||
| 35 | #endif | ||
| 36 | |||
| 37 | #include <asm-generic/topology.h> | ||
| 38 | |||
| 39 | #endif /* _ASM_ARM_TOPOLOGY_H */ | ||
diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h index 6c0f684aca81..3bf8f4e99a51 100644 --- a/arch/arm64/include/asm/uaccess.h +++ b/arch/arm64/include/asm/uaccess.h | |||
| @@ -83,7 +83,7 @@ static inline void set_fs(mm_segment_t fs) | |||
| 83 | * Returns 1 if the range is valid, 0 otherwise. | 83 | * Returns 1 if the range is valid, 0 otherwise. |
| 84 | * | 84 | * |
| 85 | * This is equivalent to the following test: | 85 | * This is equivalent to the following test: |
| 86 | * (u65)addr + (u65)size < (u65)current->addr_limit | 86 | * (u65)addr + (u65)size <= current->addr_limit |
| 87 | * | 87 | * |
| 88 | * This needs 65-bit arithmetic. | 88 | * This needs 65-bit arithmetic. |
| 89 | */ | 89 | */ |
| @@ -91,7 +91,7 @@ static inline void set_fs(mm_segment_t fs) | |||
| 91 | ({ \ | 91 | ({ \ |
| 92 | unsigned long flag, roksum; \ | 92 | unsigned long flag, roksum; \ |
| 93 | __chk_user_ptr(addr); \ | 93 | __chk_user_ptr(addr); \ |
| 94 | asm("adds %1, %1, %3; ccmp %1, %4, #2, cc; cset %0, cc" \ | 94 | asm("adds %1, %1, %3; ccmp %1, %4, #2, cc; cset %0, ls" \ |
| 95 | : "=&r" (flag), "=&r" (roksum) \ | 95 | : "=&r" (flag), "=&r" (roksum) \ |
| 96 | : "1" (addr), "Ir" (size), \ | 96 | : "1" (addr), "Ir" (size), \ |
| 97 | "r" (current_thread_info()->addr_limit) \ | 97 | "r" (current_thread_info()->addr_limit) \ |
diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h index 82ce217e94cf..a4654c656a1e 100644 --- a/arch/arm64/include/asm/unistd.h +++ b/arch/arm64/include/asm/unistd.h | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | #ifdef CONFIG_COMPAT | 16 | #ifdef CONFIG_COMPAT |
| 17 | #define __ARCH_WANT_COMPAT_SYS_GETDENTS64 | ||
| 17 | #define __ARCH_WANT_COMPAT_STAT64 | 18 | #define __ARCH_WANT_COMPAT_STAT64 |
| 18 | #define __ARCH_WANT_SYS_GETHOSTNAME | 19 | #define __ARCH_WANT_SYS_GETHOSTNAME |
| 19 | #define __ARCH_WANT_SYS_PAUSE | 20 | #define __ARCH_WANT_SYS_PAUSE |
diff --git a/arch/arm64/include/uapi/asm/Kbuild b/arch/arm64/include/uapi/asm/Kbuild index e4b78bdca19e..942376d37d22 100644 --- a/arch/arm64/include/uapi/asm/Kbuild +++ b/arch/arm64/include/uapi/asm/Kbuild | |||
| @@ -9,6 +9,7 @@ header-y += byteorder.h | |||
| 9 | header-y += fcntl.h | 9 | header-y += fcntl.h |
| 10 | header-y += hwcap.h | 10 | header-y += hwcap.h |
| 11 | header-y += kvm_para.h | 11 | header-y += kvm_para.h |
| 12 | header-y += perf_regs.h | ||
| 12 | header-y += param.h | 13 | header-y += param.h |
| 13 | header-y += ptrace.h | 14 | header-y += ptrace.h |
| 14 | header-y += setup.h | 15 | header-y += setup.h |
diff --git a/arch/arm64/include/uapi/asm/perf_regs.h b/arch/arm64/include/uapi/asm/perf_regs.h new file mode 100644 index 000000000000..172b8317ee49 --- /dev/null +++ b/arch/arm64/include/uapi/asm/perf_regs.h | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | #ifndef _ASM_ARM64_PERF_REGS_H | ||
| 2 | #define _ASM_ARM64_PERF_REGS_H | ||
| 3 | |||
| 4 | enum perf_event_arm_regs { | ||
| 5 | PERF_REG_ARM64_X0, | ||
| 6 | PERF_REG_ARM64_X1, | ||
| 7 | PERF_REG_ARM64_X2, | ||
| 8 | PERF_REG_ARM64_X3, | ||
| 9 | PERF_REG_ARM64_X4, | ||
| 10 | PERF_REG_ARM64_X5, | ||
| 11 | PERF_REG_ARM64_X6, | ||
| 12 | PERF_REG_ARM64_X7, | ||
| 13 | PERF_REG_ARM64_X8, | ||
| 14 | PERF_REG_ARM64_X9, | ||
| 15 | PERF_REG_ARM64_X10, | ||
| 16 | PERF_REG_ARM64_X11, | ||
| 17 | PERF_REG_ARM64_X12, | ||
| 18 | PERF_REG_ARM64_X13, | ||
| 19 | PERF_REG_ARM64_X14, | ||
| 20 | PERF_REG_ARM64_X15, | ||
| 21 | PERF_REG_ARM64_X16, | ||
| 22 | PERF_REG_ARM64_X17, | ||
| 23 | PERF_REG_ARM64_X18, | ||
| 24 | PERF_REG_ARM64_X19, | ||
| 25 | PERF_REG_ARM64_X20, | ||
| 26 | PERF_REG_ARM64_X21, | ||
| 27 | PERF_REG_ARM64_X22, | ||
| 28 | PERF_REG_ARM64_X23, | ||
| 29 | PERF_REG_ARM64_X24, | ||
| 30 | PERF_REG_ARM64_X25, | ||
| 31 | PERF_REG_ARM64_X26, | ||
| 32 | PERF_REG_ARM64_X27, | ||
| 33 | PERF_REG_ARM64_X28, | ||
| 34 | PERF_REG_ARM64_X29, | ||
| 35 | PERF_REG_ARM64_LR, | ||
| 36 | PERF_REG_ARM64_SP, | ||
| 37 | PERF_REG_ARM64_PC, | ||
| 38 | PERF_REG_ARM64_MAX, | ||
| 39 | }; | ||
| 40 | #endif /* _ASM_ARM64_PERF_REGS_H */ | ||
diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 2d4554b13410..7d811d9522bc 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile | |||
| @@ -14,12 +14,14 @@ arm64-obj-y := cputable.o debug-monitors.o entry.o irq.o fpsimd.o \ | |||
| 14 | arm64-obj-$(CONFIG_COMPAT) += sys32.o kuser32.o signal32.o \ | 14 | arm64-obj-$(CONFIG_COMPAT) += sys32.o kuser32.o signal32.o \ |
| 15 | sys_compat.o | 15 | sys_compat.o |
| 16 | arm64-obj-$(CONFIG_MODULES) += arm64ksyms.o module.o | 16 | arm64-obj-$(CONFIG_MODULES) += arm64ksyms.o module.o |
| 17 | arm64-obj-$(CONFIG_SMP) += smp.o smp_spin_table.o | 17 | arm64-obj-$(CONFIG_SMP) += smp.o smp_spin_table.o topology.o |
| 18 | arm64-obj-$(CONFIG_PERF_EVENTS) += perf_regs.o | ||
| 18 | arm64-obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o | 19 | arm64-obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o |
| 19 | arm64-obj-$(CONFIG_HAVE_HW_BREAKPOINT)+= hw_breakpoint.o | 20 | arm64-obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o |
| 20 | arm64-obj-$(CONFIG_EARLY_PRINTK) += early_printk.o | 21 | arm64-obj-$(CONFIG_EARLY_PRINTK) += early_printk.o |
| 21 | arm64-obj-$(CONFIG_ARM64_CPU_SUSPEND) += sleep.o suspend.o | 22 | arm64-obj-$(CONFIG_ARM64_CPU_SUSPEND) += sleep.o suspend.o |
| 22 | arm64-obj-$(CONFIG_JUMP_LABEL) += jump_label.o | 23 | arm64-obj-$(CONFIG_JUMP_LABEL) += jump_label.o |
| 24 | arm64-obj-$(CONFIG_KGDB) += kgdb.o | ||
| 23 | 25 | ||
| 24 | obj-y += $(arm64-obj-y) vdso/ | 26 | obj-y += $(arm64-obj-y) vdso/ |
| 25 | obj-m += $(arm64-obj-m) | 27 | obj-m += $(arm64-obj-m) |
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c index 636ba8b6240b..14ba23c61153 100644 --- a/arch/arm64/kernel/debug-monitors.c +++ b/arch/arm64/kernel/debug-monitors.c | |||
| @@ -137,7 +137,6 @@ void disable_debug_monitors(enum debug_el el) | |||
| 137 | static void clear_os_lock(void *unused) | 137 | static void clear_os_lock(void *unused) |
| 138 | { | 138 | { |
| 139 | asm volatile("msr oslar_el1, %0" : : "r" (0)); | 139 | asm volatile("msr oslar_el1, %0" : : "r" (0)); |
| 140 | isb(); | ||
| 141 | } | 140 | } |
| 142 | 141 | ||
| 143 | static int os_lock_notify(struct notifier_block *self, | 142 | static int os_lock_notify(struct notifier_block *self, |
| @@ -156,8 +155,9 @@ static struct notifier_block os_lock_nb = { | |||
| 156 | static int debug_monitors_init(void) | 155 | static int debug_monitors_init(void) |
| 157 | { | 156 | { |
| 158 | /* Clear the OS lock. */ | 157 | /* Clear the OS lock. */ |
| 159 | smp_call_function(clear_os_lock, NULL, 1); | 158 | on_each_cpu(clear_os_lock, NULL, 1); |
| 160 | clear_os_lock(NULL); | 159 | isb(); |
| 160 | local_dbg_enable(); | ||
| 161 | 161 | ||
| 162 | /* Register hotplug handler. */ | 162 | /* Register hotplug handler. */ |
| 163 | register_cpu_notifier(&os_lock_nb); | 163 | register_cpu_notifier(&os_lock_nb); |
| @@ -189,7 +189,7 @@ static void clear_regs_spsr_ss(struct pt_regs *regs) | |||
| 189 | 189 | ||
| 190 | /* EL1 Single Step Handler hooks */ | 190 | /* EL1 Single Step Handler hooks */ |
| 191 | static LIST_HEAD(step_hook); | 191 | static LIST_HEAD(step_hook); |
| 192 | DEFINE_RWLOCK(step_hook_lock); | 192 | static DEFINE_RWLOCK(step_hook_lock); |
| 193 | 193 | ||
| 194 | void register_step_hook(struct step_hook *hook) | 194 | void register_step_hook(struct step_hook *hook) |
| 195 | { | 195 | { |
| @@ -276,7 +276,7 @@ static int single_step_handler(unsigned long addr, unsigned int esr, | |||
| 276 | * Use reader/writer locks instead of plain spinlock. | 276 | * Use reader/writer locks instead of plain spinlock. |
| 277 | */ | 277 | */ |
| 278 | static LIST_HEAD(break_hook); | 278 | static LIST_HEAD(break_hook); |
| 279 | DEFINE_RWLOCK(break_hook_lock); | 279 | static DEFINE_RWLOCK(break_hook_lock); |
| 280 | 280 | ||
| 281 | void register_break_hook(struct break_hook *hook) | 281 | void register_break_hook(struct break_hook *hook) |
| 282 | { | 282 | { |
diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index 0b281fffda51..61035d6814cb 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S | |||
| @@ -384,26 +384,18 @@ ENDPROC(__calc_phys_offset) | |||
| 384 | * Preserves: tbl, flags | 384 | * Preserves: tbl, flags |
| 385 | * Corrupts: phys, start, end, pstate | 385 | * Corrupts: phys, start, end, pstate |
| 386 | */ | 386 | */ |
| 387 | .macro create_block_map, tbl, flags, phys, start, end, idmap=0 | 387 | .macro create_block_map, tbl, flags, phys, start, end |
| 388 | lsr \phys, \phys, #BLOCK_SHIFT | 388 | lsr \phys, \phys, #BLOCK_SHIFT |
| 389 | .if \idmap | ||
| 390 | and \start, \phys, #PTRS_PER_PTE - 1 // table index | ||
| 391 | .else | ||
| 392 | lsr \start, \start, #BLOCK_SHIFT | 389 | lsr \start, \start, #BLOCK_SHIFT |
| 393 | and \start, \start, #PTRS_PER_PTE - 1 // table index | 390 | and \start, \start, #PTRS_PER_PTE - 1 // table index |
| 394 | .endif | ||
| 395 | orr \phys, \flags, \phys, lsl #BLOCK_SHIFT // table entry | 391 | orr \phys, \flags, \phys, lsl #BLOCK_SHIFT // table entry |
| 396 | .ifnc \start,\end | ||
| 397 | lsr \end, \end, #BLOCK_SHIFT | 392 | lsr \end, \end, #BLOCK_SHIFT |
| 398 | and \end, \end, #PTRS_PER_PTE - 1 // table end index | 393 | and \end, \end, #PTRS_PER_PTE - 1 // table end index |
| 399 | .endif | ||
| 400 | 9999: str \phys, [\tbl, \start, lsl #3] // store the entry | 394 | 9999: str \phys, [\tbl, \start, lsl #3] // store the entry |
| 401 | .ifnc \start,\end | ||
| 402 | add \start, \start, #1 // next entry | 395 | add \start, \start, #1 // next entry |
| 403 | add \phys, \phys, #BLOCK_SIZE // next block | 396 | add \phys, \phys, #BLOCK_SIZE // next block |
| 404 | cmp \start, \end | 397 | cmp \start, \end |
| 405 | b.ls 9999b | 398 | b.ls 9999b |
| 406 | .endif | ||
| 407 | .endm | 399 | .endm |
| 408 | 400 | ||
| 409 | /* | 401 | /* |
| @@ -435,9 +427,13 @@ __create_page_tables: | |||
| 435 | * Create the identity mapping. | 427 | * Create the identity mapping. |
| 436 | */ | 428 | */ |
| 437 | add x0, x25, #PAGE_SIZE // section table address | 429 | add x0, x25, #PAGE_SIZE // section table address |
| 438 | adr x3, __turn_mmu_on // virtual/physical address | 430 | ldr x3, =KERNEL_START |
| 431 | add x3, x3, x28 // __pa(KERNEL_START) | ||
| 439 | create_pgd_entry x25, x0, x3, x5, x6 | 432 | create_pgd_entry x25, x0, x3, x5, x6 |
| 440 | create_block_map x0, x7, x3, x5, x5, idmap=1 | 433 | ldr x6, =KERNEL_END |
| 434 | mov x5, x3 // __pa(KERNEL_START) | ||
| 435 | add x6, x6, x28 // __pa(KERNEL_END) | ||
| 436 | create_block_map x0, x7, x3, x5, x6 | ||
| 441 | 437 | ||
| 442 | /* | 438 | /* |
| 443 | * Map the kernel image (starting with PHYS_OFFSET). | 439 | * Map the kernel image (starting with PHYS_OFFSET). |
| @@ -445,7 +441,7 @@ __create_page_tables: | |||
| 445 | add x0, x26, #PAGE_SIZE // section table address | 441 | add x0, x26, #PAGE_SIZE // section table address |
| 446 | mov x5, #PAGE_OFFSET | 442 | mov x5, #PAGE_OFFSET |
| 447 | create_pgd_entry x26, x0, x5, x3, x6 | 443 | create_pgd_entry x26, x0, x5, x3, x6 |
| 448 | ldr x6, =KERNEL_END - 1 | 444 | ldr x6, =KERNEL_END |
| 449 | mov x3, x24 // phys offset | 445 | mov x3, x24 // phys offset |
| 450 | create_block_map x0, x7, x3, x5, x6 | 446 | create_block_map x0, x7, x3, x5, x6 |
| 451 | 447 | ||
diff --git a/arch/arm64/kernel/kgdb.c b/arch/arm64/kernel/kgdb.c new file mode 100644 index 000000000000..75c9cf1aafee --- /dev/null +++ b/arch/arm64/kernel/kgdb.c | |||
| @@ -0,0 +1,336 @@ | |||
| 1 | /* | ||
| 2 | * AArch64 KGDB support | ||
| 3 | * | ||
| 4 | * Based on arch/arm/kernel/kgdb.c | ||
| 5 | * | ||
| 6 | * Copyright (C) 2013 Cavium Inc. | ||
| 7 | * Author: Vijaya Kumar K <vijaya.kumar@caviumnetworks.com> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License version 2 as | ||
| 11 | * published by the Free Software Foundation. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License | ||
| 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include <linux/irq.h> | ||
| 23 | #include <linux/kdebug.h> | ||
| 24 | #include <linux/kgdb.h> | ||
| 25 | #include <asm/traps.h> | ||
| 26 | |||
| 27 | struct dbg_reg_def_t dbg_reg_def[DBG_MAX_REG_NUM] = { | ||
| 28 | { "x0", 8, offsetof(struct pt_regs, regs[0])}, | ||
| 29 | { "x1", 8, offsetof(struct pt_regs, regs[1])}, | ||
| 30 | { "x2", 8, offsetof(struct pt_regs, regs[2])}, | ||
| 31 | { "x3", 8, offsetof(struct pt_regs, regs[3])}, | ||
| 32 | { "x4", 8, offsetof(struct pt_regs, regs[4])}, | ||
| 33 | { "x5", 8, offsetof(struct pt_regs, regs[5])}, | ||
| 34 | { "x6", 8, offsetof(struct pt_regs, regs[6])}, | ||
| 35 | { "x7", 8, offsetof(struct pt_regs, regs[7])}, | ||
| 36 | { "x8", 8, offsetof(struct pt_regs, regs[8])}, | ||
| 37 | { "x9", 8, offsetof(struct pt_regs, regs[9])}, | ||
| 38 | { "x10", 8, offsetof(struct pt_regs, regs[10])}, | ||
| 39 | { "x11", 8, offsetof(struct pt_regs, regs[11])}, | ||
| 40 | { "x12", 8, offsetof(struct pt_regs, regs[12])}, | ||
| 41 | { "x13", 8, offsetof(struct pt_regs, regs[13])}, | ||
| 42 | { "x14", 8, offsetof(struct pt_regs, regs[14])}, | ||
| 43 | { "x15", 8, offsetof(struct pt_regs, regs[15])}, | ||
| 44 | { "x16", 8, offsetof(struct pt_regs, regs[16])}, | ||
| 45 | { "x17", 8, offsetof(struct pt_regs, regs[17])}, | ||
| 46 | { "x18", 8, offsetof(struct pt_regs, regs[18])}, | ||
| 47 | { "x19", 8, offsetof(struct pt_regs, regs[19])}, | ||
| 48 | { "x20", 8, offsetof(struct pt_regs, regs[20])}, | ||
| 49 | { "x21", 8, offsetof(struct pt_regs, regs[21])}, | ||
| 50 | { "x22", 8, offsetof(struct pt_regs, regs[22])}, | ||
| 51 | { "x23", 8, offsetof(struct pt_regs, regs[23])}, | ||
| 52 | { "x24", 8, offsetof(struct pt_regs, regs[24])}, | ||
| 53 | { "x25", 8, offsetof(struct pt_regs, regs[25])}, | ||
| 54 | { "x26", 8, offsetof(struct pt_regs, regs[26])}, | ||
| 55 | { "x27", 8, offsetof(struct pt_regs, regs[27])}, | ||
| 56 | { "x28", 8, offsetof(struct pt_regs, regs[28])}, | ||
| 57 | { "x29", 8, offsetof(struct pt_regs, regs[29])}, | ||
| 58 | { "x30", 8, offsetof(struct pt_regs, regs[30])}, | ||
| 59 | { "sp", 8, offsetof(struct pt_regs, sp)}, | ||
| 60 | { "pc", 8, offsetof(struct pt_regs, pc)}, | ||
| 61 | { "pstate", 8, offsetof(struct pt_regs, pstate)}, | ||
| 62 | { "v0", 16, -1 }, | ||
| 63 | { "v1", 16, -1 }, | ||
| 64 | { "v2", 16, -1 }, | ||
| 65 | { "v3", 16, -1 }, | ||
| 66 | { "v4", 16, -1 }, | ||
| 67 | { "v5", 16, -1 }, | ||
| 68 | { "v6", 16, -1 }, | ||
| 69 | { "v7", 16, -1 }, | ||
| 70 | { "v8", 16, -1 }, | ||
| 71 | { "v9", 16, -1 }, | ||
| 72 | { "v10", 16, -1 }, | ||
| 73 | { "v11", 16, -1 }, | ||
| 74 | { "v12", 16, -1 }, | ||
| 75 | { "v13", 16, -1 }, | ||
| 76 | { "v14", 16, -1 }, | ||
| 77 | { "v15", 16, -1 }, | ||
| 78 | { "v16", 16, -1 }, | ||
| 79 | { "v17", 16, -1 }, | ||
| 80 | { "v18", 16, -1 }, | ||
| 81 | { "v19", 16, -1 }, | ||
| 82 | { "v20", 16, -1 }, | ||
| 83 | { "v21", 16, -1 }, | ||
| 84 | { "v22", 16, -1 }, | ||
| 85 | { "v23", 16, -1 }, | ||
| 86 | { "v24", 16, -1 }, | ||
| 87 | { "v25", 16, -1 }, | ||
| 88 | { "v26", 16, -1 }, | ||
| 89 | { "v27", 16, -1 }, | ||
| 90 | { "v28", 16, -1 }, | ||
| 91 | { "v29", 16, -1 }, | ||
| 92 | { "v30", 16, -1 }, | ||
| 93 | { "v31", 16, -1 }, | ||
| 94 | { "fpsr", 4, -1 }, | ||
| 95 | { "fpcr", 4, -1 }, | ||
| 96 | }; | ||
| 97 | |||
| 98 | char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs) | ||
| 99 | { | ||
| 100 | if (regno >= DBG_MAX_REG_NUM || regno < 0) | ||
| 101 | return NULL; | ||
| 102 | |||
| 103 | if (dbg_reg_def[regno].offset != -1) | ||
| 104 | memcpy(mem, (void *)regs + dbg_reg_def[regno].offset, | ||
| 105 | dbg_reg_def[regno].size); | ||
| 106 | else | ||
| 107 | memset(mem, 0, dbg_reg_def[regno].size); | ||
| 108 | return dbg_reg_def[regno].name; | ||
| 109 | } | ||
| 110 | |||
| 111 | int dbg_set_reg(int regno, void *mem, struct pt_regs *regs) | ||
| 112 | { | ||
| 113 | if (regno >= DBG_MAX_REG_NUM || regno < 0) | ||
| 114 | return -EINVAL; | ||
| 115 | |||
| 116 | if (dbg_reg_def[regno].offset != -1) | ||
| 117 | memcpy((void *)regs + dbg_reg_def[regno].offset, mem, | ||
| 118 | dbg_reg_def[regno].size); | ||
| 119 | return 0; | ||
| 120 | } | ||
| 121 | |||
| 122 | void | ||
| 123 | sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *task) | ||
| 124 | { | ||
| 125 | struct pt_regs *thread_regs; | ||
| 126 | |||
| 127 | /* Initialize to zero */ | ||
| 128 | memset((char *)gdb_regs, 0, NUMREGBYTES); | ||
| 129 | thread_regs = task_pt_regs(task); | ||
| 130 | memcpy((void *)gdb_regs, (void *)thread_regs->regs, GP_REG_BYTES); | ||
| 131 | } | ||
| 132 | |||
| 133 | void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long pc) | ||
| 134 | { | ||
| 135 | regs->pc = pc; | ||
| 136 | } | ||
| 137 | |||
| 138 | static int compiled_break; | ||
| 139 | |||
| 140 | static void kgdb_arch_update_addr(struct pt_regs *regs, | ||
| 141 | char *remcom_in_buffer) | ||
| 142 | { | ||
| 143 | unsigned long addr; | ||
| 144 | char *ptr; | ||
| 145 | |||
| 146 | ptr = &remcom_in_buffer[1]; | ||
| 147 | if (kgdb_hex2long(&ptr, &addr)) | ||
| 148 | kgdb_arch_set_pc(regs, addr); | ||
| 149 | else if (compiled_break == 1) | ||
| 150 | kgdb_arch_set_pc(regs, regs->pc + 4); | ||
| 151 | |||
| 152 | compiled_break = 0; | ||
| 153 | } | ||
| 154 | |||
| 155 | int kgdb_arch_handle_exception(int exception_vector, int signo, | ||
| 156 | int err_code, char *remcom_in_buffer, | ||
| 157 | char *remcom_out_buffer, | ||
| 158 | struct pt_regs *linux_regs) | ||
| 159 | { | ||
| 160 | int err; | ||
| 161 | |||
| 162 | switch (remcom_in_buffer[0]) { | ||
| 163 | case 'D': | ||
| 164 | case 'k': | ||
| 165 | /* | ||
| 166 | * Packet D (Detach), k (kill). No special handling | ||
| 167 | * is required here. Handle same as c packet. | ||
| 168 | */ | ||
| 169 | case 'c': | ||
| 170 | /* | ||
| 171 | * Packet c (Continue) to continue executing. | ||
| 172 | * Set pc to required address. | ||
| 173 | * Try to read optional parameter and set pc. | ||
| 174 | * If this was a compiled breakpoint, we need to move | ||
| 175 | * to the next instruction else we will just breakpoint | ||
| 176 | * over and over again. | ||
| 177 | */ | ||
| 178 | kgdb_arch_update_addr(linux_regs, remcom_in_buffer); | ||
| 179 | atomic_set(&kgdb_cpu_doing_single_step, -1); | ||
| 180 | kgdb_single_step = 0; | ||
| 181 | |||
| 182 | /* | ||
| 183 | * Received continue command, disable single step | ||
| 184 | */ | ||
| 185 | if (kernel_active_single_step()) | ||
| 186 | kernel_disable_single_step(); | ||
| 187 | |||
| 188 | err = 0; | ||
| 189 | break; | ||
| 190 | case 's': | ||
| 191 | /* | ||
| 192 | * Update step address value with address passed | ||
| 193 | * with step packet. | ||
| 194 | * On debug exception return PC is copied to ELR | ||
| 195 | * So just update PC. | ||
| 196 | * If no step address is passed, resume from the address | ||
| 197 | * pointed by PC. Do not update PC | ||
| 198 | */ | ||
| 199 | kgdb_arch_update_addr(linux_regs, remcom_in_buffer); | ||
| 200 | atomic_set(&kgdb_cpu_doing_single_step, raw_smp_processor_id()); | ||
| 201 | kgdb_single_step = 1; | ||
| 202 | |||
| 203 | /* | ||
| 204 | * Enable single step handling | ||
| 205 | */ | ||
| 206 | if (!kernel_active_single_step()) | ||
| 207 | kernel_enable_single_step(linux_regs); | ||
| 208 | err = 0; | ||
| 209 | break; | ||
| 210 | default: | ||
| 211 | err = -1; | ||
| 212 | } | ||
| 213 | return err; | ||
| 214 | } | ||
| 215 | |||
| 216 | static int kgdb_brk_fn(struct pt_regs *regs, unsigned int esr) | ||
| 217 | { | ||
| 218 | kgdb_handle_exception(1, SIGTRAP, 0, regs); | ||
| 219 | return 0; | ||
| 220 | } | ||
| 221 | |||
| 222 | static int kgdb_compiled_brk_fn(struct pt_regs *regs, unsigned int esr) | ||
| 223 | { | ||
| 224 | compiled_break = 1; | ||
| 225 | kgdb_handle_exception(1, SIGTRAP, 0, regs); | ||
| 226 | |||
| 227 | return 0; | ||
| 228 | } | ||
| 229 | |||
| 230 | static int kgdb_step_brk_fn(struct pt_regs *regs, unsigned int esr) | ||
| 231 | { | ||
| 232 | kgdb_handle_exception(1, SIGTRAP, 0, regs); | ||
| 233 | return 0; | ||
| 234 | } | ||
| 235 | |||
| 236 | static struct break_hook kgdb_brkpt_hook = { | ||
| 237 | .esr_mask = 0xffffffff, | ||
| 238 | .esr_val = DBG_ESR_VAL_BRK(KGDB_DYN_DGB_BRK_IMM), | ||
| 239 | .fn = kgdb_brk_fn | ||
| 240 | }; | ||
| 241 | |||
| 242 | static struct break_hook kgdb_compiled_brkpt_hook = { | ||
| 243 | .esr_mask = 0xffffffff, | ||
| 244 | .esr_val = DBG_ESR_VAL_BRK(KDBG_COMPILED_DBG_BRK_IMM), | ||
| 245 | .fn = kgdb_compiled_brk_fn | ||
| 246 | }; | ||
| 247 | |||
| 248 | static struct step_hook kgdb_step_hook = { | ||
| 249 | .fn = kgdb_step_brk_fn | ||
| 250 | }; | ||
| 251 | |||
| 252 | static void kgdb_call_nmi_hook(void *ignored) | ||
| 253 | { | ||
| 254 | kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs()); | ||
| 255 | } | ||
| 256 | |||
| 257 | void kgdb_roundup_cpus(unsigned long flags) | ||
| 258 | { | ||
| 259 | local_irq_enable(); | ||
| 260 | smp_call_function(kgdb_call_nmi_hook, NULL, 0); | ||
| 261 | local_irq_disable(); | ||
| 262 | } | ||
| 263 | |||
| 264 | static int __kgdb_notify(struct die_args *args, unsigned long cmd) | ||
| 265 | { | ||
| 266 | struct pt_regs *regs = args->regs; | ||
| 267 | |||
| 268 | if (kgdb_handle_exception(1, args->signr, cmd, regs)) | ||
| 269 | return NOTIFY_DONE; | ||
| 270 | return NOTIFY_STOP; | ||
| 271 | } | ||
| 272 | |||
| 273 | static int | ||
| 274 | kgdb_notify(struct notifier_block *self, unsigned long cmd, void *ptr) | ||
| 275 | { | ||
| 276 | unsigned long flags; | ||
| 277 | int ret; | ||
| 278 | |||
| 279 | local_irq_save(flags); | ||
| 280 | ret = __kgdb_notify(ptr, cmd); | ||
| 281 | local_irq_restore(flags); | ||
| 282 | |||
| 283 | return ret; | ||
| 284 | } | ||
| 285 | |||
| 286 | static struct notifier_block kgdb_notifier = { | ||
| 287 | .notifier_call = kgdb_notify, | ||
| 288 | /* | ||
| 289 | * Want to be lowest priority | ||
| 290 | */ | ||
| 291 | .priority = -INT_MAX, | ||
| 292 | }; | ||
| 293 | |||
| 294 | /* | ||
| 295 | * kgdb_arch_init - Perform any architecture specific initalization. | ||
| 296 | * This function will handle the initalization of any architecture | ||
| 297 | * specific callbacks. | ||
| 298 | */ | ||
| 299 | int kgdb_arch_init(void) | ||
| 300 | { | ||
| 301 | int ret = register_die_notifier(&kgdb_notifier); | ||
| 302 | |||
| 303 | if (ret != 0) | ||
| 304 | return ret; | ||
| 305 | |||
| 306 | register_break_hook(&kgdb_brkpt_hook); | ||
| 307 | register_break_hook(&kgdb_compiled_brkpt_hook); | ||
| 308 | register_step_hook(&kgdb_step_hook); | ||
| 309 | return 0; | ||
| 310 | } | ||
| 311 | |||
| 312 | /* | ||
| 313 | * kgdb_arch_exit - Perform any architecture specific uninitalization. | ||
| 314 | * This function will handle the uninitalization of any architecture | ||
| 315 | * specific callbacks, for dynamic registration and unregistration. | ||
| 316 | */ | ||
| 317 | void kgdb_arch_exit(void) | ||
| 318 | { | ||
| 319 | unregister_break_hook(&kgdb_brkpt_hook); | ||
| 320 | unregister_break_hook(&kgdb_compiled_brkpt_hook); | ||
| 321 | unregister_step_hook(&kgdb_step_hook); | ||
| 322 | unregister_die_notifier(&kgdb_notifier); | ||
| 323 | } | ||
| 324 | |||
| 325 | /* | ||
| 326 | * ARM instructions are always in LE. | ||
| 327 | * Break instruction is encoded in LE format | ||
| 328 | */ | ||
| 329 | struct kgdb_arch arch_kgdb_ops = { | ||
| 330 | .gdb_bpt_instr = { | ||
| 331 | KGDB_DYN_BRK_INS_BYTE0, | ||
| 332 | KGDB_DYN_BRK_INS_BYTE1, | ||
| 333 | KGDB_DYN_BRK_INS_BYTE2, | ||
| 334 | KGDB_DYN_BRK_INS_BYTE3, | ||
| 335 | } | ||
| 336 | }; | ||
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c index 5b1cd792274a..e868c72a7938 100644 --- a/arch/arm64/kernel/perf_event.c +++ b/arch/arm64/kernel/perf_event.c | |||
| @@ -1348,8 +1348,8 @@ early_initcall(init_hw_perf_events); | |||
| 1348 | * Callchain handling code. | 1348 | * Callchain handling code. |
| 1349 | */ | 1349 | */ |
| 1350 | struct frame_tail { | 1350 | struct frame_tail { |
| 1351 | struct frame_tail __user *fp; | 1351 | struct frame_tail __user *fp; |
| 1352 | unsigned long lr; | 1352 | unsigned long lr; |
| 1353 | } __attribute__((packed)); | 1353 | } __attribute__((packed)); |
| 1354 | 1354 | ||
| 1355 | /* | 1355 | /* |
| @@ -1386,22 +1386,80 @@ user_backtrace(struct frame_tail __user *tail, | |||
| 1386 | return buftail.fp; | 1386 | return buftail.fp; |
| 1387 | } | 1387 | } |
| 1388 | 1388 | ||
| 1389 | /* | ||
| 1390 | * The registers we're interested in are at the end of the variable | ||
| 1391 | * length saved register structure. The fp points at the end of this | ||
| 1392 | * structure so the address of this struct is: | ||
| 1393 | * (struct compat_frame_tail *)(xxx->fp)-1 | ||
| 1394 | * | ||
| 1395 | * This code has been adapted from the ARM OProfile support. | ||
| 1396 | */ | ||
| 1397 | struct compat_frame_tail { | ||
| 1398 | compat_uptr_t fp; /* a (struct compat_frame_tail *) in compat mode */ | ||
| 1399 | u32 sp; | ||
| 1400 | u32 lr; | ||
| 1401 | } __attribute__((packed)); | ||
| 1402 | |||
| 1403 | static struct compat_frame_tail __user * | ||
| 1404 | compat_user_backtrace(struct compat_frame_tail __user *tail, | ||
| 1405 | struct perf_callchain_entry *entry) | ||
| 1406 | { | ||
| 1407 | struct compat_frame_tail buftail; | ||
| 1408 | unsigned long err; | ||
| 1409 | |||
| 1410 | /* Also check accessibility of one struct frame_tail beyond */ | ||
| 1411 | if (!access_ok(VERIFY_READ, tail, sizeof(buftail))) | ||
| 1412 | return NULL; | ||
| 1413 | |||
| 1414 | pagefault_disable(); | ||
| 1415 | err = __copy_from_user_inatomic(&buftail, tail, sizeof(buftail)); | ||
| 1416 | pagefault_enable(); | ||
| 1417 | |||
| 1418 | if (err) | ||
| 1419 | return NULL; | ||
| 1420 | |||
| 1421 | perf_callchain_store(entry, buftail.lr); | ||
| 1422 | |||
| 1423 | /* | ||
| 1424 | * Frame pointers should strictly progress back up the stack | ||
| 1425 | * (towards higher addresses). | ||
| 1426 | */ | ||
| 1427 | if (tail + 1 >= (struct compat_frame_tail __user *) | ||
| 1428 | compat_ptr(buftail.fp)) | ||
| 1429 | return NULL; | ||
| 1430 | |||
| 1431 | return (struct compat_frame_tail __user *)compat_ptr(buftail.fp) - 1; | ||
| 1432 | } | ||
| 1433 | |||
| 1389 | void perf_callchain_user(struct perf_callchain_entry *entry, | 1434 | void perf_callchain_user(struct perf_callchain_entry *entry, |
| 1390 | struct pt_regs *regs) | 1435 | struct pt_regs *regs) |
| 1391 | { | 1436 | { |
| 1392 | struct frame_tail __user *tail; | ||
| 1393 | |||
| 1394 | if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) { | 1437 | if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) { |
| 1395 | /* We don't support guest os callchain now */ | 1438 | /* We don't support guest os callchain now */ |
| 1396 | return; | 1439 | return; |
| 1397 | } | 1440 | } |
| 1398 | 1441 | ||
| 1399 | perf_callchain_store(entry, regs->pc); | 1442 | perf_callchain_store(entry, regs->pc); |
| 1400 | tail = (struct frame_tail __user *)regs->regs[29]; | ||
| 1401 | 1443 | ||
| 1402 | while (entry->nr < PERF_MAX_STACK_DEPTH && | 1444 | if (!compat_user_mode(regs)) { |
| 1403 | tail && !((unsigned long)tail & 0xf)) | 1445 | /* AARCH64 mode */ |
| 1404 | tail = user_backtrace(tail, entry); | 1446 | struct frame_tail __user *tail; |
| 1447 | |||
| 1448 | tail = (struct frame_tail __user *)regs->regs[29]; | ||
| 1449 | |||
| 1450 | while (entry->nr < PERF_MAX_STACK_DEPTH && | ||
| 1451 | tail && !((unsigned long)tail & 0xf)) | ||
| 1452 | tail = user_backtrace(tail, entry); | ||
| 1453 | } else { | ||
| 1454 | /* AARCH32 compat mode */ | ||
| 1455 | struct compat_frame_tail __user *tail; | ||
| 1456 | |||
| 1457 | tail = (struct compat_frame_tail __user *)regs->compat_fp - 1; | ||
| 1458 | |||
| 1459 | while ((entry->nr < PERF_MAX_STACK_DEPTH) && | ||
| 1460 | tail && !((unsigned long)tail & 0x3)) | ||
| 1461 | tail = compat_user_backtrace(tail, entry); | ||
| 1462 | } | ||
| 1405 | } | 1463 | } |
| 1406 | 1464 | ||
| 1407 | /* | 1465 | /* |
| @@ -1429,6 +1487,7 @@ void perf_callchain_kernel(struct perf_callchain_entry *entry, | |||
| 1429 | frame.fp = regs->regs[29]; | 1487 | frame.fp = regs->regs[29]; |
| 1430 | frame.sp = regs->sp; | 1488 | frame.sp = regs->sp; |
| 1431 | frame.pc = regs->pc; | 1489 | frame.pc = regs->pc; |
| 1490 | |||
| 1432 | walk_stackframe(&frame, callchain_trace, entry); | 1491 | walk_stackframe(&frame, callchain_trace, entry); |
| 1433 | } | 1492 | } |
| 1434 | 1493 | ||
diff --git a/arch/arm64/kernel/perf_regs.c b/arch/arm64/kernel/perf_regs.c new file mode 100644 index 000000000000..f2d6f0a36d63 --- /dev/null +++ b/arch/arm64/kernel/perf_regs.c | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | #include <linux/errno.h> | ||
| 2 | #include <linux/kernel.h> | ||
| 3 | #include <linux/perf_event.h> | ||
| 4 | #include <linux/bug.h> | ||
| 5 | #include <asm/perf_regs.h> | ||
| 6 | #include <asm/ptrace.h> | ||
| 7 | |||
| 8 | u64 perf_reg_value(struct pt_regs *regs, int idx) | ||
| 9 | { | ||
| 10 | if (WARN_ON_ONCE((u32)idx >= PERF_REG_ARM64_MAX)) | ||
| 11 | return 0; | ||
| 12 | |||
| 13 | /* | ||
| 14 | * Compat (i.e. 32 bit) mode: | ||
| 15 | * - PC has been set in the pt_regs struct in kernel_entry, | ||
| 16 | * - Handle SP and LR here. | ||
| 17 | */ | ||
| 18 | if (compat_user_mode(regs)) { | ||
| 19 | if ((u32)idx == PERF_REG_ARM64_SP) | ||
| 20 | return regs->compat_sp; | ||
| 21 | if ((u32)idx == PERF_REG_ARM64_LR) | ||
| 22 | return regs->compat_lr; | ||
| 23 | } | ||
| 24 | |||
| 25 | return regs->regs[idx]; | ||
| 26 | } | ||
| 27 | |||
| 28 | #define REG_RESERVED (~((1ULL << PERF_REG_ARM64_MAX) - 1)) | ||
| 29 | |||
| 30 | int perf_reg_validate(u64 mask) | ||
| 31 | { | ||
| 32 | if (!mask || mask & REG_RESERVED) | ||
| 33 | return -EINVAL; | ||
| 34 | |||
| 35 | return 0; | ||
| 36 | } | ||
| 37 | |||
| 38 | u64 perf_reg_abi(struct task_struct *task) | ||
| 39 | { | ||
| 40 | if (is_compat_thread(task_thread_info(task))) | ||
| 41 | return PERF_SAMPLE_REGS_ABI_32; | ||
| 42 | else | ||
| 43 | return PERF_SAMPLE_REGS_ABI_64; | ||
| 44 | } | ||
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index 1c0a9be2ffa8..6391485f342d 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c | |||
| @@ -33,7 +33,6 @@ | |||
| 33 | #include <linux/kallsyms.h> | 33 | #include <linux/kallsyms.h> |
| 34 | #include <linux/init.h> | 34 | #include <linux/init.h> |
| 35 | #include <linux/cpu.h> | 35 | #include <linux/cpu.h> |
| 36 | #include <linux/cpuidle.h> | ||
| 37 | #include <linux/elfcore.h> | 36 | #include <linux/elfcore.h> |
| 38 | #include <linux/pm.h> | 37 | #include <linux/pm.h> |
| 39 | #include <linux/tick.h> | 38 | #include <linux/tick.h> |
| @@ -72,8 +71,17 @@ static void setup_restart(void) | |||
| 72 | 71 | ||
| 73 | void soft_restart(unsigned long addr) | 72 | void soft_restart(unsigned long addr) |
| 74 | { | 73 | { |
| 74 | typedef void (*phys_reset_t)(unsigned long); | ||
| 75 | phys_reset_t phys_reset; | ||
| 76 | |||
| 75 | setup_restart(); | 77 | setup_restart(); |
| 76 | cpu_reset(addr); | 78 | |
| 79 | /* Switch to the identity mapping */ | ||
| 80 | phys_reset = (phys_reset_t)virt_to_phys(cpu_reset); | ||
| 81 | phys_reset(addr); | ||
| 82 | |||
| 83 | /* Should never get here */ | ||
| 84 | BUG(); | ||
| 77 | } | 85 | } |
| 78 | 86 | ||
| 79 | /* | 87 | /* |
| @@ -94,10 +102,8 @@ void arch_cpu_idle(void) | |||
| 94 | * This should do all the clock switching and wait for interrupt | 102 | * This should do all the clock switching and wait for interrupt |
| 95 | * tricks | 103 | * tricks |
| 96 | */ | 104 | */ |
| 97 | if (cpuidle_idle_call()) { | 105 | cpu_do_idle(); |
| 98 | cpu_do_idle(); | 106 | local_irq_enable(); |
| 99 | local_irq_enable(); | ||
| 100 | } | ||
| 101 | } | 107 | } |
| 102 | 108 | ||
| 103 | #ifdef CONFIG_HOTPLUG_CPU | 109 | #ifdef CONFIG_HOTPLUG_CPU |
diff --git a/arch/arm64/kernel/psci.c b/arch/arm64/kernel/psci.c index 4f97db3d7363..ea4828a4aa96 100644 --- a/arch/arm64/kernel/psci.c +++ b/arch/arm64/kernel/psci.c | |||
| @@ -176,22 +176,20 @@ static const struct of_device_id psci_of_match[] __initconst = { | |||
| 176 | {}, | 176 | {}, |
| 177 | }; | 177 | }; |
| 178 | 178 | ||
| 179 | int __init psci_init(void) | 179 | void __init psci_init(void) |
| 180 | { | 180 | { |
| 181 | struct device_node *np; | 181 | struct device_node *np; |
| 182 | const char *method; | 182 | const char *method; |
| 183 | u32 id; | 183 | u32 id; |
| 184 | int err = 0; | ||
| 185 | 184 | ||
| 186 | np = of_find_matching_node(NULL, psci_of_match); | 185 | np = of_find_matching_node(NULL, psci_of_match); |
| 187 | if (!np) | 186 | if (!np) |
| 188 | return -ENODEV; | 187 | return; |
| 189 | 188 | ||
| 190 | pr_info("probing function IDs from device-tree\n"); | 189 | pr_info("probing function IDs from device-tree\n"); |
| 191 | 190 | ||
| 192 | if (of_property_read_string(np, "method", &method)) { | 191 | if (of_property_read_string(np, "method", &method)) { |
| 193 | pr_warning("missing \"method\" property\n"); | 192 | pr_warning("missing \"method\" property\n"); |
| 194 | err = -ENXIO; | ||
| 195 | goto out_put_node; | 193 | goto out_put_node; |
| 196 | } | 194 | } |
| 197 | 195 | ||
| @@ -201,7 +199,6 @@ int __init psci_init(void) | |||
| 201 | invoke_psci_fn = __invoke_psci_fn_smc; | 199 | invoke_psci_fn = __invoke_psci_fn_smc; |
| 202 | } else { | 200 | } else { |
| 203 | pr_warning("invalid \"method\" property: %s\n", method); | 201 | pr_warning("invalid \"method\" property: %s\n", method); |
| 204 | err = -EINVAL; | ||
| 205 | goto out_put_node; | 202 | goto out_put_node; |
| 206 | } | 203 | } |
| 207 | 204 | ||
| @@ -227,7 +224,7 @@ int __init psci_init(void) | |||
| 227 | 224 | ||
| 228 | out_put_node: | 225 | out_put_node: |
| 229 | of_node_put(np); | 226 | of_node_put(np); |
| 230 | return err; | 227 | return; |
| 231 | } | 228 | } |
| 232 | 229 | ||
| 233 | #ifdef CONFIG_SMP | 230 | #ifdef CONFIG_SMP |
| @@ -251,7 +248,7 @@ static int cpu_psci_cpu_boot(unsigned int cpu) | |||
| 251 | { | 248 | { |
| 252 | int err = psci_ops.cpu_on(cpu_logical_map(cpu), __pa(secondary_entry)); | 249 | int err = psci_ops.cpu_on(cpu_logical_map(cpu), __pa(secondary_entry)); |
| 253 | if (err) | 250 | if (err) |
| 254 | pr_err("psci: failed to boot CPU%d (%d)\n", cpu, err); | 251 | pr_err("failed to boot CPU%d (%d)\n", cpu, err); |
| 255 | 252 | ||
| 256 | return err; | 253 | return err; |
| 257 | } | 254 | } |
| @@ -278,7 +275,7 @@ static void cpu_psci_cpu_die(unsigned int cpu) | |||
| 278 | 275 | ||
| 279 | ret = psci_ops.cpu_off(state); | 276 | ret = psci_ops.cpu_off(state); |
| 280 | 277 | ||
| 281 | pr_crit("psci: unable to power off CPU%u (%d)\n", cpu, ret); | 278 | pr_crit("unable to power off CPU%u (%d)\n", cpu, ret); |
| 282 | } | 279 | } |
| 283 | #endif | 280 | #endif |
| 284 | 281 | ||
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index c8e9effe52e1..67da30741a1b 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c | |||
| @@ -69,6 +69,7 @@ EXPORT_SYMBOL_GPL(elf_hwcap); | |||
| 69 | COMPAT_HWCAP_VFPv3|COMPAT_HWCAP_VFPv4|\ | 69 | COMPAT_HWCAP_VFPv3|COMPAT_HWCAP_VFPv4|\ |
| 70 | COMPAT_HWCAP_NEON|COMPAT_HWCAP_IDIV) | 70 | COMPAT_HWCAP_NEON|COMPAT_HWCAP_IDIV) |
| 71 | unsigned int compat_elf_hwcap __read_mostly = COMPAT_ELF_HWCAP_DEFAULT; | 71 | unsigned int compat_elf_hwcap __read_mostly = COMPAT_ELF_HWCAP_DEFAULT; |
| 72 | unsigned int compat_elf_hwcap2 __read_mostly; | ||
| 72 | #endif | 73 | #endif |
| 73 | 74 | ||
| 74 | static const char *cpu_name; | 75 | static const char *cpu_name; |
| @@ -242,6 +243,38 @@ static void __init setup_processor(void) | |||
| 242 | block = (features >> 16) & 0xf; | 243 | block = (features >> 16) & 0xf; |
| 243 | if (block && !(block & 0x8)) | 244 | if (block && !(block & 0x8)) |
| 244 | elf_hwcap |= HWCAP_CRC32; | 245 | elf_hwcap |= HWCAP_CRC32; |
| 246 | |||
| 247 | #ifdef CONFIG_COMPAT | ||
| 248 | /* | ||
| 249 | * ID_ISAR5_EL1 carries similar information as above, but pertaining to | ||
| 250 | * the Aarch32 32-bit execution state. | ||
| 251 | */ | ||
| 252 | features = read_cpuid(ID_ISAR5_EL1); | ||
| 253 | block = (features >> 4) & 0xf; | ||
| 254 | if (!(block & 0x8)) { | ||
| 255 | switch (block) { | ||
| 256 | default: | ||
| 257 | case 2: | ||
| 258 | compat_elf_hwcap2 |= COMPAT_HWCAP2_PMULL; | ||
| 259 | case 1: | ||
| 260 | compat_elf_hwcap2 |= COMPAT_HWCAP2_AES; | ||
| 261 | case 0: | ||
| 262 | break; | ||
| 263 | } | ||
| 264 | } | ||
| 265 | |||
| 266 | block = (features >> 8) & 0xf; | ||
| 267 | if (block && !(block & 0x8)) | ||
| 268 | compat_elf_hwcap2 |= COMPAT_HWCAP2_SHA1; | ||
| 269 | |||
| 270 | block = (features >> 12) & 0xf; | ||
| 271 | if (block && !(block & 0x8)) | ||
| 272 | compat_elf_hwcap2 |= COMPAT_HWCAP2_SHA2; | ||
| 273 | |||
| 274 | block = (features >> 16) & 0xf; | ||
| 275 | if (block && !(block & 0x8)) | ||
| 276 | compat_elf_hwcap2 |= COMPAT_HWCAP2_CRC32; | ||
| 277 | #endif | ||
| 245 | } | 278 | } |
| 246 | 279 | ||
| 247 | static void __init setup_machine_fdt(phys_addr_t dt_phys) | 280 | static void __init setup_machine_fdt(phys_addr_t dt_phys) |
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 7cfb92a4ab66..f0a141dd5655 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c | |||
| @@ -114,6 +114,11 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle) | |||
| 114 | return ret; | 114 | return ret; |
| 115 | } | 115 | } |
| 116 | 116 | ||
| 117 | static void smp_store_cpu_info(unsigned int cpuid) | ||
| 118 | { | ||
| 119 | store_cpu_topology(cpuid); | ||
| 120 | } | ||
| 121 | |||
| 117 | /* | 122 | /* |
| 118 | * This is the secondary CPU boot entry. We're using this CPUs | 123 | * This is the secondary CPU boot entry. We're using this CPUs |
| 119 | * idle thread stack, but a set of temporary page tables. | 124 | * idle thread stack, but a set of temporary page tables. |
| @@ -152,6 +157,8 @@ asmlinkage void secondary_start_kernel(void) | |||
| 152 | */ | 157 | */ |
| 153 | notify_cpu_starting(cpu); | 158 | notify_cpu_starting(cpu); |
| 154 | 159 | ||
| 160 | smp_store_cpu_info(cpu); | ||
| 161 | |||
| 155 | /* | 162 | /* |
| 156 | * OK, now it's safe to let the boot CPU continue. Wait for | 163 | * OK, now it's safe to let the boot CPU continue. Wait for |
| 157 | * the CPU migration code to notice that the CPU is online | 164 | * the CPU migration code to notice that the CPU is online |
| @@ -160,6 +167,7 @@ asmlinkage void secondary_start_kernel(void) | |||
| 160 | set_cpu_online(cpu, true); | 167 | set_cpu_online(cpu, true); |
| 161 | complete(&cpu_running); | 168 | complete(&cpu_running); |
| 162 | 169 | ||
| 170 | local_dbg_enable(); | ||
| 163 | local_irq_enable(); | 171 | local_irq_enable(); |
| 164 | local_async_enable(); | 172 | local_async_enable(); |
| 165 | 173 | ||
| @@ -390,6 +398,10 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
| 390 | int err; | 398 | int err; |
| 391 | unsigned int cpu, ncores = num_possible_cpus(); | 399 | unsigned int cpu, ncores = num_possible_cpus(); |
| 392 | 400 | ||
| 401 | init_cpu_topology(); | ||
| 402 | |||
| 403 | smp_store_cpu_info(smp_processor_id()); | ||
| 404 | |||
| 393 | /* | 405 | /* |
| 394 | * are we trying to boot more cores than exist? | 406 | * are we trying to boot more cores than exist? |
| 395 | */ | 407 | */ |
diff --git a/arch/arm64/kernel/smp_spin_table.c b/arch/arm64/kernel/smp_spin_table.c index 44c22805d2e2..7a530d2cc807 100644 --- a/arch/arm64/kernel/smp_spin_table.c +++ b/arch/arm64/kernel/smp_spin_table.c | |||
| @@ -128,7 +128,7 @@ static int smp_spin_table_cpu_boot(unsigned int cpu) | |||
| 128 | return secondary_holding_pen_release != INVALID_HWID ? -ENOSYS : 0; | 128 | return secondary_holding_pen_release != INVALID_HWID ? -ENOSYS : 0; |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | void smp_spin_table_cpu_postboot(void) | 131 | static void smp_spin_table_cpu_postboot(void) |
| 132 | { | 132 | { |
| 133 | /* | 133 | /* |
| 134 | * Let the primary processor know we're out of the pen. | 134 | * Let the primary processor know we're out of the pen. |
diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c index c3b6c63ea5fb..38f0558f0c0a 100644 --- a/arch/arm64/kernel/stacktrace.c +++ b/arch/arm64/kernel/stacktrace.c | |||
| @@ -48,7 +48,11 @@ int unwind_frame(struct stackframe *frame) | |||
| 48 | 48 | ||
| 49 | frame->sp = fp + 0x10; | 49 | frame->sp = fp + 0x10; |
| 50 | frame->fp = *(unsigned long *)(fp); | 50 | frame->fp = *(unsigned long *)(fp); |
| 51 | frame->pc = *(unsigned long *)(fp + 8); | 51 | /* |
| 52 | * -4 here because we care about the PC at time of bl, | ||
| 53 | * not where the return will go. | ||
| 54 | */ | ||
| 55 | frame->pc = *(unsigned long *)(fp + 8) - 4; | ||
| 52 | 56 | ||
| 53 | return 0; | 57 | return 0; |
| 54 | } | 58 | } |
diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c new file mode 100644 index 000000000000..3e06b0be4ec8 --- /dev/null +++ b/arch/arm64/kernel/topology.c | |||
| @@ -0,0 +1,95 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm64/kernel/topology.c | ||
| 3 | * | ||
| 4 | * Copyright (C) 2011,2013,2014 Linaro Limited. | ||
| 5 | * | ||
| 6 | * Based on the arm32 version written by Vincent Guittot in turn based on | ||
| 7 | * arch/sh/kernel/topology.c | ||
| 8 | * | ||
| 9 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 10 | * License. See the file "COPYING" in the main directory of this archive | ||
| 11 | * for more details. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <linux/cpu.h> | ||
| 15 | #include <linux/cpumask.h> | ||
| 16 | #include <linux/init.h> | ||
| 17 | #include <linux/percpu.h> | ||
| 18 | #include <linux/node.h> | ||
| 19 | #include <linux/nodemask.h> | ||
| 20 | #include <linux/sched.h> | ||
| 21 | |||
| 22 | #include <asm/topology.h> | ||
| 23 | |||
| 24 | /* | ||
| 25 | * cpu topology table | ||
| 26 | */ | ||
| 27 | struct cpu_topology cpu_topology[NR_CPUS]; | ||
| 28 | EXPORT_SYMBOL_GPL(cpu_topology); | ||
| 29 | |||
| 30 | const struct cpumask *cpu_coregroup_mask(int cpu) | ||
| 31 | { | ||
| 32 | return &cpu_topology[cpu].core_sibling; | ||
| 33 | } | ||
| 34 | |||
| 35 | static void update_siblings_masks(unsigned int cpuid) | ||
| 36 | { | ||
| 37 | struct cpu_topology *cpu_topo, *cpuid_topo = &cpu_topology[cpuid]; | ||
| 38 | int cpu; | ||
| 39 | |||
| 40 | if (cpuid_topo->cluster_id == -1) { | ||
| 41 | /* | ||
| 42 | * DT does not contain topology information for this cpu | ||
| 43 | * reset it to default behaviour | ||
| 44 | */ | ||
| 45 | pr_debug("CPU%u: No topology information configured\n", cpuid); | ||
| 46 | cpuid_topo->core_id = 0; | ||
| 47 | cpumask_set_cpu(cpuid, &cpuid_topo->core_sibling); | ||
| 48 | cpumask_set_cpu(cpuid, &cpuid_topo->thread_sibling); | ||
| 49 | return; | ||
| 50 | } | ||
| 51 | |||
| 52 | /* update core and thread sibling masks */ | ||
| 53 | for_each_possible_cpu(cpu) { | ||
| 54 | cpu_topo = &cpu_topology[cpu]; | ||
| 55 | |||
| 56 | if (cpuid_topo->cluster_id != cpu_topo->cluster_id) | ||
| 57 | continue; | ||
| 58 | |||
| 59 | cpumask_set_cpu(cpuid, &cpu_topo->core_sibling); | ||
| 60 | if (cpu != cpuid) | ||
| 61 | cpumask_set_cpu(cpu, &cpuid_topo->core_sibling); | ||
| 62 | |||
| 63 | if (cpuid_topo->core_id != cpu_topo->core_id) | ||
| 64 | continue; | ||
| 65 | |||
| 66 | cpumask_set_cpu(cpuid, &cpu_topo->thread_sibling); | ||
| 67 | if (cpu != cpuid) | ||
| 68 | cpumask_set_cpu(cpu, &cpuid_topo->thread_sibling); | ||
| 69 | } | ||
| 70 | } | ||
| 71 | |||
| 72 | void store_cpu_topology(unsigned int cpuid) | ||
| 73 | { | ||
| 74 | update_siblings_masks(cpuid); | ||
| 75 | } | ||
| 76 | |||
| 77 | /* | ||
| 78 | * init_cpu_topology is called at boot when only one cpu is running | ||
| 79 | * which prevent simultaneous write access to cpu_topology array | ||
| 80 | */ | ||
| 81 | void __init init_cpu_topology(void) | ||
| 82 | { | ||
| 83 | unsigned int cpu; | ||
| 84 | |||
| 85 | /* init core mask and power*/ | ||
| 86 | for_each_possible_cpu(cpu) { | ||
| 87 | struct cpu_topology *cpu_topo = &cpu_topology[cpu]; | ||
| 88 | |||
| 89 | cpu_topo->thread_id = -1; | ||
| 90 | cpu_topo->core_id = -1; | ||
| 91 | cpu_topo->cluster_id = -1; | ||
| 92 | cpumask_clear(&cpu_topo->core_sibling); | ||
| 93 | cpumask_clear(&cpu_topo->thread_sibling); | ||
| 94 | } | ||
| 95 | } | ||
diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c index a7149cae1615..50384fec56c4 100644 --- a/arch/arm64/kernel/vdso.c +++ b/arch/arm64/kernel/vdso.c | |||
| @@ -106,49 +106,31 @@ int aarch32_setup_vectors_page(struct linux_binprm *bprm, int uses_interp) | |||
| 106 | 106 | ||
| 107 | static int __init vdso_init(void) | 107 | static int __init vdso_init(void) |
| 108 | { | 108 | { |
| 109 | struct page *pg; | 109 | int i; |
| 110 | char *vbase; | 110 | |
| 111 | int i, ret = 0; | 111 | if (memcmp(&vdso_start, "\177ELF", 4)) { |
| 112 | pr_err("vDSO is not a valid ELF object!\n"); | ||
| 113 | return -EINVAL; | ||
| 114 | } | ||
| 112 | 115 | ||
| 113 | vdso_pages = (&vdso_end - &vdso_start) >> PAGE_SHIFT; | 116 | vdso_pages = (&vdso_end - &vdso_start) >> PAGE_SHIFT; |
| 114 | pr_info("vdso: %ld pages (%ld code, %ld data) at base %p\n", | 117 | pr_info("vdso: %ld pages (%ld code, %ld data) at base %p\n", |
| 115 | vdso_pages + 1, vdso_pages, 1L, &vdso_start); | 118 | vdso_pages + 1, vdso_pages, 1L, &vdso_start); |
| 116 | 119 | ||
| 117 | /* Allocate the vDSO pagelist, plus a page for the data. */ | 120 | /* Allocate the vDSO pagelist, plus a page for the data. */ |
| 118 | vdso_pagelist = kzalloc(sizeof(struct page *) * (vdso_pages + 1), | 121 | vdso_pagelist = kcalloc(vdso_pages + 1, sizeof(struct page *), |
| 119 | GFP_KERNEL); | 122 | GFP_KERNEL); |
| 120 | if (vdso_pagelist == NULL) { | 123 | if (vdso_pagelist == NULL) |
| 121 | pr_err("Failed to allocate vDSO pagelist!\n"); | ||
| 122 | return -ENOMEM; | 124 | return -ENOMEM; |
| 123 | } | ||
| 124 | 125 | ||
| 125 | /* Grab the vDSO code pages. */ | 126 | /* Grab the vDSO code pages. */ |
| 126 | for (i = 0; i < vdso_pages; i++) { | 127 | for (i = 0; i < vdso_pages; i++) |
| 127 | pg = virt_to_page(&vdso_start + i*PAGE_SIZE); | 128 | vdso_pagelist[i] = virt_to_page(&vdso_start + i * PAGE_SIZE); |
| 128 | ClearPageReserved(pg); | ||
| 129 | get_page(pg); | ||
| 130 | vdso_pagelist[i] = pg; | ||
| 131 | } | ||
| 132 | |||
| 133 | /* Sanity check the shared object header. */ | ||
| 134 | vbase = vmap(vdso_pagelist, 1, 0, PAGE_KERNEL); | ||
| 135 | if (vbase == NULL) { | ||
| 136 | pr_err("Failed to map vDSO pagelist!\n"); | ||
| 137 | return -ENOMEM; | ||
| 138 | } else if (memcmp(vbase, "\177ELF", 4)) { | ||
| 139 | pr_err("vDSO is not a valid ELF object!\n"); | ||
| 140 | ret = -EINVAL; | ||
| 141 | goto unmap; | ||
| 142 | } | ||
| 143 | 129 | ||
| 144 | /* Grab the vDSO data page. */ | 130 | /* Grab the vDSO data page. */ |
| 145 | pg = virt_to_page(vdso_data); | 131 | vdso_pagelist[i] = virt_to_page(vdso_data); |
| 146 | get_page(pg); | ||
| 147 | vdso_pagelist[i] = pg; | ||
| 148 | 132 | ||
| 149 | unmap: | 133 | return 0; |
| 150 | vunmap(vbase); | ||
| 151 | return ret; | ||
| 152 | } | 134 | } |
| 153 | arch_initcall(vdso_init); | 135 | arch_initcall(vdso_init); |
| 154 | 136 | ||
diff --git a/arch/arm64/kvm/hyp-init.S b/arch/arm64/kvm/hyp-init.S index 2b0244d65c16..d968796f4b2d 100644 --- a/arch/arm64/kvm/hyp-init.S +++ b/arch/arm64/kvm/hyp-init.S | |||
| @@ -68,6 +68,12 @@ __do_hyp_init: | |||
| 68 | msr tcr_el2, x4 | 68 | msr tcr_el2, x4 |
| 69 | 69 | ||
| 70 | ldr x4, =VTCR_EL2_FLAGS | 70 | ldr x4, =VTCR_EL2_FLAGS |
| 71 | /* | ||
| 72 | * Read the PARange bits from ID_AA64MMFR0_EL1 and set the PS bits in | ||
| 73 | * VTCR_EL2. | ||
| 74 | */ | ||
| 75 | mrs x5, ID_AA64MMFR0_EL1 | ||
| 76 | bfi x4, x5, #16, #3 | ||
| 71 | msr vtcr_el2, x4 | 77 | msr vtcr_el2, x4 |
| 72 | 78 | ||
| 73 | mrs x4, mair_el1 | 79 | mrs x4, mair_el1 |
diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S index 3b47c36e10ff..2c56012cb2d2 100644 --- a/arch/arm64/kvm/hyp.S +++ b/arch/arm64/kvm/hyp.S | |||
| @@ -694,6 +694,24 @@ __hyp_panic_str: | |||
| 694 | 694 | ||
| 695 | .align 2 | 695 | .align 2 |
| 696 | 696 | ||
| 697 | /* | ||
| 698 | * u64 kvm_call_hyp(void *hypfn, ...); | ||
| 699 | * | ||
| 700 | * This is not really a variadic function in the classic C-way and care must | ||
| 701 | * be taken when calling this to ensure parameters are passed in registers | ||
| 702 | * only, since the stack will change between the caller and the callee. | ||
| 703 | * | ||
| 704 | * Call the function with the first argument containing a pointer to the | ||
| 705 | * function you wish to call in Hyp mode, and subsequent arguments will be | ||
| 706 | * passed as x0, x1, and x2 (a maximum of 3 arguments in addition to the | ||
| 707 | * function pointer can be passed). The function being called must be mapped | ||
| 708 | * in Hyp mode (see init_hyp_mode in arch/arm/kvm/arm.c). Return values are | ||
| 709 | * passed in r0 and r1. | ||
| 710 | * | ||
| 711 | * A function pointer with a value of 0 has a special meaning, and is | ||
| 712 | * used to implement __hyp_get_vectors in the same way as in | ||
| 713 | * arch/arm64/kernel/hyp_stub.S. | ||
| 714 | */ | ||
| 697 | ENTRY(kvm_call_hyp) | 715 | ENTRY(kvm_call_hyp) |
| 698 | hvc #0 | 716 | hvc #0 |
| 699 | ret | 717 | ret |
| @@ -737,7 +755,12 @@ el1_sync: // Guest trapped into EL2 | |||
| 737 | pop x2, x3 | 755 | pop x2, x3 |
| 738 | pop x0, x1 | 756 | pop x0, x1 |
| 739 | 757 | ||
| 740 | push lr, xzr | 758 | /* Check for __hyp_get_vectors */ |
| 759 | cbnz x0, 1f | ||
| 760 | mrs x0, vbar_el2 | ||
| 761 | b 2f | ||
| 762 | |||
| 763 | 1: push lr, xzr | ||
| 741 | 764 | ||
| 742 | /* | 765 | /* |
| 743 | * Compute the function address in EL2, and shuffle the parameters. | 766 | * Compute the function address in EL2, and shuffle the parameters. |
| @@ -750,7 +773,7 @@ el1_sync: // Guest trapped into EL2 | |||
| 750 | blr lr | 773 | blr lr |
| 751 | 774 | ||
| 752 | pop lr, xzr | 775 | pop lr, xzr |
| 753 | eret | 776 | 2: eret |
| 754 | 777 | ||
| 755 | el1_trap: | 778 | el1_trap: |
| 756 | /* | 779 | /* |
diff --git a/arch/arm64/mm/cache.S b/arch/arm64/mm/cache.S index 1ea9f26d1b70..c46f48b33c14 100644 --- a/arch/arm64/mm/cache.S +++ b/arch/arm64/mm/cache.S | |||
| @@ -30,7 +30,7 @@ | |||
| 30 | * | 30 | * |
| 31 | * Corrupted registers: x0-x7, x9-x11 | 31 | * Corrupted registers: x0-x7, x9-x11 |
| 32 | */ | 32 | */ |
| 33 | ENTRY(__flush_dcache_all) | 33 | __flush_dcache_all: |
| 34 | dsb sy // ensure ordering with previous memory accesses | 34 | dsb sy // ensure ordering with previous memory accesses |
| 35 | mrs x0, clidr_el1 // read clidr | 35 | mrs x0, clidr_el1 // read clidr |
| 36 | and x3, x0, #0x7000000 // extract loc from clidr | 36 | and x3, x0, #0x7000000 // extract loc from clidr |
| @@ -166,3 +166,81 @@ ENTRY(__flush_dcache_area) | |||
| 166 | dsb sy | 166 | dsb sy |
| 167 | ret | 167 | ret |
| 168 | ENDPROC(__flush_dcache_area) | 168 | ENDPROC(__flush_dcache_area) |
| 169 | |||
| 170 | /* | ||
| 171 | * __dma_inv_range(start, end) | ||
| 172 | * - start - virtual start address of region | ||
| 173 | * - end - virtual end address of region | ||
| 174 | */ | ||
| 175 | __dma_inv_range: | ||
| 176 | dcache_line_size x2, x3 | ||
| 177 | sub x3, x2, #1 | ||
| 178 | bic x0, x0, x3 | ||
| 179 | bic x1, x1, x3 | ||
| 180 | 1: dc ivac, x0 // invalidate D / U line | ||
| 181 | add x0, x0, x2 | ||
| 182 | cmp x0, x1 | ||
| 183 | b.lo 1b | ||
| 184 | dsb sy | ||
| 185 | ret | ||
| 186 | ENDPROC(__dma_inv_range) | ||
| 187 | |||
| 188 | /* | ||
| 189 | * __dma_clean_range(start, end) | ||
| 190 | * - start - virtual start address of region | ||
| 191 | * - end - virtual end address of region | ||
| 192 | */ | ||
| 193 | __dma_clean_range: | ||
| 194 | dcache_line_size x2, x3 | ||
| 195 | sub x3, x2, #1 | ||
| 196 | bic x0, x0, x3 | ||
| 197 | 1: dc cvac, x0 // clean D / U line | ||
| 198 | add x0, x0, x2 | ||
| 199 | cmp x0, x1 | ||
| 200 | b.lo 1b | ||
| 201 | dsb sy | ||
| 202 | ret | ||
| 203 | ENDPROC(__dma_clean_range) | ||
| 204 | |||
| 205 | /* | ||
| 206 | * __dma_flush_range(start, end) | ||
| 207 | * - start - virtual start address of region | ||
| 208 | * - end - virtual end address of region | ||
| 209 | */ | ||
| 210 | ENTRY(__dma_flush_range) | ||
| 211 | dcache_line_size x2, x3 | ||
| 212 | sub x3, x2, #1 | ||
| 213 | bic x0, x0, x3 | ||
| 214 | 1: dc civac, x0 // clean & invalidate D / U line | ||
| 215 | add x0, x0, x2 | ||
| 216 | cmp x0, x1 | ||
| 217 | b.lo 1b | ||
| 218 | dsb sy | ||
| 219 | ret | ||
| 220 | ENDPROC(__dma_flush_range) | ||
| 221 | |||
| 222 | /* | ||
| 223 | * __dma_map_area(start, size, dir) | ||
| 224 | * - start - kernel virtual start address | ||
| 225 | * - size - size of region | ||
| 226 | * - dir - DMA direction | ||
| 227 | */ | ||
| 228 | ENTRY(__dma_map_area) | ||
| 229 | add x1, x1, x0 | ||
| 230 | cmp w2, #DMA_FROM_DEVICE | ||
| 231 | b.eq __dma_inv_range | ||
| 232 | b __dma_clean_range | ||
| 233 | ENDPROC(__dma_map_area) | ||
| 234 | |||
| 235 | /* | ||
| 236 | * __dma_unmap_area(start, size, dir) | ||
| 237 | * - start - kernel virtual start address | ||
| 238 | * - size - size of region | ||
| 239 | * - dir - DMA direction | ||
| 240 | */ | ||
| 241 | ENTRY(__dma_unmap_area) | ||
| 242 | add x1, x1, x0 | ||
| 243 | cmp w2, #DMA_TO_DEVICE | ||
| 244 | b.ne __dma_inv_range | ||
| 245 | ret | ||
| 246 | ENDPROC(__dma_unmap_area) | ||
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c index fbd76785c5db..0ba347e59f06 100644 --- a/arch/arm64/mm/dma-mapping.c +++ b/arch/arm64/mm/dma-mapping.c | |||
| @@ -30,18 +30,26 @@ | |||
| 30 | struct dma_map_ops *dma_ops; | 30 | struct dma_map_ops *dma_ops; |
| 31 | EXPORT_SYMBOL(dma_ops); | 31 | EXPORT_SYMBOL(dma_ops); |
| 32 | 32 | ||
| 33 | static void *arm64_swiotlb_alloc_coherent(struct device *dev, size_t size, | 33 | static pgprot_t __get_dma_pgprot(struct dma_attrs *attrs, pgprot_t prot, |
| 34 | dma_addr_t *dma_handle, gfp_t flags, | 34 | bool coherent) |
| 35 | struct dma_attrs *attrs) | 35 | { |
| 36 | if (!coherent || dma_get_attr(DMA_ATTR_WRITE_COMBINE, attrs)) | ||
| 37 | return pgprot_writecombine(prot); | ||
| 38 | return prot; | ||
| 39 | } | ||
| 40 | |||
| 41 | static void *__dma_alloc_coherent(struct device *dev, size_t size, | ||
| 42 | dma_addr_t *dma_handle, gfp_t flags, | ||
| 43 | struct dma_attrs *attrs) | ||
| 36 | { | 44 | { |
| 37 | if (dev == NULL) { | 45 | if (dev == NULL) { |
| 38 | WARN_ONCE(1, "Use an actual device structure for DMA allocation\n"); | 46 | WARN_ONCE(1, "Use an actual device structure for DMA allocation\n"); |
| 39 | return NULL; | 47 | return NULL; |
| 40 | } | 48 | } |
| 41 | 49 | ||
| 42 | if (IS_ENABLED(CONFIG_ZONE_DMA32) && | 50 | if (IS_ENABLED(CONFIG_ZONE_DMA) && |
| 43 | dev->coherent_dma_mask <= DMA_BIT_MASK(32)) | 51 | dev->coherent_dma_mask <= DMA_BIT_MASK(32)) |
| 44 | flags |= GFP_DMA32; | 52 | flags |= GFP_DMA; |
| 45 | if (IS_ENABLED(CONFIG_DMA_CMA)) { | 53 | if (IS_ENABLED(CONFIG_DMA_CMA)) { |
| 46 | struct page *page; | 54 | struct page *page; |
| 47 | 55 | ||
| @@ -58,9 +66,9 @@ static void *arm64_swiotlb_alloc_coherent(struct device *dev, size_t size, | |||
| 58 | } | 66 | } |
| 59 | } | 67 | } |
| 60 | 68 | ||
| 61 | static void arm64_swiotlb_free_coherent(struct device *dev, size_t size, | 69 | static void __dma_free_coherent(struct device *dev, size_t size, |
| 62 | void *vaddr, dma_addr_t dma_handle, | 70 | void *vaddr, dma_addr_t dma_handle, |
| 63 | struct dma_attrs *attrs) | 71 | struct dma_attrs *attrs) |
| 64 | { | 72 | { |
| 65 | if (dev == NULL) { | 73 | if (dev == NULL) { |
| 66 | WARN_ONCE(1, "Use an actual device structure for DMA allocation\n"); | 74 | WARN_ONCE(1, "Use an actual device structure for DMA allocation\n"); |
| @@ -78,9 +86,212 @@ static void arm64_swiotlb_free_coherent(struct device *dev, size_t size, | |||
| 78 | } | 86 | } |
| 79 | } | 87 | } |
| 80 | 88 | ||
| 81 | static struct dma_map_ops arm64_swiotlb_dma_ops = { | 89 | static void *__dma_alloc_noncoherent(struct device *dev, size_t size, |
| 82 | .alloc = arm64_swiotlb_alloc_coherent, | 90 | dma_addr_t *dma_handle, gfp_t flags, |
| 83 | .free = arm64_swiotlb_free_coherent, | 91 | struct dma_attrs *attrs) |
| 92 | { | ||
| 93 | struct page *page, **map; | ||
| 94 | void *ptr, *coherent_ptr; | ||
| 95 | int order, i; | ||
| 96 | |||
| 97 | size = PAGE_ALIGN(size); | ||
| 98 | order = get_order(size); | ||
| 99 | |||
| 100 | ptr = __dma_alloc_coherent(dev, size, dma_handle, flags, attrs); | ||
| 101 | if (!ptr) | ||
| 102 | goto no_mem; | ||
| 103 | map = kmalloc(sizeof(struct page *) << order, flags & ~GFP_DMA); | ||
| 104 | if (!map) | ||
| 105 | goto no_map; | ||
| 106 | |||
| 107 | /* remove any dirty cache lines on the kernel alias */ | ||
| 108 | __dma_flush_range(ptr, ptr + size); | ||
| 109 | |||
| 110 | /* create a coherent mapping */ | ||
| 111 | page = virt_to_page(ptr); | ||
| 112 | for (i = 0; i < (size >> PAGE_SHIFT); i++) | ||
| 113 | map[i] = page + i; | ||
| 114 | coherent_ptr = vmap(map, size >> PAGE_SHIFT, VM_MAP, | ||
| 115 | __get_dma_pgprot(attrs, pgprot_default, false)); | ||
| 116 | kfree(map); | ||
| 117 | if (!coherent_ptr) | ||
| 118 | goto no_map; | ||
| 119 | |||
| 120 | return coherent_ptr; | ||
| 121 | |||
| 122 | no_map: | ||
| 123 | __dma_free_coherent(dev, size, ptr, *dma_handle, attrs); | ||
| 124 | no_mem: | ||
| 125 | *dma_handle = ~0; | ||
| 126 | return NULL; | ||
| 127 | } | ||
| 128 | |||
| 129 | static void __dma_free_noncoherent(struct device *dev, size_t size, | ||
| 130 | void *vaddr, dma_addr_t dma_handle, | ||
| 131 | struct dma_attrs *attrs) | ||
| 132 | { | ||
| 133 | void *swiotlb_addr = phys_to_virt(dma_to_phys(dev, dma_handle)); | ||
| 134 | |||
| 135 | vunmap(vaddr); | ||
| 136 | __dma_free_coherent(dev, size, swiotlb_addr, dma_handle, attrs); | ||
| 137 | } | ||
| 138 | |||
| 139 | static dma_addr_t __swiotlb_map_page(struct device *dev, struct page *page, | ||
| 140 | unsigned long offset, size_t size, | ||
| 141 | enum dma_data_direction dir, | ||
| 142 | struct dma_attrs *attrs) | ||
| 143 | { | ||
| 144 | dma_addr_t dev_addr; | ||
| 145 | |||
| 146 | dev_addr = swiotlb_map_page(dev, page, offset, size, dir, attrs); | ||
| 147 | __dma_map_area(phys_to_virt(dma_to_phys(dev, dev_addr)), size, dir); | ||
| 148 | |||
| 149 | return dev_addr; | ||
| 150 | } | ||
| 151 | |||
| 152 | |||
| 153 | static void __swiotlb_unmap_page(struct device *dev, dma_addr_t dev_addr, | ||
| 154 | size_t size, enum dma_data_direction dir, | ||
| 155 | struct dma_attrs *attrs) | ||
| 156 | { | ||
| 157 | __dma_unmap_area(phys_to_virt(dma_to_phys(dev, dev_addr)), size, dir); | ||
| 158 | swiotlb_unmap_page(dev, dev_addr, size, dir, attrs); | ||
| 159 | } | ||
| 160 | |||
| 161 | static int __swiotlb_map_sg_attrs(struct device *dev, struct scatterlist *sgl, | ||
| 162 | int nelems, enum dma_data_direction dir, | ||
| 163 | struct dma_attrs *attrs) | ||
| 164 | { | ||
| 165 | struct scatterlist *sg; | ||
| 166 | int i, ret; | ||
| 167 | |||
| 168 | ret = swiotlb_map_sg_attrs(dev, sgl, nelems, dir, attrs); | ||
| 169 | for_each_sg(sgl, sg, ret, i) | ||
| 170 | __dma_map_area(phys_to_virt(dma_to_phys(dev, sg->dma_address)), | ||
| 171 | sg->length, dir); | ||
| 172 | |||
| 173 | return ret; | ||
| 174 | } | ||
| 175 | |||
| 176 | static void __swiotlb_unmap_sg_attrs(struct device *dev, | ||
| 177 | struct scatterlist *sgl, int nelems, | ||
| 178 | enum dma_data_direction dir, | ||
| 179 | struct dma_attrs *attrs) | ||
| 180 | { | ||
| 181 | struct scatterlist *sg; | ||
| 182 | int i; | ||
| 183 | |||
| 184 | for_each_sg(sgl, sg, nelems, i) | ||
| 185 | __dma_unmap_area(phys_to_virt(dma_to_phys(dev, sg->dma_address)), | ||
| 186 | sg->length, dir); | ||
| 187 | swiotlb_unmap_sg_attrs(dev, sgl, nelems, dir, attrs); | ||
| 188 | } | ||
| 189 | |||
| 190 | static void __swiotlb_sync_single_for_cpu(struct device *dev, | ||
| 191 | dma_addr_t dev_addr, size_t size, | ||
| 192 | enum dma_data_direction dir) | ||
| 193 | { | ||
| 194 | __dma_unmap_area(phys_to_virt(dma_to_phys(dev, dev_addr)), size, dir); | ||
| 195 | swiotlb_sync_single_for_cpu(dev, dev_addr, size, dir); | ||
| 196 | } | ||
| 197 | |||
| 198 | static void __swiotlb_sync_single_for_device(struct device *dev, | ||
| 199 | dma_addr_t dev_addr, size_t size, | ||
| 200 | enum dma_data_direction dir) | ||
| 201 | { | ||
| 202 | swiotlb_sync_single_for_device(dev, dev_addr, size, dir); | ||
| 203 | __dma_map_area(phys_to_virt(dma_to_phys(dev, dev_addr)), size, dir); | ||
| 204 | } | ||
| 205 | |||
| 206 | static void __swiotlb_sync_sg_for_cpu(struct device *dev, | ||
| 207 | struct scatterlist *sgl, int nelems, | ||
| 208 | enum dma_data_direction dir) | ||
| 209 | { | ||
| 210 | struct scatterlist *sg; | ||
| 211 | int i; | ||
| 212 | |||
| 213 | for_each_sg(sgl, sg, nelems, i) | ||
| 214 | __dma_unmap_area(phys_to_virt(dma_to_phys(dev, sg->dma_address)), | ||
| 215 | sg->length, dir); | ||
| 216 | swiotlb_sync_sg_for_cpu(dev, sgl, nelems, dir); | ||
| 217 | } | ||
| 218 | |||
| 219 | static void __swiotlb_sync_sg_for_device(struct device *dev, | ||
| 220 | struct scatterlist *sgl, int nelems, | ||
| 221 | enum dma_data_direction dir) | ||
| 222 | { | ||
| 223 | struct scatterlist *sg; | ||
| 224 | int i; | ||
| 225 | |||
| 226 | swiotlb_sync_sg_for_device(dev, sgl, nelems, dir); | ||
| 227 | for_each_sg(sgl, sg, nelems, i) | ||
| 228 | __dma_map_area(phys_to_virt(dma_to_phys(dev, sg->dma_address)), | ||
| 229 | sg->length, dir); | ||
| 230 | } | ||
| 231 | |||
| 232 | /* vma->vm_page_prot must be set appropriately before calling this function */ | ||
| 233 | static int __dma_common_mmap(struct device *dev, struct vm_area_struct *vma, | ||
| 234 | void *cpu_addr, dma_addr_t dma_addr, size_t size) | ||
| 235 | { | ||
| 236 | int ret = -ENXIO; | ||
| 237 | unsigned long nr_vma_pages = (vma->vm_end - vma->vm_start) >> | ||
| 238 | PAGE_SHIFT; | ||
| 239 | unsigned long nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT; | ||
| 240 | unsigned long pfn = dma_to_phys(dev, dma_addr) >> PAGE_SHIFT; | ||
| 241 | unsigned long off = vma->vm_pgoff; | ||
| 242 | |||
| 243 | if (dma_mmap_from_coherent(dev, vma, cpu_addr, size, &ret)) | ||
| 244 | return ret; | ||
| 245 | |||
| 246 | if (off < nr_pages && nr_vma_pages <= (nr_pages - off)) { | ||
| 247 | ret = remap_pfn_range(vma, vma->vm_start, | ||
| 248 | pfn + off, | ||
| 249 | vma->vm_end - vma->vm_start, | ||
| 250 | vma->vm_page_prot); | ||
| 251 | } | ||
| 252 | |||
| 253 | return ret; | ||
| 254 | } | ||
| 255 | |||
| 256 | static int __swiotlb_mmap_noncoherent(struct device *dev, | ||
| 257 | struct vm_area_struct *vma, | ||
| 258 | void *cpu_addr, dma_addr_t dma_addr, size_t size, | ||
| 259 | struct dma_attrs *attrs) | ||
| 260 | { | ||
| 261 | vma->vm_page_prot = __get_dma_pgprot(attrs, vma->vm_page_prot, false); | ||
| 262 | return __dma_common_mmap(dev, vma, cpu_addr, dma_addr, size); | ||
| 263 | } | ||
| 264 | |||
| 265 | static int __swiotlb_mmap_coherent(struct device *dev, | ||
| 266 | struct vm_area_struct *vma, | ||
| 267 | void *cpu_addr, dma_addr_t dma_addr, size_t size, | ||
| 268 | struct dma_attrs *attrs) | ||
| 269 | { | ||
| 270 | /* Just use whatever page_prot attributes were specified */ | ||
| 271 | return __dma_common_mmap(dev, vma, cpu_addr, dma_addr, size); | ||
| 272 | } | ||
| 273 | |||
| 274 | struct dma_map_ops noncoherent_swiotlb_dma_ops = { | ||
| 275 | .alloc = __dma_alloc_noncoherent, | ||
| 276 | .free = __dma_free_noncoherent, | ||
| 277 | .mmap = __swiotlb_mmap_noncoherent, | ||
| 278 | .map_page = __swiotlb_map_page, | ||
| 279 | .unmap_page = __swiotlb_unmap_page, | ||
| 280 | .map_sg = __swiotlb_map_sg_attrs, | ||
| 281 | .unmap_sg = __swiotlb_unmap_sg_attrs, | ||
| 282 | .sync_single_for_cpu = __swiotlb_sync_single_for_cpu, | ||
| 283 | .sync_single_for_device = __swiotlb_sync_single_for_device, | ||
| 284 | .sync_sg_for_cpu = __swiotlb_sync_sg_for_cpu, | ||
| 285 | .sync_sg_for_device = __swiotlb_sync_sg_for_device, | ||
| 286 | .dma_supported = swiotlb_dma_supported, | ||
| 287 | .mapping_error = swiotlb_dma_mapping_error, | ||
| 288 | }; | ||
| 289 | EXPORT_SYMBOL(noncoherent_swiotlb_dma_ops); | ||
| 290 | |||
| 291 | struct dma_map_ops coherent_swiotlb_dma_ops = { | ||
| 292 | .alloc = __dma_alloc_coherent, | ||
| 293 | .free = __dma_free_coherent, | ||
| 294 | .mmap = __swiotlb_mmap_coherent, | ||
| 84 | .map_page = swiotlb_map_page, | 295 | .map_page = swiotlb_map_page, |
| 85 | .unmap_page = swiotlb_unmap_page, | 296 | .unmap_page = swiotlb_unmap_page, |
| 86 | .map_sg = swiotlb_map_sg_attrs, | 297 | .map_sg = swiotlb_map_sg_attrs, |
| @@ -92,12 +303,19 @@ static struct dma_map_ops arm64_swiotlb_dma_ops = { | |||
| 92 | .dma_supported = swiotlb_dma_supported, | 303 | .dma_supported = swiotlb_dma_supported, |
| 93 | .mapping_error = swiotlb_dma_mapping_error, | 304 | .mapping_error = swiotlb_dma_mapping_error, |
| 94 | }; | 305 | }; |
| 306 | EXPORT_SYMBOL(coherent_swiotlb_dma_ops); | ||
| 307 | |||
| 308 | extern int swiotlb_late_init_with_default_size(size_t default_size); | ||
| 95 | 309 | ||
| 96 | void __init arm64_swiotlb_init(void) | 310 | static int __init swiotlb_late_init(void) |
| 97 | { | 311 | { |
| 98 | dma_ops = &arm64_swiotlb_dma_ops; | 312 | size_t swiotlb_size = min(SZ_64M, MAX_ORDER_NR_PAGES << PAGE_SHIFT); |
| 99 | swiotlb_init(1); | 313 | |
| 314 | dma_ops = &coherent_swiotlb_dma_ops; | ||
| 315 | |||
| 316 | return swiotlb_late_init_with_default_size(swiotlb_size); | ||
| 100 | } | 317 | } |
| 318 | subsys_initcall(swiotlb_late_init); | ||
| 101 | 319 | ||
| 102 | #define PREALLOC_DMA_DEBUG_ENTRIES 4096 | 320 | #define PREALLOC_DMA_DEBUG_ENTRIES 4096 |
| 103 | 321 | ||
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index d0b4c2efda90..88627c450a6c 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #include <linux/memblock.h> | 30 | #include <linux/memblock.h> |
| 31 | #include <linux/sort.h> | 31 | #include <linux/sort.h> |
| 32 | #include <linux/of_fdt.h> | 32 | #include <linux/of_fdt.h> |
| 33 | #include <linux/dma-mapping.h> | ||
| 33 | #include <linux/dma-contiguous.h> | 34 | #include <linux/dma-contiguous.h> |
| 34 | 35 | ||
| 35 | #include <asm/sections.h> | 36 | #include <asm/sections.h> |
| @@ -59,22 +60,22 @@ static int __init early_initrd(char *p) | |||
| 59 | early_param("initrd", early_initrd); | 60 | early_param("initrd", early_initrd); |
| 60 | #endif | 61 | #endif |
| 61 | 62 | ||
| 62 | #define MAX_DMA32_PFN ((4UL * 1024 * 1024 * 1024) >> PAGE_SHIFT) | ||
| 63 | |||
| 64 | static void __init zone_sizes_init(unsigned long min, unsigned long max) | 63 | static void __init zone_sizes_init(unsigned long min, unsigned long max) |
| 65 | { | 64 | { |
| 66 | struct memblock_region *reg; | 65 | struct memblock_region *reg; |
| 67 | unsigned long zone_size[MAX_NR_ZONES], zhole_size[MAX_NR_ZONES]; | 66 | unsigned long zone_size[MAX_NR_ZONES], zhole_size[MAX_NR_ZONES]; |
| 68 | unsigned long max_dma32 = min; | 67 | unsigned long max_dma = min; |
| 69 | 68 | ||
| 70 | memset(zone_size, 0, sizeof(zone_size)); | 69 | memset(zone_size, 0, sizeof(zone_size)); |
| 71 | 70 | ||
| 72 | #ifdef CONFIG_ZONE_DMA32 | ||
| 73 | /* 4GB maximum for 32-bit only capable devices */ | 71 | /* 4GB maximum for 32-bit only capable devices */ |
| 74 | max_dma32 = max(min, min(max, MAX_DMA32_PFN)); | 72 | if (IS_ENABLED(CONFIG_ZONE_DMA)) { |
| 75 | zone_size[ZONE_DMA32] = max_dma32 - min; | 73 | unsigned long max_dma_phys = |
| 76 | #endif | 74 | (unsigned long)dma_to_phys(NULL, DMA_BIT_MASK(32) + 1); |
| 77 | zone_size[ZONE_NORMAL] = max - max_dma32; | 75 | max_dma = max(min, min(max, max_dma_phys >> PAGE_SHIFT)); |
| 76 | zone_size[ZONE_DMA] = max_dma - min; | ||
| 77 | } | ||
| 78 | zone_size[ZONE_NORMAL] = max - max_dma; | ||
| 78 | 79 | ||
| 79 | memcpy(zhole_size, zone_size, sizeof(zhole_size)); | 80 | memcpy(zhole_size, zone_size, sizeof(zhole_size)); |
| 80 | 81 | ||
| @@ -84,15 +85,15 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max) | |||
| 84 | 85 | ||
| 85 | if (start >= max) | 86 | if (start >= max) |
| 86 | continue; | 87 | continue; |
| 87 | #ifdef CONFIG_ZONE_DMA32 | 88 | |
| 88 | if (start < max_dma32) { | 89 | if (IS_ENABLED(CONFIG_ZONE_DMA) && start < max_dma) { |
| 89 | unsigned long dma_end = min(end, max_dma32); | 90 | unsigned long dma_end = min(end, max_dma); |
| 90 | zhole_size[ZONE_DMA32] -= dma_end - start; | 91 | zhole_size[ZONE_DMA] -= dma_end - start; |
| 91 | } | 92 | } |
| 92 | #endif | 93 | |
| 93 | if (end > max_dma32) { | 94 | if (end > max_dma) { |
| 94 | unsigned long normal_end = min(end, max); | 95 | unsigned long normal_end = min(end, max); |
| 95 | unsigned long normal_start = max(start, max_dma32); | 96 | unsigned long normal_start = max(start, max_dma); |
| 96 | zhole_size[ZONE_NORMAL] -= normal_end - normal_start; | 97 | zhole_size[ZONE_NORMAL] -= normal_end - normal_start; |
| 97 | } | 98 | } |
| 98 | } | 99 | } |
| @@ -261,8 +262,6 @@ static void __init free_unused_memmap(void) | |||
| 261 | */ | 262 | */ |
| 262 | void __init mem_init(void) | 263 | void __init mem_init(void) |
| 263 | { | 264 | { |
| 264 | arm64_swiotlb_init(); | ||
| 265 | |||
| 266 | max_mapnr = pfn_to_page(max_pfn + PHYS_PFN_OFFSET) - mem_map; | 265 | max_mapnr = pfn_to_page(max_pfn + PHYS_PFN_OFFSET) - mem_map; |
| 267 | 266 | ||
| 268 | #ifndef CONFIG_SPARSEMEM_VMEMMAP | 267 | #ifndef CONFIG_SPARSEMEM_VMEMMAP |
diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S index 1333e6f9a8e5..e085ee6ef4e2 100644 --- a/arch/arm64/mm/proc.S +++ b/arch/arm64/mm/proc.S | |||
| @@ -173,12 +173,6 @@ ENDPROC(cpu_do_switch_mm) | |||
| 173 | * value of the SCTLR_EL1 register. | 173 | * value of the SCTLR_EL1 register. |
| 174 | */ | 174 | */ |
| 175 | ENTRY(__cpu_setup) | 175 | ENTRY(__cpu_setup) |
| 176 | /* | ||
| 177 | * Preserve the link register across the function call. | ||
| 178 | */ | ||
| 179 | mov x28, lr | ||
| 180 | bl __flush_dcache_all | ||
| 181 | mov lr, x28 | ||
| 182 | ic iallu // I+BTB cache invalidate | 176 | ic iallu // I+BTB cache invalidate |
| 183 | tlbi vmalle1is // invalidate I + D TLBs | 177 | tlbi vmalle1is // invalidate I + D TLBs |
| 184 | dsb sy | 178 | dsb sy |
| @@ -215,8 +209,14 @@ ENTRY(__cpu_setup) | |||
| 215 | * Set/prepare TCR and TTBR. We use 512GB (39-bit) address range for | 209 | * Set/prepare TCR and TTBR. We use 512GB (39-bit) address range for |
| 216 | * both user and kernel. | 210 | * both user and kernel. |
| 217 | */ | 211 | */ |
| 218 | ldr x10, =TCR_TxSZ(VA_BITS) | TCR_FLAGS | TCR_IPS_40BIT | \ | 212 | ldr x10, =TCR_TxSZ(VA_BITS) | TCR_FLAGS | \ |
| 219 | TCR_ASID16 | TCR_TBI0 | (1 << 31) | 213 | TCR_ASID16 | TCR_TBI0 | (1 << 31) |
| 214 | /* | ||
| 215 | * Read the PARange bits from ID_AA64MMFR0_EL1 and set the IPS bits in | ||
| 216 | * TCR_EL1. | ||
| 217 | */ | ||
| 218 | mrs x9, ID_AA64MMFR0_EL1 | ||
| 219 | bfi x10, x9, #32, #3 | ||
| 220 | #ifdef CONFIG_ARM64_64K_PAGES | 220 | #ifdef CONFIG_ARM64_64K_PAGES |
| 221 | orr x10, x10, TCR_TG0_64K | 221 | orr x10, x10, TCR_TG0_64K |
| 222 | orr x10, x10, TCR_TG1_64K | 222 | orr x10, x10, TCR_TG1_64K |
diff --git a/arch/avr32/include/asm/Kbuild b/arch/avr32/include/asm/Kbuild index c7c64a63c29f..00a0f3ccd6eb 100644 --- a/arch/avr32/include/asm/Kbuild +++ b/arch/avr32/include/asm/Kbuild | |||
| @@ -1,22 +1,23 @@ | |||
| 1 | 1 | ||
| 2 | generic-y += clkdev.h | 2 | generic-y += clkdev.h |
| 3 | generic-y += cputime.h | 3 | generic-y += cputime.h |
| 4 | generic-y += delay.h | 4 | generic-y += delay.h |
| 5 | generic-y += device.h | 5 | generic-y += device.h |
| 6 | generic-y += div64.h | 6 | generic-y += div64.h |
| 7 | generic-y += emergency-restart.h | 7 | generic-y += emergency-restart.h |
| 8 | generic-y += exec.h | 8 | generic-y += exec.h |
| 9 | generic-y += futex.h | 9 | generic-y += futex.h |
| 10 | generic-y += preempt.h | 10 | generic-y += hash.h |
| 11 | generic-y += irq_regs.h | 11 | generic-y += irq_regs.h |
| 12 | generic-y += param.h | 12 | generic-y += local.h |
| 13 | generic-y += local.h | 13 | generic-y += local64.h |
| 14 | generic-y += local64.h | 14 | generic-y += mcs_spinlock.h |
| 15 | generic-y += percpu.h | 15 | generic-y += param.h |
| 16 | generic-y += scatterlist.h | 16 | generic-y += percpu.h |
| 17 | generic-y += sections.h | 17 | generic-y += preempt.h |
| 18 | generic-y += topology.h | 18 | generic-y += scatterlist.h |
| 19 | generic-y += trace_clock.h | 19 | generic-y += sections.h |
| 20 | generic-y += topology.h | ||
| 21 | generic-y += trace_clock.h | ||
| 20 | generic-y += vga.h | 22 | generic-y += vga.h |
| 21 | generic-y += xor.h | 23 | generic-y += xor.h |
| 22 | generic-y += hash.h | ||
diff --git a/arch/avr32/include/asm/bugs.h b/arch/avr32/include/asm/bugs.h index 7635e770622e..278661bbd1b0 100644 --- a/arch/avr32/include/asm/bugs.h +++ b/arch/avr32/include/asm/bugs.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | 9 | ||
| 10 | static void __init check_bugs(void) | 10 | static void __init check_bugs(void) |
| 11 | { | 11 | { |
| 12 | cpu_data->loops_per_jiffy = loops_per_jiffy; | 12 | boot_cpu_data.loops_per_jiffy = loops_per_jiffy; |
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | #endif /* __ASM_AVR32_BUGS_H */ | 15 | #endif /* __ASM_AVR32_BUGS_H */ |
diff --git a/arch/avr32/include/asm/processor.h b/arch/avr32/include/asm/processor.h index 48d71c5c898a..972adcc1e8f4 100644 --- a/arch/avr32/include/asm/processor.h +++ b/arch/avr32/include/asm/processor.h | |||
| @@ -83,13 +83,8 @@ static inline unsigned int avr32_get_chip_revision(struct avr32_cpuinfo *cpu) | |||
| 83 | 83 | ||
| 84 | extern struct avr32_cpuinfo boot_cpu_data; | 84 | extern struct avr32_cpuinfo boot_cpu_data; |
| 85 | 85 | ||
| 86 | #ifdef CONFIG_SMP | 86 | /* No SMP support so far */ |
| 87 | extern struct avr32_cpuinfo cpu_data[]; | ||
| 88 | #define current_cpu_data cpu_data[smp_processor_id()] | ||
| 89 | #else | ||
| 90 | #define cpu_data (&boot_cpu_data) | ||
| 91 | #define current_cpu_data boot_cpu_data | 87 | #define current_cpu_data boot_cpu_data |
| 92 | #endif | ||
| 93 | 88 | ||
| 94 | /* This decides where the kernel will search for a free chunk of vm | 89 | /* This decides where the kernel will search for a free chunk of vm |
| 95 | * space during mmap's | 90 | * space during mmap's |
diff --git a/arch/avr32/kernel/cpu.c b/arch/avr32/kernel/cpu.c index 2233be71e2e8..0341ae27c9ec 100644 --- a/arch/avr32/kernel/cpu.c +++ b/arch/avr32/kernel/cpu.c | |||
| @@ -39,10 +39,12 @@ static ssize_t store_pc0event(struct device *dev, | |||
| 39 | size_t count) | 39 | size_t count) |
| 40 | { | 40 | { |
| 41 | unsigned long val; | 41 | unsigned long val; |
| 42 | char *endp; | 42 | int ret; |
| 43 | 43 | ||
| 44 | val = simple_strtoul(buf, &endp, 0); | 44 | ret = kstrtoul(buf, 0, &val); |
| 45 | if (endp == buf || val > 0x3f) | 45 | if (ret) |
| 46 | return ret; | ||
| 47 | if (val > 0x3f) | ||
| 46 | return -EINVAL; | 48 | return -EINVAL; |
| 47 | val = (val << 12) | (sysreg_read(PCCR) & 0xfffc0fff); | 49 | val = (val << 12) | (sysreg_read(PCCR) & 0xfffc0fff); |
| 48 | sysreg_write(PCCR, val); | 50 | sysreg_write(PCCR, val); |
| @@ -61,11 +63,11 @@ static ssize_t store_pc0count(struct device *dev, | |||
| 61 | const char *buf, size_t count) | 63 | const char *buf, size_t count) |
| 62 | { | 64 | { |
| 63 | unsigned long val; | 65 | unsigned long val; |
| 64 | char *endp; | 66 | int ret; |
| 65 | 67 | ||
| 66 | val = simple_strtoul(buf, &endp, 0); | 68 | ret = kstrtoul(buf, 0, &val); |
| 67 | if (endp == buf) | 69 | if (ret) |
| 68 | return -EINVAL; | 70 | return ret; |
| 69 | sysreg_write(PCNT0, val); | 71 | sysreg_write(PCNT0, val); |
| 70 | 72 | ||
| 71 | return count; | 73 | return count; |
| @@ -84,10 +86,12 @@ static ssize_t store_pc1event(struct device *dev, | |||
| 84 | size_t count) | 86 | size_t count) |
| 85 | { | 87 | { |
| 86 | unsigned long val; | 88 | unsigned long val; |
| 87 | char *endp; | 89 | int ret; |
| 88 | 90 | ||
| 89 | val = simple_strtoul(buf, &endp, 0); | 91 | ret = kstrtoul(buf, 0, &val); |
| 90 | if (endp == buf || val > 0x3f) | 92 | if (ret) |
| 93 | return ret; | ||
| 94 | if (val > 0x3f) | ||
| 91 | return -EINVAL; | 95 | return -EINVAL; |
| 92 | val = (val << 18) | (sysreg_read(PCCR) & 0xff03ffff); | 96 | val = (val << 18) | (sysreg_read(PCCR) & 0xff03ffff); |
| 93 | sysreg_write(PCCR, val); | 97 | sysreg_write(PCCR, val); |
| @@ -106,11 +110,11 @@ static ssize_t store_pc1count(struct device *dev, | |||
| 106 | size_t count) | 110 | size_t count) |
| 107 | { | 111 | { |
| 108 | unsigned long val; | 112 | unsigned long val; |
| 109 | char *endp; | 113 | int ret; |
| 110 | 114 | ||
| 111 | val = simple_strtoul(buf, &endp, 0); | 115 | ret = kstrtoul(buf, 0, &val); |
| 112 | if (endp == buf) | 116 | if (ret) |
| 113 | return -EINVAL; | 117 | return ret; |
| 114 | sysreg_write(PCNT1, val); | 118 | sysreg_write(PCNT1, val); |
| 115 | 119 | ||
| 116 | return count; | 120 | return count; |
| @@ -129,11 +133,11 @@ static ssize_t store_pccycles(struct device *dev, | |||
| 129 | size_t count) | 133 | size_t count) |
| 130 | { | 134 | { |
| 131 | unsigned long val; | 135 | unsigned long val; |
| 132 | char *endp; | 136 | int ret; |
| 133 | 137 | ||
| 134 | val = simple_strtoul(buf, &endp, 0); | 138 | ret = kstrtoul(buf, 0, &val); |
| 135 | if (endp == buf) | 139 | if (ret) |
| 136 | return -EINVAL; | 140 | return ret; |
| 137 | sysreg_write(PCCNT, val); | 141 | sysreg_write(PCCNT, val); |
| 138 | 142 | ||
| 139 | return count; | 143 | return count; |
| @@ -152,11 +156,11 @@ static ssize_t store_pcenable(struct device *dev, | |||
| 152 | size_t count) | 156 | size_t count) |
| 153 | { | 157 | { |
| 154 | unsigned long pccr, val; | 158 | unsigned long pccr, val; |
| 155 | char *endp; | 159 | int ret; |
| 156 | 160 | ||
| 157 | val = simple_strtoul(buf, &endp, 0); | 161 | ret = kstrtoul(buf, 0, &val); |
| 158 | if (endp == buf) | 162 | if (ret) |
| 159 | return -EINVAL; | 163 | return ret; |
| 160 | if (val) | 164 | if (val) |
| 161 | val = 1; | 165 | val = 1; |
| 162 | 166 | ||
diff --git a/arch/avr32/mm/cache.c b/arch/avr32/mm/cache.c index 6a46ecd56cfd..85d635cd7b28 100644 --- a/arch/avr32/mm/cache.c +++ b/arch/avr32/mm/cache.c | |||
| @@ -111,6 +111,7 @@ void flush_icache_range(unsigned long start, unsigned long end) | |||
| 111 | __flush_icache_range(start & ~(linesz - 1), | 111 | __flush_icache_range(start & ~(linesz - 1), |
| 112 | (end + linesz - 1) & ~(linesz - 1)); | 112 | (end + linesz - 1) & ~(linesz - 1)); |
| 113 | } | 113 | } |
| 114 | EXPORT_SYMBOL(flush_icache_range); | ||
| 114 | 115 | ||
| 115 | /* | 116 | /* |
| 116 | * This one is called from __do_fault() and do_swap_page(). | 117 | * This one is called from __do_fault() and do_swap_page(). |
diff --git a/arch/blackfin/include/asm/Kbuild b/arch/blackfin/include/asm/Kbuild index 359d36fdc247..0d93b9a79ca9 100644 --- a/arch/blackfin/include/asm/Kbuild +++ b/arch/blackfin/include/asm/Kbuild | |||
| @@ -10,6 +10,7 @@ generic-y += emergency-restart.h | |||
| 10 | generic-y += errno.h | 10 | generic-y += errno.h |
| 11 | generic-y += fb.h | 11 | generic-y += fb.h |
| 12 | generic-y += futex.h | 12 | generic-y += futex.h |
| 13 | generic-y += hash.h | ||
| 13 | generic-y += hw_irq.h | 14 | generic-y += hw_irq.h |
| 14 | generic-y += ioctl.h | 15 | generic-y += ioctl.h |
| 15 | generic-y += ipcbuf.h | 16 | generic-y += ipcbuf.h |
| @@ -17,14 +18,16 @@ generic-y += irq_regs.h | |||
| 17 | generic-y += kdebug.h | 18 | generic-y += kdebug.h |
| 18 | generic-y += kmap_types.h | 19 | generic-y += kmap_types.h |
| 19 | generic-y += kvm_para.h | 20 | generic-y += kvm_para.h |
| 20 | generic-y += local64.h | ||
| 21 | generic-y += local.h | 21 | generic-y += local.h |
| 22 | generic-y += local64.h | ||
| 23 | generic-y += mcs_spinlock.h | ||
| 22 | generic-y += mman.h | 24 | generic-y += mman.h |
| 23 | generic-y += msgbuf.h | 25 | generic-y += msgbuf.h |
| 24 | generic-y += mutex.h | 26 | generic-y += mutex.h |
| 25 | generic-y += param.h | 27 | generic-y += param.h |
| 26 | generic-y += percpu.h | 28 | generic-y += percpu.h |
| 27 | generic-y += pgalloc.h | 29 | generic-y += pgalloc.h |
| 30 | generic-y += preempt.h | ||
| 28 | generic-y += resource.h | 31 | generic-y += resource.h |
| 29 | generic-y += scatterlist.h | 32 | generic-y += scatterlist.h |
| 30 | generic-y += sembuf.h | 33 | generic-y += sembuf.h |
| @@ -44,5 +47,3 @@ generic-y += ucontext.h | |||
| 44 | generic-y += unaligned.h | 47 | generic-y += unaligned.h |
| 45 | generic-y += user.h | 48 | generic-y += user.h |
| 46 | generic-y += xor.h | 49 | generic-y += xor.h |
| 47 | generic-y += preempt.h | ||
| 48 | generic-y += hash.h | ||
diff --git a/arch/c6x/include/asm/Kbuild b/arch/c6x/include/asm/Kbuild index d73bb85ccdd3..8dbdce8421b0 100644 --- a/arch/c6x/include/asm/Kbuild +++ b/arch/c6x/include/asm/Kbuild | |||
| @@ -15,6 +15,7 @@ generic-y += exec.h | |||
| 15 | generic-y += fb.h | 15 | generic-y += fb.h |
| 16 | generic-y += fcntl.h | 16 | generic-y += fcntl.h |
| 17 | generic-y += futex.h | 17 | generic-y += futex.h |
| 18 | generic-y += hash.h | ||
| 18 | generic-y += hw_irq.h | 19 | generic-y += hw_irq.h |
| 19 | generic-y += io.h | 20 | generic-y += io.h |
| 20 | generic-y += ioctl.h | 21 | generic-y += ioctl.h |
| @@ -24,6 +25,7 @@ generic-y += irq_regs.h | |||
| 24 | generic-y += kdebug.h | 25 | generic-y += kdebug.h |
| 25 | generic-y += kmap_types.h | 26 | generic-y += kmap_types.h |
| 26 | generic-y += local.h | 27 | generic-y += local.h |
| 28 | generic-y += mcs_spinlock.h | ||
| 27 | generic-y += mman.h | 29 | generic-y += mman.h |
| 28 | generic-y += mmu.h | 30 | generic-y += mmu.h |
| 29 | generic-y += mmu_context.h | 31 | generic-y += mmu_context.h |
| @@ -34,6 +36,7 @@ generic-y += percpu.h | |||
| 34 | generic-y += pgalloc.h | 36 | generic-y += pgalloc.h |
| 35 | generic-y += poll.h | 37 | generic-y += poll.h |
| 36 | generic-y += posix_types.h | 38 | generic-y += posix_types.h |
| 39 | generic-y += preempt.h | ||
| 37 | generic-y += resource.h | 40 | generic-y += resource.h |
| 38 | generic-y += scatterlist.h | 41 | generic-y += scatterlist.h |
| 39 | generic-y += segment.h | 42 | generic-y += segment.h |
| @@ -56,5 +59,3 @@ generic-y += ucontext.h | |||
| 56 | generic-y += user.h | 59 | generic-y += user.h |
| 57 | generic-y += vga.h | 60 | generic-y += vga.h |
| 58 | generic-y += xor.h | 61 | generic-y += xor.h |
| 59 | generic-y += preempt.h | ||
| 60 | generic-y += hash.h | ||
diff --git a/arch/c6x/include/asm/cache.h b/arch/c6x/include/asm/cache.h index 09c5a0f5f4d1..86648c083bb4 100644 --- a/arch/c6x/include/asm/cache.h +++ b/arch/c6x/include/asm/cache.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #define _ASM_C6X_CACHE_H | 12 | #define _ASM_C6X_CACHE_H |
| 13 | 13 | ||
| 14 | #include <linux/irqflags.h> | 14 | #include <linux/irqflags.h> |
| 15 | #include <linux/init.h> | ||
| 15 | 16 | ||
| 16 | /* | 17 | /* |
| 17 | * Cache line size | 18 | * Cache line size |
diff --git a/arch/cris/include/asm/Kbuild b/arch/cris/include/asm/Kbuild index f3fd8768f095..afff5105909d 100644 --- a/arch/cris/include/asm/Kbuild +++ b/arch/cris/include/asm/Kbuild | |||
| @@ -5,12 +5,14 @@ header-y += arch-v32/ | |||
| 5 | 5 | ||
| 6 | generic-y += barrier.h | 6 | generic-y += barrier.h |
| 7 | generic-y += clkdev.h | 7 | generic-y += clkdev.h |
| 8 | generic-y += cputime.h | ||
| 8 | generic-y += exec.h | 9 | generic-y += exec.h |
| 9 | generic-y += hash.h | 10 | generic-y += hash.h |
| 10 | generic-y += kvm_para.h | 11 | generic-y += kvm_para.h |
| 11 | generic-y += linkage.h | 12 | generic-y += linkage.h |
| 13 | generic-y += mcs_spinlock.h | ||
| 12 | generic-y += module.h | 14 | generic-y += module.h |
| 15 | generic-y += preempt.h | ||
| 13 | generic-y += trace_clock.h | 16 | generic-y += trace_clock.h |
| 14 | generic-y += vga.h | 17 | generic-y += vga.h |
| 15 | generic-y += xor.h | 18 | generic-y += xor.h |
| 16 | generic-y += preempt.h | ||
diff --git a/arch/cris/include/asm/bitops.h b/arch/cris/include/asm/bitops.h index 184066ceb1f6..053c17b36559 100644 --- a/arch/cris/include/asm/bitops.h +++ b/arch/cris/include/asm/bitops.h | |||
| @@ -144,7 +144,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr) | |||
| 144 | * definition, which doesn't have the same semantics. We don't want to | 144 | * definition, which doesn't have the same semantics. We don't want to |
| 145 | * use -fno-builtin, so just hide the name ffs. | 145 | * use -fno-builtin, so just hide the name ffs. |
| 146 | */ | 146 | */ |
| 147 | #define ffs kernel_ffs | 147 | #define ffs(x) kernel_ffs(x) |
| 148 | 148 | ||
| 149 | #include <asm-generic/bitops/fls.h> | 149 | #include <asm-generic/bitops/fls.h> |
| 150 | #include <asm-generic/bitops/__fls.h> | 150 | #include <asm-generic/bitops/__fls.h> |
diff --git a/arch/cris/include/asm/cputime.h b/arch/cris/include/asm/cputime.h deleted file mode 100644 index 4446a65656fa..000000000000 --- a/arch/cris/include/asm/cputime.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __CRIS_CPUTIME_H | ||
| 2 | #define __CRIS_CPUTIME_H | ||
| 3 | |||
| 4 | #include <asm-generic/cputime.h> | ||
| 5 | |||
| 6 | #endif /* __CRIS_CPUTIME_H */ | ||
diff --git a/arch/frv/include/asm/Kbuild b/arch/frv/include/asm/Kbuild index bc42f14c9c2e..87b95eb8aee5 100644 --- a/arch/frv/include/asm/Kbuild +++ b/arch/frv/include/asm/Kbuild | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | 1 | ||
| 2 | generic-y += clkdev.h | 2 | generic-y += clkdev.h |
| 3 | generic-y += cputime.h | ||
| 3 | generic-y += exec.h | 4 | generic-y += exec.h |
| 4 | generic-y += trace_clock.h | ||
| 5 | generic-y += preempt.h | ||
| 6 | generic-y += hash.h | 5 | generic-y += hash.h |
| 6 | generic-y += mcs_spinlock.h | ||
| 7 | generic-y += preempt.h | ||
| 8 | generic-y += trace_clock.h | ||
diff --git a/arch/frv/include/asm/cputime.h b/arch/frv/include/asm/cputime.h deleted file mode 100644 index f6c373ad2b80..000000000000 --- a/arch/frv/include/asm/cputime.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef _ASM_CPUTIME_H | ||
| 2 | #define _ASM_CPUTIME_H | ||
| 3 | |||
| 4 | #include <asm-generic/cputime.h> | ||
| 5 | |||
| 6 | #endif /* _ASM_CPUTIME_H */ | ||
diff --git a/arch/hexagon/include/asm/Kbuild b/arch/hexagon/include/asm/Kbuild index 38ca45d3df1e..eadcc118f950 100644 --- a/arch/hexagon/include/asm/Kbuild +++ b/arch/hexagon/include/asm/Kbuild | |||
| @@ -25,14 +25,16 @@ generic-y += ipcbuf.h | |||
| 25 | generic-y += irq_regs.h | 25 | generic-y += irq_regs.h |
| 26 | generic-y += kdebug.h | 26 | generic-y += kdebug.h |
| 27 | generic-y += kmap_types.h | 27 | generic-y += kmap_types.h |
| 28 | generic-y += local64.h | ||
| 29 | generic-y += local.h | 28 | generic-y += local.h |
| 29 | generic-y += local64.h | ||
| 30 | generic-y += mcs_spinlock.h | ||
| 30 | generic-y += mman.h | 31 | generic-y += mman.h |
| 31 | generic-y += msgbuf.h | 32 | generic-y += msgbuf.h |
| 32 | generic-y += pci.h | 33 | generic-y += pci.h |
| 33 | generic-y += percpu.h | 34 | generic-y += percpu.h |
| 34 | generic-y += poll.h | 35 | generic-y += poll.h |
| 35 | generic-y += posix_types.h | 36 | generic-y += posix_types.h |
| 37 | generic-y += preempt.h | ||
| 36 | generic-y += resource.h | 38 | generic-y += resource.h |
| 37 | generic-y += rwsem.h | 39 | generic-y += rwsem.h |
| 38 | generic-y += scatterlist.h | 40 | generic-y += scatterlist.h |
| @@ -45,8 +47,8 @@ generic-y += siginfo.h | |||
| 45 | generic-y += sizes.h | 47 | generic-y += sizes.h |
| 46 | generic-y += socket.h | 48 | generic-y += socket.h |
| 47 | generic-y += sockios.h | 49 | generic-y += sockios.h |
| 48 | generic-y += statfs.h | ||
| 49 | generic-y += stat.h | 50 | generic-y += stat.h |
| 51 | generic-y += statfs.h | ||
| 50 | generic-y += termbits.h | 52 | generic-y += termbits.h |
| 51 | generic-y += termios.h | 53 | generic-y += termios.h |
| 52 | generic-y += topology.h | 54 | generic-y += topology.h |
| @@ -55,4 +57,3 @@ generic-y += types.h | |||
| 55 | generic-y += ucontext.h | 57 | generic-y += ucontext.h |
| 56 | generic-y += unaligned.h | 58 | generic-y += unaligned.h |
| 57 | generic-y += xor.h | 59 | generic-y += xor.h |
| 58 | generic-y += preempt.h | ||
diff --git a/arch/ia64/configs/generic_defconfig b/arch/ia64/configs/generic_defconfig index efbd2929aeb7..6404acbb84b2 100644 --- a/arch/ia64/configs/generic_defconfig +++ b/arch/ia64/configs/generic_defconfig | |||
| @@ -30,9 +30,9 @@ CONFIG_ACPI_BUTTON=m | |||
| 30 | CONFIG_ACPI_FAN=m | 30 | CONFIG_ACPI_FAN=m |
| 31 | CONFIG_ACPI_DOCK=y | 31 | CONFIG_ACPI_DOCK=y |
| 32 | CONFIG_ACPI_PROCESSOR=m | 32 | CONFIG_ACPI_PROCESSOR=m |
| 33 | CONFIG_ACPI_CONTAINER=m | 33 | CONFIG_ACPI_CONTAINER=y |
| 34 | CONFIG_HOTPLUG_PCI=y | 34 | CONFIG_HOTPLUG_PCI=y |
| 35 | CONFIG_HOTPLUG_PCI_ACPI=m | 35 | CONFIG_HOTPLUG_PCI_ACPI=y |
| 36 | CONFIG_PACKET=y | 36 | CONFIG_PACKET=y |
| 37 | CONFIG_UNIX=y | 37 | CONFIG_UNIX=y |
| 38 | CONFIG_INET=y | 38 | CONFIG_INET=y |
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c index 8e858b593e4f..30c43d39dede 100644 --- a/arch/ia64/hp/common/sba_iommu.c +++ b/arch/ia64/hp/common/sba_iommu.c | |||
| @@ -1596,7 +1596,7 @@ static void sba_unmap_sg_attrs(struct device *dev, struct scatterlist *sglist, | |||
| 1596 | * | 1596 | * |
| 1597 | ***************************************************************/ | 1597 | ***************************************************************/ |
| 1598 | 1598 | ||
| 1599 | static void __init | 1599 | static void |
| 1600 | ioc_iova_init(struct ioc *ioc) | 1600 | ioc_iova_init(struct ioc *ioc) |
| 1601 | { | 1601 | { |
| 1602 | int tcnfg; | 1602 | int tcnfg; |
| @@ -1807,7 +1807,7 @@ static struct ioc_iommu ioc_iommu_info[] __initdata = { | |||
| 1807 | { SX2000_IOC_ID, "sx2000", NULL }, | 1807 | { SX2000_IOC_ID, "sx2000", NULL }, |
| 1808 | }; | 1808 | }; |
| 1809 | 1809 | ||
| 1810 | static struct ioc * __init | 1810 | static struct ioc * |
| 1811 | ioc_init(unsigned long hpa, void *handle) | 1811 | ioc_init(unsigned long hpa, void *handle) |
| 1812 | { | 1812 | { |
| 1813 | struct ioc *ioc; | 1813 | struct ioc *ioc; |
| @@ -2041,7 +2041,7 @@ sba_map_ioc_to_node(struct ioc *ioc, acpi_handle handle) | |||
| 2041 | #define sba_map_ioc_to_node(ioc, handle) | 2041 | #define sba_map_ioc_to_node(ioc, handle) |
| 2042 | #endif | 2042 | #endif |
| 2043 | 2043 | ||
| 2044 | static int __init | 2044 | static int |
| 2045 | acpi_sba_ioc_add(struct acpi_device *device, | 2045 | acpi_sba_ioc_add(struct acpi_device *device, |
| 2046 | const struct acpi_device_id *not_used) | 2046 | const struct acpi_device_id *not_used) |
| 2047 | { | 2047 | { |
diff --git a/arch/ia64/include/asm/Kbuild b/arch/ia64/include/asm/Kbuild index 283a83154b5e..0da4aa2602ae 100644 --- a/arch/ia64/include/asm/Kbuild +++ b/arch/ia64/include/asm/Kbuild | |||
| @@ -1,8 +1,9 @@ | |||
| 1 | 1 | ||
| 2 | generic-y += clkdev.h | 2 | generic-y += clkdev.h |
| 3 | generic-y += exec.h | 3 | generic-y += exec.h |
| 4 | generic-y += hash.h | ||
| 4 | generic-y += kvm_para.h | 5 | generic-y += kvm_para.h |
| 5 | generic-y += trace_clock.h | 6 | generic-y += mcs_spinlock.h |
| 6 | generic-y += preempt.h | 7 | generic-y += preempt.h |
| 8 | generic-y += trace_clock.h | ||
| 7 | generic-y += vtime.h | 9 | generic-y += vtime.h |
| 8 | generic-y += hash.h | ||
diff --git a/arch/ia64/include/asm/topology.h b/arch/ia64/include/asm/topology.h index a2496e449b75..5cb55a1e606b 100644 --- a/arch/ia64/include/asm/topology.h +++ b/arch/ia64/include/asm/topology.h | |||
| @@ -77,7 +77,6 @@ void build_cpu_to_node_map(void); | |||
| 77 | #define topology_core_id(cpu) (cpu_data(cpu)->core_id) | 77 | #define topology_core_id(cpu) (cpu_data(cpu)->core_id) |
| 78 | #define topology_core_cpumask(cpu) (&cpu_core_map[cpu]) | 78 | #define topology_core_cpumask(cpu) (&cpu_core_map[cpu]) |
| 79 | #define topology_thread_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu)) | 79 | #define topology_thread_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu)) |
| 80 | #define smt_capable() (smp_num_siblings > 1) | ||
| 81 | #endif | 80 | #endif |
| 82 | 81 | ||
| 83 | extern void arch_fix_phys_package_id(int num, u32 slot); | 82 | extern void arch_fix_phys_package_id(int num, u32 slot); |
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index da5b462e6de6..741b99c1a0b1 100644 --- a/arch/ia64/kernel/efi.c +++ b/arch/ia64/kernel/efi.c | |||
| @@ -477,6 +477,9 @@ efi_init (void) | |||
| 477 | char *cp, vendor[100] = "unknown"; | 477 | char *cp, vendor[100] = "unknown"; |
| 478 | int i; | 478 | int i; |
| 479 | 479 | ||
| 480 | set_bit(EFI_BOOT, &efi.flags); | ||
| 481 | set_bit(EFI_64BIT, &efi.flags); | ||
| 482 | |||
| 480 | /* | 483 | /* |
| 481 | * It's too early to be able to use the standard kernel command line | 484 | * It's too early to be able to use the standard kernel command line |
| 482 | * support... | 485 | * support... |
| @@ -529,6 +532,8 @@ efi_init (void) | |||
| 529 | efi.systab->hdr.revision >> 16, | 532 | efi.systab->hdr.revision >> 16, |
| 530 | efi.systab->hdr.revision & 0xffff, vendor); | 533 | efi.systab->hdr.revision & 0xffff, vendor); |
| 531 | 534 | ||
| 535 | set_bit(EFI_SYSTEM_TABLES, &efi.flags); | ||
| 536 | |||
| 532 | palo_phys = EFI_INVALID_TABLE_ADDR; | 537 | palo_phys = EFI_INVALID_TABLE_ADDR; |
| 533 | 538 | ||
| 534 | if (efi_config_init(arch_tables) != 0) | 539 | if (efi_config_init(arch_tables) != 0) |
| @@ -657,6 +662,8 @@ efi_enter_virtual_mode (void) | |||
| 657 | return; | 662 | return; |
| 658 | } | 663 | } |
| 659 | 664 | ||
| 665 | set_bit(EFI_RUNTIME_SERVICES, &efi.flags); | ||
| 666 | |||
| 660 | /* | 667 | /* |
| 661 | * Now that EFI is in virtual mode, we call the EFI functions more | 668 | * Now that EFI is in virtual mode, we call the EFI functions more |
| 662 | * efficiently: | 669 | * efficiently: |
diff --git a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c index 1034884b77da..0884f5ecbcc3 100644 --- a/arch/ia64/kernel/irq_ia64.c +++ b/arch/ia64/kernel/irq_ia64.c | |||
| @@ -364,7 +364,6 @@ static irqreturn_t smp_irq_move_cleanup_interrupt(int irq, void *dev_id) | |||
| 364 | 364 | ||
| 365 | static struct irqaction irq_move_irqaction = { | 365 | static struct irqaction irq_move_irqaction = { |
| 366 | .handler = smp_irq_move_cleanup_interrupt, | 366 | .handler = smp_irq_move_cleanup_interrupt, |
| 367 | .flags = IRQF_DISABLED, | ||
| 368 | .name = "irq_move" | 367 | .name = "irq_move" |
| 369 | }; | 368 | }; |
| 370 | 369 | ||
| @@ -489,14 +488,13 @@ ia64_handle_irq (ia64_vector vector, struct pt_regs *regs) | |||
| 489 | ia64_srlz_d(); | 488 | ia64_srlz_d(); |
| 490 | while (vector != IA64_SPURIOUS_INT_VECTOR) { | 489 | while (vector != IA64_SPURIOUS_INT_VECTOR) { |
| 491 | int irq = local_vector_to_irq(vector); | 490 | int irq = local_vector_to_irq(vector); |
| 492 | struct irq_desc *desc = irq_to_desc(irq); | ||
| 493 | 491 | ||
| 494 | if (unlikely(IS_LOCAL_TLB_FLUSH(vector))) { | 492 | if (unlikely(IS_LOCAL_TLB_FLUSH(vector))) { |
| 495 | smp_local_flush_tlb(); | 493 | smp_local_flush_tlb(); |
| 496 | kstat_incr_irqs_this_cpu(irq, desc); | 494 | kstat_incr_irq_this_cpu(irq); |
| 497 | } else if (unlikely(IS_RESCHEDULE(vector))) { | 495 | } else if (unlikely(IS_RESCHEDULE(vector))) { |
| 498 | scheduler_ipi(); | 496 | scheduler_ipi(); |
| 499 | kstat_incr_irqs_this_cpu(irq, desc); | 497 | kstat_incr_irq_this_cpu(irq); |
| 500 | } else { | 498 | } else { |
| 501 | ia64_setreg(_IA64_REG_CR_TPR, vector); | 499 | ia64_setreg(_IA64_REG_CR_TPR, vector); |
| 502 | ia64_srlz_d(); | 500 | ia64_srlz_d(); |
| @@ -549,13 +547,12 @@ void ia64_process_pending_intr(void) | |||
| 549 | */ | 547 | */ |
| 550 | while (vector != IA64_SPURIOUS_INT_VECTOR) { | 548 | while (vector != IA64_SPURIOUS_INT_VECTOR) { |
| 551 | int irq = local_vector_to_irq(vector); | 549 | int irq = local_vector_to_irq(vector); |
| 552 | struct irq_desc *desc = irq_to_desc(irq); | ||
| 553 | 550 | ||
| 554 | if (unlikely(IS_LOCAL_TLB_FLUSH(vector))) { | 551 | if (unlikely(IS_LOCAL_TLB_FLUSH(vector))) { |
| 555 | smp_local_flush_tlb(); | 552 | smp_local_flush_tlb(); |
| 556 | kstat_incr_irqs_this_cpu(irq, desc); | 553 | kstat_incr_irq_this_cpu(irq); |
| 557 | } else if (unlikely(IS_RESCHEDULE(vector))) { | 554 | } else if (unlikely(IS_RESCHEDULE(vector))) { |
| 558 | kstat_incr_irqs_this_cpu(irq, desc); | 555 | kstat_incr_irq_this_cpu(irq); |
| 559 | } else { | 556 | } else { |
| 560 | struct pt_regs *old_regs = set_irq_regs(NULL); | 557 | struct pt_regs *old_regs = set_irq_regs(NULL); |
| 561 | 558 | ||
| @@ -602,7 +599,6 @@ static irqreturn_t dummy_handler (int irq, void *dev_id) | |||
| 602 | 599 | ||
| 603 | static struct irqaction ipi_irqaction = { | 600 | static struct irqaction ipi_irqaction = { |
| 604 | .handler = handle_IPI, | 601 | .handler = handle_IPI, |
| 605 | .flags = IRQF_DISABLED, | ||
| 606 | .name = "IPI" | 602 | .name = "IPI" |
| 607 | }; | 603 | }; |
| 608 | 604 | ||
| @@ -611,13 +607,11 @@ static struct irqaction ipi_irqaction = { | |||
| 611 | */ | 607 | */ |
| 612 | static struct irqaction resched_irqaction = { | 608 | static struct irqaction resched_irqaction = { |
| 613 | .handler = dummy_handler, | 609 | .handler = dummy_handler, |
| 614 | .flags = IRQF_DISABLED, | ||
| 615 | .name = "resched" | 610 | .name = "resched" |
| 616 | }; | 611 | }; |
| 617 | 612 | ||
| 618 | static struct irqaction tlb_irqaction = { | 613 | static struct irqaction tlb_irqaction = { |
| 619 | .handler = dummy_handler, | 614 | .handler = dummy_handler, |
| 620 | .flags = IRQF_DISABLED, | ||
| 621 | .name = "tlb_flush" | 615 | .name = "tlb_flush" |
| 622 | }; | 616 | }; |
| 623 | 617 | ||
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c index b8edfa75a83f..db7b36bb068b 100644 --- a/arch/ia64/kernel/mca.c +++ b/arch/ia64/kernel/mca.c | |||
| @@ -217,7 +217,7 @@ void ia64_mca_printk(const char *fmt, ...) | |||
| 217 | /* Copy the output into mlogbuf */ | 217 | /* Copy the output into mlogbuf */ |
| 218 | if (oops_in_progress) { | 218 | if (oops_in_progress) { |
| 219 | /* mlogbuf was abandoned, use printk directly instead. */ | 219 | /* mlogbuf was abandoned, use printk directly instead. */ |
| 220 | printk(temp_buf); | 220 | printk("%s", temp_buf); |
| 221 | } else { | 221 | } else { |
| 222 | spin_lock(&mlogbuf_wlock); | 222 | spin_lock(&mlogbuf_wlock); |
| 223 | for (p = temp_buf; *p; p++) { | 223 | for (p = temp_buf; *p; p++) { |
| @@ -268,7 +268,7 @@ void ia64_mlogbuf_dump(void) | |||
| 268 | } | 268 | } |
| 269 | *p = '\0'; | 269 | *p = '\0'; |
| 270 | if (temp_buf[0]) | 270 | if (temp_buf[0]) |
| 271 | printk(temp_buf); | 271 | printk("%s", temp_buf); |
| 272 | mlogbuf_start = index; | 272 | mlogbuf_start = index; |
| 273 | 273 | ||
| 274 | mlogbuf_timestamp = 0; | 274 | mlogbuf_timestamp = 0; |
| @@ -1772,38 +1772,32 @@ __setup("disable_cpe_poll", ia64_mca_disable_cpe_polling); | |||
| 1772 | 1772 | ||
| 1773 | static struct irqaction cmci_irqaction = { | 1773 | static struct irqaction cmci_irqaction = { |
| 1774 | .handler = ia64_mca_cmc_int_handler, | 1774 | .handler = ia64_mca_cmc_int_handler, |
| 1775 | .flags = IRQF_DISABLED, | ||
| 1776 | .name = "cmc_hndlr" | 1775 | .name = "cmc_hndlr" |
| 1777 | }; | 1776 | }; |
| 1778 | 1777 | ||
| 1779 | static struct irqaction cmcp_irqaction = { | 1778 | static struct irqaction cmcp_irqaction = { |
| 1780 | .handler = ia64_mca_cmc_int_caller, | 1779 | .handler = ia64_mca_cmc_int_caller, |
| 1781 | .flags = IRQF_DISABLED, | ||
| 1782 | .name = "cmc_poll" | 1780 | .name = "cmc_poll" |
| 1783 | }; | 1781 | }; |
| 1784 | 1782 | ||
| 1785 | static struct irqaction mca_rdzv_irqaction = { | 1783 | static struct irqaction mca_rdzv_irqaction = { |
| 1786 | .handler = ia64_mca_rendez_int_handler, | 1784 | .handler = ia64_mca_rendez_int_handler, |
| 1787 | .flags = IRQF_DISABLED, | ||
| 1788 | .name = "mca_rdzv" | 1785 | .name = "mca_rdzv" |
| 1789 | }; | 1786 | }; |
| 1790 | 1787 | ||
| 1791 | static struct irqaction mca_wkup_irqaction = { | 1788 | static struct irqaction mca_wkup_irqaction = { |
| 1792 | .handler = ia64_mca_wakeup_int_handler, | 1789 | .handler = ia64_mca_wakeup_int_handler, |
| 1793 | .flags = IRQF_DISABLED, | ||
| 1794 | .name = "mca_wkup" | 1790 | .name = "mca_wkup" |
| 1795 | }; | 1791 | }; |
| 1796 | 1792 | ||
| 1797 | #ifdef CONFIG_ACPI | 1793 | #ifdef CONFIG_ACPI |
| 1798 | static struct irqaction mca_cpe_irqaction = { | 1794 | static struct irqaction mca_cpe_irqaction = { |
| 1799 | .handler = ia64_mca_cpe_int_handler, | 1795 | .handler = ia64_mca_cpe_int_handler, |
| 1800 | .flags = IRQF_DISABLED, | ||
| 1801 | .name = "cpe_hndlr" | 1796 | .name = "cpe_hndlr" |
| 1802 | }; | 1797 | }; |
| 1803 | 1798 | ||
| 1804 | static struct irqaction mca_cpep_irqaction = { | 1799 | static struct irqaction mca_cpep_irqaction = { |
| 1805 | .handler = ia64_mca_cpe_int_caller, | 1800 | .handler = ia64_mca_cpe_int_caller, |
| 1806 | .flags = IRQF_DISABLED, | ||
| 1807 | .name = "cpe_poll" | 1801 | .name = "cpe_poll" |
| 1808 | }; | 1802 | }; |
| 1809 | #endif /* CONFIG_ACPI */ | 1803 | #endif /* CONFIG_ACPI */ |
diff --git a/arch/ia64/kernel/msi_ia64.c b/arch/ia64/kernel/msi_ia64.c index fb2f1e622877..c430f9198d1b 100644 --- a/arch/ia64/kernel/msi_ia64.c +++ b/arch/ia64/kernel/msi_ia64.c | |||
| @@ -17,12 +17,9 @@ static int ia64_set_msi_irq_affinity(struct irq_data *idata, | |||
| 17 | { | 17 | { |
| 18 | struct msi_msg msg; | 18 | struct msi_msg msg; |
| 19 | u32 addr, data; | 19 | u32 addr, data; |
| 20 | int cpu = first_cpu(*cpu_mask); | 20 | int cpu = cpumask_first_and(cpu_mask, cpu_online_mask); |
| 21 | unsigned int irq = idata->irq; | 21 | unsigned int irq = idata->irq; |
| 22 | 22 | ||
| 23 | if (!cpu_online(cpu)) | ||
| 24 | return -1; | ||
| 25 | |||
| 26 | if (irq_prepare_move(irq, cpu)) | 23 | if (irq_prepare_move(irq, cpu)) |
| 27 | return -1; | 24 | return -1; |
| 28 | 25 | ||
| @@ -139,10 +136,7 @@ static int dmar_msi_set_affinity(struct irq_data *data, | |||
| 139 | unsigned int irq = data->irq; | 136 | unsigned int irq = data->irq; |
| 140 | struct irq_cfg *cfg = irq_cfg + irq; | 137 | struct irq_cfg *cfg = irq_cfg + irq; |
| 141 | struct msi_msg msg; | 138 | struct msi_msg msg; |
| 142 | int cpu = cpumask_first(mask); | 139 | int cpu = cpumask_first_and(mask, cpu_online_mask); |
| 143 | |||
| 144 | if (!cpu_online(cpu)) | ||
| 145 | return -1; | ||
| 146 | 140 | ||
| 147 | if (irq_prepare_move(irq, cpu)) | 141 | if (irq_prepare_move(irq, cpu)) |
| 148 | return -1; | 142 | return -1; |
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index cb592773c78b..d841c4bd6864 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
| @@ -6387,7 +6387,6 @@ pfm_flush_pmds(struct task_struct *task, pfm_context_t *ctx) | |||
| 6387 | 6387 | ||
| 6388 | static struct irqaction perfmon_irqaction = { | 6388 | static struct irqaction perfmon_irqaction = { |
| 6389 | .handler = pfm_interrupt_handler, | 6389 | .handler = pfm_interrupt_handler, |
| 6390 | .flags = IRQF_DISABLED, | ||
| 6391 | .name = "perfmon" | 6390 | .name = "perfmon" |
| 6392 | }; | 6391 | }; |
| 6393 | 6392 | ||
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c index fbaac1afb844..71c52bc7c28d 100644 --- a/arch/ia64/kernel/time.c +++ b/arch/ia64/kernel/time.c | |||
| @@ -380,7 +380,7 @@ static cycle_t itc_get_cycles(struct clocksource *cs) | |||
| 380 | 380 | ||
| 381 | static struct irqaction timer_irqaction = { | 381 | static struct irqaction timer_irqaction = { |
| 382 | .handler = timer_interrupt, | 382 | .handler = timer_interrupt, |
| 383 | .flags = IRQF_DISABLED | IRQF_IRQPOLL, | 383 | .flags = IRQF_IRQPOLL, |
| 384 | .name = "timer" | 384 | .name = "timer" |
| 385 | }; | 385 | }; |
| 386 | 386 | ||
diff --git a/arch/ia64/kernel/uncached.c b/arch/ia64/kernel/uncached.c index a96bcf83a735..20e8a9b21d75 100644 --- a/arch/ia64/kernel/uncached.c +++ b/arch/ia64/kernel/uncached.c | |||
| @@ -98,7 +98,7 @@ static int uncached_add_chunk(struct uncached_pool *uc_pool, int nid) | |||
| 98 | /* attempt to allocate a granule's worth of cached memory pages */ | 98 | /* attempt to allocate a granule's worth of cached memory pages */ |
| 99 | 99 | ||
| 100 | page = alloc_pages_exact_node(nid, | 100 | page = alloc_pages_exact_node(nid, |
| 101 | GFP_KERNEL | __GFP_ZERO | GFP_THISNODE, | 101 | GFP_KERNEL | __GFP_ZERO | __GFP_THISNODE, |
| 102 | IA64_GRANULE_SHIFT-PAGE_SHIFT); | 102 | IA64_GRANULE_SHIFT-PAGE_SHIFT); |
| 103 | if (!page) { | 103 | if (!page) { |
| 104 | mutex_unlock(&uc_pool->add_chunk_mutex); | 104 | mutex_unlock(&uc_pool->add_chunk_mutex); |
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c index 62cf4dde6a04..85d095154902 100644 --- a/arch/ia64/sn/kernel/irq.c +++ b/arch/ia64/sn/kernel/irq.c | |||
| @@ -209,8 +209,8 @@ static int sn_set_affinity_irq(struct irq_data *data, | |||
| 209 | nasid_t nasid; | 209 | nasid_t nasid; |
| 210 | int slice; | 210 | int slice; |
| 211 | 211 | ||
| 212 | nasid = cpuid_to_nasid(cpumask_first(mask)); | 212 | nasid = cpuid_to_nasid(cpumask_first_and(mask, cpu_online_mask)); |
| 213 | slice = cpuid_to_slice(cpumask_first(mask)); | 213 | slice = cpuid_to_slice(cpumask_first_and(mask, cpu_online_mask)); |
| 214 | 214 | ||
| 215 | list_for_each_entry_safe(sn_irq_info, sn_irq_info_safe, | 215 | list_for_each_entry_safe(sn_irq_info, sn_irq_info_safe, |
| 216 | sn_irq_lh[irq], list) | 216 | sn_irq_lh[irq], list) |
diff --git a/arch/ia64/sn/kernel/msi_sn.c b/arch/ia64/sn/kernel/msi_sn.c index 2b98b9e088de..afc58d2799ad 100644 --- a/arch/ia64/sn/kernel/msi_sn.c +++ b/arch/ia64/sn/kernel/msi_sn.c | |||
| @@ -166,7 +166,7 @@ static int sn_set_msi_irq_affinity(struct irq_data *data, | |||
| 166 | struct sn_pcibus_provider *provider; | 166 | struct sn_pcibus_provider *provider; |
| 167 | unsigned int cpu, irq = data->irq; | 167 | unsigned int cpu, irq = data->irq; |
| 168 | 168 | ||
| 169 | cpu = cpumask_first(cpu_mask); | 169 | cpu = cpumask_first_and(cpu_mask, cpu_online_mask); |
| 170 | sn_irq_info = sn_msi_info[irq].sn_irq_info; | 170 | sn_irq_info = sn_msi_info[irq].sn_irq_info; |
| 171 | if (sn_irq_info == NULL || sn_irq_info->irq_int_bit >= 0) | 171 | if (sn_irq_info == NULL || sn_irq_info->irq_int_bit >= 0) |
| 172 | return -1; | 172 | return -1; |
diff --git a/arch/m32r/include/asm/Kbuild b/arch/m32r/include/asm/Kbuild index 932435ac4e5c..67779a74b62d 100644 --- a/arch/m32r/include/asm/Kbuild +++ b/arch/m32r/include/asm/Kbuild | |||
| @@ -1,7 +1,9 @@ | |||
| 1 | 1 | ||
| 2 | generic-y += clkdev.h | 2 | generic-y += clkdev.h |
| 3 | generic-y += cputime.h | ||
| 3 | generic-y += exec.h | 4 | generic-y += exec.h |
| 5 | generic-y += hash.h | ||
| 6 | generic-y += mcs_spinlock.h | ||
| 4 | generic-y += module.h | 7 | generic-y += module.h |
| 5 | generic-y += trace_clock.h | ||
| 6 | generic-y += preempt.h | 8 | generic-y += preempt.h |
| 7 | generic-y += hash.h | 9 | generic-y += trace_clock.h |
diff --git a/arch/m32r/include/asm/cputime.h b/arch/m32r/include/asm/cputime.h deleted file mode 100644 index 0a47550df2b7..000000000000 --- a/arch/m32r/include/asm/cputime.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef __M32R_CPUTIME_H | ||
| 2 | #define __M32R_CPUTIME_H | ||
| 3 | |||
| 4 | #include <asm-generic/cputime.h> | ||
| 5 | |||
| 6 | #endif /* __M32R_CPUTIME_H */ | ||
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index dbdd2231c75d..b2e322939256 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig | |||
| @@ -17,6 +17,7 @@ config M68K | |||
| 17 | select FPU if MMU | 17 | select FPU if MMU |
| 18 | select ARCH_WANT_IPC_PARSE_VERSION | 18 | select ARCH_WANT_IPC_PARSE_VERSION |
| 19 | select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE | 19 | select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE |
| 20 | select HAVE_FUTEX_CMPXCHG if MMU && FUTEX | ||
| 20 | select HAVE_MOD_ARCH_SPECIFIC | 21 | select HAVE_MOD_ARCH_SPECIFIC |
| 21 | select MODULES_USE_ELF_REL | 22 | select MODULES_USE_ELF_REL |
| 22 | select MODULES_USE_ELF_RELA | 23 | select MODULES_USE_ELF_RELA |
diff --git a/arch/m68k/amiga/cia.c b/arch/m68k/amiga/cia.c index 18c0e29976e3..2081b8cd5591 100644 --- a/arch/m68k/amiga/cia.c +++ b/arch/m68k/amiga/cia.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
| 19 | #include <linux/seq_file.h> | 19 | #include <linux/seq_file.h> |
| 20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
| 21 | #include <linux/irq.h> | ||
| 21 | 22 | ||
| 22 | #include <asm/irq.h> | 23 | #include <asm/irq.h> |
| 23 | #include <asm/amigahw.h> | 24 | #include <asm/amigahw.h> |
diff --git a/arch/m68k/atari/ataints.c b/arch/m68k/atari/ataints.c index 3e73a63c066f..3d2b63bedf05 100644 --- a/arch/m68k/atari/ataints.c +++ b/arch/m68k/atari/ataints.c | |||
| @@ -41,6 +41,7 @@ | |||
| 41 | #include <linux/init.h> | 41 | #include <linux/init.h> |
| 42 | #include <linux/seq_file.h> | 42 | #include <linux/seq_file.h> |
| 43 | #include <linux/module.h> | 43 | #include <linux/module.h> |
| 44 | #include <linux/irq.h> | ||
| 44 | 45 | ||
| 45 | #include <asm/traps.h> | 46 | #include <asm/traps.h> |
| 46 | 47 | ||
diff --git a/arch/m68k/configs/amiga_defconfig b/arch/m68k/configs/amiga_defconfig index 559ff3af8ff7..96da4963d14b 100644 --- a/arch/m68k/configs/amiga_defconfig +++ b/arch/m68k/configs/amiga_defconfig | |||
| @@ -24,6 +24,8 @@ CONFIG_SUN_PARTITION=y | |||
| 24 | # CONFIG_EFI_PARTITION is not set | 24 | # CONFIG_EFI_PARTITION is not set |
| 25 | CONFIG_SYSV68_PARTITION=y | 25 | CONFIG_SYSV68_PARTITION=y |
| 26 | CONFIG_IOSCHED_DEADLINE=m | 26 | CONFIG_IOSCHED_DEADLINE=m |
| 27 | CONFIG_KEXEC=y | ||
| 28 | CONFIG_BOOTINFO_PROC=y | ||
| 27 | CONFIG_M68020=y | 29 | CONFIG_M68020=y |
| 28 | CONFIG_M68030=y | 30 | CONFIG_M68030=y |
| 29 | CONFIG_M68040=y | 31 | CONFIG_M68040=y |
| @@ -85,6 +87,7 @@ CONFIG_NF_CONNTRACK_SANE=m | |||
| 85 | CONFIG_NF_CONNTRACK_SIP=m | 87 | CONFIG_NF_CONNTRACK_SIP=m |
| 86 | CONFIG_NF_CONNTRACK_TFTP=m | 88 | CONFIG_NF_CONNTRACK_TFTP=m |
| 87 | CONFIG_NF_TABLES=m | 89 | CONFIG_NF_TABLES=m |
| 90 | CONFIG_NF_TABLES_INET=m | ||
| 88 | CONFIG_NFT_EXTHDR=m | 91 | CONFIG_NFT_EXTHDR=m |
| 89 | CONFIG_NFT_META=m | 92 | CONFIG_NFT_META=m |
| 90 | CONFIG_NFT_CT=m | 93 | CONFIG_NFT_CT=m |
| @@ -94,6 +97,8 @@ CONFIG_NFT_COUNTER=m | |||
| 94 | CONFIG_NFT_LOG=m | 97 | CONFIG_NFT_LOG=m |
| 95 | CONFIG_NFT_LIMIT=m | 98 | CONFIG_NFT_LIMIT=m |
| 96 | CONFIG_NFT_NAT=m | 99 | CONFIG_NFT_NAT=m |
| 100 | CONFIG_NFT_QUEUE=m | ||
| 101 | CONFIG_NFT_REJECT=m | ||
| 97 | CONFIG_NFT_COMPAT=m | 102 | CONFIG_NFT_COMPAT=m |
| 98 | CONFIG_NETFILTER_XT_SET=m | 103 | CONFIG_NETFILTER_XT_SET=m |
| 99 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m | 104 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m |
| @@ -126,6 +131,7 @@ CONFIG_NETFILTER_XT_MATCH_DSCP=m | |||
| 126 | CONFIG_NETFILTER_XT_MATCH_ESP=m | 131 | CONFIG_NETFILTER_XT_MATCH_ESP=m |
| 127 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m | 132 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m |
| 128 | CONFIG_NETFILTER_XT_MATCH_HELPER=m | 133 | CONFIG_NETFILTER_XT_MATCH_HELPER=m |
| 134 | CONFIG_NETFILTER_XT_MATCH_IPCOMP=m | ||
| 129 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m | 135 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m |
| 130 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m | 136 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m |
| 131 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m | 137 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m |
| @@ -163,8 +169,6 @@ CONFIG_IP_SET_HASH_NETPORT=m | |||
| 163 | CONFIG_IP_SET_HASH_NETIFACE=m | 169 | CONFIG_IP_SET_HASH_NETIFACE=m |
| 164 | CONFIG_IP_SET_LIST_SET=m | 170 | CONFIG_IP_SET_LIST_SET=m |
| 165 | CONFIG_NF_CONNTRACK_IPV4=m | 171 | CONFIG_NF_CONNTRACK_IPV4=m |
| 166 | CONFIG_NF_TABLES_IPV4=m | ||
| 167 | CONFIG_NFT_REJECT_IPV4=m | ||
| 168 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m | 172 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m |
| 169 | CONFIG_NFT_CHAIN_NAT_IPV4=m | 173 | CONFIG_NFT_CHAIN_NAT_IPV4=m |
| 170 | CONFIG_NF_TABLES_ARP=m | 174 | CONFIG_NF_TABLES_ARP=m |
| @@ -190,7 +194,6 @@ CONFIG_IP_NF_ARPTABLES=m | |||
| 190 | CONFIG_IP_NF_ARPFILTER=m | 194 | CONFIG_IP_NF_ARPFILTER=m |
| 191 | CONFIG_IP_NF_ARP_MANGLE=m | 195 | CONFIG_IP_NF_ARP_MANGLE=m |
| 192 | CONFIG_NF_CONNTRACK_IPV6=m | 196 | CONFIG_NF_CONNTRACK_IPV6=m |
| 193 | CONFIG_NF_TABLES_IPV6=m | ||
| 194 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m | 197 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m |
| 195 | CONFIG_NFT_CHAIN_NAT_IPV6=m | 198 | CONFIG_NFT_CHAIN_NAT_IPV6=m |
| 196 | CONFIG_IP6_NF_IPTABLES=m | 199 | CONFIG_IP6_NF_IPTABLES=m |
| @@ -512,7 +515,6 @@ CONFIG_CRYPTO_LZ4HC=m | |||
| 512 | CONFIG_CRYPTO_USER_API_HASH=m | 515 | CONFIG_CRYPTO_USER_API_HASH=m |
| 513 | CONFIG_CRYPTO_USER_API_SKCIPHER=m | 516 | CONFIG_CRYPTO_USER_API_SKCIPHER=m |
| 514 | # CONFIG_CRYPTO_HW is not set | 517 | # CONFIG_CRYPTO_HW is not set |
| 515 | CONFIG_CRC_T10DIF=y | ||
| 516 | CONFIG_XZ_DEC_X86=y | 518 | CONFIG_XZ_DEC_X86=y |
| 517 | CONFIG_XZ_DEC_POWERPC=y | 519 | CONFIG_XZ_DEC_POWERPC=y |
| 518 | CONFIG_XZ_DEC_IA64=y | 520 | CONFIG_XZ_DEC_IA64=y |
diff --git a/arch/m68k/configs/apollo_defconfig b/arch/m68k/configs/apollo_defconfig index cb1f55df69b6..1b8739f50cbf 100644 --- a/arch/m68k/configs/apollo_defconfig +++ b/arch/m68k/configs/apollo_defconfig | |||
| @@ -25,6 +25,8 @@ CONFIG_SUN_PARTITION=y | |||
| 25 | # CONFIG_EFI_PARTITION is not set | 25 | # CONFIG_EFI_PARTITION is not set |
| 26 | CONFIG_SYSV68_PARTITION=y | 26 | CONFIG_SYSV68_PARTITION=y |
| 27 | CONFIG_IOSCHED_DEADLINE=m | 27 | CONFIG_IOSCHED_DEADLINE=m |
| 28 | CONFIG_KEXEC=y | ||
| 29 | CONFIG_BOOTINFO_PROC=y | ||
| 28 | CONFIG_M68020=y | 30 | CONFIG_M68020=y |
| 29 | CONFIG_M68030=y | 31 | CONFIG_M68030=y |
| 30 | CONFIG_M68040=y | 32 | CONFIG_M68040=y |
| @@ -83,6 +85,7 @@ CONFIG_NF_CONNTRACK_SANE=m | |||
| 83 | CONFIG_NF_CONNTRACK_SIP=m | 85 | CONFIG_NF_CONNTRACK_SIP=m |
| 84 | CONFIG_NF_CONNTRACK_TFTP=m | 86 | CONFIG_NF_CONNTRACK_TFTP=m |
| 85 | CONFIG_NF_TABLES=m | 87 | CONFIG_NF_TABLES=m |
| 88 | CONFIG_NF_TABLES_INET=m | ||
| 86 | CONFIG_NFT_EXTHDR=m | 89 | CONFIG_NFT_EXTHDR=m |
| 87 | CONFIG_NFT_META=m | 90 | CONFIG_NFT_META=m |
| 88 | CONFIG_NFT_CT=m | 91 | CONFIG_NFT_CT=m |
| @@ -92,6 +95,8 @@ CONFIG_NFT_COUNTER=m | |||
| 92 | CONFIG_NFT_LOG=m | 95 | CONFIG_NFT_LOG=m |
| 93 | CONFIG_NFT_LIMIT=m | 96 | CONFIG_NFT_LIMIT=m |
| 94 | CONFIG_NFT_NAT=m | 97 | CONFIG_NFT_NAT=m |
| 98 | CONFIG_NFT_QUEUE=m | ||
| 99 | CONFIG_NFT_REJECT=m | ||
| 95 | CONFIG_NFT_COMPAT=m | 100 | CONFIG_NFT_COMPAT=m |
| 96 | CONFIG_NETFILTER_XT_SET=m | 101 | CONFIG_NETFILTER_XT_SET=m |
| 97 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m | 102 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m |
| @@ -124,6 +129,7 @@ CONFIG_NETFILTER_XT_MATCH_DSCP=m | |||
| 124 | CONFIG_NETFILTER_XT_MATCH_ESP=m | 129 | CONFIG_NETFILTER_XT_MATCH_ESP=m |
| 125 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m | 130 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m |
| 126 | CONFIG_NETFILTER_XT_MATCH_HELPER=m | 131 | CONFIG_NETFILTER_XT_MATCH_HELPER=m |
| 132 | CONFIG_NETFILTER_XT_MATCH_IPCOMP=m | ||
| 127 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m | 133 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m |
| 128 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m | 134 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m |
| 129 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m | 135 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m |
| @@ -161,8 +167,6 @@ CONFIG_IP_SET_HASH_NETPORT=m | |||
| 161 | CONFIG_IP_SET_HASH_NETIFACE=m | 167 | CONFIG_IP_SET_HASH_NETIFACE=m |
| 162 | CONFIG_IP_SET_LIST_SET=m | 168 | CONFIG_IP_SET_LIST_SET=m |
| 163 | CONFIG_NF_CONNTRACK_IPV4=m | 169 | CONFIG_NF_CONNTRACK_IPV4=m |
| 164 | CONFIG_NF_TABLES_IPV4=m | ||
| 165 | CONFIG_NFT_REJECT_IPV4=m | ||
| 166 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m | 170 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m |
| 167 | CONFIG_NFT_CHAIN_NAT_IPV4=m | 171 | CONFIG_NFT_CHAIN_NAT_IPV4=m |
| 168 | CONFIG_NF_TABLES_ARP=m | 172 | CONFIG_NF_TABLES_ARP=m |
| @@ -188,7 +192,6 @@ CONFIG_IP_NF_ARPTABLES=m | |||
| 188 | CONFIG_IP_NF_ARPFILTER=m | 192 | CONFIG_IP_NF_ARPFILTER=m |
| 189 | CONFIG_IP_NF_ARP_MANGLE=m | 193 | CONFIG_IP_NF_ARP_MANGLE=m |
| 190 | CONFIG_NF_CONNTRACK_IPV6=m | 194 | CONFIG_NF_CONNTRACK_IPV6=m |
| 191 | CONFIG_NF_TABLES_IPV6=m | ||
| 192 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m | 195 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m |
| 193 | CONFIG_NFT_CHAIN_NAT_IPV6=m | 196 | CONFIG_NFT_CHAIN_NAT_IPV6=m |
| 194 | CONFIG_IP6_NF_IPTABLES=m | 197 | CONFIG_IP6_NF_IPTABLES=m |
| @@ -470,7 +473,6 @@ CONFIG_CRYPTO_LZ4HC=m | |||
| 470 | CONFIG_CRYPTO_USER_API_HASH=m | 473 | CONFIG_CRYPTO_USER_API_HASH=m |
| 471 | CONFIG_CRYPTO_USER_API_SKCIPHER=m | 474 | CONFIG_CRYPTO_USER_API_SKCIPHER=m |
| 472 | # CONFIG_CRYPTO_HW is not set | 475 | # CONFIG_CRYPTO_HW is not set |
| 473 | CONFIG_CRC_T10DIF=y | ||
| 474 | CONFIG_XZ_DEC_X86=y | 476 | CONFIG_XZ_DEC_X86=y |
| 475 | CONFIG_XZ_DEC_POWERPC=y | 477 | CONFIG_XZ_DEC_POWERPC=y |
| 476 | CONFIG_XZ_DEC_IA64=y | 478 | CONFIG_XZ_DEC_IA64=y |
diff --git a/arch/m68k/configs/atari_defconfig b/arch/m68k/configs/atari_defconfig index e880cfbb62d9..6ea4e91f0caa 100644 --- a/arch/m68k/configs/atari_defconfig +++ b/arch/m68k/configs/atari_defconfig | |||
| @@ -24,6 +24,8 @@ CONFIG_SUN_PARTITION=y | |||
| 24 | # CONFIG_EFI_PARTITION is not set | 24 | # CONFIG_EFI_PARTITION is not set |
| 25 | CONFIG_SYSV68_PARTITION=y | 25 | CONFIG_SYSV68_PARTITION=y |
| 26 | CONFIG_IOSCHED_DEADLINE=m | 26 | CONFIG_IOSCHED_DEADLINE=m |
| 27 | CONFIG_KEXEC=y | ||
| 28 | CONFIG_BOOTINFO_PROC=y | ||
| 27 | CONFIG_M68020=y | 29 | CONFIG_M68020=y |
| 28 | CONFIG_M68030=y | 30 | CONFIG_M68030=y |
| 29 | CONFIG_M68040=y | 31 | CONFIG_M68040=y |
| @@ -82,6 +84,7 @@ CONFIG_NF_CONNTRACK_SANE=m | |||
| 82 | CONFIG_NF_CONNTRACK_SIP=m | 84 | CONFIG_NF_CONNTRACK_SIP=m |
| 83 | CONFIG_NF_CONNTRACK_TFTP=m | 85 | CONFIG_NF_CONNTRACK_TFTP=m |
| 84 | CONFIG_NF_TABLES=m | 86 | CONFIG_NF_TABLES=m |
| 87 | CONFIG_NF_TABLES_INET=m | ||
| 85 | CONFIG_NFT_EXTHDR=m | 88 | CONFIG_NFT_EXTHDR=m |
| 86 | CONFIG_NFT_META=m | 89 | CONFIG_NFT_META=m |
| 87 | CONFIG_NFT_CT=m | 90 | CONFIG_NFT_CT=m |
| @@ -91,6 +94,8 @@ CONFIG_NFT_COUNTER=m | |||
| 91 | CONFIG_NFT_LOG=m | 94 | CONFIG_NFT_LOG=m |
| 92 | CONFIG_NFT_LIMIT=m | 95 | CONFIG_NFT_LIMIT=m |
| 93 | CONFIG_NFT_NAT=m | 96 | CONFIG_NFT_NAT=m |
| 97 | CONFIG_NFT_QUEUE=m | ||
| 98 | CONFIG_NFT_REJECT=m | ||
| 94 | CONFIG_NFT_COMPAT=m | 99 | CONFIG_NFT_COMPAT=m |
| 95 | CONFIG_NETFILTER_XT_SET=m | 100 | CONFIG_NETFILTER_XT_SET=m |
| 96 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m | 101 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m |
| @@ -123,6 +128,7 @@ CONFIG_NETFILTER_XT_MATCH_DSCP=m | |||
| 123 | CONFIG_NETFILTER_XT_MATCH_ESP=m | 128 | CONFIG_NETFILTER_XT_MATCH_ESP=m |
| 124 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m | 129 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m |
| 125 | CONFIG_NETFILTER_XT_MATCH_HELPER=m | 130 | CONFIG_NETFILTER_XT_MATCH_HELPER=m |
| 131 | CONFIG_NETFILTER_XT_MATCH_IPCOMP=m | ||
| 126 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m | 132 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m |
| 127 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m | 133 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m |
| 128 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m | 134 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m |
| @@ -160,8 +166,6 @@ CONFIG_IP_SET_HASH_NETPORT=m | |||
| 160 | CONFIG_IP_SET_HASH_NETIFACE=m | 166 | CONFIG_IP_SET_HASH_NETIFACE=m |
| 161 | CONFIG_IP_SET_LIST_SET=m | 167 | CONFIG_IP_SET_LIST_SET=m |
| 162 | CONFIG_NF_CONNTRACK_IPV4=m | 168 | CONFIG_NF_CONNTRACK_IPV4=m |
| 163 | CONFIG_NF_TABLES_IPV4=m | ||
| 164 | CONFIG_NFT_REJECT_IPV4=m | ||
| 165 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m | 169 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m |
| 166 | CONFIG_NFT_CHAIN_NAT_IPV4=m | 170 | CONFIG_NFT_CHAIN_NAT_IPV4=m |
| 167 | CONFIG_NF_TABLES_ARP=m | 171 | CONFIG_NF_TABLES_ARP=m |
| @@ -187,7 +191,6 @@ CONFIG_IP_NF_ARPTABLES=m | |||
| 187 | CONFIG_IP_NF_ARPFILTER=m | 191 | CONFIG_IP_NF_ARPFILTER=m |
| 188 | CONFIG_IP_NF_ARP_MANGLE=m | 192 | CONFIG_IP_NF_ARP_MANGLE=m |
| 189 | CONFIG_NF_CONNTRACK_IPV6=m | 193 | CONFIG_NF_CONNTRACK_IPV6=m |
| 190 | CONFIG_NF_TABLES_IPV6=m | ||
| 191 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m | 194 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m |
| 192 | CONFIG_NFT_CHAIN_NAT_IPV6=m | 195 | CONFIG_NFT_CHAIN_NAT_IPV6=m |
| 193 | CONFIG_IP6_NF_IPTABLES=m | 196 | CONFIG_IP6_NF_IPTABLES=m |
| @@ -487,7 +490,6 @@ CONFIG_CRYPTO_LZ4HC=m | |||
| 487 | CONFIG_CRYPTO_USER_API_HASH=m | 490 | CONFIG_CRYPTO_USER_API_HASH=m |
| 488 | CONFIG_CRYPTO_USER_API_SKCIPHER=m | 491 | CONFIG_CRYPTO_USER_API_SKCIPHER=m |
| 489 | # CONFIG_CRYPTO_HW is not set | 492 | # CONFIG_CRYPTO_HW is not set |
| 490 | CONFIG_CRC_T10DIF=y | ||
| 491 | CONFIG_XZ_DEC_X86=y | 493 | CONFIG_XZ_DEC_X86=y |
| 492 | CONFIG_XZ_DEC_POWERPC=y | 494 | CONFIG_XZ_DEC_POWERPC=y |
| 493 | CONFIG_XZ_DEC_IA64=y | 495 | CONFIG_XZ_DEC_IA64=y |
diff --git a/arch/m68k/configs/bvme6000_defconfig b/arch/m68k/configs/bvme6000_defconfig index 4aa4f45e52a8..e5a12739ff2d 100644 --- a/arch/m68k/configs/bvme6000_defconfig +++ b/arch/m68k/configs/bvme6000_defconfig | |||
| @@ -24,6 +24,8 @@ CONFIG_UNIXWARE_DISKLABEL=y | |||
| 24 | CONFIG_SUN_PARTITION=y | 24 | CONFIG_SUN_PARTITION=y |
| 25 | # CONFIG_EFI_PARTITION is not set | 25 | # CONFIG_EFI_PARTITION is not set |
| 26 | CONFIG_IOSCHED_DEADLINE=m | 26 | CONFIG_IOSCHED_DEADLINE=m |
| 27 | CONFIG_KEXEC=y | ||
| 28 | CONFIG_BOOTINFO_PROC=y | ||
| 27 | CONFIG_M68040=y | 29 | CONFIG_M68040=y |
| 28 | CONFIG_M68060=y | 30 | CONFIG_M68060=y |
| 29 | CONFIG_VME=y | 31 | CONFIG_VME=y |
| @@ -81,6 +83,7 @@ CONFIG_NF_CONNTRACK_SANE=m | |||
| 81 | CONFIG_NF_CONNTRACK_SIP=m | 83 | CONFIG_NF_CONNTRACK_SIP=m |
| 82 | CONFIG_NF_CONNTRACK_TFTP=m | 84 | CONFIG_NF_CONNTRACK_TFTP=m |
| 83 | CONFIG_NF_TABLES=m | 85 | CONFIG_NF_TABLES=m |
| 86 | CONFIG_NF_TABLES_INET=m | ||
| 84 | CONFIG_NFT_EXTHDR=m | 87 | CONFIG_NFT_EXTHDR=m |
| 85 | CONFIG_NFT_META=m | 88 | CONFIG_NFT_META=m |
| 86 | CONFIG_NFT_CT=m | 89 | CONFIG_NFT_CT=m |
| @@ -90,6 +93,8 @@ CONFIG_NFT_COUNTER=m | |||
| 90 | CONFIG_NFT_LOG=m | 93 | CONFIG_NFT_LOG=m |
| 91 | CONFIG_NFT_LIMIT=m | 94 | CONFIG_NFT_LIMIT=m |
| 92 | CONFIG_NFT_NAT=m | 95 | CONFIG_NFT_NAT=m |
| 96 | CONFIG_NFT_QUEUE=m | ||
| 97 | CONFIG_NFT_REJECT=m | ||
| 93 | CONFIG_NFT_COMPAT=m | 98 | CONFIG_NFT_COMPAT=m |
| 94 | CONFIG_NETFILTER_XT_SET=m | 99 | CONFIG_NETFILTER_XT_SET=m |
| 95 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m | 100 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m |
| @@ -122,6 +127,7 @@ CONFIG_NETFILTER_XT_MATCH_DSCP=m | |||
| 122 | CONFIG_NETFILTER_XT_MATCH_ESP=m | 127 | CONFIG_NETFILTER_XT_MATCH_ESP=m |
| 123 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m | 128 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m |
| 124 | CONFIG_NETFILTER_XT_MATCH_HELPER=m | 129 | CONFIG_NETFILTER_XT_MATCH_HELPER=m |
| 130 | CONFIG_NETFILTER_XT_MATCH_IPCOMP=m | ||
| 125 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m | 131 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m |
| 126 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m | 132 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m |
| 127 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m | 133 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m |
| @@ -159,8 +165,6 @@ CONFIG_IP_SET_HASH_NETPORT=m | |||
| 159 | CONFIG_IP_SET_HASH_NETIFACE=m | 165 | CONFIG_IP_SET_HASH_NETIFACE=m |
| 160 | CONFIG_IP_SET_LIST_SET=m | 166 | CONFIG_IP_SET_LIST_SET=m |
| 161 | CONFIG_NF_CONNTRACK_IPV4=m | 167 | CONFIG_NF_CONNTRACK_IPV4=m |
| 162 | CONFIG_NF_TABLES_IPV4=m | ||
| 163 | CONFIG_NFT_REJECT_IPV4=m | ||
| 164 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m | 168 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m |
| 165 | CONFIG_NFT_CHAIN_NAT_IPV4=m | 169 | CONFIG_NFT_CHAIN_NAT_IPV4=m |
| 166 | CONFIG_NF_TABLES_ARP=m | 170 | CONFIG_NF_TABLES_ARP=m |
| @@ -186,7 +190,6 @@ CONFIG_IP_NF_ARPTABLES=m | |||
| 186 | CONFIG_IP_NF_ARPFILTER=m | 190 | CONFIG_IP_NF_ARPFILTER=m |
| 187 | CONFIG_IP_NF_ARP_MANGLE=m | 191 | CONFIG_IP_NF_ARP_MANGLE=m |
| 188 | CONFIG_NF_CONNTRACK_IPV6=m | 192 | CONFIG_NF_CONNTRACK_IPV6=m |
| 189 | CONFIG_NF_TABLES_IPV6=m | ||
| 190 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m | 193 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m |
| 191 | CONFIG_NFT_CHAIN_NAT_IPV6=m | 194 | CONFIG_NFT_CHAIN_NAT_IPV6=m |
| 192 | CONFIG_IP6_NF_IPTABLES=m | 195 | CONFIG_IP6_NF_IPTABLES=m |
| @@ -463,7 +466,6 @@ CONFIG_CRYPTO_LZ4HC=m | |||
| 463 | CONFIG_CRYPTO_USER_API_HASH=m | 466 | CONFIG_CRYPTO_USER_API_HASH=m |
| 464 | CONFIG_CRYPTO_USER_API_SKCIPHER=m | 467 | CONFIG_CRYPTO_USER_API_SKCIPHER=m |
| 465 | # CONFIG_CRYPTO_HW is not set | 468 | # CONFIG_CRYPTO_HW is not set |
| 466 | CONFIG_CRC_T10DIF=y | ||
| 467 | CONFIG_XZ_DEC_X86=y | 469 | CONFIG_XZ_DEC_X86=y |
| 468 | CONFIG_XZ_DEC_POWERPC=y | 470 | CONFIG_XZ_DEC_POWERPC=y |
| 469 | CONFIG_XZ_DEC_IA64=y | 471 | CONFIG_XZ_DEC_IA64=y |
diff --git a/arch/m68k/configs/hp300_defconfig b/arch/m68k/configs/hp300_defconfig index 7cd9d9f456fb..8936d7fb0f0f 100644 --- a/arch/m68k/configs/hp300_defconfig +++ b/arch/m68k/configs/hp300_defconfig | |||
| @@ -25,6 +25,8 @@ CONFIG_SUN_PARTITION=y | |||
| 25 | # CONFIG_EFI_PARTITION is not set | 25 | # CONFIG_EFI_PARTITION is not set |
| 26 | CONFIG_SYSV68_PARTITION=y | 26 | CONFIG_SYSV68_PARTITION=y |
| 27 | CONFIG_IOSCHED_DEADLINE=m | 27 | CONFIG_IOSCHED_DEADLINE=m |
| 28 | CONFIG_KEXEC=y | ||
| 29 | CONFIG_BOOTINFO_PROC=y | ||
| 28 | CONFIG_M68020=y | 30 | CONFIG_M68020=y |
| 29 | CONFIG_M68030=y | 31 | CONFIG_M68030=y |
| 30 | CONFIG_M68040=y | 32 | CONFIG_M68040=y |
| @@ -83,6 +85,7 @@ CONFIG_NF_CONNTRACK_SANE=m | |||
| 83 | CONFIG_NF_CONNTRACK_SIP=m | 85 | CONFIG_NF_CONNTRACK_SIP=m |
| 84 | CONFIG_NF_CONNTRACK_TFTP=m | 86 | CONFIG_NF_CONNTRACK_TFTP=m |
| 85 | CONFIG_NF_TABLES=m | 87 | CONFIG_NF_TABLES=m |
| 88 | CONFIG_NF_TABLES_INET=m | ||
| 86 | CONFIG_NFT_EXTHDR=m | 89 | CONFIG_NFT_EXTHDR=m |
| 87 | CONFIG_NFT_META=m | 90 | CONFIG_NFT_META=m |
| 88 | CONFIG_NFT_CT=m | 91 | CONFIG_NFT_CT=m |
| @@ -92,6 +95,8 @@ CONFIG_NFT_COUNTER=m | |||
| 92 | CONFIG_NFT_LOG=m | 95 | CONFIG_NFT_LOG=m |
| 93 | CONFIG_NFT_LIMIT=m | 96 | CONFIG_NFT_LIMIT=m |
| 94 | CONFIG_NFT_NAT=m | 97 | CONFIG_NFT_NAT=m |
| 98 | CONFIG_NFT_QUEUE=m | ||
| 99 | CONFIG_NFT_REJECT=m | ||
| 95 | CONFIG_NFT_COMPAT=m | 100 | CONFIG_NFT_COMPAT=m |
| 96 | CONFIG_NETFILTER_XT_SET=m | 101 | CONFIG_NETFILTER_XT_SET=m |
| 97 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m | 102 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m |
| @@ -124,6 +129,7 @@ CONFIG_NETFILTER_XT_MATCH_DSCP=m | |||
| 124 | CONFIG_NETFILTER_XT_MATCH_ESP=m | 129 | CONFIG_NETFILTER_XT_MATCH_ESP=m |
| 125 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m | 130 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m |
| 126 | CONFIG_NETFILTER_XT_MATCH_HELPER=m | 131 | CONFIG_NETFILTER_XT_MATCH_HELPER=m |
| 132 | CONFIG_NETFILTER_XT_MATCH_IPCOMP=m | ||
| 127 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m | 133 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m |
| 128 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m | 134 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m |
| 129 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m | 135 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m |
| @@ -161,8 +167,6 @@ CONFIG_IP_SET_HASH_NETPORT=m | |||
| 161 | CONFIG_IP_SET_HASH_NETIFACE=m | 167 | CONFIG_IP_SET_HASH_NETIFACE=m |
| 162 | CONFIG_IP_SET_LIST_SET=m | 168 | CONFIG_IP_SET_LIST_SET=m |
| 163 | CONFIG_NF_CONNTRACK_IPV4=m | 169 | CONFIG_NF_CONNTRACK_IPV4=m |
| 164 | CONFIG_NF_TABLES_IPV4=m | ||
| 165 | CONFIG_NFT_REJECT_IPV4=m | ||
| 166 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m | 170 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m |
| 167 | CONFIG_NFT_CHAIN_NAT_IPV4=m | 171 | CONFIG_NFT_CHAIN_NAT_IPV4=m |
| 168 | CONFIG_NF_TABLES_ARP=m | 172 | CONFIG_NF_TABLES_ARP=m |
| @@ -188,7 +192,6 @@ CONFIG_IP_NF_ARPTABLES=m | |||
| 188 | CONFIG_IP_NF_ARPFILTER=m | 192 | CONFIG_IP_NF_ARPFILTER=m |
| 189 | CONFIG_IP_NF_ARP_MANGLE=m | 193 | CONFIG_IP_NF_ARP_MANGLE=m |
| 190 | CONFIG_NF_CONNTRACK_IPV6=m | 194 | CONFIG_NF_CONNTRACK_IPV6=m |
| 191 | CONFIG_NF_TABLES_IPV6=m | ||
| 192 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m | 195 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m |
| 193 | CONFIG_NFT_CHAIN_NAT_IPV6=m | 196 | CONFIG_NFT_CHAIN_NAT_IPV6=m |
| 194 | CONFIG_IP6_NF_IPTABLES=m | 197 | CONFIG_IP6_NF_IPTABLES=m |
| @@ -472,7 +475,6 @@ CONFIG_CRYPTO_LZ4HC=m | |||
| 472 | CONFIG_CRYPTO_USER_API_HASH=m | 475 | CONFIG_CRYPTO_USER_API_HASH=m |
| 473 | CONFIG_CRYPTO_USER_API_SKCIPHER=m | 476 | CONFIG_CRYPTO_USER_API_SKCIPHER=m |
| 474 | # CONFIG_CRYPTO_HW is not set | 477 | # CONFIG_CRYPTO_HW is not set |
| 475 | CONFIG_CRC_T10DIF=y | ||
| 476 | CONFIG_XZ_DEC_X86=y | 478 | CONFIG_XZ_DEC_X86=y |
| 477 | CONFIG_XZ_DEC_POWERPC=y | 479 | CONFIG_XZ_DEC_POWERPC=y |
| 478 | CONFIG_XZ_DEC_IA64=y | 480 | CONFIG_XZ_DEC_IA64=y |
diff --git a/arch/m68k/configs/mac_defconfig b/arch/m68k/configs/mac_defconfig index 31f5bd061d14..be5342cca25b 100644 --- a/arch/m68k/configs/mac_defconfig +++ b/arch/m68k/configs/mac_defconfig | |||
| @@ -24,6 +24,8 @@ CONFIG_SUN_PARTITION=y | |||
| 24 | # CONFIG_EFI_PARTITION is not set | 24 | # CONFIG_EFI_PARTITION is not set |
| 25 | CONFIG_SYSV68_PARTITION=y | 25 | CONFIG_SYSV68_PARTITION=y |
| 26 | CONFIG_IOSCHED_DEADLINE=m | 26 | CONFIG_IOSCHED_DEADLINE=m |
| 27 | CONFIG_KEXEC=y | ||
| 28 | CONFIG_BOOTINFO_PROC=y | ||
| 27 | CONFIG_M68020=y | 29 | CONFIG_M68020=y |
| 28 | CONFIG_M68030=y | 30 | CONFIG_M68030=y |
| 29 | CONFIG_M68040=y | 31 | CONFIG_M68040=y |
| @@ -82,6 +84,7 @@ CONFIG_NF_CONNTRACK_SANE=m | |||
| 82 | CONFIG_NF_CONNTRACK_SIP=m | 84 | CONFIG_NF_CONNTRACK_SIP=m |
| 83 | CONFIG_NF_CONNTRACK_TFTP=m | 85 | CONFIG_NF_CONNTRACK_TFTP=m |
| 84 | CONFIG_NF_TABLES=m | 86 | CONFIG_NF_TABLES=m |
| 87 | CONFIG_NF_TABLES_INET=m | ||
| 85 | CONFIG_NFT_EXTHDR=m | 88 | CONFIG_NFT_EXTHDR=m |
| 86 | CONFIG_NFT_META=m | 89 | CONFIG_NFT_META=m |
| 87 | CONFIG_NFT_CT=m | 90 | CONFIG_NFT_CT=m |
| @@ -91,6 +94,8 @@ CONFIG_NFT_COUNTER=m | |||
| 91 | CONFIG_NFT_LOG=m | 94 | CONFIG_NFT_LOG=m |
| 92 | CONFIG_NFT_LIMIT=m | 95 | CONFIG_NFT_LIMIT=m |
| 93 | CONFIG_NFT_NAT=m | 96 | CONFIG_NFT_NAT=m |
| 97 | CONFIG_NFT_QUEUE=m | ||
| 98 | CONFIG_NFT_REJECT=m | ||
| 94 | CONFIG_NFT_COMPAT=m | 99 | CONFIG_NFT_COMPAT=m |
| 95 | CONFIG_NETFILTER_XT_SET=m | 100 | CONFIG_NETFILTER_XT_SET=m |
| 96 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m | 101 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m |
| @@ -123,6 +128,7 @@ CONFIG_NETFILTER_XT_MATCH_DSCP=m | |||
| 123 | CONFIG_NETFILTER_XT_MATCH_ESP=m | 128 | CONFIG_NETFILTER_XT_MATCH_ESP=m |
| 124 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m | 129 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m |
| 125 | CONFIG_NETFILTER_XT_MATCH_HELPER=m | 130 | CONFIG_NETFILTER_XT_MATCH_HELPER=m |
| 131 | CONFIG_NETFILTER_XT_MATCH_IPCOMP=m | ||
| 126 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m | 132 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m |
| 127 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m | 133 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m |
| 128 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m | 134 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m |
| @@ -160,8 +166,6 @@ CONFIG_IP_SET_HASH_NETPORT=m | |||
| 160 | CONFIG_IP_SET_HASH_NETIFACE=m | 166 | CONFIG_IP_SET_HASH_NETIFACE=m |
| 161 | CONFIG_IP_SET_LIST_SET=m | 167 | CONFIG_IP_SET_LIST_SET=m |
| 162 | CONFIG_NF_CONNTRACK_IPV4=m | 168 | CONFIG_NF_CONNTRACK_IPV4=m |
| 163 | CONFIG_NF_TABLES_IPV4=m | ||
| 164 | CONFIG_NFT_REJECT_IPV4=m | ||
| 165 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m | 169 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m |
| 166 | CONFIG_NFT_CHAIN_NAT_IPV4=m | 170 | CONFIG_NFT_CHAIN_NAT_IPV4=m |
| 167 | CONFIG_NF_TABLES_ARP=m | 171 | CONFIG_NF_TABLES_ARP=m |
| @@ -187,7 +191,6 @@ CONFIG_IP_NF_ARPTABLES=m | |||
| 187 | CONFIG_IP_NF_ARPFILTER=m | 191 | CONFIG_IP_NF_ARPFILTER=m |
| 188 | CONFIG_IP_NF_ARP_MANGLE=m | 192 | CONFIG_IP_NF_ARP_MANGLE=m |
| 189 | CONFIG_NF_CONNTRACK_IPV6=m | 193 | CONFIG_NF_CONNTRACK_IPV6=m |
| 190 | CONFIG_NF_TABLES_IPV6=m | ||
| 191 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m | 194 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m |
| 192 | CONFIG_NFT_CHAIN_NAT_IPV6=m | 195 | CONFIG_NFT_CHAIN_NAT_IPV6=m |
| 193 | CONFIG_IP6_NF_IPTABLES=m | 196 | CONFIG_IP6_NF_IPTABLES=m |
| @@ -495,7 +498,6 @@ CONFIG_CRYPTO_LZ4HC=m | |||
| 495 | CONFIG_CRYPTO_USER_API_HASH=m | 498 | CONFIG_CRYPTO_USER_API_HASH=m |
| 496 | CONFIG_CRYPTO_USER_API_SKCIPHER=m | 499 | CONFIG_CRYPTO_USER_API_SKCIPHER=m |
| 497 | # CONFIG_CRYPTO_HW is not set | 500 | # CONFIG_CRYPTO_HW is not set |
| 498 | CONFIG_CRC_T10DIF=y | ||
| 499 | CONFIG_XZ_DEC_X86=y | 501 | CONFIG_XZ_DEC_X86=y |
| 500 | CONFIG_XZ_DEC_POWERPC=y | 502 | CONFIG_XZ_DEC_POWERPC=y |
| 501 | CONFIG_XZ_DEC_IA64=y | 503 | CONFIG_XZ_DEC_IA64=y |
diff --git a/arch/m68k/configs/multi_defconfig b/arch/m68k/configs/multi_defconfig index 4e5adff326ee..f27194ade167 100644 --- a/arch/m68k/configs/multi_defconfig +++ b/arch/m68k/configs/multi_defconfig | |||
| @@ -20,6 +20,8 @@ CONFIG_SOLARIS_X86_PARTITION=y | |||
| 20 | CONFIG_UNIXWARE_DISKLABEL=y | 20 | CONFIG_UNIXWARE_DISKLABEL=y |
| 21 | # CONFIG_EFI_PARTITION is not set | 21 | # CONFIG_EFI_PARTITION is not set |
| 22 | CONFIG_IOSCHED_DEADLINE=m | 22 | CONFIG_IOSCHED_DEADLINE=m |
| 23 | CONFIG_KEXEC=y | ||
| 24 | CONFIG_BOOTINFO_PROC=y | ||
| 23 | CONFIG_M68020=y | 25 | CONFIG_M68020=y |
| 24 | CONFIG_M68040=y | 26 | CONFIG_M68040=y |
| 25 | CONFIG_M68060=y | 27 | CONFIG_M68060=y |
| @@ -91,6 +93,7 @@ CONFIG_NF_CONNTRACK_SANE=m | |||
| 91 | CONFIG_NF_CONNTRACK_SIP=m | 93 | CONFIG_NF_CONNTRACK_SIP=m |
| 92 | CONFIG_NF_CONNTRACK_TFTP=m | 94 | CONFIG_NF_CONNTRACK_TFTP=m |
| 93 | CONFIG_NF_TABLES=m | 95 | CONFIG_NF_TABLES=m |
| 96 | CONFIG_NF_TABLES_INET=m | ||
| 94 | CONFIG_NFT_EXTHDR=m | 97 | CONFIG_NFT_EXTHDR=m |
| 95 | CONFIG_NFT_META=m | 98 | CONFIG_NFT_META=m |
| 96 | CONFIG_NFT_CT=m | 99 | CONFIG_NFT_CT=m |
| @@ -100,6 +103,8 @@ CONFIG_NFT_COUNTER=m | |||
| 100 | CONFIG_NFT_LOG=m | 103 | CONFIG_NFT_LOG=m |
| 101 | CONFIG_NFT_LIMIT=m | 104 | CONFIG_NFT_LIMIT=m |
| 102 | CONFIG_NFT_NAT=m | 105 | CONFIG_NFT_NAT=m |
| 106 | CONFIG_NFT_QUEUE=m | ||
| 107 | CONFIG_NFT_REJECT=m | ||
| 103 | CONFIG_NFT_COMPAT=m | 108 | CONFIG_NFT_COMPAT=m |
| 104 | CONFIG_NETFILTER_XT_SET=m | 109 | CONFIG_NETFILTER_XT_SET=m |
| 105 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m | 110 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m |
| @@ -132,6 +137,7 @@ CONFIG_NETFILTER_XT_MATCH_DSCP=m | |||
| 132 | CONFIG_NETFILTER_XT_MATCH_ESP=m | 137 | CONFIG_NETFILTER_XT_MATCH_ESP=m |
| 133 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m | 138 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m |
| 134 | CONFIG_NETFILTER_XT_MATCH_HELPER=m | 139 | CONFIG_NETFILTER_XT_MATCH_HELPER=m |
| 140 | CONFIG_NETFILTER_XT_MATCH_IPCOMP=m | ||
| 135 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m | 141 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m |
| 136 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m | 142 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m |
| 137 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m | 143 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m |
| @@ -169,8 +175,6 @@ CONFIG_IP_SET_HASH_NETPORT=m | |||
| 169 | CONFIG_IP_SET_HASH_NETIFACE=m | 175 | CONFIG_IP_SET_HASH_NETIFACE=m |
| 170 | CONFIG_IP_SET_LIST_SET=m | 176 | CONFIG_IP_SET_LIST_SET=m |
| 171 | CONFIG_NF_CONNTRACK_IPV4=m | 177 | CONFIG_NF_CONNTRACK_IPV4=m |
| 172 | CONFIG_NF_TABLES_IPV4=m | ||
| 173 | CONFIG_NFT_REJECT_IPV4=m | ||
| 174 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m | 178 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m |
| 175 | CONFIG_NFT_CHAIN_NAT_IPV4=m | 179 | CONFIG_NFT_CHAIN_NAT_IPV4=m |
| 176 | CONFIG_NF_TABLES_ARP=m | 180 | CONFIG_NF_TABLES_ARP=m |
| @@ -196,7 +200,6 @@ CONFIG_IP_NF_ARPTABLES=m | |||
| 196 | CONFIG_IP_NF_ARPFILTER=m | 200 | CONFIG_IP_NF_ARPFILTER=m |
| 197 | CONFIG_IP_NF_ARP_MANGLE=m | 201 | CONFIG_IP_NF_ARP_MANGLE=m |
| 198 | CONFIG_NF_CONNTRACK_IPV6=m | 202 | CONFIG_NF_CONNTRACK_IPV6=m |
| 199 | CONFIG_NF_TABLES_IPV6=m | ||
| 200 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m | 203 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m |
| 201 | CONFIG_NFT_CHAIN_NAT_IPV6=m | 204 | CONFIG_NFT_CHAIN_NAT_IPV6=m |
| 202 | CONFIG_IP6_NF_IPTABLES=m | 205 | CONFIG_IP6_NF_IPTABLES=m |
| @@ -571,7 +574,6 @@ CONFIG_CRYPTO_LZ4HC=m | |||
| 571 | CONFIG_CRYPTO_USER_API_HASH=m | 574 | CONFIG_CRYPTO_USER_API_HASH=m |
| 572 | CONFIG_CRYPTO_USER_API_SKCIPHER=m | 575 | CONFIG_CRYPTO_USER_API_SKCIPHER=m |
| 573 | # CONFIG_CRYPTO_HW is not set | 576 | # CONFIG_CRYPTO_HW is not set |
| 574 | CONFIG_CRC_T10DIF=y | ||
| 575 | CONFIG_XZ_DEC_X86=y | 577 | CONFIG_XZ_DEC_X86=y |
| 576 | CONFIG_XZ_DEC_POWERPC=y | 578 | CONFIG_XZ_DEC_POWERPC=y |
| 577 | CONFIG_XZ_DEC_IA64=y | 579 | CONFIG_XZ_DEC_IA64=y |
diff --git a/arch/m68k/configs/mvme147_defconfig b/arch/m68k/configs/mvme147_defconfig index 02cdbac5565e..c3887603c1db 100644 --- a/arch/m68k/configs/mvme147_defconfig +++ b/arch/m68k/configs/mvme147_defconfig | |||
| @@ -24,6 +24,8 @@ CONFIG_UNIXWARE_DISKLABEL=y | |||
| 24 | CONFIG_SUN_PARTITION=y | 24 | CONFIG_SUN_PARTITION=y |
| 25 | # CONFIG_EFI_PARTITION is not set | 25 | # CONFIG_EFI_PARTITION is not set |
| 26 | CONFIG_IOSCHED_DEADLINE=m | 26 | CONFIG_IOSCHED_DEADLINE=m |
| 27 | CONFIG_KEXEC=y | ||
| 28 | CONFIG_BOOTINFO_PROC=y | ||
| 27 | CONFIG_M68030=y | 29 | CONFIG_M68030=y |
| 28 | CONFIG_VME=y | 30 | CONFIG_VME=y |
| 29 | CONFIG_MVME147=y | 31 | CONFIG_MVME147=y |
| @@ -80,6 +82,7 @@ CONFIG_NF_CONNTRACK_SANE=m | |||
| 80 | CONFIG_NF_CONNTRACK_SIP=m | 82 | CONFIG_NF_CONNTRACK_SIP=m |
| 81 | CONFIG_NF_CONNTRACK_TFTP=m | 83 | CONFIG_NF_CONNTRACK_TFTP=m |
| 82 | CONFIG_NF_TABLES=m | 84 | CONFIG_NF_TABLES=m |
| 85 | CONFIG_NF_TABLES_INET=m | ||
| 83 | CONFIG_NFT_EXTHDR=m | 86 | CONFIG_NFT_EXTHDR=m |
| 84 | CONFIG_NFT_META=m | 87 | CONFIG_NFT_META=m |
| 85 | CONFIG_NFT_CT=m | 88 | CONFIG_NFT_CT=m |
| @@ -89,6 +92,8 @@ CONFIG_NFT_COUNTER=m | |||
| 89 | CONFIG_NFT_LOG=m | 92 | CONFIG_NFT_LOG=m |
| 90 | CONFIG_NFT_LIMIT=m | 93 | CONFIG_NFT_LIMIT=m |
| 91 | CONFIG_NFT_NAT=m | 94 | CONFIG_NFT_NAT=m |
| 95 | CONFIG_NFT_QUEUE=m | ||
| 96 | CONFIG_NFT_REJECT=m | ||
| 92 | CONFIG_NFT_COMPAT=m | 97 | CONFIG_NFT_COMPAT=m |
| 93 | CONFIG_NETFILTER_XT_SET=m | 98 | CONFIG_NETFILTER_XT_SET=m |
| 94 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m | 99 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m |
| @@ -121,6 +126,7 @@ CONFIG_NETFILTER_XT_MATCH_DSCP=m | |||
| 121 | CONFIG_NETFILTER_XT_MATCH_ESP=m | 126 | CONFIG_NETFILTER_XT_MATCH_ESP=m |
| 122 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m | 127 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m |
| 123 | CONFIG_NETFILTER_XT_MATCH_HELPER=m | 128 | CONFIG_NETFILTER_XT_MATCH_HELPER=m |
| 129 | CONFIG_NETFILTER_XT_MATCH_IPCOMP=m | ||
| 124 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m | 130 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m |
| 125 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m | 131 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m |
| 126 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m | 132 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m |
| @@ -158,8 +164,6 @@ CONFIG_IP_SET_HASH_NETPORT=m | |||
| 158 | CONFIG_IP_SET_HASH_NETIFACE=m | 164 | CONFIG_IP_SET_HASH_NETIFACE=m |
| 159 | CONFIG_IP_SET_LIST_SET=m | 165 | CONFIG_IP_SET_LIST_SET=m |
| 160 | CONFIG_NF_CONNTRACK_IPV4=m | 166 | CONFIG_NF_CONNTRACK_IPV4=m |
| 161 | CONFIG_NF_TABLES_IPV4=m | ||
| 162 | CONFIG_NFT_REJECT_IPV4=m | ||
| 163 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m | 167 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m |
| 164 | CONFIG_NFT_CHAIN_NAT_IPV4=m | 168 | CONFIG_NFT_CHAIN_NAT_IPV4=m |
| 165 | CONFIG_NF_TABLES_ARP=m | 169 | CONFIG_NF_TABLES_ARP=m |
| @@ -185,7 +189,6 @@ CONFIG_IP_NF_ARPTABLES=m | |||
| 185 | CONFIG_IP_NF_ARPFILTER=m | 189 | CONFIG_IP_NF_ARPFILTER=m |
| 186 | CONFIG_IP_NF_ARP_MANGLE=m | 190 | CONFIG_IP_NF_ARP_MANGLE=m |
| 187 | CONFIG_NF_CONNTRACK_IPV6=m | 191 | CONFIG_NF_CONNTRACK_IPV6=m |
| 188 | CONFIG_NF_TABLES_IPV6=m | ||
| 189 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m | 192 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m |
| 190 | CONFIG_NFT_CHAIN_NAT_IPV6=m | 193 | CONFIG_NFT_CHAIN_NAT_IPV6=m |
| 191 | CONFIG_IP6_NF_IPTABLES=m | 194 | CONFIG_IP6_NF_IPTABLES=m |
| @@ -463,7 +466,6 @@ CONFIG_CRYPTO_LZ4HC=m | |||
| 463 | CONFIG_CRYPTO_USER_API_HASH=m | 466 | CONFIG_CRYPTO_USER_API_HASH=m |
| 464 | CONFIG_CRYPTO_USER_API_SKCIPHER=m | 467 | CONFIG_CRYPTO_USER_API_SKCIPHER=m |
| 465 | # CONFIG_CRYPTO_HW is not set | 468 | # CONFIG_CRYPTO_HW is not set |
| 466 | CONFIG_CRC_T10DIF=y | ||
| 467 | CONFIG_XZ_DEC_X86=y | 469 | CONFIG_XZ_DEC_X86=y |
| 468 | CONFIG_XZ_DEC_POWERPC=y | 470 | CONFIG_XZ_DEC_POWERPC=y |
| 469 | CONFIG_XZ_DEC_IA64=y | 471 | CONFIG_XZ_DEC_IA64=y |
diff --git a/arch/m68k/configs/mvme16x_defconfig b/arch/m68k/configs/mvme16x_defconfig index 05a990a9dbd4..f7ff784d05ac 100644 --- a/arch/m68k/configs/mvme16x_defconfig +++ b/arch/m68k/configs/mvme16x_defconfig | |||
| @@ -24,6 +24,8 @@ CONFIG_UNIXWARE_DISKLABEL=y | |||
| 24 | CONFIG_SUN_PARTITION=y | 24 | CONFIG_SUN_PARTITION=y |
| 25 | # CONFIG_EFI_PARTITION is not set | 25 | # CONFIG_EFI_PARTITION is not set |
| 26 | CONFIG_IOSCHED_DEADLINE=m | 26 | CONFIG_IOSCHED_DEADLINE=m |
| 27 | CONFIG_KEXEC=y | ||
| 28 | CONFIG_BOOTINFO_PROC=y | ||
| 27 | CONFIG_M68040=y | 29 | CONFIG_M68040=y |
| 28 | CONFIG_M68060=y | 30 | CONFIG_M68060=y |
| 29 | CONFIG_VME=y | 31 | CONFIG_VME=y |
| @@ -81,6 +83,7 @@ CONFIG_NF_CONNTRACK_SANE=m | |||
| 81 | CONFIG_NF_CONNTRACK_SIP=m | 83 | CONFIG_NF_CONNTRACK_SIP=m |
| 82 | CONFIG_NF_CONNTRACK_TFTP=m | 84 | CONFIG_NF_CONNTRACK_TFTP=m |
| 83 | CONFIG_NF_TABLES=m | 85 | CONFIG_NF_TABLES=m |
| 86 | CONFIG_NF_TABLES_INET=m | ||
| 84 | CONFIG_NFT_EXTHDR=m | 87 | CONFIG_NFT_EXTHDR=m |
| 85 | CONFIG_NFT_META=m | 88 | CONFIG_NFT_META=m |
| 86 | CONFIG_NFT_CT=m | 89 | CONFIG_NFT_CT=m |
| @@ -90,6 +93,8 @@ CONFIG_NFT_COUNTER=m | |||
| 90 | CONFIG_NFT_LOG=m | 93 | CONFIG_NFT_LOG=m |
| 91 | CONFIG_NFT_LIMIT=m | 94 | CONFIG_NFT_LIMIT=m |
| 92 | CONFIG_NFT_NAT=m | 95 | CONFIG_NFT_NAT=m |
| 96 | CONFIG_NFT_QUEUE=m | ||
| 97 | CONFIG_NFT_REJECT=m | ||
| 93 | CONFIG_NFT_COMPAT=m | 98 | CONFIG_NFT_COMPAT=m |
| 94 | CONFIG_NETFILTER_XT_SET=m | 99 | CONFIG_NETFILTER_XT_SET=m |
| 95 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m | 100 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m |
| @@ -122,6 +127,7 @@ CONFIG_NETFILTER_XT_MATCH_DSCP=m | |||
| 122 | CONFIG_NETFILTER_XT_MATCH_ESP=m | 127 | CONFIG_NETFILTER_XT_MATCH_ESP=m |
| 123 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m | 128 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m |
| 124 | CONFIG_NETFILTER_XT_MATCH_HELPER=m | 129 | CONFIG_NETFILTER_XT_MATCH_HELPER=m |
| 130 | CONFIG_NETFILTER_XT_MATCH_IPCOMP=m | ||
| 125 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m | 131 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m |
| 126 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m | 132 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m |
| 127 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m | 133 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m |
| @@ -159,8 +165,6 @@ CONFIG_IP_SET_HASH_NETPORT=m | |||
| 159 | CONFIG_IP_SET_HASH_NETIFACE=m | 165 | CONFIG_IP_SET_HASH_NETIFACE=m |
| 160 | CONFIG_IP_SET_LIST_SET=m | 166 | CONFIG_IP_SET_LIST_SET=m |
| 161 | CONFIG_NF_CONNTRACK_IPV4=m | 167 | CONFIG_NF_CONNTRACK_IPV4=m |
| 162 | CONFIG_NF_TABLES_IPV4=m | ||
| 163 | CONFIG_NFT_REJECT_IPV4=m | ||
| 164 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m | 168 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m |
| 165 | CONFIG_NFT_CHAIN_NAT_IPV4=m | 169 | CONFIG_NFT_CHAIN_NAT_IPV4=m |
| 166 | CONFIG_NF_TABLES_ARP=m | 170 | CONFIG_NF_TABLES_ARP=m |
| @@ -186,7 +190,6 @@ CONFIG_IP_NF_ARPTABLES=m | |||
| 186 | CONFIG_IP_NF_ARPFILTER=m | 190 | CONFIG_IP_NF_ARPFILTER=m |
| 187 | CONFIG_IP_NF_ARP_MANGLE=m | 191 | CONFIG_IP_NF_ARP_MANGLE=m |
| 188 | CONFIG_NF_CONNTRACK_IPV6=m | 192 | CONFIG_NF_CONNTRACK_IPV6=m |
| 189 | CONFIG_NF_TABLES_IPV6=m | ||
| 190 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m | 193 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m |
| 191 | CONFIG_NFT_CHAIN_NAT_IPV6=m | 194 | CONFIG_NFT_CHAIN_NAT_IPV6=m |
| 192 | CONFIG_IP6_NF_IPTABLES=m | 195 | CONFIG_IP6_NF_IPTABLES=m |
| @@ -464,7 +467,6 @@ CONFIG_CRYPTO_LZ4HC=m | |||
| 464 | CONFIG_CRYPTO_USER_API_HASH=m | 467 | CONFIG_CRYPTO_USER_API_HASH=m |
| 465 | CONFIG_CRYPTO_USER_API_SKCIPHER=m | 468 | CONFIG_CRYPTO_USER_API_SKCIPHER=m |
| 466 | # CONFIG_CRYPTO_HW is not set | 469 | # CONFIG_CRYPTO_HW is not set |
| 467 | CONFIG_CRC_T10DIF=y | ||
| 468 | CONFIG_XZ_DEC_X86=y | 470 | CONFIG_XZ_DEC_X86=y |
| 469 | CONFIG_XZ_DEC_POWERPC=y | 471 | CONFIG_XZ_DEC_POWERPC=y |
| 470 | CONFIG_XZ_DEC_IA64=y | 472 | CONFIG_XZ_DEC_IA64=y |
diff --git a/arch/m68k/configs/q40_defconfig b/arch/m68k/configs/q40_defconfig index 568e2a98f976..f0c72ab037be 100644 --- a/arch/m68k/configs/q40_defconfig +++ b/arch/m68k/configs/q40_defconfig | |||
| @@ -25,6 +25,8 @@ CONFIG_SUN_PARTITION=y | |||
| 25 | # CONFIG_EFI_PARTITION is not set | 25 | # CONFIG_EFI_PARTITION is not set |
| 26 | CONFIG_SYSV68_PARTITION=y | 26 | CONFIG_SYSV68_PARTITION=y |
| 27 | CONFIG_IOSCHED_DEADLINE=m | 27 | CONFIG_IOSCHED_DEADLINE=m |
| 28 | CONFIG_KEXEC=y | ||
| 29 | CONFIG_BOOTINFO_PROC=y | ||
| 28 | CONFIG_M68040=y | 30 | CONFIG_M68040=y |
| 29 | CONFIG_M68060=y | 31 | CONFIG_M68060=y |
| 30 | CONFIG_Q40=y | 32 | CONFIG_Q40=y |
| @@ -81,6 +83,7 @@ CONFIG_NF_CONNTRACK_SANE=m | |||
| 81 | CONFIG_NF_CONNTRACK_SIP=m | 83 | CONFIG_NF_CONNTRACK_SIP=m |
| 82 | CONFIG_NF_CONNTRACK_TFTP=m | 84 | CONFIG_NF_CONNTRACK_TFTP=m |
| 83 | CONFIG_NF_TABLES=m | 85 | CONFIG_NF_TABLES=m |
| 86 | CONFIG_NF_TABLES_INET=m | ||
| 84 | CONFIG_NFT_EXTHDR=m | 87 | CONFIG_NFT_EXTHDR=m |
| 85 | CONFIG_NFT_META=m | 88 | CONFIG_NFT_META=m |
| 86 | CONFIG_NFT_CT=m | 89 | CONFIG_NFT_CT=m |
| @@ -90,6 +93,8 @@ CONFIG_NFT_COUNTER=m | |||
| 90 | CONFIG_NFT_LOG=m | 93 | CONFIG_NFT_LOG=m |
| 91 | CONFIG_NFT_LIMIT=m | 94 | CONFIG_NFT_LIMIT=m |
| 92 | CONFIG_NFT_NAT=m | 95 | CONFIG_NFT_NAT=m |
| 96 | CONFIG_NFT_QUEUE=m | ||
| 97 | CONFIG_NFT_REJECT=m | ||
| 93 | CONFIG_NFT_COMPAT=m | 98 | CONFIG_NFT_COMPAT=m |
| 94 | CONFIG_NETFILTER_XT_SET=m | 99 | CONFIG_NETFILTER_XT_SET=m |
| 95 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m | 100 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m |
| @@ -122,6 +127,7 @@ CONFIG_NETFILTER_XT_MATCH_DSCP=m | |||
| 122 | CONFIG_NETFILTER_XT_MATCH_ESP=m | 127 | CONFIG_NETFILTER_XT_MATCH_ESP=m |
| 123 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m | 128 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m |
| 124 | CONFIG_NETFILTER_XT_MATCH_HELPER=m | 129 | CONFIG_NETFILTER_XT_MATCH_HELPER=m |
| 130 | CONFIG_NETFILTER_XT_MATCH_IPCOMP=m | ||
| 125 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m | 131 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m |
| 126 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m | 132 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m |
| 127 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m | 133 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m |
| @@ -159,8 +165,6 @@ CONFIG_IP_SET_HASH_NETPORT=m | |||
| 159 | CONFIG_IP_SET_HASH_NETIFACE=m | 165 | CONFIG_IP_SET_HASH_NETIFACE=m |
| 160 | CONFIG_IP_SET_LIST_SET=m | 166 | CONFIG_IP_SET_LIST_SET=m |
| 161 | CONFIG_NF_CONNTRACK_IPV4=m | 167 | CONFIG_NF_CONNTRACK_IPV4=m |
| 162 | CONFIG_NF_TABLES_IPV4=m | ||
| 163 | CONFIG_NFT_REJECT_IPV4=m | ||
| 164 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m | 168 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m |
| 165 | CONFIG_NFT_CHAIN_NAT_IPV4=m | 169 | CONFIG_NFT_CHAIN_NAT_IPV4=m |
| 166 | CONFIG_NF_TABLES_ARP=m | 170 | CONFIG_NF_TABLES_ARP=m |
| @@ -186,7 +190,6 @@ CONFIG_IP_NF_ARPTABLES=m | |||
| 186 | CONFIG_IP_NF_ARPFILTER=m | 190 | CONFIG_IP_NF_ARPFILTER=m |
| 187 | CONFIG_IP_NF_ARP_MANGLE=m | 191 | CONFIG_IP_NF_ARP_MANGLE=m |
| 188 | CONFIG_NF_CONNTRACK_IPV6=m | 192 | CONFIG_NF_CONNTRACK_IPV6=m |
| 189 | CONFIG_NF_TABLES_IPV6=m | ||
| 190 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m | 193 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m |
| 191 | CONFIG_NFT_CHAIN_NAT_IPV6=m | 194 | CONFIG_NFT_CHAIN_NAT_IPV6=m |
| 192 | CONFIG_IP6_NF_IPTABLES=m | 195 | CONFIG_IP6_NF_IPTABLES=m |
| @@ -485,7 +488,6 @@ CONFIG_CRYPTO_LZ4HC=m | |||
| 485 | CONFIG_CRYPTO_USER_API_HASH=m | 488 | CONFIG_CRYPTO_USER_API_HASH=m |
| 486 | CONFIG_CRYPTO_USER_API_SKCIPHER=m | 489 | CONFIG_CRYPTO_USER_API_SKCIPHER=m |
| 487 | # CONFIG_CRYPTO_HW is not set | 490 | # CONFIG_CRYPTO_HW is not set |
| 488 | CONFIG_CRC_T10DIF=y | ||
| 489 | CONFIG_XZ_DEC_X86=y | 491 | CONFIG_XZ_DEC_X86=y |
| 490 | CONFIG_XZ_DEC_POWERPC=y | 492 | CONFIG_XZ_DEC_POWERPC=y |
| 491 | CONFIG_XZ_DEC_IA64=y | 493 | CONFIG_XZ_DEC_IA64=y |
diff --git a/arch/m68k/configs/sun3_defconfig b/arch/m68k/configs/sun3_defconfig index 60b0aeac5742..7bca0f464521 100644 --- a/arch/m68k/configs/sun3_defconfig +++ b/arch/m68k/configs/sun3_defconfig | |||
| @@ -24,6 +24,8 @@ CONFIG_UNIXWARE_DISKLABEL=y | |||
| 24 | # CONFIG_EFI_PARTITION is not set | 24 | # CONFIG_EFI_PARTITION is not set |
| 25 | CONFIG_SYSV68_PARTITION=y | 25 | CONFIG_SYSV68_PARTITION=y |
| 26 | CONFIG_IOSCHED_DEADLINE=m | 26 | CONFIG_IOSCHED_DEADLINE=m |
| 27 | CONFIG_KEXEC=y | ||
| 28 | CONFIG_BOOTINFO_PROC=y | ||
| 27 | CONFIG_SUN3=y | 29 | CONFIG_SUN3=y |
| 28 | # CONFIG_COMPACTION is not set | 30 | # CONFIG_COMPACTION is not set |
| 29 | CONFIG_CLEANCACHE=y | 31 | CONFIG_CLEANCACHE=y |
| @@ -78,6 +80,7 @@ CONFIG_NF_CONNTRACK_SANE=m | |||
| 78 | CONFIG_NF_CONNTRACK_SIP=m | 80 | CONFIG_NF_CONNTRACK_SIP=m |
| 79 | CONFIG_NF_CONNTRACK_TFTP=m | 81 | CONFIG_NF_CONNTRACK_TFTP=m |
| 80 | CONFIG_NF_TABLES=m | 82 | CONFIG_NF_TABLES=m |
| 83 | CONFIG_NF_TABLES_INET=m | ||
| 81 | CONFIG_NFT_EXTHDR=m | 84 | CONFIG_NFT_EXTHDR=m |
| 82 | CONFIG_NFT_META=m | 85 | CONFIG_NFT_META=m |
| 83 | CONFIG_NFT_CT=m | 86 | CONFIG_NFT_CT=m |
| @@ -87,6 +90,8 @@ CONFIG_NFT_COUNTER=m | |||
| 87 | CONFIG_NFT_LOG=m | 90 | CONFIG_NFT_LOG=m |
| 88 | CONFIG_NFT_LIMIT=m | 91 | CONFIG_NFT_LIMIT=m |
| 89 | CONFIG_NFT_NAT=m | 92 | CONFIG_NFT_NAT=m |
| 93 | CONFIG_NFT_QUEUE=m | ||
| 94 | CONFIG_NFT_REJECT=m | ||
| 90 | CONFIG_NFT_COMPAT=m | 95 | CONFIG_NFT_COMPAT=m |
| 91 | CONFIG_NETFILTER_XT_SET=m | 96 | CONFIG_NETFILTER_XT_SET=m |
| 92 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m | 97 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m |
| @@ -119,6 +124,7 @@ CONFIG_NETFILTER_XT_MATCH_DSCP=m | |||
| 119 | CONFIG_NETFILTER_XT_MATCH_ESP=m | 124 | CONFIG_NETFILTER_XT_MATCH_ESP=m |
| 120 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m | 125 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m |
| 121 | CONFIG_NETFILTER_XT_MATCH_HELPER=m | 126 | CONFIG_NETFILTER_XT_MATCH_HELPER=m |
| 127 | CONFIG_NETFILTER_XT_MATCH_IPCOMP=m | ||
| 122 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m | 128 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m |
| 123 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m | 129 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m |
| 124 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m | 130 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m |
| @@ -156,8 +162,6 @@ CONFIG_IP_SET_HASH_NETPORT=m | |||
| 156 | CONFIG_IP_SET_HASH_NETIFACE=m | 162 | CONFIG_IP_SET_HASH_NETIFACE=m |
| 157 | CONFIG_IP_SET_LIST_SET=m | 163 | CONFIG_IP_SET_LIST_SET=m |
| 158 | CONFIG_NF_CONNTRACK_IPV4=m | 164 | CONFIG_NF_CONNTRACK_IPV4=m |
| 159 | CONFIG_NF_TABLES_IPV4=m | ||
| 160 | CONFIG_NFT_REJECT_IPV4=m | ||
| 161 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m | 165 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m |
| 162 | CONFIG_NFT_CHAIN_NAT_IPV4=m | 166 | CONFIG_NFT_CHAIN_NAT_IPV4=m |
| 163 | CONFIG_NF_TABLES_ARP=m | 167 | CONFIG_NF_TABLES_ARP=m |
| @@ -183,7 +187,6 @@ CONFIG_IP_NF_ARPTABLES=m | |||
| 183 | CONFIG_IP_NF_ARPFILTER=m | 187 | CONFIG_IP_NF_ARPFILTER=m |
| 184 | CONFIG_IP_NF_ARP_MANGLE=m | 188 | CONFIG_IP_NF_ARP_MANGLE=m |
| 185 | CONFIG_NF_CONNTRACK_IPV6=m | 189 | CONFIG_NF_CONNTRACK_IPV6=m |
| 186 | CONFIG_NF_TABLES_IPV6=m | ||
| 187 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m | 190 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m |
| 188 | CONFIG_NFT_CHAIN_NAT_IPV6=m | 191 | CONFIG_NFT_CHAIN_NAT_IPV6=m |
| 189 | CONFIG_IP6_NF_IPTABLES=m | 192 | CONFIG_IP6_NF_IPTABLES=m |
| @@ -464,7 +467,6 @@ CONFIG_CRYPTO_LZ4HC=m | |||
| 464 | CONFIG_CRYPTO_USER_API_HASH=m | 467 | CONFIG_CRYPTO_USER_API_HASH=m |
| 465 | CONFIG_CRYPTO_USER_API_SKCIPHER=m | 468 | CONFIG_CRYPTO_USER_API_SKCIPHER=m |
| 466 | # CONFIG_CRYPTO_HW is not set | 469 | # CONFIG_CRYPTO_HW is not set |
| 467 | CONFIG_CRC_T10DIF=y | ||
| 468 | CONFIG_XZ_DEC_X86=y | 470 | CONFIG_XZ_DEC_X86=y |
| 469 | CONFIG_XZ_DEC_POWERPC=y | 471 | CONFIG_XZ_DEC_POWERPC=y |
| 470 | CONFIG_XZ_DEC_IA64=y | 472 | CONFIG_XZ_DEC_IA64=y |
diff --git a/arch/m68k/configs/sun3x_defconfig b/arch/m68k/configs/sun3x_defconfig index 21bda331eebb..317f3e1fec95 100644 --- a/arch/m68k/configs/sun3x_defconfig +++ b/arch/m68k/configs/sun3x_defconfig | |||
| @@ -24,6 +24,8 @@ CONFIG_UNIXWARE_DISKLABEL=y | |||
| 24 | # CONFIG_EFI_PARTITION is not set | 24 | # CONFIG_EFI_PARTITION is not set |
| 25 | CONFIG_SYSV68_PARTITION=y | 25 | CONFIG_SYSV68_PARTITION=y |
| 26 | CONFIG_IOSCHED_DEADLINE=m | 26 | CONFIG_IOSCHED_DEADLINE=m |
| 27 | CONFIG_KEXEC=y | ||
| 28 | CONFIG_BOOTINFO_PROC=y | ||
| 27 | CONFIG_SUN3X=y | 29 | CONFIG_SUN3X=y |
| 28 | # CONFIG_COMPACTION is not set | 30 | # CONFIG_COMPACTION is not set |
| 29 | CONFIG_CLEANCACHE=y | 31 | CONFIG_CLEANCACHE=y |
| @@ -78,6 +80,7 @@ CONFIG_NF_CONNTRACK_SANE=m | |||
| 78 | CONFIG_NF_CONNTRACK_SIP=m | 80 | CONFIG_NF_CONNTRACK_SIP=m |
| 79 | CONFIG_NF_CONNTRACK_TFTP=m | 81 | CONFIG_NF_CONNTRACK_TFTP=m |
| 80 | CONFIG_NF_TABLES=m | 82 | CONFIG_NF_TABLES=m |
| 83 | CONFIG_NF_TABLES_INET=m | ||
| 81 | CONFIG_NFT_EXTHDR=m | 84 | CONFIG_NFT_EXTHDR=m |
| 82 | CONFIG_NFT_META=m | 85 | CONFIG_NFT_META=m |
| 83 | CONFIG_NFT_CT=m | 86 | CONFIG_NFT_CT=m |
| @@ -87,6 +90,8 @@ CONFIG_NFT_COUNTER=m | |||
| 87 | CONFIG_NFT_LOG=m | 90 | CONFIG_NFT_LOG=m |
| 88 | CONFIG_NFT_LIMIT=m | 91 | CONFIG_NFT_LIMIT=m |
| 89 | CONFIG_NFT_NAT=m | 92 | CONFIG_NFT_NAT=m |
| 93 | CONFIG_NFT_QUEUE=m | ||
| 94 | CONFIG_NFT_REJECT=m | ||
| 90 | CONFIG_NFT_COMPAT=m | 95 | CONFIG_NFT_COMPAT=m |
| 91 | CONFIG_NETFILTER_XT_SET=m | 96 | CONFIG_NETFILTER_XT_SET=m |
| 92 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m | 97 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m |
| @@ -119,6 +124,7 @@ CONFIG_NETFILTER_XT_MATCH_DSCP=m | |||
| 119 | CONFIG_NETFILTER_XT_MATCH_ESP=m | 124 | CONFIG_NETFILTER_XT_MATCH_ESP=m |
| 120 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m | 125 | CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m |
| 121 | CONFIG_NETFILTER_XT_MATCH_HELPER=m | 126 | CONFIG_NETFILTER_XT_MATCH_HELPER=m |
| 127 | CONFIG_NETFILTER_XT_MATCH_IPCOMP=m | ||
| 122 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m | 128 | CONFIG_NETFILTER_XT_MATCH_IPRANGE=m |
| 123 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m | 129 | CONFIG_NETFILTER_XT_MATCH_LENGTH=m |
| 124 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m | 130 | CONFIG_NETFILTER_XT_MATCH_LIMIT=m |
| @@ -156,8 +162,6 @@ CONFIG_IP_SET_HASH_NETPORT=m | |||
| 156 | CONFIG_IP_SET_HASH_NETIFACE=m | 162 | CONFIG_IP_SET_HASH_NETIFACE=m |
| 157 | CONFIG_IP_SET_LIST_SET=m | 163 | CONFIG_IP_SET_LIST_SET=m |
| 158 | CONFIG_NF_CONNTRACK_IPV4=m | 164 | CONFIG_NF_CONNTRACK_IPV4=m |
| 159 | CONFIG_NF_TABLES_IPV4=m | ||
| 160 | CONFIG_NFT_REJECT_IPV4=m | ||
| 161 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m | 165 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m |
| 162 | CONFIG_NFT_CHAIN_NAT_IPV4=m | 166 | CONFIG_NFT_CHAIN_NAT_IPV4=m |
| 163 | CONFIG_NF_TABLES_ARP=m | 167 | CONFIG_NF_TABLES_ARP=m |
| @@ -183,7 +187,6 @@ CONFIG_IP_NF_ARPTABLES=m | |||
| 183 | CONFIG_IP_NF_ARPFILTER=m | 187 | CONFIG_IP_NF_ARPFILTER=m |
| 184 | CONFIG_IP_NF_ARP_MANGLE=m | 188 | CONFIG_IP_NF_ARP_MANGLE=m |
| 185 | CONFIG_NF_CONNTRACK_IPV6=m | 189 | CONFIG_NF_CONNTRACK_IPV6=m |
| 186 | CONFIG_NF_TABLES_IPV6=m | ||
| 187 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m | 190 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m |
| 188 | CONFIG_NFT_CHAIN_NAT_IPV6=m | 191 | CONFIG_NFT_CHAIN_NAT_IPV6=m |
| 189 | CONFIG_IP6_NF_IPTABLES=m | 192 | CONFIG_IP6_NF_IPTABLES=m |
| @@ -464,7 +467,6 @@ CONFIG_CRYPTO_LZ4HC=m | |||
| 464 | CONFIG_CRYPTO_USER_API_HASH=m | 467 | CONFIG_CRYPTO_USER_API_HASH=m |
| 465 | CONFIG_CRYPTO_USER_API_SKCIPHER=m | 468 | CONFIG_CRYPTO_USER_API_SKCIPHER=m |
| 466 | # CONFIG_CRYPTO_HW is not set | 469 | # CONFIG_CRYPTO_HW is not set |
| 467 | CONFIG_CRC_T10DIF=y | ||
| 468 | CONFIG_XZ_DEC_X86=y | 470 | CONFIG_XZ_DEC_X86=y |
| 469 | CONFIG_XZ_DEC_POWERPC=y | 471 | CONFIG_XZ_DEC_POWERPC=y |
| 470 | CONFIG_XZ_DEC_IA64=y | 472 | CONFIG_XZ_DEC_IA64=y |
diff --git a/arch/m68k/include/asm/Kbuild b/arch/m68k/include/asm/Kbuild index 7cc8c364924d..c67c94a2d672 100644 --- a/arch/m68k/include/asm/Kbuild +++ b/arch/m68k/include/asm/Kbuild | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | 1 | generic-y += barrier.h | |
| 2 | generic-y += bitsperlong.h | 2 | generic-y += bitsperlong.h |
| 3 | generic-y += clkdev.h | 3 | generic-y += clkdev.h |
| 4 | generic-y += cputime.h | 4 | generic-y += cputime.h |
| @@ -6,6 +6,7 @@ generic-y += device.h | |||
| 6 | generic-y += emergency-restart.h | 6 | generic-y += emergency-restart.h |
| 7 | generic-y += errno.h | 7 | generic-y += errno.h |
| 8 | generic-y += exec.h | 8 | generic-y += exec.h |
| 9 | generic-y += hash.h | ||
| 9 | generic-y += hw_irq.h | 10 | generic-y += hw_irq.h |
| 10 | generic-y += ioctl.h | 11 | generic-y += ioctl.h |
| 11 | generic-y += ipcbuf.h | 12 | generic-y += ipcbuf.h |
| @@ -13,11 +14,13 @@ generic-y += irq_regs.h | |||
| 13 | generic-y += kdebug.h | 14 | generic-y += kdebug.h |
| 14 | generic-y += kmap_types.h | 15 | generic-y += kmap_types.h |
| 15 | generic-y += kvm_para.h | 16 | generic-y += kvm_para.h |
| 16 | generic-y += local64.h | ||
| 17 | generic-y += local.h | 17 | generic-y += local.h |
| 18 | generic-y += local64.h | ||
| 19 | generic-y += mcs_spinlock.h | ||
| 18 | generic-y += mman.h | 20 | generic-y += mman.h |
| 19 | generic-y += mutex.h | 21 | generic-y += mutex.h |
| 20 | generic-y += percpu.h | 22 | generic-y += percpu.h |
| 23 | generic-y += preempt.h | ||
| 21 | generic-y += resource.h | 24 | generic-y += resource.h |
| 22 | generic-y += scatterlist.h | 25 | generic-y += scatterlist.h |
| 23 | generic-y += sections.h | 26 | generic-y += sections.h |
| @@ -31,5 +34,3 @@ generic-y += trace_clock.h | |||
| 31 | generic-y += types.h | 34 | generic-y += types.h |
| 32 | generic-y += word-at-a-time.h | 35 | generic-y += word-at-a-time.h |
| 33 | generic-y += xor.h | 36 | generic-y += xor.h |
| 34 | generic-y += preempt.h | ||
| 35 | generic-y += hash.h | ||
diff --git a/arch/m68k/include/asm/barrier.h b/arch/m68k/include/asm/barrier.h deleted file mode 100644 index 15c5f77c1614..000000000000 --- a/arch/m68k/include/asm/barrier.h +++ /dev/null | |||
| @@ -1,8 +0,0 @@ | |||
| 1 | #ifndef _M68K_BARRIER_H | ||
| 2 | #define _M68K_BARRIER_H | ||
| 3 | |||
| 4 | #define nop() do { asm volatile ("nop"); barrier(); } while (0) | ||
| 5 | |||
| 6 | #include <asm-generic/barrier.h> | ||
| 7 | |||
| 8 | #endif /* _M68K_BARRIER_H */ | ||
diff --git a/arch/m68k/include/asm/unistd.h b/arch/m68k/include/asm/unistd.h index 014f288fc813..9d38b73989eb 100644 --- a/arch/m68k/include/asm/unistd.h +++ b/arch/m68k/include/asm/unistd.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #include <uapi/asm/unistd.h> | 4 | #include <uapi/asm/unistd.h> |
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | #define NR_syscalls 349 | 7 | #define NR_syscalls 351 |
| 8 | 8 | ||
| 9 | #define __ARCH_WANT_OLD_READDIR | 9 | #define __ARCH_WANT_OLD_READDIR |
| 10 | #define __ARCH_WANT_OLD_STAT | 10 | #define __ARCH_WANT_OLD_STAT |
diff --git a/arch/m68k/include/uapi/asm/unistd.h b/arch/m68k/include/uapi/asm/unistd.h index 625f321001dc..b932dd470041 100644 --- a/arch/m68k/include/uapi/asm/unistd.h +++ b/arch/m68k/include/uapi/asm/unistd.h | |||
| @@ -354,5 +354,7 @@ | |||
| 354 | #define __NR_process_vm_writev 346 | 354 | #define __NR_process_vm_writev 346 |
| 355 | #define __NR_kcmp 347 | 355 | #define __NR_kcmp 347 |
| 356 | #define __NR_finit_module 348 | 356 | #define __NR_finit_module 348 |
| 357 | #define __NR_sched_setattr 349 | ||
| 358 | #define __NR_sched_getattr 350 | ||
| 357 | 359 | ||
| 358 | #endif /* _UAPI_ASM_M68K_UNISTD_H_ */ | 360 | #endif /* _UAPI_ASM_M68K_UNISTD_H_ */ |
diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S index 4c99bab7e664..3ab329b88521 100644 --- a/arch/m68k/kernel/head.S +++ b/arch/m68k/kernel/head.S | |||
| @@ -275,7 +275,6 @@ | |||
| 275 | 275 | ||
| 276 | #ifdef CONFIG_FRAMEBUFFER_CONSOLE | 276 | #ifdef CONFIG_FRAMEBUFFER_CONSOLE |
| 277 | #define CONSOLE | 277 | #define CONSOLE |
| 278 | #define CONSOLE_PENGUIN | ||
| 279 | #endif | 278 | #endif |
| 280 | 279 | ||
| 281 | #ifdef CONFIG_EARLY_PRINTK | 280 | #ifdef CONFIG_EARLY_PRINTK |
| @@ -658,27 +657,6 @@ ENTRY(__start) | |||
| 658 | movel %a0@,%a1@ | 657 | movel %a0@,%a1@ |
| 659 | #endif | 658 | #endif |
| 660 | 659 | ||
| 661 | #if 0 | ||
| 662 | /* | ||
| 663 | * Clear the screen | ||
| 664 | */ | ||
| 665 | lea %pc@(L(mac_videobase)),%a0 | ||
| 666 | movel %a0@,%a1 | ||
| 667 | lea %pc@(L(mac_dimensions)),%a0 | ||
| 668 | movel %a0@,%d1 | ||
| 669 | swap %d1 /* #rows is high bytes */ | ||
| 670 | andl #0xFFFF,%d1 /* rows */ | ||
| 671 | subl #10,%d1 | ||
| 672 | lea %pc@(L(mac_rowbytes)),%a0 | ||
| 673 | loopy2: | ||
| 674 | movel %a0@,%d0 | ||
| 675 | subql #1,%d0 | ||
| 676 | loopx2: | ||
| 677 | moveb #0x55, %a1@+ | ||
| 678 | dbra %d0,loopx2 | ||
| 679 | dbra %d1,loopy2 | ||
| 680 | #endif | ||
| 681 | |||
| 682 | L(test_notmac): | 660 | L(test_notmac): |
| 683 | #endif /* CONFIG_MAC */ | 661 | #endif /* CONFIG_MAC */ |
| 684 | 662 | ||
| @@ -907,15 +885,15 @@ L(nothp): | |||
| 907 | */ | 885 | */ |
| 908 | #ifdef CONFIG_MAC | 886 | #ifdef CONFIG_MAC |
| 909 | is_not_mac(L(nocon)) | 887 | is_not_mac(L(nocon)) |
| 910 | #ifdef CONSOLE | 888 | # ifdef CONSOLE |
| 911 | console_init | 889 | console_init |
| 912 | #ifdef CONSOLE_PENGUIN | 890 | # ifdef CONFIG_LOGO |
| 913 | console_put_penguin | 891 | console_put_penguin |
| 914 | #endif /* CONSOLE_PENGUIN */ | 892 | # endif /* CONFIG_LOGO */ |
| 915 | console_put_stats | 893 | console_put_stats |
| 916 | #endif /* CONSOLE */ | 894 | # endif /* CONSOLE */ |
| 917 | L(nocon): | 895 | L(nocon): |
| 918 | #endif /* CONFIG_MAC */ | 896 | #endif /* CONFIG_MAC */ |
| 919 | 897 | ||
| 920 | 898 | ||
| 921 | putc '\n' | 899 | putc '\n' |
| @@ -3324,14 +3302,13 @@ func_return set_leds | |||
| 3324 | #define Lconsole_struct_num_columns 8 | 3302 | #define Lconsole_struct_num_columns 8 |
| 3325 | #define Lconsole_struct_num_rows 12 | 3303 | #define Lconsole_struct_num_rows 12 |
| 3326 | #define Lconsole_struct_left_edge 16 | 3304 | #define Lconsole_struct_left_edge 16 |
| 3327 | #define Lconsole_struct_penguin_putc 20 | ||
| 3328 | 3305 | ||
| 3329 | func_start console_init,%a0-%a4/%d0-%d7 | 3306 | func_start console_init,%a0-%a4/%d0-%d7 |
| 3330 | /* | 3307 | /* |
| 3331 | * Some of the register usage that follows | 3308 | * Some of the register usage that follows |
| 3332 | * a0 = pointer to boot_info | 3309 | * a0 = pointer to boot_info |
| 3333 | * a1 = pointer to screen | 3310 | * a1 = pointer to screen |
| 3334 | * a2 = pointer to Lconsole_globals | 3311 | * a2 = pointer to console_globals |
| 3335 | * d3 = pixel width of screen | 3312 | * d3 = pixel width of screen |
| 3336 | * d4 = pixel height of screen | 3313 | * d4 = pixel height of screen |
| 3337 | * (d3,d4) ~= (x,y) of a point just below | 3314 | * (d3,d4) ~= (x,y) of a point just below |
| @@ -3456,7 +3433,7 @@ func_start console_put_stats,%a0/%d7 | |||
| 3456 | 3433 | ||
| 3457 | func_return console_put_stats | 3434 | func_return console_put_stats |
| 3458 | 3435 | ||
| 3459 | #ifdef CONSOLE_PENGUIN | 3436 | #ifdef CONFIG_LOGO |
| 3460 | func_start console_put_penguin,%a0-%a1/%d0-%d7 | 3437 | func_start console_put_penguin,%a0-%a1/%d0-%d7 |
| 3461 | /* | 3438 | /* |
| 3462 | * Get 'that_penguin' onto the screen in the upper right corner | 3439 | * Get 'that_penguin' onto the screen in the upper right corner |
| @@ -3799,38 +3776,6 @@ L(console_plot_pixel_exit): | |||
| 3799 | func_return console_plot_pixel | 3776 | func_return console_plot_pixel |
| 3800 | #endif /* CONSOLE */ | 3777 | #endif /* CONSOLE */ |
| 3801 | 3778 | ||
| 3802 | #if 0 | ||
| 3803 | /* | ||
| 3804 | * This is some old code lying around. I don't believe | ||
| 3805 | * it's used or important anymore. My guess is it contributed | ||
| 3806 | * to getting to this point, but it's done for now. | ||
| 3807 | * It was still in the 2.1.77 head.S, so it's still here. | ||
| 3808 | * (And still not used!) | ||
| 3809 | */ | ||
| 3810 | L(showtest): | ||
| 3811 | moveml %a0/%d7,%sp@- | ||
| 3812 | puts "A=" | ||
| 3813 | putn %a1 | ||
| 3814 | |||
| 3815 | .long 0xf0119f15 | ptestr #5,%a1@,#7,%a0 | ||
| 3816 | |||
| 3817 | puts "DA=" | ||
| 3818 | putn %a0 | ||
| 3819 | |||
| 3820 | puts "D=" | ||
| 3821 | putn %a0@ | ||
| 3822 | |||
| 3823 | puts "S=" | ||
| 3824 | lea %pc@(L(mmu)),%a0 | ||
| 3825 | .long 0xf0106200 | pmove %psr,%a0@ | ||
| 3826 | clrl %d7 | ||
| 3827 | movew %a0@,%d7 | ||
| 3828 | putn %d7 | ||
| 3829 | |||
| 3830 | putc '\n' | ||
| 3831 | moveml %sp@+,%a0/%d7 | ||
| 3832 | rts | ||
| 3833 | #endif /* 0 */ | ||
| 3834 | 3779 | ||
| 3835 | __INITDATA | 3780 | __INITDATA |
| 3836 | .align 4 | 3781 | .align 4 |
| @@ -3849,7 +3794,6 @@ L(console_globals): | |||
| 3849 | .long 0 /* max num columns */ | 3794 | .long 0 /* max num columns */ |
| 3850 | .long 0 /* max num rows */ | 3795 | .long 0 /* max num rows */ |
| 3851 | .long 0 /* left edge */ | 3796 | .long 0 /* left edge */ |
| 3852 | .long 0 /* mac putc */ | ||
| 3853 | L(console_font): | 3797 | L(console_font): |
| 3854 | .long 0 /* pointer to console font (struct font_desc) */ | 3798 | .long 0 /* pointer to console font (struct font_desc) */ |
| 3855 | L(console_font_data): | 3799 | L(console_font_data): |
diff --git a/arch/m68k/kernel/ints.c b/arch/m68k/kernel/ints.c index 077d3a70fed1..5b8d66fbf383 100644 --- a/arch/m68k/kernel/ints.c +++ b/arch/m68k/kernel/ints.c | |||
| @@ -10,9 +10,9 @@ | |||
| 10 | #include <linux/types.h> | 10 | #include <linux/types.h> |
| 11 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
| 12 | #include <linux/interrupt.h> | 12 | #include <linux/interrupt.h> |
| 13 | #include <linux/kernel_stat.h> | ||
| 14 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
| 15 | #include <linux/init.h> | 14 | #include <linux/init.h> |
| 15 | #include <linux/irq.h> | ||
| 16 | 16 | ||
| 17 | #include <asm/setup.h> | 17 | #include <asm/setup.h> |
| 18 | #include <asm/irq.h> | 18 | #include <asm/irq.h> |
diff --git a/arch/m68k/kernel/syscalltable.S b/arch/m68k/kernel/syscalltable.S index 3f04ea0ab802..b6223dc41d82 100644 --- a/arch/m68k/kernel/syscalltable.S +++ b/arch/m68k/kernel/syscalltable.S | |||
| @@ -369,4 +369,6 @@ ENTRY(sys_call_table) | |||
| 369 | .long sys_process_vm_writev | 369 | .long sys_process_vm_writev |
| 370 | .long sys_kcmp | 370 | .long sys_kcmp |
| 371 | .long sys_finit_module | 371 | .long sys_finit_module |
| 372 | .long sys_sched_setattr | ||
| 373 | .long sys_sched_getattr /* 350 */ | ||
| 372 | 374 | ||
diff --git a/arch/metag/include/asm/Kbuild b/arch/metag/include/asm/Kbuild index b716d807c2ec..c29ead89a317 100644 --- a/arch/metag/include/asm/Kbuild +++ b/arch/metag/include/asm/Kbuild | |||
| @@ -13,6 +13,7 @@ generic-y += fb.h | |||
| 13 | generic-y += fcntl.h | 13 | generic-y += fcntl.h |
| 14 | generic-y += futex.h | 14 | generic-y += futex.h |
| 15 | generic-y += hardirq.h | 15 | generic-y += hardirq.h |
| 16 | generic-y += hash.h | ||
| 16 | generic-y += hw_irq.h | 17 | generic-y += hw_irq.h |
| 17 | generic-y += ioctl.h | 18 | generic-y += ioctl.h |
| 18 | generic-y += ioctls.h | 19 | generic-y += ioctls.h |
| @@ -23,6 +24,7 @@ generic-y += kmap_types.h | |||
| 23 | generic-y += kvm_para.h | 24 | generic-y += kvm_para.h |
| 24 | generic-y += local.h | 25 | generic-y += local.h |
| 25 | generic-y += local64.h | 26 | generic-y += local64.h |
| 27 | generic-y += mcs_spinlock.h | ||
| 26 | generic-y += msgbuf.h | 28 | generic-y += msgbuf.h |
| 27 | generic-y += mutex.h | 29 | generic-y += mutex.h |
| 28 | generic-y += param.h | 30 | generic-y += param.h |
| @@ -30,6 +32,7 @@ generic-y += pci.h | |||
| 30 | generic-y += percpu.h | 32 | generic-y += percpu.h |
| 31 | generic-y += poll.h | 33 | generic-y += poll.h |
| 32 | generic-y += posix_types.h | 34 | generic-y += posix_types.h |
| 35 | generic-y += preempt.h | ||
| 33 | generic-y += scatterlist.h | 36 | generic-y += scatterlist.h |
| 34 | generic-y += sections.h | 37 | generic-y += sections.h |
| 35 | generic-y += sembuf.h | 38 | generic-y += sembuf.h |
| @@ -52,5 +55,3 @@ generic-y += unaligned.h | |||
| 52 | generic-y += user.h | 55 | generic-y += user.h |
| 53 | generic-y += vga.h | 56 | generic-y += vga.h |
| 54 | generic-y += xor.h | 57 | generic-y += xor.h |
| 55 | generic-y += preempt.h | ||
| 56 | generic-y += hash.h | ||
diff --git a/arch/microblaze/include/asm/Kbuild b/arch/microblaze/include/asm/Kbuild index 2b98bc73642a..c98ed95c0541 100644 --- a/arch/microblaze/include/asm/Kbuild +++ b/arch/microblaze/include/asm/Kbuild | |||
| @@ -1,8 +1,10 @@ | |||
| 1 | 1 | ||
| 2 | generic-y += barrier.h | 2 | generic-y += barrier.h |
| 3 | generic-y += clkdev.h | 3 | generic-y += clkdev.h |
| 4 | generic-y += cputime.h | ||
| 4 | generic-y += exec.h | 5 | generic-y += exec.h |
| 5 | generic-y += hash.h | 6 | generic-y += hash.h |
| 6 | generic-y += trace_clock.h | 7 | generic-y += mcs_spinlock.h |
| 7 | generic-y += syscalls.h | ||
| 8 | generic-y += preempt.h | 8 | generic-y += preempt.h |
| 9 | generic-y += syscalls.h | ||
| 10 | generic-y += trace_clock.h | ||
diff --git a/arch/microblaze/include/asm/cputime.h b/arch/microblaze/include/asm/cputime.h deleted file mode 100644 index 6d68ad7e0ea3..000000000000 --- a/arch/microblaze/include/asm/cputime.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <asm-generic/cputime.h> | ||
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index dcae3a7035db..95fa1f1d5c8b 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
| @@ -1776,12 +1776,12 @@ endchoice | |||
| 1776 | 1776 | ||
| 1777 | config FORCE_MAX_ZONEORDER | 1777 | config FORCE_MAX_ZONEORDER |
| 1778 | int "Maximum zone order" | 1778 | int "Maximum zone order" |
| 1779 | range 14 64 if HUGETLB_PAGE && PAGE_SIZE_64KB | 1779 | range 14 64 if MIPS_HUGE_TLB_SUPPORT && PAGE_SIZE_64KB |
| 1780 | default "14" if HUGETLB_PAGE && PAGE_SIZE_64KB | 1780 | default "14" if MIPS_HUGE_TLB_SUPPORT && PAGE_SIZE_64KB |
| 1781 | range 13 64 if HUGETLB_PAGE && PAGE_SIZE_32KB | 1781 | range 13 64 if MIPS_HUGE_TLB_SUPPORT && PAGE_SIZE_32KB |
| 1782 | default "13" if HUGETLB_PAGE && PAGE_SIZE_32KB | 1782 | default "13" if MIPS_HUGE_TLB_SUPPORT && PAGE_SIZE_32KB |
| 1783 | range 12 64 if HUGETLB_PAGE && PAGE_SIZE_16KB | 1783 | range 12 64 if MIPS_HUGE_TLB_SUPPORT && PAGE_SIZE_16KB |
| 1784 | default "12" if HUGETLB_PAGE && PAGE_SIZE_16KB | 1784 | default "12" if MIPS_HUGE_TLB_SUPPORT && PAGE_SIZE_16KB |
| 1785 | range 11 64 | 1785 | range 11 64 |
| 1786 | default "11" | 1786 | default "11" |
| 1787 | help | 1787 | help |
| @@ -2353,9 +2353,8 @@ config SECCOMP | |||
| 2353 | If unsure, say Y. Only embedded should say N here. | 2353 | If unsure, say Y. Only embedded should say N here. |
| 2354 | 2354 | ||
| 2355 | config MIPS_O32_FP64_SUPPORT | 2355 | config MIPS_O32_FP64_SUPPORT |
| 2356 | bool "Support for O32 binaries using 64-bit FP" | 2356 | bool "Support for O32 binaries using 64-bit FP (EXPERIMENTAL)" |
| 2357 | depends on 32BIT || MIPS32_O32 | 2357 | depends on 32BIT || MIPS32_O32 |
| 2358 | default y | ||
| 2359 | help | 2358 | help |
| 2360 | When this is enabled, the kernel will support use of 64-bit floating | 2359 | When this is enabled, the kernel will support use of 64-bit floating |
| 2361 | point registers with binaries using the O32 ABI along with the | 2360 | point registers with binaries using the O32 ABI along with the |
| @@ -2367,7 +2366,14 @@ config MIPS_O32_FP64_SUPPORT | |||
| 2367 | of your kernel & potentially improve FP emulation performance by | 2366 | of your kernel & potentially improve FP emulation performance by |
| 2368 | saying N here. | 2367 | saying N here. |
| 2369 | 2368 | ||
| 2370 | If unsure, say Y. | 2369 | Although binutils currently supports use of this flag the details |
| 2370 | concerning its effect upon the O32 ABI in userland are still being | ||
| 2371 | worked on. In order to avoid userland becoming dependant upon current | ||
| 2372 | behaviour before the details have been finalised, this option should | ||
| 2373 | be considered experimental and only enabled by those working upon | ||
| 2374 | said details. | ||
| 2375 | |||
| 2376 | If unsure, say N. | ||
| 2371 | 2377 | ||
| 2372 | config USE_OF | 2378 | config USE_OF |
| 2373 | bool | 2379 | bool |
diff --git a/arch/mips/alchemy/board-gpr.c b/arch/mips/alchemy/board-gpr.c index 9edc35ff8cf1..acf9a2a37f5a 100644 --- a/arch/mips/alchemy/board-gpr.c +++ b/arch/mips/alchemy/board-gpr.c | |||
| @@ -53,10 +53,8 @@ void __init prom_init(void) | |||
| 53 | prom_init_cmdline(); | 53 | prom_init_cmdline(); |
| 54 | 54 | ||
| 55 | memsize_str = prom_getenv("memsize"); | 55 | memsize_str = prom_getenv("memsize"); |
| 56 | if (!memsize_str) | 56 | if (!memsize_str || kstrtoul(memsize_str, 0, &memsize)) |
| 57 | memsize = 0x04000000; | 57 | memsize = 0x04000000; |
| 58 | else | ||
| 59 | strict_strtoul(memsize_str, 0, &memsize); | ||
| 60 | add_memory_region(0, memsize, BOOT_MEM_RAM); | 58 | add_memory_region(0, memsize, BOOT_MEM_RAM); |
| 61 | } | 59 | } |
| 62 | 60 | ||
diff --git a/arch/mips/alchemy/board-mtx1.c b/arch/mips/alchemy/board-mtx1.c index 9969dbab19e3..25a59a23547e 100644 --- a/arch/mips/alchemy/board-mtx1.c +++ b/arch/mips/alchemy/board-mtx1.c | |||
| @@ -52,10 +52,8 @@ void __init prom_init(void) | |||
| 52 | prom_init_cmdline(); | 52 | prom_init_cmdline(); |
| 53 | 53 | ||
| 54 | memsize_str = prom_getenv("memsize"); | 54 | memsize_str = prom_getenv("memsize"); |
| 55 | if (!memsize_str) | 55 | if (!memsize_str || kstrtoul(memsize_str, 0, &memsize)) |
| 56 | memsize = 0x04000000; | 56 | memsize = 0x04000000; |
| 57 | else | ||
| 58 | strict_strtoul(memsize_str, 0, &memsize); | ||
| 59 | add_memory_region(0, memsize, BOOT_MEM_RAM); | 57 | add_memory_region(0, memsize, BOOT_MEM_RAM); |
| 60 | } | 58 | } |
| 61 | 59 | ||
diff --git a/arch/mips/bcm47xx/board.c b/arch/mips/bcm47xx/board.c index 6d612e2b949b..cdd8246f92b3 100644 --- a/arch/mips/bcm47xx/board.c +++ b/arch/mips/bcm47xx/board.c | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | #include <linux/errno.h> | ||
| 1 | #include <linux/export.h> | 2 | #include <linux/export.h> |
| 2 | #include <linux/string.h> | 3 | #include <linux/string.h> |
| 3 | #include <bcm47xx_board.h> | 4 | #include <bcm47xx_board.h> |
diff --git a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c index 6decb27cf48b..2bed73a684ae 100644 --- a/arch/mips/bcm47xx/nvram.c +++ b/arch/mips/bcm47xx/nvram.c | |||
| @@ -196,7 +196,7 @@ int bcm47xx_nvram_gpio_pin(const char *name) | |||
| 196 | char nvram_var[10]; | 196 | char nvram_var[10]; |
| 197 | char buf[30]; | 197 | char buf[30]; |
| 198 | 198 | ||
| 199 | for (i = 0; i < 16; i++) { | 199 | for (i = 0; i < 32; i++) { |
| 200 | err = snprintf(nvram_var, sizeof(nvram_var), "gpio%i", i); | 200 | err = snprintf(nvram_var, sizeof(nvram_var), "gpio%i", i); |
| 201 | if (err <= 0) | 201 | if (err <= 0) |
| 202 | continue; | 202 | continue; |
diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c index 25fbfae06c1f..c2bb4f896ce7 100644 --- a/arch/mips/cavium-octeon/octeon-irq.c +++ b/arch/mips/cavium-octeon/octeon-irq.c | |||
| @@ -975,10 +975,6 @@ static int octeon_irq_ciu_xlat(struct irq_domain *d, | |||
| 975 | if (ciu > 1 || bit > 63) | 975 | if (ciu > 1 || bit > 63) |
| 976 | return -EINVAL; | 976 | return -EINVAL; |
| 977 | 977 | ||
| 978 | /* These are the GPIO lines */ | ||
| 979 | if (ciu == 0 && bit >= 16 && bit < 32) | ||
| 980 | return -EINVAL; | ||
| 981 | |||
| 982 | *out_hwirq = (ciu << 6) | bit; | 978 | *out_hwirq = (ciu << 6) | bit; |
| 983 | *out_type = 0; | 979 | *out_type = 0; |
| 984 | 980 | ||
| @@ -1007,6 +1003,10 @@ static int octeon_irq_ciu_map(struct irq_domain *d, | |||
| 1007 | if (!octeon_irq_virq_in_range(virq)) | 1003 | if (!octeon_irq_virq_in_range(virq)) |
| 1008 | return -EINVAL; | 1004 | return -EINVAL; |
| 1009 | 1005 | ||
| 1006 | /* Don't map irq if it is reserved for GPIO. */ | ||
| 1007 | if (line == 0 && bit >= 16 && bit <32) | ||
| 1008 | return 0; | ||
| 1009 | |||
| 1010 | if (line > 1 || octeon_irq_ciu_to_irq[line][bit] != 0) | 1010 | if (line > 1 || octeon_irq_ciu_to_irq[line][bit] != 0) |
| 1011 | return -EINVAL; | 1011 | return -EINVAL; |
| 1012 | 1012 | ||
| @@ -1525,10 +1525,6 @@ static int octeon_irq_ciu2_xlat(struct irq_domain *d, | |||
| 1525 | ciu = intspec[0]; | 1525 | ciu = intspec[0]; |
| 1526 | bit = intspec[1]; | 1526 | bit = intspec[1]; |
| 1527 | 1527 | ||
| 1528 | /* Line 7 are the GPIO lines */ | ||
| 1529 | if (ciu > 6 || bit > 63) | ||
| 1530 | return -EINVAL; | ||
| 1531 | |||
| 1532 | *out_hwirq = (ciu << 6) | bit; | 1528 | *out_hwirq = (ciu << 6) | bit; |
| 1533 | *out_type = 0; | 1529 | *out_type = 0; |
| 1534 | 1530 | ||
| @@ -1570,8 +1566,14 @@ static int octeon_irq_ciu2_map(struct irq_domain *d, | |||
| 1570 | if (!octeon_irq_virq_in_range(virq)) | 1566 | if (!octeon_irq_virq_in_range(virq)) |
| 1571 | return -EINVAL; | 1567 | return -EINVAL; |
| 1572 | 1568 | ||
| 1573 | /* Line 7 are the GPIO lines */ | 1569 | /* |
| 1574 | if (line > 6 || octeon_irq_ciu_to_irq[line][bit] != 0) | 1570 | * Don't map irq if it is reserved for GPIO. |
| 1571 | * (Line 7 are the GPIO lines.) | ||
| 1572 | */ | ||
| 1573 | if (line == 7) | ||
| 1574 | return 0; | ||
| 1575 | |||
| 1576 | if (line > 7 || octeon_irq_ciu_to_irq[line][bit] != 0) | ||
| 1575 | return -EINVAL; | 1577 | return -EINVAL; |
| 1576 | 1578 | ||
| 1577 | if (octeon_irq_ciu2_is_edge(line, bit)) | 1579 | if (octeon_irq_ciu2_is_edge(line, bit)) |
diff --git a/arch/mips/include/asm/Kbuild b/arch/mips/include/asm/Kbuild index 2d7f65052c1f..05439187891d 100644 --- a/arch/mips/include/asm/Kbuild +++ b/arch/mips/include/asm/Kbuild | |||
| @@ -2,16 +2,17 @@ | |||
| 2 | generic-y += cputime.h | 2 | generic-y += cputime.h |
| 3 | generic-y += current.h | 3 | generic-y += current.h |
| 4 | generic-y += emergency-restart.h | 4 | generic-y += emergency-restart.h |
| 5 | generic-y += hash.h | ||
| 5 | generic-y += local64.h | 6 | generic-y += local64.h |
| 7 | generic-y += mcs_spinlock.h | ||
| 6 | generic-y += mutex.h | 8 | generic-y += mutex.h |
| 7 | generic-y += parport.h | 9 | generic-y += parport.h |
| 8 | generic-y += percpu.h | 10 | generic-y += percpu.h |
| 11 | generic-y += preempt.h | ||
| 9 | generic-y += scatterlist.h | 12 | generic-y += scatterlist.h |
| 10 | generic-y += sections.h | 13 | generic-y += sections.h |
| 11 | generic-y += segment.h | 14 | generic-y += segment.h |
| 12 | generic-y += serial.h | 15 | generic-y += serial.h |
| 13 | generic-y += trace_clock.h | 16 | generic-y += trace_clock.h |
| 14 | generic-y += preempt.h | ||
| 15 | generic-y += ucontext.h | 17 | generic-y += ucontext.h |
| 16 | generic-y += xor.h | 18 | generic-y += xor.h |
| 17 | generic-y += hash.h | ||
diff --git a/arch/mips/include/asm/asmmacro.h b/arch/mips/include/asm/asmmacro.h index 3220c93ea981..4225e99bd7bf 100644 --- a/arch/mips/include/asm/asmmacro.h +++ b/arch/mips/include/asm/asmmacro.h | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #define _ASM_ASMMACRO_H | 9 | #define _ASM_ASMMACRO_H |
| 10 | 10 | ||
| 11 | #include <asm/hazards.h> | 11 | #include <asm/hazards.h> |
| 12 | #include <asm/asm-offsets.h> | ||
| 12 | 13 | ||
| 13 | #ifdef CONFIG_32BIT | 14 | #ifdef CONFIG_32BIT |
| 14 | #include <asm/asmmacro-32.h> | 15 | #include <asm/asmmacro-32.h> |
| @@ -54,11 +55,21 @@ | |||
| 54 | .endm | 55 | .endm |
| 55 | 56 | ||
| 56 | .macro local_irq_disable reg=t0 | 57 | .macro local_irq_disable reg=t0 |
| 58 | #ifdef CONFIG_PREEMPT | ||
| 59 | lw \reg, TI_PRE_COUNT($28) | ||
| 60 | addi \reg, \reg, 1 | ||
| 61 | sw \reg, TI_PRE_COUNT($28) | ||
| 62 | #endif | ||
| 57 | mfc0 \reg, CP0_STATUS | 63 | mfc0 \reg, CP0_STATUS |
| 58 | ori \reg, \reg, 1 | 64 | ori \reg, \reg, 1 |
| 59 | xori \reg, \reg, 1 | 65 | xori \reg, \reg, 1 |
| 60 | mtc0 \reg, CP0_STATUS | 66 | mtc0 \reg, CP0_STATUS |
| 61 | irq_disable_hazard | 67 | irq_disable_hazard |
| 68 | #ifdef CONFIG_PREEMPT | ||
| 69 | lw \reg, TI_PRE_COUNT($28) | ||
| 70 | addi \reg, \reg, -1 | ||
| 71 | sw \reg, TI_PRE_COUNT($28) | ||
| 72 | #endif | ||
| 62 | .endm | 73 | .endm |
| 63 | #endif /* CONFIG_MIPS_MT_SMTC */ | 74 | #endif /* CONFIG_MIPS_MT_SMTC */ |
| 64 | 75 | ||
| @@ -106,7 +117,7 @@ | |||
| 106 | .endm | 117 | .endm |
| 107 | 118 | ||
| 108 | .macro fpu_save_double thread status tmp | 119 | .macro fpu_save_double thread status tmp |
| 109 | #if defined(CONFIG_MIPS64) || defined(CONFIG_CPU_MIPS32_R2) | 120 | #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) |
| 110 | sll \tmp, \status, 5 | 121 | sll \tmp, \status, 5 |
| 111 | bgez \tmp, 10f | 122 | bgez \tmp, 10f |
| 112 | fpu_save_16odd \thread | 123 | fpu_save_16odd \thread |
| @@ -159,7 +170,7 @@ | |||
| 159 | .endm | 170 | .endm |
| 160 | 171 | ||
| 161 | .macro fpu_restore_double thread status tmp | 172 | .macro fpu_restore_double thread status tmp |
| 162 | #if defined(CONFIG_MIPS64) || defined(CONFIG_CPU_MIPS32_R2) | 173 | #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) |
| 163 | sll \tmp, \status, 5 | 174 | sll \tmp, \status, 5 |
| 164 | bgez \tmp, 10f # 16 register mode? | 175 | bgez \tmp, 10f # 16 register mode? |
| 165 | 176 | ||
diff --git a/arch/mips/include/asm/fpu.h b/arch/mips/include/asm/fpu.h index 6b9749540edf..58e50cbdb1a6 100644 --- a/arch/mips/include/asm/fpu.h +++ b/arch/mips/include/asm/fpu.h | |||
| @@ -57,7 +57,7 @@ static inline int __enable_fpu(enum fpu_mode mode) | |||
| 57 | return 0; | 57 | return 0; |
| 58 | 58 | ||
| 59 | case FPU_64BIT: | 59 | case FPU_64BIT: |
| 60 | #if !(defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_MIPS64)) | 60 | #if !(defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_64BIT)) |
| 61 | /* we only have a 32-bit FPU */ | 61 | /* we only have a 32-bit FPU */ |
| 62 | return SIGFPE; | 62 | return SIGFPE; |
| 63 | #endif | 63 | #endif |
diff --git a/arch/mips/include/asm/ftrace.h b/arch/mips/include/asm/ftrace.h index ce35c9af0c28..992aaba603b5 100644 --- a/arch/mips/include/asm/ftrace.h +++ b/arch/mips/include/asm/ftrace.h | |||
| @@ -22,12 +22,12 @@ extern void _mcount(void); | |||
| 22 | #define safe_load(load, src, dst, error) \ | 22 | #define safe_load(load, src, dst, error) \ |
| 23 | do { \ | 23 | do { \ |
| 24 | asm volatile ( \ | 24 | asm volatile ( \ |
| 25 | "1: " load " %[" STR(dst) "], 0(%[" STR(src) "])\n"\ | 25 | "1: " load " %[tmp_dst], 0(%[tmp_src])\n" \ |
| 26 | " li %[" STR(error) "], 0\n" \ | 26 | " li %[tmp_err], 0\n" \ |
| 27 | "2:\n" \ | 27 | "2:\n" \ |
| 28 | \ | 28 | \ |
| 29 | ".section .fixup, \"ax\"\n" \ | 29 | ".section .fixup, \"ax\"\n" \ |
| 30 | "3: li %[" STR(error) "], 1\n" \ | 30 | "3: li %[tmp_err], 1\n" \ |
| 31 | " j 2b\n" \ | 31 | " j 2b\n" \ |
| 32 | ".previous\n" \ | 32 | ".previous\n" \ |
| 33 | \ | 33 | \ |
| @@ -35,8 +35,8 @@ do { \ | |||
| 35 | STR(PTR) "\t1b, 3b\n\t" \ | 35 | STR(PTR) "\t1b, 3b\n\t" \ |
| 36 | ".previous\n" \ | 36 | ".previous\n" \ |
| 37 | \ | 37 | \ |
| 38 | : [dst] "=&r" (dst), [error] "=r" (error)\ | 38 | : [tmp_dst] "=&r" (dst), [tmp_err] "=r" (error)\ |
| 39 | : [src] "r" (src) \ | 39 | : [tmp_src] "r" (src) \ |
| 40 | : "memory" \ | 40 | : "memory" \ |
| 41 | ); \ | 41 | ); \ |
| 42 | } while (0) | 42 | } while (0) |
| @@ -44,12 +44,12 @@ do { \ | |||
| 44 | #define safe_store(store, src, dst, error) \ | 44 | #define safe_store(store, src, dst, error) \ |
| 45 | do { \ | 45 | do { \ |
| 46 | asm volatile ( \ | 46 | asm volatile ( \ |
| 47 | "1: " store " %[" STR(src) "], 0(%[" STR(dst) "])\n"\ | 47 | "1: " store " %[tmp_src], 0(%[tmp_dst])\n"\ |
| 48 | " li %[" STR(error) "], 0\n" \ | 48 | " li %[tmp_err], 0\n" \ |
| 49 | "2:\n" \ | 49 | "2:\n" \ |
| 50 | \ | 50 | \ |
| 51 | ".section .fixup, \"ax\"\n" \ | 51 | ".section .fixup, \"ax\"\n" \ |
| 52 | "3: li %[" STR(error) "], 1\n" \ | 52 | "3: li %[tmp_err], 1\n" \ |
| 53 | " j 2b\n" \ | 53 | " j 2b\n" \ |
| 54 | ".previous\n" \ | 54 | ".previous\n" \ |
| 55 | \ | 55 | \ |
| @@ -57,8 +57,8 @@ do { \ | |||
| 57 | STR(PTR) "\t1b, 3b\n\t" \ | 57 | STR(PTR) "\t1b, 3b\n\t" \ |
| 58 | ".previous\n" \ | 58 | ".previous\n" \ |
| 59 | \ | 59 | \ |
| 60 | : [error] "=r" (error) \ | 60 | : [tmp_err] "=r" (error) \ |
| 61 | : [dst] "r" (dst), [src] "r" (src)\ | 61 | : [tmp_dst] "r" (dst), [tmp_src] "r" (src)\ |
| 62 | : "memory" \ | 62 | : "memory" \ |
| 63 | ); \ | 63 | ); \ |
| 64 | } while (0) | 64 | } while (0) |
diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h index 33e8dbfc1b63..f35b131977e6 100644 --- a/arch/mips/include/asm/syscall.h +++ b/arch/mips/include/asm/syscall.h | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #ifndef __ASM_MIPS_SYSCALL_H | 13 | #ifndef __ASM_MIPS_SYSCALL_H |
| 14 | #define __ASM_MIPS_SYSCALL_H | 14 | #define __ASM_MIPS_SYSCALL_H |
| 15 | 15 | ||
| 16 | #include <linux/compiler.h> | ||
| 16 | #include <linux/audit.h> | 17 | #include <linux/audit.h> |
| 17 | #include <linux/elf-em.h> | 18 | #include <linux/elf-em.h> |
| 18 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
| @@ -39,14 +40,14 @@ static inline unsigned long mips_get_syscall_arg(unsigned long *arg, | |||
| 39 | 40 | ||
| 40 | #ifdef CONFIG_32BIT | 41 | #ifdef CONFIG_32BIT |
| 41 | case 4: case 5: case 6: case 7: | 42 | case 4: case 5: case 6: case 7: |
| 42 | return get_user(*arg, (int *)usp + 4 * n); | 43 | return get_user(*arg, (int *)usp + n); |
| 43 | #endif | 44 | #endif |
| 44 | 45 | ||
| 45 | #ifdef CONFIG_64BIT | 46 | #ifdef CONFIG_64BIT |
| 46 | case 4: case 5: case 6: case 7: | 47 | case 4: case 5: case 6: case 7: |
| 47 | #ifdef CONFIG_MIPS32_O32 | 48 | #ifdef CONFIG_MIPS32_O32 |
| 48 | if (test_thread_flag(TIF_32BIT_REGS)) | 49 | if (test_thread_flag(TIF_32BIT_REGS)) |
| 49 | return get_user(*arg, (int *)usp + 4 * n); | 50 | return get_user(*arg, (int *)usp + n); |
| 50 | else | 51 | else |
| 51 | #endif | 52 | #endif |
| 52 | *arg = regs->regs[4 + n]; | 53 | *arg = regs->regs[4 + n]; |
| @@ -57,6 +58,8 @@ static inline unsigned long mips_get_syscall_arg(unsigned long *arg, | |||
| 57 | default: | 58 | default: |
| 58 | BUG(); | 59 | BUG(); |
| 59 | } | 60 | } |
| 61 | |||
| 62 | unreachable(); | ||
| 60 | } | 63 | } |
| 61 | 64 | ||
| 62 | static inline long syscall_get_return_value(struct task_struct *task, | 65 | static inline long syscall_get_return_value(struct task_struct *task, |
| @@ -83,11 +86,10 @@ static inline void syscall_get_arguments(struct task_struct *task, | |||
| 83 | unsigned int i, unsigned int n, | 86 | unsigned int i, unsigned int n, |
| 84 | unsigned long *args) | 87 | unsigned long *args) |
| 85 | { | 88 | { |
| 86 | unsigned long arg; | ||
| 87 | int ret; | 89 | int ret; |
| 88 | 90 | ||
| 89 | while (n--) | 91 | while (n--) |
| 90 | ret |= mips_get_syscall_arg(&arg, task, regs, i++); | 92 | ret |= mips_get_syscall_arg(args++, task, regs, i++); |
| 91 | 93 | ||
| 92 | /* | 94 | /* |
| 93 | * No way to communicate an error because this is a void function. | 95 | * No way to communicate an error because this is a void function. |
diff --git a/arch/mips/include/asm/topology.h b/arch/mips/include/asm/topology.h index 12609a17dc8b..20ea4859c822 100644 --- a/arch/mips/include/asm/topology.h +++ b/arch/mips/include/asm/topology.h | |||
| @@ -10,8 +10,4 @@ | |||
| 10 | 10 | ||
| 11 | #include <topology.h> | 11 | #include <topology.h> |
| 12 | 12 | ||
| 13 | #ifdef CONFIG_SMP | ||
| 14 | #define smt_capable() (smp_num_siblings > 1) | ||
| 15 | #endif | ||
| 16 | |||
| 17 | #endif /* __ASM_TOPOLOGY_H */ | 13 | #endif /* __ASM_TOPOLOGY_H */ |
diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h index 4d3b92886665..413d6c612bec 100644 --- a/arch/mips/include/asm/unistd.h +++ b/arch/mips/include/asm/unistd.h | |||
| @@ -24,7 +24,6 @@ | |||
| 24 | 24 | ||
| 25 | #ifndef __ASSEMBLY__ | 25 | #ifndef __ASSEMBLY__ |
| 26 | 26 | ||
| 27 | #define __ARCH_OMIT_COMPAT_SYS_GETDENTS64 | ||
| 28 | #define __ARCH_WANT_OLD_READDIR | 27 | #define __ARCH_WANT_OLD_READDIR |
| 29 | #define __ARCH_WANT_SYS_ALARM | 28 | #define __ARCH_WANT_SYS_ALARM |
| 30 | #define __ARCH_WANT_SYS_GETHOSTNAME | 29 | #define __ARCH_WANT_SYS_GETHOSTNAME |
diff --git a/arch/mips/include/uapi/asm/inst.h b/arch/mips/include/uapi/asm/inst.h index b39ba25b41cc..f25181b19941 100644 --- a/arch/mips/include/uapi/asm/inst.h +++ b/arch/mips/include/uapi/asm/inst.h | |||
| @@ -163,8 +163,8 @@ enum cop1_sdw_func { | |||
| 163 | */ | 163 | */ |
| 164 | enum cop1x_func { | 164 | enum cop1x_func { |
| 165 | lwxc1_op = 0x00, ldxc1_op = 0x01, | 165 | lwxc1_op = 0x00, ldxc1_op = 0x01, |
| 166 | pfetch_op = 0x07, swxc1_op = 0x08, | 166 | swxc1_op = 0x08, sdxc1_op = 0x09, |
| 167 | sdxc1_op = 0x09, madd_s_op = 0x20, | 167 | pfetch_op = 0x0f, madd_s_op = 0x20, |
| 168 | madd_d_op = 0x21, madd_e_op = 0x22, | 168 | madd_d_op = 0x21, madd_e_op = 0x22, |
| 169 | msub_s_op = 0x28, msub_d_op = 0x29, | 169 | msub_s_op = 0x28, msub_d_op = 0x29, |
| 170 | msub_e_op = 0x2a, nmadd_s_op = 0x30, | 170 | msub_e_op = 0x2a, nmadd_s_op = 0x30, |
diff --git a/arch/mips/kernel/ftrace.c b/arch/mips/kernel/ftrace.c index 185ba258361b..374ed74cd516 100644 --- a/arch/mips/kernel/ftrace.c +++ b/arch/mips/kernel/ftrace.c | |||
| @@ -111,11 +111,10 @@ static int ftrace_modify_code_2(unsigned long ip, unsigned int new_code1, | |||
| 111 | safe_store_code(new_code1, ip, faulted); | 111 | safe_store_code(new_code1, ip, faulted); |
| 112 | if (unlikely(faulted)) | 112 | if (unlikely(faulted)) |
| 113 | return -EFAULT; | 113 | return -EFAULT; |
| 114 | ip += 4; | 114 | safe_store_code(new_code2, ip + 4, faulted); |
| 115 | safe_store_code(new_code2, ip, faulted); | ||
| 116 | if (unlikely(faulted)) | 115 | if (unlikely(faulted)) |
| 117 | return -EFAULT; | 116 | return -EFAULT; |
| 118 | flush_icache_range(ip, ip + 8); /* original ip + 12 */ | 117 | flush_icache_range(ip, ip + 8); |
| 119 | return 0; | 118 | return 0; |
| 120 | } | 119 | } |
| 121 | #endif | 120 | #endif |
diff --git a/arch/mips/kernel/r4k_fpu.S b/arch/mips/kernel/r4k_fpu.S index 253b2fb52026..73b0ddf910d4 100644 --- a/arch/mips/kernel/r4k_fpu.S +++ b/arch/mips/kernel/r4k_fpu.S | |||
| @@ -35,9 +35,9 @@ | |||
| 35 | LEAF(_save_fp_context) | 35 | LEAF(_save_fp_context) |
| 36 | cfc1 t1, fcr31 | 36 | cfc1 t1, fcr31 |
| 37 | 37 | ||
| 38 | #if defined(CONFIG_64BIT) || defined(CONFIG_MIPS32_R2) | 38 | #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) |
| 39 | .set push | 39 | .set push |
| 40 | #ifdef CONFIG_MIPS32_R2 | 40 | #ifdef CONFIG_CPU_MIPS32_R2 |
| 41 | .set mips64r2 | 41 | .set mips64r2 |
| 42 | mfc0 t0, CP0_STATUS | 42 | mfc0 t0, CP0_STATUS |
| 43 | sll t0, t0, 5 | 43 | sll t0, t0, 5 |
| @@ -146,11 +146,11 @@ LEAF(_save_fp_context32) | |||
| 146 | * - cp1 status/control register | 146 | * - cp1 status/control register |
| 147 | */ | 147 | */ |
| 148 | LEAF(_restore_fp_context) | 148 | LEAF(_restore_fp_context) |
| 149 | EX lw t0, SC_FPC_CSR(a0) | 149 | EX lw t1, SC_FPC_CSR(a0) |
| 150 | 150 | ||
| 151 | #if defined(CONFIG_64BIT) || defined(CONFIG_MIPS32_R2) | 151 | #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2) |
| 152 | .set push | 152 | .set push |
| 153 | #ifdef CONFIG_MIPS32_R2 | 153 | #ifdef CONFIG_CPU_MIPS32_R2 |
| 154 | .set mips64r2 | 154 | .set mips64r2 |
| 155 | mfc0 t0, CP0_STATUS | 155 | mfc0 t0, CP0_STATUS |
| 156 | sll t0, t0, 5 | 156 | sll t0, t0, 5 |
| @@ -191,7 +191,7 @@ LEAF(_restore_fp_context) | |||
| 191 | EX ldc1 $f26, SC_FPREGS+208(a0) | 191 | EX ldc1 $f26, SC_FPREGS+208(a0) |
| 192 | EX ldc1 $f28, SC_FPREGS+224(a0) | 192 | EX ldc1 $f28, SC_FPREGS+224(a0) |
| 193 | EX ldc1 $f30, SC_FPREGS+240(a0) | 193 | EX ldc1 $f30, SC_FPREGS+240(a0) |
| 194 | ctc1 t0, fcr31 | 194 | ctc1 t1, fcr31 |
| 195 | jr ra | 195 | jr ra |
| 196 | li v0, 0 # success | 196 | li v0, 0 # success |
| 197 | END(_restore_fp_context) | 197 | END(_restore_fp_context) |
| @@ -199,7 +199,7 @@ LEAF(_restore_fp_context) | |||
| 199 | #ifdef CONFIG_MIPS32_COMPAT | 199 | #ifdef CONFIG_MIPS32_COMPAT |
| 200 | LEAF(_restore_fp_context32) | 200 | LEAF(_restore_fp_context32) |
| 201 | /* Restore an o32 sigcontext. */ | 201 | /* Restore an o32 sigcontext. */ |
| 202 | EX lw t0, SC32_FPC_CSR(a0) | 202 | EX lw t1, SC32_FPC_CSR(a0) |
| 203 | 203 | ||
| 204 | mfc0 t0, CP0_STATUS | 204 | mfc0 t0, CP0_STATUS |
| 205 | sll t0, t0, 5 | 205 | sll t0, t0, 5 |
| @@ -239,7 +239,7 @@ LEAF(_restore_fp_context32) | |||
| 239 | EX ldc1 $f26, SC32_FPREGS+208(a0) | 239 | EX ldc1 $f26, SC32_FPREGS+208(a0) |
| 240 | EX ldc1 $f28, SC32_FPREGS+224(a0) | 240 | EX ldc1 $f28, SC32_FPREGS+224(a0) |
| 241 | EX ldc1 $f30, SC32_FPREGS+240(a0) | 241 | EX ldc1 $f30, SC32_FPREGS+240(a0) |
| 242 | ctc1 t0, fcr31 | 242 | ctc1 t1, fcr31 |
| 243 | jr ra | 243 | jr ra |
| 244 | li v0, 0 # success | 244 | li v0, 0 # success |
| 245 | END(_restore_fp_context32) | 245 | END(_restore_fp_context32) |
diff --git a/arch/mips/kernel/rtlx-cmp.c b/arch/mips/kernel/rtlx-cmp.c index 56dc69635153..758fb3cd2326 100644 --- a/arch/mips/kernel/rtlx-cmp.c +++ b/arch/mips/kernel/rtlx-cmp.c | |||
| @@ -112,5 +112,8 @@ void __exit rtlx_module_exit(void) | |||
| 112 | 112 | ||
| 113 | for (i = 0; i < RTLX_CHANNELS; i++) | 113 | for (i = 0; i < RTLX_CHANNELS; i++) |
| 114 | device_destroy(mt_class, MKDEV(major, i)); | 114 | device_destroy(mt_class, MKDEV(major, i)); |
| 115 | |||
| 115 | unregister_chrdev(major, RTLX_MODULE_NAME); | 116 | unregister_chrdev(major, RTLX_MODULE_NAME); |
| 117 | |||
| 118 | aprp_hook = NULL; | ||
| 116 | } | 119 | } |
diff --git a/arch/mips/kernel/rtlx-mt.c b/arch/mips/kernel/rtlx-mt.c index 91d61ba422b4..9c1aca00fd54 100644 --- a/arch/mips/kernel/rtlx-mt.c +++ b/arch/mips/kernel/rtlx-mt.c | |||
| @@ -144,5 +144,8 @@ void __exit rtlx_module_exit(void) | |||
| 144 | 144 | ||
| 145 | for (i = 0; i < RTLX_CHANNELS; i++) | 145 | for (i = 0; i < RTLX_CHANNELS; i++) |
| 146 | device_destroy(mt_class, MKDEV(major, i)); | 146 | device_destroy(mt_class, MKDEV(major, i)); |
| 147 | |||
| 147 | unregister_chrdev(major, RTLX_MODULE_NAME); | 148 | unregister_chrdev(major, RTLX_MODULE_NAME); |
| 149 | |||
| 150 | aprp_hook = NULL; | ||
| 148 | } | 151 | } |
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c index dfc1b911be04..c1681d65dd5c 100644 --- a/arch/mips/kernel/smtc.c +++ b/arch/mips/kernel/smtc.c | |||
| @@ -1007,7 +1007,7 @@ static void __irq_entry smtc_clock_tick_interrupt(void) | |||
| 1007 | int irq = MIPS_CPU_IRQ_BASE + 1; | 1007 | int irq = MIPS_CPU_IRQ_BASE + 1; |
| 1008 | 1008 | ||
| 1009 | irq_enter(); | 1009 | irq_enter(); |
| 1010 | kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq)); | 1010 | kstat_incr_irq_this_cpu(irq); |
| 1011 | cd = &per_cpu(mips_clockevent_device, cpu); | 1011 | cd = &per_cpu(mips_clockevent_device, cpu); |
| 1012 | cd->event_handler(cd); | 1012 | cd->event_handler(cd); |
| 1013 | irq_exit(); | 1013 | irq_exit(); |
diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c index 506925b2c3f3..0b4e2e38294b 100644 --- a/arch/mips/math-emu/cp1emu.c +++ b/arch/mips/math-emu/cp1emu.c | |||
| @@ -1538,10 +1538,10 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
| 1538 | break; | 1538 | break; |
| 1539 | } | 1539 | } |
| 1540 | 1540 | ||
| 1541 | case 0x7: /* 7 */ | 1541 | case 0x3: |
| 1542 | if (MIPSInst_FUNC(ir) != pfetch_op) { | 1542 | if (MIPSInst_FUNC(ir) != pfetch_op) |
| 1543 | return SIGILL; | 1543 | return SIGILL; |
| 1544 | } | 1544 | |
| 1545 | /* ignore prefx operation */ | 1545 | /* ignore prefx operation */ |
| 1546 | break; | 1546 | break; |
| 1547 | 1547 | ||
diff --git a/arch/mips/mti-malta/malta-amon.c b/arch/mips/mti-malta/malta-amon.c index 592ac0427426..84ac523b0ce0 100644 --- a/arch/mips/mti-malta/malta-amon.c +++ b/arch/mips/mti-malta/malta-amon.c | |||
| @@ -72,7 +72,7 @@ int amon_cpu_start(int cpu, | |||
| 72 | return 0; | 72 | return 0; |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | #ifdef CONFIG_MIPS_VPE_LOADER | 75 | #ifdef CONFIG_MIPS_VPE_LOADER_CMP |
| 76 | int vpe_run(struct vpe *v) | 76 | int vpe_run(struct vpe *v) |
| 77 | { | 77 | { |
| 78 | struct vpe_notifications *n; | 78 | struct vpe_notifications *n; |
diff --git a/arch/mips/mti-malta/malta-int.c b/arch/mips/mti-malta/malta-int.c index ca3e3a46a42f..2242181a6284 100644 --- a/arch/mips/mti-malta/malta-int.c +++ b/arch/mips/mti-malta/malta-int.c | |||
| @@ -119,7 +119,7 @@ static void malta_hw0_irqdispatch(void) | |||
| 119 | 119 | ||
| 120 | do_IRQ(MALTA_INT_BASE + irq); | 120 | do_IRQ(MALTA_INT_BASE + irq); |
| 121 | 121 | ||
| 122 | #ifdef MIPS_VPE_APSP_API | 122 | #ifdef CONFIG_MIPS_VPE_APSP_API_MT |
| 123 | if (aprp_hook) | 123 | if (aprp_hook) |
| 124 | aprp_hook(); | 124 | aprp_hook(); |
| 125 | #endif | 125 | #endif |
| @@ -310,7 +310,7 @@ static void ipi_call_dispatch(void) | |||
| 310 | 310 | ||
| 311 | static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id) | 311 | static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id) |
| 312 | { | 312 | { |
| 313 | #ifdef MIPS_VPE_APSP_API | 313 | #ifdef CONFIG_MIPS_VPE_APSP_API_CMP |
| 314 | if (aprp_hook) | 314 | if (aprp_hook) |
| 315 | aprp_hook(); | 315 | aprp_hook(); |
| 316 | #endif | 316 | #endif |
diff --git a/arch/mips/pci/msi-octeon.c b/arch/mips/pci/msi-octeon.c index d37be36dc659..2b91b0e61566 100644 --- a/arch/mips/pci/msi-octeon.c +++ b/arch/mips/pci/msi-octeon.c | |||
| @@ -150,6 +150,7 @@ msi_irq_allocated: | |||
| 150 | msg.address_lo = | 150 | msg.address_lo = |
| 151 | ((128ul << 20) + CVMX_PCI_MSI_RCV) & 0xffffffff; | 151 | ((128ul << 20) + CVMX_PCI_MSI_RCV) & 0xffffffff; |
| 152 | msg.address_hi = ((128ul << 20) + CVMX_PCI_MSI_RCV) >> 32; | 152 | msg.address_hi = ((128ul << 20) + CVMX_PCI_MSI_RCV) >> 32; |
| 153 | break; | ||
| 153 | case OCTEON_DMA_BAR_TYPE_BIG: | 154 | case OCTEON_DMA_BAR_TYPE_BIG: |
| 154 | /* When using big bar, Bar 0 is based at 0 */ | 155 | /* When using big bar, Bar 0 is based at 0 */ |
| 155 | msg.address_lo = (0 + CVMX_PCI_MSI_RCV) & 0xffffffff; | 156 | msg.address_lo = (0 + CVMX_PCI_MSI_RCV) & 0xffffffff; |
diff --git a/arch/mips/sgi-ip22/ip22-int.c b/arch/mips/sgi-ip22/ip22-int.c index 3db64d51798d..58b40ae59335 100644 --- a/arch/mips/sgi-ip22/ip22-int.c +++ b/arch/mips/sgi-ip22/ip22-int.c | |||
| @@ -148,7 +148,7 @@ static void __irq_entry indy_buserror_irq(void) | |||
| 148 | int irq = SGI_BUSERR_IRQ; | 148 | int irq = SGI_BUSERR_IRQ; |
| 149 | 149 | ||
| 150 | irq_enter(); | 150 | irq_enter(); |
| 151 | kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq)); | 151 | kstat_incr_irq_this_cpu(irq); |
| 152 | ip22_be_interrupt(irq); | 152 | ip22_be_interrupt(irq); |
| 153 | irq_exit(); | 153 | irq_exit(); |
| 154 | } | 154 | } |
diff --git a/arch/mips/sgi-ip22/ip22-time.c b/arch/mips/sgi-ip22/ip22-time.c index 607192449335..045aa89f28d8 100644 --- a/arch/mips/sgi-ip22/ip22-time.c +++ b/arch/mips/sgi-ip22/ip22-time.c | |||
| @@ -123,7 +123,7 @@ void __irq_entry indy_8254timer_irq(void) | |||
| 123 | char c; | 123 | char c; |
| 124 | 124 | ||
| 125 | irq_enter(); | 125 | irq_enter(); |
| 126 | kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq)); | 126 | kstat_incr_irq_this_cpu(irq); |
| 127 | printk(KERN_ALERT "Oops, got 8254 interrupt.\n"); | 127 | printk(KERN_ALERT "Oops, got 8254 interrupt.\n"); |
| 128 | ArcRead(0, &c, 1, &cnt); | 128 | ArcRead(0, &c, 1, &cnt); |
| 129 | ArcEnterInteractiveMode(); | 129 | ArcEnterInteractiveMode(); |
diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c index 09d6e16a70f1..59cfe2659771 100644 --- a/arch/mips/sibyte/bcm1480/irq.c +++ b/arch/mips/sibyte/bcm1480/irq.c | |||
| @@ -95,7 +95,7 @@ static int bcm1480_set_affinity(struct irq_data *d, const struct cpumask *mask, | |||
| 95 | u64 cur_ints; | 95 | u64 cur_ints; |
| 96 | unsigned long flags; | 96 | unsigned long flags; |
| 97 | 97 | ||
| 98 | i = cpumask_first(mask); | 98 | i = cpumask_first_and(mask, cpu_online_mask); |
| 99 | 99 | ||
| 100 | /* Convert logical CPU to physical CPU */ | 100 | /* Convert logical CPU to physical CPU */ |
| 101 | cpu = cpu_logical_map(i); | 101 | cpu = cpu_logical_map(i); |
diff --git a/arch/mips/sibyte/bcm1480/smp.c b/arch/mips/sibyte/bcm1480/smp.c index 54e2c4de15c1..70d9182b26f1 100644 --- a/arch/mips/sibyte/bcm1480/smp.c +++ b/arch/mips/sibyte/bcm1480/smp.c | |||
| @@ -182,7 +182,7 @@ void bcm1480_mailbox_interrupt(void) | |||
| 182 | int irq = K_BCM1480_INT_MBOX_0_0; | 182 | int irq = K_BCM1480_INT_MBOX_0_0; |
| 183 | unsigned int action; | 183 | unsigned int action; |
| 184 | 184 | ||
| 185 | kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq)); | 185 | kstat_incr_irq_this_cpu(irq); |
| 186 | /* Load the mailbox register to figure out what we're supposed to do */ | 186 | /* Load the mailbox register to figure out what we're supposed to do */ |
| 187 | action = (__raw_readq(mailbox_0_regs[cpu]) >> 48) & 0xffff; | 187 | action = (__raw_readq(mailbox_0_regs[cpu]) >> 48) & 0xffff; |
| 188 | 188 | ||
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c index fca0cdb99509..6d8dba5cf348 100644 --- a/arch/mips/sibyte/sb1250/irq.c +++ b/arch/mips/sibyte/sb1250/irq.c | |||
| @@ -88,7 +88,7 @@ static int sb1250_set_affinity(struct irq_data *d, const struct cpumask *mask, | |||
| 88 | u64 cur_ints; | 88 | u64 cur_ints; |
| 89 | unsigned long flags; | 89 | unsigned long flags; |
| 90 | 90 | ||
| 91 | i = cpumask_first(mask); | 91 | i = cpumask_first_and(mask, cpu_online_mask); |
| 92 | 92 | ||
| 93 | /* Convert logical CPU to physical CPU */ | 93 | /* Convert logical CPU to physical CPU */ |
| 94 | cpu = cpu_logical_map(i); | 94 | cpu = cpu_logical_map(i); |
diff --git a/arch/mips/sibyte/sb1250/smp.c b/arch/mips/sibyte/sb1250/smp.c index d7b942db0ea5..db976117dd4d 100644 --- a/arch/mips/sibyte/sb1250/smp.c +++ b/arch/mips/sibyte/sb1250/smp.c | |||
| @@ -170,7 +170,7 @@ void sb1250_mailbox_interrupt(void) | |||
| 170 | int irq = K_INT_MBOX_0; | 170 | int irq = K_INT_MBOX_0; |
| 171 | unsigned int action; | 171 | unsigned int action; |
| 172 | 172 | ||
| 173 | kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq)); | 173 | kstat_incr_irq_this_cpu(irq); |
| 174 | /* Load the mailbox register to figure out what we're supposed to do */ | 174 | /* Load the mailbox register to figure out what we're supposed to do */ |
| 175 | action = (____raw_readq(mailbox_regs[cpu]) >> 48) & 0xffff; | 175 | action = (____raw_readq(mailbox_regs[cpu]) >> 48) & 0xffff; |
| 176 | 176 | ||
diff --git a/arch/mn10300/include/asm/Kbuild b/arch/mn10300/include/asm/Kbuild index 992e989ab785..654d5ba6e310 100644 --- a/arch/mn10300/include/asm/Kbuild +++ b/arch/mn10300/include/asm/Kbuild | |||
| @@ -1,7 +1,9 @@ | |||
| 1 | 1 | ||
| 2 | generic-y += barrier.h | 2 | generic-y += barrier.h |
| 3 | generic-y += clkdev.h | 3 | generic-y += clkdev.h |
| 4 | generic-y += cputime.h | ||
| 4 | generic-y += exec.h | 5 | generic-y += exec.h |
| 5 | generic-y += hash.h | 6 | generic-y += hash.h |
| 6 | generic-y += trace_clock.h | 7 | generic-y += mcs_spinlock.h |
| 7 | generic-y += preempt.h | 8 | generic-y += preempt.h |
| 9 | generic-y += trace_clock.h | ||
diff --git a/arch/mn10300/include/asm/cputime.h b/arch/mn10300/include/asm/cputime.h deleted file mode 100644 index 6d68ad7e0ea3..000000000000 --- a/arch/mn10300/include/asm/cputime.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <asm-generic/cputime.h> | ||
diff --git a/arch/mn10300/kernel/cevt-mn10300.c b/arch/mn10300/kernel/cevt-mn10300.c index ccce35e3e179..60f64ca1752a 100644 --- a/arch/mn10300/kernel/cevt-mn10300.c +++ b/arch/mn10300/kernel/cevt-mn10300.c | |||
| @@ -113,7 +113,7 @@ int __init init_clockevents(void) | |||
| 113 | cd->set_next_event = next_event; | 113 | cd->set_next_event = next_event; |
| 114 | 114 | ||
| 115 | iact = &per_cpu(timer_irq, cpu); | 115 | iact = &per_cpu(timer_irq, cpu); |
| 116 | iact->flags = IRQF_DISABLED | IRQF_SHARED | IRQF_TIMER; | 116 | iact->flags = IRQF_SHARED | IRQF_TIMER; |
| 117 | iact->handler = timer_interrupt; | 117 | iact->handler = timer_interrupt; |
| 118 | 118 | ||
| 119 | clockevents_register_device(cd); | 119 | clockevents_register_device(cd); |
diff --git a/arch/mn10300/kernel/mn10300-serial.c b/arch/mn10300/kernel/mn10300-serial.c index bf6e949a2f87..7ecf69879e2d 100644 --- a/arch/mn10300/kernel/mn10300-serial.c +++ b/arch/mn10300/kernel/mn10300-serial.c | |||
| @@ -985,17 +985,17 @@ static int mn10300_serial_startup(struct uart_port *_port) | |||
| 985 | irq_set_chip(port->tm_irq, &mn10300_serial_pic); | 985 | irq_set_chip(port->tm_irq, &mn10300_serial_pic); |
| 986 | 986 | ||
| 987 | if (request_irq(port->rx_irq, mn10300_serial_interrupt, | 987 | if (request_irq(port->rx_irq, mn10300_serial_interrupt, |
| 988 | IRQF_DISABLED | IRQF_NOBALANCING, | 988 | IRQF_NOBALANCING, |
| 989 | port->rx_name, port) < 0) | 989 | port->rx_name, port) < 0) |
| 990 | goto error; | 990 | goto error; |
| 991 | 991 | ||
| 992 | if (request_irq(port->tx_irq, mn10300_serial_interrupt, | 992 | if (request_irq(port->tx_irq, mn10300_serial_interrupt, |
| 993 | IRQF_DISABLED | IRQF_NOBALANCING, | 993 | IRQF_NOBALANCING, |
| 994 | port->tx_name, port) < 0) | 994 | port->tx_name, port) < 0) |
| 995 | goto error2; | 995 | goto error2; |
| 996 | 996 | ||
| 997 | if (request_irq(port->tm_irq, mn10300_serial_interrupt, | 997 | if (request_irq(port->tm_irq, mn10300_serial_interrupt, |
| 998 | IRQF_DISABLED | IRQF_NOBALANCING, | 998 | IRQF_NOBALANCING, |
| 999 | port->tm_name, port) < 0) | 999 | port->tm_name, port) < 0) |
| 1000 | goto error3; | 1000 | goto error3; |
| 1001 | mn10300_serial_mask_ack(port->tm_irq); | 1001 | mn10300_serial_mask_ack(port->tm_irq); |
diff --git a/arch/mn10300/kernel/mn10300-watchdog.c b/arch/mn10300/kernel/mn10300-watchdog.c index db64a7166c09..a2d8e6938d67 100644 --- a/arch/mn10300/kernel/mn10300-watchdog.c +++ b/arch/mn10300/kernel/mn10300-watchdog.c | |||
| @@ -142,7 +142,7 @@ void watchdog_interrupt(struct pt_regs *regs, enum exception_code excep) | |||
| 142 | NMICR = NMICR_WDIF; | 142 | NMICR = NMICR_WDIF; |
| 143 | 143 | ||
| 144 | nmi_count(smp_processor_id())++; | 144 | nmi_count(smp_processor_id())++; |
| 145 | kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq)); | 145 | kstat_incr_irq_this_cpu(irq); |
| 146 | 146 | ||
| 147 | for_each_online_cpu(cpu) { | 147 | for_each_online_cpu(cpu) { |
| 148 | 148 | ||
diff --git a/arch/mn10300/kernel/smp.c b/arch/mn10300/kernel/smp.c index a17f9c9c14c9..f984193718b1 100644 --- a/arch/mn10300/kernel/smp.c +++ b/arch/mn10300/kernel/smp.c | |||
| @@ -143,7 +143,7 @@ static struct irqaction call_function_ipi = { | |||
| 143 | static irqreturn_t smp_ipi_timer_interrupt(int irq, void *dev_id); | 143 | static irqreturn_t smp_ipi_timer_interrupt(int irq, void *dev_id); |
| 144 | static struct irqaction local_timer_ipi = { | 144 | static struct irqaction local_timer_ipi = { |
| 145 | .handler = smp_ipi_timer_interrupt, | 145 | .handler = smp_ipi_timer_interrupt, |
| 146 | .flags = IRQF_DISABLED | IRQF_NOBALANCING, | 146 | .flags = IRQF_NOBALANCING, |
| 147 | .name = "smp local timer IPI" | 147 | .name = "smp local timer IPI" |
| 148 | }; | 148 | }; |
| 149 | #endif | 149 | #endif |
diff --git a/arch/mn10300/unit-asb2364/irq-fpga.c b/arch/mn10300/unit-asb2364/irq-fpga.c index e16c216f31dc..073e2ccc4a44 100644 --- a/arch/mn10300/unit-asb2364/irq-fpga.c +++ b/arch/mn10300/unit-asb2364/irq-fpga.c | |||
| @@ -76,7 +76,7 @@ static irqreturn_t fpga_interrupt(int irq, void *_mask) | |||
| 76 | static struct irqaction fpga_irq[] = { | 76 | static struct irqaction fpga_irq[] = { |
| 77 | [0] = { | 77 | [0] = { |
| 78 | .handler = fpga_interrupt, | 78 | .handler = fpga_interrupt, |
| 79 | .flags = IRQF_DISABLED | IRQF_SHARED, | 79 | .flags = IRQF_SHARED, |
| 80 | .name = "fpga", | 80 | .name = "fpga", |
| 81 | }, | 81 | }, |
| 82 | }; | 82 | }; |
diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild index 2e40f1ca8667..480af0d9c2f5 100644 --- a/arch/openrisc/include/asm/Kbuild +++ b/arch/openrisc/include/asm/Kbuild | |||
| @@ -10,8 +10,8 @@ generic-y += bugs.h | |||
| 10 | generic-y += cacheflush.h | 10 | generic-y += cacheflush.h |
| 11 | generic-y += checksum.h | 11 | generic-y += checksum.h |
| 12 | generic-y += clkdev.h | 12 | generic-y += clkdev.h |
| 13 | generic-y += cmpxchg.h | ||
| 14 | generic-y += cmpxchg-local.h | 13 | generic-y += cmpxchg-local.h |
| 14 | generic-y += cmpxchg.h | ||
| 15 | generic-y += cputime.h | 15 | generic-y += cputime.h |
| 16 | generic-y += current.h | 16 | generic-y += current.h |
| 17 | generic-y += device.h | 17 | generic-y += device.h |
| @@ -25,6 +25,7 @@ generic-y += fcntl.h | |||
| 25 | generic-y += ftrace.h | 25 | generic-y += ftrace.h |
| 26 | generic-y += futex.h | 26 | generic-y += futex.h |
| 27 | generic-y += hardirq.h | 27 | generic-y += hardirq.h |
| 28 | generic-y += hash.h | ||
| 28 | generic-y += hw_irq.h | 29 | generic-y += hw_irq.h |
| 29 | generic-y += ioctl.h | 30 | generic-y += ioctl.h |
| 30 | generic-y += ioctls.h | 31 | generic-y += ioctls.h |
| @@ -34,6 +35,7 @@ generic-y += kdebug.h | |||
| 34 | generic-y += kmap_types.h | 35 | generic-y += kmap_types.h |
| 35 | generic-y += kvm_para.h | 36 | generic-y += kvm_para.h |
| 36 | generic-y += local.h | 37 | generic-y += local.h |
| 38 | generic-y += mcs_spinlock.h | ||
| 37 | generic-y += mman.h | 39 | generic-y += mman.h |
| 38 | generic-y += module.h | 40 | generic-y += module.h |
| 39 | generic-y += msgbuf.h | 41 | generic-y += msgbuf.h |
| @@ -41,6 +43,7 @@ generic-y += pci.h | |||
| 41 | generic-y += percpu.h | 43 | generic-y += percpu.h |
| 42 | generic-y += poll.h | 44 | generic-y += poll.h |
| 43 | generic-y += posix_types.h | 45 | generic-y += posix_types.h |
| 46 | generic-y += preempt.h | ||
| 44 | generic-y += resource.h | 47 | generic-y += resource.h |
| 45 | generic-y += scatterlist.h | 48 | generic-y += scatterlist.h |
| 46 | generic-y += sections.h | 49 | generic-y += sections.h |
| @@ -53,11 +56,11 @@ generic-y += siginfo.h | |||
| 53 | generic-y += signal.h | 56 | generic-y += signal.h |
| 54 | generic-y += socket.h | 57 | generic-y += socket.h |
| 55 | generic-y += sockios.h | 58 | generic-y += sockios.h |
| 56 | generic-y += statfs.h | ||
| 57 | generic-y += stat.h | 59 | generic-y += stat.h |
| 60 | generic-y += statfs.h | ||
| 58 | generic-y += string.h | 61 | generic-y += string.h |
| 59 | generic-y += switch_to.h | ||
| 60 | generic-y += swab.h | 62 | generic-y += swab.h |
| 63 | generic-y += switch_to.h | ||
| 61 | generic-y += termbits.h | 64 | generic-y += termbits.h |
| 62 | generic-y += termios.h | 65 | generic-y += termios.h |
| 63 | generic-y += topology.h | 66 | generic-y += topology.h |
| @@ -68,5 +71,3 @@ generic-y += user.h | |||
| 68 | generic-y += vga.h | 71 | generic-y += vga.h |
| 69 | generic-y += word-at-a-time.h | 72 | generic-y += word-at-a-time.h |
| 70 | generic-y += xor.h | 73 | generic-y += xor.h |
| 71 | generic-y += preempt.h | ||
| 72 | generic-y += hash.h | ||
diff --git a/arch/parisc/include/asm/Kbuild b/arch/parisc/include/asm/Kbuild index 752c981bc3c7..ecf25e6678ad 100644 --- a/arch/parisc/include/asm/Kbuild +++ b/arch/parisc/include/asm/Kbuild | |||
| @@ -1,9 +1,29 @@ | |||
| 1 | 1 | ||
| 2 | generic-y += auxvec.h | ||
| 2 | generic-y += barrier.h | 3 | generic-y += barrier.h |
| 3 | generic-y += word-at-a-time.h auxvec.h user.h cputime.h emergency-restart.h \ | 4 | generic-y += clkdev.h |
| 4 | segment.h topology.h vga.h device.h percpu.h hw_irq.h mutex.h \ | 5 | generic-y += cputime.h |
| 5 | div64.h irq_regs.h kdebug.h kvm_para.h local64.h local.h param.h \ | 6 | generic-y += device.h |
| 6 | poll.h xor.h clkdev.h exec.h | 7 | generic-y += div64.h |
| 7 | generic-y += trace_clock.h | 8 | generic-y += emergency-restart.h |
| 8 | generic-y += preempt.h | 9 | generic-y += exec.h |
| 9 | generic-y += hash.h | 10 | generic-y += hash.h |
| 11 | generic-y += hw_irq.h | ||
| 12 | generic-y += irq_regs.h | ||
| 13 | generic-y += kdebug.h | ||
| 14 | generic-y += kvm_para.h | ||
| 15 | generic-y += local.h | ||
| 16 | generic-y += local64.h | ||
| 17 | generic-y += mcs_spinlock.h | ||
| 18 | generic-y += mutex.h | ||
| 19 | generic-y += param.h | ||
| 20 | generic-y += percpu.h | ||
| 21 | generic-y += poll.h | ||
| 22 | generic-y += preempt.h | ||
| 23 | generic-y += segment.h | ||
| 24 | generic-y += topology.h | ||
| 25 | generic-y += trace_clock.h | ||
| 26 | generic-y += user.h | ||
| 27 | generic-y += vga.h | ||
| 28 | generic-y += word-at-a-time.h | ||
| 29 | generic-y += xor.h | ||
diff --git a/arch/parisc/include/asm/page.h b/arch/parisc/include/asm/page.h index 637fe031aa84..60d5d174dfe4 100644 --- a/arch/parisc/include/asm/page.h +++ b/arch/parisc/include/asm/page.h | |||
| @@ -32,17 +32,6 @@ void copy_page_asm(void *to, void *from); | |||
| 32 | void copy_user_page(void *vto, void *vfrom, unsigned long vaddr, | 32 | void copy_user_page(void *vto, void *vfrom, unsigned long vaddr, |
| 33 | struct page *pg); | 33 | struct page *pg); |
| 34 | 34 | ||
| 35 | /* #define CONFIG_PARISC_TMPALIAS */ | ||
| 36 | |||
| 37 | #ifdef CONFIG_PARISC_TMPALIAS | ||
| 38 | void clear_user_highpage(struct page *page, unsigned long vaddr); | ||
| 39 | #define clear_user_highpage clear_user_highpage | ||
| 40 | struct vm_area_struct; | ||
| 41 | void copy_user_highpage(struct page *to, struct page *from, | ||
| 42 | unsigned long vaddr, struct vm_area_struct *vma); | ||
| 43 | #define __HAVE_ARCH_COPY_USER_HIGHPAGE | ||
| 44 | #endif | ||
| 45 | |||
| 46 | /* | 35 | /* |
| 47 | * These are used to make use of C type-checking.. | 36 | * These are used to make use of C type-checking.. |
| 48 | */ | 37 | */ |
diff --git a/arch/parisc/include/asm/spinlock.h b/arch/parisc/include/asm/spinlock.h index 3516e0b27044..64f2992e439f 100644 --- a/arch/parisc/include/asm/spinlock.h +++ b/arch/parisc/include/asm/spinlock.h | |||
| @@ -191,8 +191,4 @@ static __inline__ int arch_write_can_lock(arch_rwlock_t *rw) | |||
| 191 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) | 191 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) |
| 192 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) | 192 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) |
| 193 | 193 | ||
| 194 | #define arch_spin_relax(lock) cpu_relax() | ||
| 195 | #define arch_read_relax(lock) cpu_relax() | ||
| 196 | #define arch_write_relax(lock) cpu_relax() | ||
| 197 | |||
| 198 | #endif /* __ASM_SPINLOCK_H */ | 194 | #endif /* __ASM_SPINLOCK_H */ |
diff --git a/arch/parisc/include/uapi/asm/unistd.h b/arch/parisc/include/uapi/asm/unistd.h index 42706794a36f..265ae5190b0a 100644 --- a/arch/parisc/include/uapi/asm/unistd.h +++ b/arch/parisc/include/uapi/asm/unistd.h | |||
| @@ -828,13 +828,13 @@ | |||
| 828 | #define __NR_finit_module (__NR_Linux + 333) | 828 | #define __NR_finit_module (__NR_Linux + 333) |
| 829 | #define __NR_sched_setattr (__NR_Linux + 334) | 829 | #define __NR_sched_setattr (__NR_Linux + 334) |
| 830 | #define __NR_sched_getattr (__NR_Linux + 335) | 830 | #define __NR_sched_getattr (__NR_Linux + 335) |
| 831 | #define __NR_utimes (__NR_Linux + 336) | ||
| 831 | 832 | ||
| 832 | #define __NR_Linux_syscalls (__NR_sched_getattr + 1) | 833 | #define __NR_Linux_syscalls (__NR_utimes + 1) |
| 833 | 834 | ||
| 834 | 835 | ||
| 835 | #define __IGNORE_select /* newselect */ | 836 | #define __IGNORE_select /* newselect */ |
| 836 | #define __IGNORE_fadvise64 /* fadvise64_64 */ | 837 | #define __IGNORE_fadvise64 /* fadvise64_64 */ |
| 837 | #define __IGNORE_utimes /* utime */ | ||
| 838 | 838 | ||
| 839 | 839 | ||
| 840 | #define HPUX_GATEWAY_ADDR 0xC0000004 | 840 | #define HPUX_GATEWAY_ADDR 0xC0000004 |
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c index ac87a40502e6..a6ffc775a9f8 100644 --- a/arch/parisc/kernel/cache.c +++ b/arch/parisc/kernel/cache.c | |||
| @@ -581,67 +581,3 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long | |||
| 581 | __flush_cache_page(vma, vmaddr, PFN_PHYS(pfn)); | 581 | __flush_cache_page(vma, vmaddr, PFN_PHYS(pfn)); |
| 582 | } | 582 | } |
| 583 | } | 583 | } |
| 584 | |||
| 585 | #ifdef CONFIG_PARISC_TMPALIAS | ||
| 586 | |||
| 587 | void clear_user_highpage(struct page *page, unsigned long vaddr) | ||
| 588 | { | ||
| 589 | void *vto; | ||
| 590 | unsigned long flags; | ||
| 591 | |||
| 592 | /* Clear using TMPALIAS region. The page doesn't need to | ||
| 593 | be flushed but the kernel mapping needs to be purged. */ | ||
| 594 | |||
| 595 | vto = kmap_atomic(page); | ||
| 596 | |||
| 597 | /* The PA-RISC 2.0 Architecture book states on page F-6: | ||
| 598 | "Before a write-capable translation is enabled, *all* | ||
| 599 | non-equivalently-aliased translations must be removed | ||
| 600 | from the page table and purged from the TLB. (Note | ||
| 601 | that the caches are not required to be flushed at this | ||
| 602 | time.) Before any non-equivalent aliased translation | ||
| 603 | is re-enabled, the virtual address range for the writeable | ||
| 604 | page (the entire page) must be flushed from the cache, | ||
| 605 | and the write-capable translation removed from the page | ||
| 606 | table and purged from the TLB." */ | ||
| 607 | |||
| 608 | purge_kernel_dcache_page_asm((unsigned long)vto); | ||
| 609 | purge_tlb_start(flags); | ||
| 610 | pdtlb_kernel(vto); | ||
| 611 | purge_tlb_end(flags); | ||
| 612 | preempt_disable(); | ||
| 613 | clear_user_page_asm(vto, vaddr); | ||
| 614 | preempt_enable(); | ||
| 615 | |||
| 616 | pagefault_enable(); /* kunmap_atomic(addr, KM_USER0); */ | ||
| 617 | } | ||
| 618 | |||
| 619 | void copy_user_highpage(struct page *to, struct page *from, | ||
| 620 | unsigned long vaddr, struct vm_area_struct *vma) | ||
| 621 | { | ||
| 622 | void *vfrom, *vto; | ||
| 623 | unsigned long flags; | ||
| 624 | |||
| 625 | /* Copy using TMPALIAS region. This has the advantage | ||
| 626 | that the `from' page doesn't need to be flushed. However, | ||
| 627 | the `to' page must be flushed in copy_user_page_asm since | ||
| 628 | it can be used to bring in executable code. */ | ||
| 629 | |||
| 630 | vfrom = kmap_atomic(from); | ||
| 631 | vto = kmap_atomic(to); | ||
| 632 | |||
| 633 | purge_kernel_dcache_page_asm((unsigned long)vto); | ||
| 634 | purge_tlb_start(flags); | ||
| 635 | pdtlb_kernel(vto); | ||
| 636 | pdtlb_kernel(vfrom); | ||
| 637 | purge_tlb_end(flags); | ||
| 638 | preempt_disable(); | ||
| 639 | copy_user_page_asm(vto, vfrom, vaddr); | ||
| 640 | flush_dcache_page_asm(__pa(vto), vaddr); | ||
| 641 | preempt_enable(); | ||
| 642 | |||
| 643 | pagefault_enable(); /* kunmap_atomic(addr, KM_USER1); */ | ||
| 644 | pagefault_enable(); /* kunmap_atomic(addr, KM_USER0); */ | ||
| 645 | } | ||
| 646 | |||
| 647 | #endif /* CONFIG_PARISC_TMPALIAS */ | ||
diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c index 8ceac4785609..cfe056fe7f5c 100644 --- a/arch/parisc/kernel/irq.c +++ b/arch/parisc/kernel/irq.c | |||
| @@ -117,7 +117,7 @@ int cpu_check_affinity(struct irq_data *d, const struct cpumask *dest) | |||
| 117 | return -EINVAL; | 117 | return -EINVAL; |
| 118 | 118 | ||
| 119 | /* whatever mask they set, we just allow one CPU */ | 119 | /* whatever mask they set, we just allow one CPU */ |
| 120 | cpu_dest = first_cpu(*dest); | 120 | cpu_dest = cpumask_first_and(dest, cpu_online_mask); |
| 121 | 121 | ||
| 122 | return cpu_dest; | 122 | return cpu_dest; |
| 123 | } | 123 | } |
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S index 8fa3fbb3e4d3..80e5dd248934 100644 --- a/arch/parisc/kernel/syscall_table.S +++ b/arch/parisc/kernel/syscall_table.S | |||
| @@ -431,6 +431,7 @@ | |||
| 431 | ENTRY_SAME(finit_module) | 431 | ENTRY_SAME(finit_module) |
| 432 | ENTRY_SAME(sched_setattr) | 432 | ENTRY_SAME(sched_setattr) |
| 433 | ENTRY_SAME(sched_getattr) /* 335 */ | 433 | ENTRY_SAME(sched_getattr) /* 335 */ |
| 434 | ENTRY_COMP(utimes) | ||
| 434 | 435 | ||
| 435 | /* Nothing yet */ | 436 | /* Nothing yet */ |
| 436 | 437 | ||
diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild index 6c0a955a1b06..3fb1bc432f4f 100644 --- a/arch/powerpc/include/asm/Kbuild +++ b/arch/powerpc/include/asm/Kbuild | |||
| @@ -1,7 +1,8 @@ | |||
| 1 | 1 | ||
| 2 | generic-y += clkdev.h | 2 | generic-y += clkdev.h |
| 3 | generic-y += hash.h | ||
| 4 | generic-y += mcs_spinlock.h | ||
| 5 | generic-y += preempt.h | ||
| 3 | generic-y += rwsem.h | 6 | generic-y += rwsem.h |
| 4 | generic-y += trace_clock.h | 7 | generic-y += trace_clock.h |
| 5 | generic-y += preempt.h | ||
| 6 | generic-y += vtime.h | 8 | generic-y += vtime.h |
| 7 | generic-y += hash.h | ||
diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h index 84fdf6857c31..a613d2c82fd9 100644 --- a/arch/powerpc/include/asm/compat.h +++ b/arch/powerpc/include/asm/compat.h | |||
| @@ -200,10 +200,11 @@ static inline void __user *arch_compat_alloc_user_space(long len) | |||
| 200 | 200 | ||
| 201 | /* | 201 | /* |
| 202 | * We can't access below the stack pointer in the 32bit ABI and | 202 | * We can't access below the stack pointer in the 32bit ABI and |
| 203 | * can access 288 bytes in the 64bit ABI | 203 | * can access 288 bytes in the 64bit big-endian ABI, |
| 204 | * or 512 bytes with the new ELFv2 little-endian ABI. | ||
| 204 | */ | 205 | */ |
| 205 | if (!is_32bit_task()) | 206 | if (!is_32bit_task()) |
| 206 | usp -= 288; | 207 | usp -= USER_REDZONE_SIZE; |
| 207 | 208 | ||
| 208 | return (void __user *) (usp - len); | 209 | return (void __user *) (usp - len); |
| 209 | } | 210 | } |
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h index 40157e2ca691..ed82142a3251 100644 --- a/arch/powerpc/include/asm/opal.h +++ b/arch/powerpc/include/asm/opal.h | |||
| @@ -816,8 +816,8 @@ int64_t opal_pci_next_error(uint64_t phb_id, uint64_t *first_frozen_pe, | |||
| 816 | int64_t opal_pci_poll(uint64_t phb_id); | 816 | int64_t opal_pci_poll(uint64_t phb_id); |
| 817 | int64_t opal_return_cpu(void); | 817 | int64_t opal_return_cpu(void); |
| 818 | 818 | ||
| 819 | int64_t opal_xscom_read(uint32_t gcid, uint32_t pcb_addr, __be64 *val); | 819 | int64_t opal_xscom_read(uint32_t gcid, uint64_t pcb_addr, __be64 *val); |
| 820 | int64_t opal_xscom_write(uint32_t gcid, uint32_t pcb_addr, uint64_t val); | 820 | int64_t opal_xscom_write(uint32_t gcid, uint64_t pcb_addr, uint64_t val); |
| 821 | 821 | ||
| 822 | int64_t opal_lpc_write(uint32_t chip_id, enum OpalLPCAddressType addr_type, | 822 | int64_t opal_lpc_write(uint32_t chip_id, enum OpalLPCAddressType addr_type, |
| 823 | uint32_t addr, uint32_t data, uint32_t sz); | 823 | uint32_t addr, uint32_t data, uint32_t sz); |
diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h index becc08e6a65c..279b80f3bb29 100644 --- a/arch/powerpc/include/asm/ptrace.h +++ b/arch/powerpc/include/asm/ptrace.h | |||
| @@ -28,11 +28,23 @@ | |||
| 28 | 28 | ||
| 29 | #ifdef __powerpc64__ | 29 | #ifdef __powerpc64__ |
| 30 | 30 | ||
| 31 | /* | ||
| 32 | * Size of redzone that userspace is allowed to use below the stack | ||
| 33 | * pointer. This is 288 in the 64-bit big-endian ELF ABI, and 512 in | ||
| 34 | * the new ELFv2 little-endian ABI, so we allow the larger amount. | ||
| 35 | * | ||
| 36 | * For kernel code we allow a 288-byte redzone, in order to conserve | ||
| 37 | * kernel stack space; gcc currently only uses 288 bytes, and will | ||
| 38 | * hopefully allow explicit control of the redzone size in future. | ||
| 39 | */ | ||
| 40 | #define USER_REDZONE_SIZE 512 | ||
| 41 | #define KERNEL_REDZONE_SIZE 288 | ||
| 42 | |||
| 31 | #define STACK_FRAME_OVERHEAD 112 /* size of minimum stack frame */ | 43 | #define STACK_FRAME_OVERHEAD 112 /* size of minimum stack frame */ |
| 32 | #define STACK_FRAME_LR_SAVE 2 /* Location of LR in stack frame */ | 44 | #define STACK_FRAME_LR_SAVE 2 /* Location of LR in stack frame */ |
| 33 | #define STACK_FRAME_REGS_MARKER ASM_CONST(0x7265677368657265) | 45 | #define STACK_FRAME_REGS_MARKER ASM_CONST(0x7265677368657265) |
| 34 | #define STACK_INT_FRAME_SIZE (sizeof(struct pt_regs) + \ | 46 | #define STACK_INT_FRAME_SIZE (sizeof(struct pt_regs) + \ |
| 35 | STACK_FRAME_OVERHEAD + 288) | 47 | STACK_FRAME_OVERHEAD + KERNEL_REDZONE_SIZE) |
| 36 | #define STACK_FRAME_MARKER 12 | 48 | #define STACK_FRAME_MARKER 12 |
| 37 | 49 | ||
| 38 | /* Size of dummy stack frame allocated when calling signal handler. */ | 50 | /* Size of dummy stack frame allocated when calling signal handler. */ |
| @@ -41,6 +53,8 @@ | |||
| 41 | 53 | ||
| 42 | #else /* __powerpc64__ */ | 54 | #else /* __powerpc64__ */ |
| 43 | 55 | ||
| 56 | #define USER_REDZONE_SIZE 0 | ||
| 57 | #define KERNEL_REDZONE_SIZE 0 | ||
| 44 | #define STACK_FRAME_OVERHEAD 16 /* size of minimum stack frame */ | 58 | #define STACK_FRAME_OVERHEAD 16 /* size of minimum stack frame */ |
| 45 | #define STACK_FRAME_LR_SAVE 1 /* Location of LR in stack frame */ | 59 | #define STACK_FRAME_LR_SAVE 1 /* Location of LR in stack frame */ |
| 46 | #define STACK_FRAME_REGS_MARKER ASM_CONST(0x72656773) | 60 | #define STACK_FRAME_REGS_MARKER ASM_CONST(0x72656773) |
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h index d0b5fca6b077..c9202151079f 100644 --- a/arch/powerpc/include/asm/topology.h +++ b/arch/powerpc/include/asm/topology.h | |||
| @@ -99,7 +99,6 @@ static inline int prrn_is_enabled(void) | |||
| 99 | 99 | ||
| 100 | #ifdef CONFIG_SMP | 100 | #ifdef CONFIG_SMP |
| 101 | #include <asm/cputable.h> | 101 | #include <asm/cputable.h> |
| 102 | #define smt_capable() (cpu_has_feature(CPU_FTR_SMT)) | ||
| 103 | 102 | ||
| 104 | #ifdef CONFIG_PPC64 | 103 | #ifdef CONFIG_PPC64 |
| 105 | #include <asm/smp.h> | 104 | #include <asm/smp.h> |
diff --git a/arch/powerpc/kernel/crash_dump.c b/arch/powerpc/kernel/crash_dump.c index 11c1d069d920..7a13f378ca2c 100644 --- a/arch/powerpc/kernel/crash_dump.c +++ b/arch/powerpc/kernel/crash_dump.c | |||
| @@ -98,17 +98,19 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf, | |||
| 98 | size_t csize, unsigned long offset, int userbuf) | 98 | size_t csize, unsigned long offset, int userbuf) |
| 99 | { | 99 | { |
| 100 | void *vaddr; | 100 | void *vaddr; |
| 101 | phys_addr_t paddr; | ||
| 101 | 102 | ||
| 102 | if (!csize) | 103 | if (!csize) |
| 103 | return 0; | 104 | return 0; |
| 104 | 105 | ||
| 105 | csize = min_t(size_t, csize, PAGE_SIZE); | 106 | csize = min_t(size_t, csize, PAGE_SIZE); |
| 107 | paddr = pfn << PAGE_SHIFT; | ||
| 106 | 108 | ||
| 107 | if ((min_low_pfn < pfn) && (pfn < max_pfn)) { | 109 | if (memblock_is_region_memory(paddr, csize)) { |
| 108 | vaddr = __va(pfn << PAGE_SHIFT); | 110 | vaddr = __va(paddr); |
| 109 | csize = copy_oldmem_vaddr(vaddr, buf, csize, offset, userbuf); | 111 | csize = copy_oldmem_vaddr(vaddr, buf, csize, offset, userbuf); |
| 110 | } else { | 112 | } else { |
| 111 | vaddr = __ioremap(pfn << PAGE_SHIFT, PAGE_SIZE, 0); | 113 | vaddr = __ioremap(paddr, PAGE_SIZE, 0); |
| 112 | csize = copy_oldmem_vaddr(vaddr, buf, csize, offset, userbuf); | 114 | csize = copy_oldmem_vaddr(vaddr, buf, csize, offset, userbuf); |
| 113 | iounmap(vaddr); | 115 | iounmap(vaddr); |
| 114 | } | 116 | } |
diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c index fdc679d309ec..bb61ca58ca6d 100644 --- a/arch/powerpc/kernel/eeh_driver.c +++ b/arch/powerpc/kernel/eeh_driver.c | |||
| @@ -143,13 +143,30 @@ static void eeh_disable_irq(struct pci_dev *dev) | |||
| 143 | static void eeh_enable_irq(struct pci_dev *dev) | 143 | static void eeh_enable_irq(struct pci_dev *dev) |
| 144 | { | 144 | { |
| 145 | struct eeh_dev *edev = pci_dev_to_eeh_dev(dev); | 145 | struct eeh_dev *edev = pci_dev_to_eeh_dev(dev); |
| 146 | struct irq_desc *desc; | ||
| 147 | 146 | ||
| 148 | if ((edev->mode) & EEH_DEV_IRQ_DISABLED) { | 147 | if ((edev->mode) & EEH_DEV_IRQ_DISABLED) { |
| 149 | edev->mode &= ~EEH_DEV_IRQ_DISABLED; | 148 | edev->mode &= ~EEH_DEV_IRQ_DISABLED; |
| 150 | 149 | /* | |
| 151 | desc = irq_to_desc(dev->irq); | 150 | * FIXME !!!!! |
| 152 | if (desc && desc->depth > 0) | 151 | * |
| 152 | * This is just ass backwards. This maze has | ||
| 153 | * unbalanced irq_enable/disable calls. So instead of | ||
| 154 | * finding the root cause it works around the warning | ||
| 155 | * in the irq_enable code by conditionally calling | ||
| 156 | * into it. | ||
| 157 | * | ||
| 158 | * That's just wrong.The warning in the core code is | ||
| 159 | * there to tell people to fix their assymetries in | ||
| 160 | * their own code, not by abusing the core information | ||
| 161 | * to avoid it. | ||
| 162 | * | ||
| 163 | * I so wish that the assymetry would be the other way | ||
| 164 | * round and a few more irq_disable calls render that | ||
| 165 | * shit unusable forever. | ||
| 166 | * | ||
| 167 | * tglx | ||
| 168 | */ | ||
| 169 | if (irqd_irq_disabled(irq_get_irq_data(dev->irq))) | ||
| 153 | enable_irq(dev->irq); | 170 | enable_irq(dev->irq); |
| 154 | } | 171 | } |
| 155 | } | 172 | } |
diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c index 9b27b293a922..b0ded97ee4e1 100644 --- a/arch/powerpc/kernel/ftrace.c +++ b/arch/powerpc/kernel/ftrace.c | |||
| @@ -74,6 +74,7 @@ ftrace_modify_code(unsigned long ip, unsigned int old, unsigned int new) | |||
| 74 | */ | 74 | */ |
| 75 | static int test_24bit_addr(unsigned long ip, unsigned long addr) | 75 | static int test_24bit_addr(unsigned long ip, unsigned long addr) |
| 76 | { | 76 | { |
| 77 | addr = ppc_function_entry((void *)addr); | ||
| 77 | 78 | ||
| 78 | /* use the create_branch to verify that this offset can be branched */ | 79 | /* use the create_branch to verify that this offset can be branched */ |
| 79 | return create_branch((unsigned int *)ip, addr, 0); | 80 | return create_branch((unsigned int *)ip, addr, 0); |
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 1d0848bba049..ca1cd7459c4a 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
| @@ -465,7 +465,6 @@ static inline void check_stack_overflow(void) | |||
| 465 | 465 | ||
| 466 | void __do_irq(struct pt_regs *regs) | 466 | void __do_irq(struct pt_regs *regs) |
| 467 | { | 467 | { |
| 468 | struct irq_desc *desc; | ||
| 469 | unsigned int irq; | 468 | unsigned int irq; |
| 470 | 469 | ||
| 471 | irq_enter(); | 470 | irq_enter(); |
| @@ -487,11 +486,8 @@ void __do_irq(struct pt_regs *regs) | |||
| 487 | /* And finally process it */ | 486 | /* And finally process it */ |
| 488 | if (unlikely(irq == NO_IRQ)) | 487 | if (unlikely(irq == NO_IRQ)) |
| 489 | __get_cpu_var(irq_stat).spurious_irqs++; | 488 | __get_cpu_var(irq_stat).spurious_irqs++; |
| 490 | else { | 489 | else |
| 491 | desc = irq_to_desc(irq); | 490 | generic_handle_irq(irq); |
| 492 | if (likely(desc)) | ||
| 493 | desc->handle_irq(irq, desc); | ||
| 494 | } | ||
| 495 | 491 | ||
| 496 | trace_irq_exit(regs); | 492 | trace_irq_exit(regs); |
| 497 | 493 | ||
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 8d4c247f1738..af064d28b365 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
| @@ -1048,6 +1048,15 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) | |||
| 1048 | flush_altivec_to_thread(src); | 1048 | flush_altivec_to_thread(src); |
| 1049 | flush_vsx_to_thread(src); | 1049 | flush_vsx_to_thread(src); |
| 1050 | flush_spe_to_thread(src); | 1050 | flush_spe_to_thread(src); |
| 1051 | /* | ||
| 1052 | * Flush TM state out so we can copy it. __switch_to_tm() does this | ||
| 1053 | * flush but it removes the checkpointed state from the current CPU and | ||
| 1054 | * transitions the CPU out of TM mode. Hence we need to call | ||
| 1055 | * tm_recheckpoint_new_task() (on the same task) to restore the | ||
| 1056 | * checkpointed state back and the TM mode. | ||
| 1057 | */ | ||
| 1058 | __switch_to_tm(src); | ||
| 1059 | tm_recheckpoint_new_task(src); | ||
| 1051 | 1060 | ||
| 1052 | *dst = *src; | 1061 | *dst = *src; |
| 1053 | 1062 | ||
diff --git a/arch/powerpc/kernel/reloc_64.S b/arch/powerpc/kernel/reloc_64.S index 1482327cfeba..d88736fbece6 100644 --- a/arch/powerpc/kernel/reloc_64.S +++ b/arch/powerpc/kernel/reloc_64.S | |||
| @@ -81,6 +81,7 @@ _GLOBAL(relocate) | |||
| 81 | 81 | ||
| 82 | 6: blr | 82 | 6: blr |
| 83 | 83 | ||
| 84 | .balign 8 | ||
| 84 | p_dyn: .llong __dynamic_start - 0b | 85 | p_dyn: .llong __dynamic_start - 0b |
| 85 | p_rela: .llong __rela_dyn_start - 0b | 86 | p_rela: .llong __rela_dyn_start - 0b |
| 86 | p_st: .llong _stext - 0b | 87 | p_st: .llong _stext - 0b |
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index e35bf773df7a..8d253c29649b 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c | |||
| @@ -65,8 +65,8 @@ struct rt_sigframe { | |||
| 65 | struct siginfo __user *pinfo; | 65 | struct siginfo __user *pinfo; |
| 66 | void __user *puc; | 66 | void __user *puc; |
| 67 | struct siginfo info; | 67 | struct siginfo info; |
| 68 | /* 64 bit ABI allows for 288 bytes below sp before decrementing it. */ | 68 | /* New 64 bit little-endian ABI allows redzone of 512 bytes below sp */ |
| 69 | char abigap[288]; | 69 | char abigap[USER_REDZONE_SIZE]; |
| 70 | } __attribute__ ((aligned (16))); | 70 | } __attribute__ ((aligned (16))); |
| 71 | 71 | ||
| 72 | static const char fmt32[] = KERN_INFO \ | 72 | static const char fmt32[] = KERN_INFO \ |
diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S index e66d4ec04d95..818dce344e82 100644 --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S | |||
| @@ -1504,73 +1504,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S) | |||
| 1504 | 1: addi r8,r8,16 | 1504 | 1: addi r8,r8,16 |
| 1505 | .endr | 1505 | .endr |
| 1506 | 1506 | ||
| 1507 | /* Save DEC */ | ||
| 1508 | mfspr r5,SPRN_DEC | ||
| 1509 | mftb r6 | ||
| 1510 | extsw r5,r5 | ||
| 1511 | add r5,r5,r6 | ||
| 1512 | std r5,VCPU_DEC_EXPIRES(r9) | ||
| 1513 | |||
| 1514 | BEGIN_FTR_SECTION | ||
| 1515 | b 8f | ||
| 1516 | END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S) | ||
| 1517 | /* Turn on TM so we can access TFHAR/TFIAR/TEXASR */ | ||
| 1518 | mfmsr r8 | ||
| 1519 | li r0, 1 | ||
| 1520 | rldimi r8, r0, MSR_TM_LG, 63-MSR_TM_LG | ||
| 1521 | mtmsrd r8 | ||
| 1522 | |||
| 1523 | /* Save POWER8-specific registers */ | ||
| 1524 | mfspr r5, SPRN_IAMR | ||
| 1525 | mfspr r6, SPRN_PSPB | ||
| 1526 | mfspr r7, SPRN_FSCR | ||
| 1527 | std r5, VCPU_IAMR(r9) | ||
| 1528 | stw r6, VCPU_PSPB(r9) | ||
| 1529 | std r7, VCPU_FSCR(r9) | ||
| 1530 | mfspr r5, SPRN_IC | ||
| 1531 | mfspr r6, SPRN_VTB | ||
| 1532 | mfspr r7, SPRN_TAR | ||
| 1533 | std r5, VCPU_IC(r9) | ||
| 1534 | std r6, VCPU_VTB(r9) | ||
| 1535 | std r7, VCPU_TAR(r9) | ||
| 1536 | #ifdef CONFIG_PPC_TRANSACTIONAL_MEM | ||
| 1537 | mfspr r5, SPRN_TFHAR | ||
| 1538 | mfspr r6, SPRN_TFIAR | ||
| 1539 | mfspr r7, SPRN_TEXASR | ||
| 1540 | std r5, VCPU_TFHAR(r9) | ||
| 1541 | std r6, VCPU_TFIAR(r9) | ||
| 1542 | std r7, VCPU_TEXASR(r9) | ||
| 1543 | #endif | ||
| 1544 | mfspr r8, SPRN_EBBHR | ||
| 1545 | std r8, VCPU_EBBHR(r9) | ||
| 1546 | mfspr r5, SPRN_EBBRR | ||
| 1547 | mfspr r6, SPRN_BESCR | ||
| 1548 | mfspr r7, SPRN_CSIGR | ||
| 1549 | mfspr r8, SPRN_TACR | ||
| 1550 | std r5, VCPU_EBBRR(r9) | ||
| 1551 | std r6, VCPU_BESCR(r9) | ||
| 1552 | std r7, VCPU_CSIGR(r9) | ||
| 1553 | std r8, VCPU_TACR(r9) | ||
| 1554 | mfspr r5, SPRN_TCSCR | ||
| 1555 | mfspr r6, SPRN_ACOP | ||
| 1556 | mfspr r7, SPRN_PID | ||
| 1557 | mfspr r8, SPRN_WORT | ||
| 1558 | std r5, VCPU_TCSCR(r9) | ||
| 1559 | std r6, VCPU_ACOP(r9) | ||
| 1560 | stw r7, VCPU_GUEST_PID(r9) | ||
| 1561 | std r8, VCPU_WORT(r9) | ||
| 1562 | 8: | ||
| 1563 | |||
| 1564 | /* Save and reset AMR and UAMOR before turning on the MMU */ | ||
| 1565 | BEGIN_FTR_SECTION | ||
| 1566 | mfspr r5,SPRN_AMR | ||
| 1567 | mfspr r6,SPRN_UAMOR | ||
| 1568 | std r5,VCPU_AMR(r9) | ||
| 1569 | std r6,VCPU_UAMOR(r9) | ||
| 1570 | li r6,0 | ||
| 1571 | mtspr SPRN_AMR,r6 | ||
| 1572 | END_FTR_SECTION_IFSET(CPU_FTR_ARCH_206) | ||
| 1573 | |||
| 1574 | /* Unset guest mode */ | 1507 | /* Unset guest mode */ |
| 1575 | li r0, KVM_GUEST_MODE_NONE | 1508 | li r0, KVM_GUEST_MODE_NONE |
| 1576 | stb r0, HSTATE_IN_GUEST(r13) | 1509 | stb r0, HSTATE_IN_GUEST(r13) |
| @@ -2203,7 +2136,7 @@ BEGIN_FTR_SECTION | |||
| 2203 | END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) | 2136 | END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) |
| 2204 | #endif | 2137 | #endif |
| 2205 | mfspr r6,SPRN_VRSAVE | 2138 | mfspr r6,SPRN_VRSAVE |
| 2206 | stw r6,VCPU_VRSAVE(r3) | 2139 | stw r6,VCPU_VRSAVE(r31) |
| 2207 | mtlr r30 | 2140 | mtlr r30 |
| 2208 | mtmsrd r5 | 2141 | mtmsrd r5 |
| 2209 | isync | 2142 | isync |
| @@ -2240,7 +2173,7 @@ BEGIN_FTR_SECTION | |||
| 2240 | bl .load_vr_state | 2173 | bl .load_vr_state |
| 2241 | END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) | 2174 | END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) |
| 2242 | #endif | 2175 | #endif |
| 2243 | lwz r7,VCPU_VRSAVE(r4) | 2176 | lwz r7,VCPU_VRSAVE(r31) |
| 2244 | mtspr SPRN_VRSAVE,r7 | 2177 | mtspr SPRN_VRSAVE,r7 |
| 2245 | mtlr r30 | 2178 | mtlr r30 |
| 2246 | mr r4,r31 | 2179 | mr r4,r31 |
diff --git a/arch/powerpc/platforms/cell/ras.c b/arch/powerpc/platforms/cell/ras.c index 5ec1e47a0d77..e865d748179b 100644 --- a/arch/powerpc/platforms/cell/ras.c +++ b/arch/powerpc/platforms/cell/ras.c | |||
| @@ -123,7 +123,8 @@ static int __init cbe_ptcal_enable_on_node(int nid, int order) | |||
| 123 | 123 | ||
| 124 | area->nid = nid; | 124 | area->nid = nid; |
| 125 | area->order = order; | 125 | area->order = order; |
| 126 | area->pages = alloc_pages_exact_node(area->nid, GFP_KERNEL|GFP_THISNODE, | 126 | area->pages = alloc_pages_exact_node(area->nid, |
| 127 | GFP_KERNEL|__GFP_THISNODE, | ||
| 127 | area->order); | 128 | area->order); |
| 128 | 129 | ||
| 129 | if (!area->pages) { | 130 | if (!area->pages) { |
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c index 49318385d4fa..4a0a64fe25df 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c | |||
| @@ -83,7 +83,6 @@ static struct timer_list spuloadavg_timer; | |||
| 83 | #define MIN_SPU_TIMESLICE max(5 * HZ / (1000 * SPUSCHED_TICK), 1) | 83 | #define MIN_SPU_TIMESLICE max(5 * HZ / (1000 * SPUSCHED_TICK), 1) |
| 84 | #define DEF_SPU_TIMESLICE (100 * HZ / (1000 * SPUSCHED_TICK)) | 84 | #define DEF_SPU_TIMESLICE (100 * HZ / (1000 * SPUSCHED_TICK)) |
| 85 | 85 | ||
| 86 | #define MAX_USER_PRIO (MAX_PRIO - MAX_RT_PRIO) | ||
| 87 | #define SCALE_PRIO(x, prio) \ | 86 | #define SCALE_PRIO(x, prio) \ |
| 88 | max(x * (MAX_PRIO - prio) / (MAX_USER_PRIO / 2), MIN_SPU_TIMESLICE) | 87 | max(x * (MAX_PRIO - prio) / (MAX_USER_PRIO / 2), MIN_SPU_TIMESLICE) |
| 89 | 88 | ||
diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c index f51474336460..253fefe3d1a0 100644 --- a/arch/powerpc/platforms/powernv/eeh-ioda.c +++ b/arch/powerpc/platforms/powernv/eeh-ioda.c | |||
| @@ -114,6 +114,7 @@ DEFINE_SIMPLE_ATTRIBUTE(ioda_eeh_inbB_dbgfs_ops, ioda_eeh_inbB_dbgfs_get, | |||
| 114 | ioda_eeh_inbB_dbgfs_set, "0x%llx\n"); | 114 | ioda_eeh_inbB_dbgfs_set, "0x%llx\n"); |
| 115 | #endif /* CONFIG_DEBUG_FS */ | 115 | #endif /* CONFIG_DEBUG_FS */ |
| 116 | 116 | ||
| 117 | |||
| 117 | /** | 118 | /** |
| 118 | * ioda_eeh_post_init - Chip dependent post initialization | 119 | * ioda_eeh_post_init - Chip dependent post initialization |
| 119 | * @hose: PCI controller | 120 | * @hose: PCI controller |
| @@ -221,6 +222,22 @@ static int ioda_eeh_set_option(struct eeh_pe *pe, int option) | |||
| 221 | return ret; | 222 | return ret; |
| 222 | } | 223 | } |
| 223 | 224 | ||
| 225 | static void ioda_eeh_phb_diag(struct pci_controller *hose) | ||
| 226 | { | ||
| 227 | struct pnv_phb *phb = hose->private_data; | ||
| 228 | long rc; | ||
| 229 | |||
| 230 | rc = opal_pci_get_phb_diag_data2(phb->opal_id, phb->diag.blob, | ||
| 231 | PNV_PCI_DIAG_BUF_SIZE); | ||
| 232 | if (rc != OPAL_SUCCESS) { | ||
| 233 | pr_warning("%s: Failed to get diag-data for PHB#%x (%ld)\n", | ||
| 234 | __func__, hose->global_number, rc); | ||
| 235 | return; | ||
| 236 | } | ||
| 237 | |||
| 238 | pnv_pci_dump_phb_diag_data(hose, phb->diag.blob); | ||
| 239 | } | ||
| 240 | |||
| 224 | /** | 241 | /** |
| 225 | * ioda_eeh_get_state - Retrieve the state of PE | 242 | * ioda_eeh_get_state - Retrieve the state of PE |
| 226 | * @pe: EEH PE | 243 | * @pe: EEH PE |
| @@ -272,6 +289,9 @@ static int ioda_eeh_get_state(struct eeh_pe *pe) | |||
| 272 | result |= EEH_STATE_DMA_ACTIVE; | 289 | result |= EEH_STATE_DMA_ACTIVE; |
| 273 | result |= EEH_STATE_MMIO_ENABLED; | 290 | result |= EEH_STATE_MMIO_ENABLED; |
| 274 | result |= EEH_STATE_DMA_ENABLED; | 291 | result |= EEH_STATE_DMA_ENABLED; |
| 292 | } else if (!(pe->state & EEH_PE_ISOLATED)) { | ||
| 293 | eeh_pe_state_mark(pe, EEH_PE_ISOLATED); | ||
| 294 | ioda_eeh_phb_diag(hose); | ||
| 275 | } | 295 | } |
| 276 | 296 | ||
| 277 | return result; | 297 | return result; |
| @@ -315,6 +335,15 @@ static int ioda_eeh_get_state(struct eeh_pe *pe) | |||
| 315 | __func__, fstate, hose->global_number, pe_no); | 335 | __func__, fstate, hose->global_number, pe_no); |
| 316 | } | 336 | } |
| 317 | 337 | ||
| 338 | /* Dump PHB diag-data for frozen PE */ | ||
| 339 | if (result != EEH_STATE_NOT_SUPPORT && | ||
| 340 | (result & (EEH_STATE_MMIO_ACTIVE | EEH_STATE_DMA_ACTIVE)) != | ||
| 341 | (EEH_STATE_MMIO_ACTIVE | EEH_STATE_DMA_ACTIVE) && | ||
| 342 | !(pe->state & EEH_PE_ISOLATED)) { | ||
| 343 | eeh_pe_state_mark(pe, EEH_PE_ISOLATED); | ||
| 344 | ioda_eeh_phb_diag(hose); | ||
| 345 | } | ||
| 346 | |||
| 318 | return result; | 347 | return result; |
| 319 | } | 348 | } |
| 320 | 349 | ||
| @@ -530,42 +559,6 @@ static int ioda_eeh_reset(struct eeh_pe *pe, int option) | |||
| 530 | } | 559 | } |
| 531 | 560 | ||
| 532 | /** | 561 | /** |
| 533 | * ioda_eeh_get_log - Retrieve error log | ||
| 534 | * @pe: EEH PE | ||
| 535 | * @severity: Severity level of the log | ||
| 536 | * @drv_log: buffer to store the log | ||
| 537 | * @len: space of the log buffer | ||
| 538 | * | ||
| 539 | * The function is used to retrieve error log from P7IOC. | ||
| 540 | */ | ||
| 541 | static int ioda_eeh_get_log(struct eeh_pe *pe, int severity, | ||
| 542 | char *drv_log, unsigned long len) | ||
| 543 | { | ||
| 544 | s64 ret; | ||
| 545 | unsigned long flags; | ||
| 546 | struct pci_controller *hose = pe->phb; | ||
| 547 | struct pnv_phb *phb = hose->private_data; | ||
| 548 | |||
| 549 | spin_lock_irqsave(&phb->lock, flags); | ||
| 550 | |||
| 551 | ret = opal_pci_get_phb_diag_data2(phb->opal_id, | ||
| 552 | phb->diag.blob, PNV_PCI_DIAG_BUF_SIZE); | ||
| 553 | if (ret) { | ||
| 554 | spin_unlock_irqrestore(&phb->lock, flags); | ||
| 555 | pr_warning("%s: Can't get log for PHB#%x-PE#%x (%lld)\n", | ||
| 556 | __func__, hose->global_number, pe->addr, ret); | ||
| 557 | return -EIO; | ||
| 558 | } | ||
| 559 | |||
| 560 | /* The PHB diag-data is always indicative */ | ||
| 561 | pnv_pci_dump_phb_diag_data(hose, phb->diag.blob); | ||
| 562 | |||
| 563 | spin_unlock_irqrestore(&phb->lock, flags); | ||
| 564 | |||
| 565 | return 0; | ||
| 566 | } | ||
| 567 | |||
| 568 | /** | ||
| 569 | * ioda_eeh_configure_bridge - Configure the PCI bridges for the indicated PE | 562 | * ioda_eeh_configure_bridge - Configure the PCI bridges for the indicated PE |
| 570 | * @pe: EEH PE | 563 | * @pe: EEH PE |
| 571 | * | 564 | * |
| @@ -646,22 +639,6 @@ static void ioda_eeh_hub_diag(struct pci_controller *hose) | |||
| 646 | } | 639 | } |
| 647 | } | 640 | } |
| 648 | 641 | ||
| 649 | static void ioda_eeh_phb_diag(struct pci_controller *hose) | ||
| 650 | { | ||
| 651 | struct pnv_phb *phb = hose->private_data; | ||
| 652 | long rc; | ||
| 653 | |||
| 654 | rc = opal_pci_get_phb_diag_data2(phb->opal_id, phb->diag.blob, | ||
| 655 | PNV_PCI_DIAG_BUF_SIZE); | ||
| 656 | if (rc != OPAL_SUCCESS) { | ||
| 657 | pr_warning("%s: Failed to get diag-data for PHB#%x (%ld)\n", | ||
| 658 | __func__, hose->global_number, rc); | ||
| 659 | return; | ||
| 660 | } | ||
| 661 | |||
| 662 | pnv_pci_dump_phb_diag_data(hose, phb->diag.blob); | ||
| 663 | } | ||
| 664 | |||
| 665 | static int ioda_eeh_get_phb_pe(struct pci_controller *hose, | 642 | static int ioda_eeh_get_phb_pe(struct pci_controller *hose, |
| 666 | struct eeh_pe **pe) | 643 | struct eeh_pe **pe) |
| 667 | { | 644 | { |
| @@ -835,6 +812,20 @@ static int ioda_eeh_next_error(struct eeh_pe **pe) | |||
| 835 | } | 812 | } |
| 836 | 813 | ||
| 837 | /* | 814 | /* |
| 815 | * EEH core will try recover from fenced PHB or | ||
| 816 | * frozen PE. In the time for frozen PE, EEH core | ||
| 817 | * enable IO path for that before collecting logs, | ||
| 818 | * but it ruins the site. So we have to dump the | ||
| 819 | * log in advance here. | ||
| 820 | */ | ||
| 821 | if ((ret == EEH_NEXT_ERR_FROZEN_PE || | ||
| 822 | ret == EEH_NEXT_ERR_FENCED_PHB) && | ||
| 823 | !((*pe)->state & EEH_PE_ISOLATED)) { | ||
| 824 | eeh_pe_state_mark(*pe, EEH_PE_ISOLATED); | ||
| 825 | ioda_eeh_phb_diag(hose); | ||
| 826 | } | ||
| 827 | |||
| 828 | /* | ||
| 838 | * If we have no errors on the specific PHB or only | 829 | * If we have no errors on the specific PHB or only |
| 839 | * informative error there, we continue poking it. | 830 | * informative error there, we continue poking it. |
| 840 | * Otherwise, we need actions to be taken by upper | 831 | * Otherwise, we need actions to be taken by upper |
| @@ -852,7 +843,6 @@ struct pnv_eeh_ops ioda_eeh_ops = { | |||
| 852 | .set_option = ioda_eeh_set_option, | 843 | .set_option = ioda_eeh_set_option, |
| 853 | .get_state = ioda_eeh_get_state, | 844 | .get_state = ioda_eeh_get_state, |
| 854 | .reset = ioda_eeh_reset, | 845 | .reset = ioda_eeh_reset, |
| 855 | .get_log = ioda_eeh_get_log, | ||
| 856 | .configure_bridge = ioda_eeh_configure_bridge, | 846 | .configure_bridge = ioda_eeh_configure_bridge, |
| 857 | .next_error = ioda_eeh_next_error | 847 | .next_error = ioda_eeh_next_error |
| 858 | }; | 848 | }; |
diff --git a/arch/powerpc/platforms/powernv/opal-xscom.c b/arch/powerpc/platforms/powernv/opal-xscom.c index 4fbf276ac99e..4cd2ea6c0dbe 100644 --- a/arch/powerpc/platforms/powernv/opal-xscom.c +++ b/arch/powerpc/platforms/powernv/opal-xscom.c | |||
| @@ -71,11 +71,11 @@ static int opal_xscom_err_xlate(int64_t rc) | |||
| 71 | } | 71 | } |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | static u64 opal_scom_unmangle(u64 reg) | 74 | static u64 opal_scom_unmangle(u64 addr) |
| 75 | { | 75 | { |
| 76 | /* | 76 | /* |
| 77 | * XSCOM indirect addresses have the top bit set. Additionally | 77 | * XSCOM indirect addresses have the top bit set. Additionally |
| 78 | * the reset of the top 3 nibbles is always 0. | 78 | * the rest of the top 3 nibbles is always 0. |
| 79 | * | 79 | * |
| 80 | * Because the debugfs interface uses signed offsets and shifts | 80 | * Because the debugfs interface uses signed offsets and shifts |
| 81 | * the address left by 3, we basically cannot use the top 4 bits | 81 | * the address left by 3, we basically cannot use the top 4 bits |
| @@ -86,10 +86,13 @@ static u64 opal_scom_unmangle(u64 reg) | |||
| 86 | * conversion here. To leave room for further xscom address | 86 | * conversion here. To leave room for further xscom address |
| 87 | * expansion, we only clear out the top byte | 87 | * expansion, we only clear out the top byte |
| 88 | * | 88 | * |
| 89 | * For in-kernel use, we also support the real indirect bit, so | ||
| 90 | * we test for any of the top 5 bits | ||
| 91 | * | ||
| 89 | */ | 92 | */ |
| 90 | if (reg & (1ull << 59)) | 93 | if (addr & (0x1full << 59)) |
| 91 | reg = (reg & ~(0xffull << 56)) | (1ull << 63); | 94 | addr = (addr & ~(0xffull << 56)) | (1ull << 63); |
| 92 | return reg; | 95 | return addr; |
| 93 | } | 96 | } |
| 94 | 97 | ||
| 95 | static int opal_scom_read(scom_map_t map, u64 reg, u64 *value) | 98 | static int opal_scom_read(scom_map_t map, u64 reg, u64 *value) |
| @@ -98,8 +101,8 @@ static int opal_scom_read(scom_map_t map, u64 reg, u64 *value) | |||
| 98 | int64_t rc; | 101 | int64_t rc; |
| 99 | __be64 v; | 102 | __be64 v; |
| 100 | 103 | ||
| 101 | reg = opal_scom_unmangle(reg); | 104 | reg = opal_scom_unmangle(m->addr + reg); |
| 102 | rc = opal_xscom_read(m->chip, m->addr + reg, (__be64 *)__pa(&v)); | 105 | rc = opal_xscom_read(m->chip, reg, (__be64 *)__pa(&v)); |
| 103 | *value = be64_to_cpu(v); | 106 | *value = be64_to_cpu(v); |
| 104 | return opal_xscom_err_xlate(rc); | 107 | return opal_xscom_err_xlate(rc); |
| 105 | } | 108 | } |
| @@ -109,8 +112,8 @@ static int opal_scom_write(scom_map_t map, u64 reg, u64 value) | |||
| 109 | struct opal_scom_map *m = map; | 112 | struct opal_scom_map *m = map; |
| 110 | int64_t rc; | 113 | int64_t rc; |
| 111 | 114 | ||
| 112 | reg = opal_scom_unmangle(reg); | 115 | reg = opal_scom_unmangle(m->addr + reg); |
| 113 | rc = opal_xscom_write(m->chip, m->addr + reg, value); | 116 | rc = opal_xscom_write(m->chip, reg, value); |
| 114 | return opal_xscom_err_xlate(rc); | 117 | return opal_xscom_err_xlate(rc); |
| 115 | } | 118 | } |
| 116 | 119 | ||
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index 95633d79ef5d..8518817dcdfd 100644 --- a/arch/powerpc/platforms/powernv/pci.c +++ b/arch/powerpc/platforms/powernv/pci.c | |||
| @@ -134,57 +134,72 @@ static void pnv_pci_dump_p7ioc_diag_data(struct pci_controller *hose, | |||
| 134 | pr_info("P7IOC PHB#%d Diag-data (Version: %d)\n\n", | 134 | pr_info("P7IOC PHB#%d Diag-data (Version: %d)\n\n", |
| 135 | hose->global_number, common->version); | 135 | hose->global_number, common->version); |
| 136 | 136 | ||
| 137 | pr_info(" brdgCtl: %08x\n", data->brdgCtl); | 137 | if (data->brdgCtl) |
| 138 | 138 | pr_info(" brdgCtl: %08x\n", | |
| 139 | pr_info(" portStatusReg: %08x\n", data->portStatusReg); | 139 | data->brdgCtl); |
| 140 | pr_info(" rootCmplxStatus: %08x\n", data->rootCmplxStatus); | 140 | if (data->portStatusReg || data->rootCmplxStatus || |
| 141 | pr_info(" busAgentStatus: %08x\n", data->busAgentStatus); | 141 | data->busAgentStatus) |
| 142 | 142 | pr_info(" UtlSts: %08x %08x %08x\n", | |
| 143 | pr_info(" deviceStatus: %08x\n", data->deviceStatus); | 143 | data->portStatusReg, data->rootCmplxStatus, |
| 144 | pr_info(" slotStatus: %08x\n", data->slotStatus); | 144 | data->busAgentStatus); |
| 145 | pr_info(" linkStatus: %08x\n", data->linkStatus); | 145 | if (data->deviceStatus || data->slotStatus || |
| 146 | pr_info(" devCmdStatus: %08x\n", data->devCmdStatus); | 146 | data->linkStatus || data->devCmdStatus || |
| 147 | pr_info(" devSecStatus: %08x\n", data->devSecStatus); | 147 | data->devSecStatus) |
| 148 | 148 | pr_info(" RootSts: %08x %08x %08x %08x %08x\n", | |
| 149 | pr_info(" rootErrorStatus: %08x\n", data->rootErrorStatus); | 149 | data->deviceStatus, data->slotStatus, |
| 150 | pr_info(" uncorrErrorStatus: %08x\n", data->uncorrErrorStatus); | 150 | data->linkStatus, data->devCmdStatus, |
| 151 | pr_info(" corrErrorStatus: %08x\n", data->corrErrorStatus); | 151 | data->devSecStatus); |
| 152 | pr_info(" tlpHdr1: %08x\n", data->tlpHdr1); | 152 | if (data->rootErrorStatus || data->uncorrErrorStatus || |
| 153 | pr_info(" tlpHdr2: %08x\n", data->tlpHdr2); | 153 | data->corrErrorStatus) |
| 154 | pr_info(" tlpHdr3: %08x\n", data->tlpHdr3); | 154 | pr_info(" RootErrSts: %08x %08x %08x\n", |
| 155 | pr_info(" tlpHdr4: %08x\n", data->tlpHdr4); | 155 | data->rootErrorStatus, data->uncorrErrorStatus, |
| 156 | pr_info(" sourceId: %08x\n", data->sourceId); | 156 | data->corrErrorStatus); |
| 157 | pr_info(" errorClass: %016llx\n", data->errorClass); | 157 | if (data->tlpHdr1 || data->tlpHdr2 || |
| 158 | pr_info(" correlator: %016llx\n", data->correlator); | 158 | data->tlpHdr3 || data->tlpHdr4) |
| 159 | pr_info(" p7iocPlssr: %016llx\n", data->p7iocPlssr); | 159 | pr_info(" RootErrLog: %08x %08x %08x %08x\n", |
| 160 | pr_info(" p7iocCsr: %016llx\n", data->p7iocCsr); | 160 | data->tlpHdr1, data->tlpHdr2, |
| 161 | pr_info(" lemFir: %016llx\n", data->lemFir); | 161 | data->tlpHdr3, data->tlpHdr4); |
| 162 | pr_info(" lemErrorMask: %016llx\n", data->lemErrorMask); | 162 | if (data->sourceId || data->errorClass || |
| 163 | pr_info(" lemWOF: %016llx\n", data->lemWOF); | 163 | data->correlator) |
| 164 | pr_info(" phbErrorStatus: %016llx\n", data->phbErrorStatus); | 164 | pr_info(" RootErrLog1: %08x %016llx %016llx\n", |
| 165 | pr_info(" phbFirstErrorStatus: %016llx\n", data->phbFirstErrorStatus); | 165 | data->sourceId, data->errorClass, |
| 166 | pr_info(" phbErrorLog0: %016llx\n", data->phbErrorLog0); | 166 | data->correlator); |
| 167 | pr_info(" phbErrorLog1: %016llx\n", data->phbErrorLog1); | 167 | if (data->p7iocPlssr || data->p7iocCsr) |
| 168 | pr_info(" mmioErrorStatus: %016llx\n", data->mmioErrorStatus); | 168 | pr_info(" PhbSts: %016llx %016llx\n", |
| 169 | pr_info(" mmioFirstErrorStatus: %016llx\n", data->mmioFirstErrorStatus); | 169 | data->p7iocPlssr, data->p7iocCsr); |
| 170 | pr_info(" mmioErrorLog0: %016llx\n", data->mmioErrorLog0); | 170 | if (data->lemFir || data->lemErrorMask || |
| 171 | pr_info(" mmioErrorLog1: %016llx\n", data->mmioErrorLog1); | 171 | data->lemWOF) |
| 172 | pr_info(" dma0ErrorStatus: %016llx\n", data->dma0ErrorStatus); | 172 | pr_info(" Lem: %016llx %016llx %016llx\n", |
| 173 | pr_info(" dma0FirstErrorStatus: %016llx\n", data->dma0FirstErrorStatus); | 173 | data->lemFir, data->lemErrorMask, |
| 174 | pr_info(" dma0ErrorLog0: %016llx\n", data->dma0ErrorLog0); | 174 | data->lemWOF); |
| 175 | pr_info(" dma0ErrorLog1: %016llx\n", data->dma0ErrorLog1); | 175 | if (data->phbErrorStatus || data->phbFirstErrorStatus || |
| 176 | pr_info(" dma1ErrorStatus: %016llx\n", data->dma1ErrorStatus); | 176 | data->phbErrorLog0 || data->phbErrorLog1) |
| 177 | pr_info(" dma1FirstErrorStatus: %016llx\n", data->dma1FirstErrorStatus); | 177 | pr_info(" PhbErr: %016llx %016llx %016llx %016llx\n", |
| 178 | pr_info(" dma1ErrorLog0: %016llx\n", data->dma1ErrorLog0); | 178 | data->phbErrorStatus, data->phbFirstErrorStatus, |
| 179 | pr_info(" dma1ErrorLog1: %016llx\n", data->dma1ErrorLog1); | 179 | data->phbErrorLog0, data->phbErrorLog1); |
| 180 | if (data->mmioErrorStatus || data->mmioFirstErrorStatus || | ||
| 181 | data->mmioErrorLog0 || data->mmioErrorLog1) | ||
| 182 | pr_info(" OutErr: %016llx %016llx %016llx %016llx\n", | ||
| 183 | data->mmioErrorStatus, data->mmioFirstErrorStatus, | ||
| 184 | data->mmioErrorLog0, data->mmioErrorLog1); | ||
| 185 | if (data->dma0ErrorStatus || data->dma0FirstErrorStatus || | ||
| 186 | data->dma0ErrorLog0 || data->dma0ErrorLog1) | ||
| 187 | pr_info(" InAErr: %016llx %016llx %016llx %016llx\n", | ||
| 188 | data->dma0ErrorStatus, data->dma0FirstErrorStatus, | ||
| 189 | data->dma0ErrorLog0, data->dma0ErrorLog1); | ||
| 190 | if (data->dma1ErrorStatus || data->dma1FirstErrorStatus || | ||
| 191 | data->dma1ErrorLog0 || data->dma1ErrorLog1) | ||
| 192 | pr_info(" InBErr: %016llx %016llx %016llx %016llx\n", | ||
| 193 | data->dma1ErrorStatus, data->dma1FirstErrorStatus, | ||
| 194 | data->dma1ErrorLog0, data->dma1ErrorLog1); | ||
| 180 | 195 | ||
| 181 | for (i = 0; i < OPAL_P7IOC_NUM_PEST_REGS; i++) { | 196 | for (i = 0; i < OPAL_P7IOC_NUM_PEST_REGS; i++) { |
| 182 | if ((data->pestA[i] >> 63) == 0 && | 197 | if ((data->pestA[i] >> 63) == 0 && |
| 183 | (data->pestB[i] >> 63) == 0) | 198 | (data->pestB[i] >> 63) == 0) |
| 184 | continue; | 199 | continue; |
| 185 | 200 | ||
| 186 | pr_info(" PE[%3d] PESTA: %016llx\n", i, data->pestA[i]); | 201 | pr_info(" PE[%3d] A/B: %016llx %016llx\n", |
| 187 | pr_info(" PESTB: %016llx\n", data->pestB[i]); | 202 | i, data->pestA[i], data->pestB[i]); |
| 188 | } | 203 | } |
| 189 | } | 204 | } |
| 190 | 205 | ||
| @@ -197,62 +212,77 @@ static void pnv_pci_dump_phb3_diag_data(struct pci_controller *hose, | |||
| 197 | data = (struct OpalIoPhb3ErrorData*)common; | 212 | data = (struct OpalIoPhb3ErrorData*)common; |
| 198 | pr_info("PHB3 PHB#%d Diag-data (Version: %d)\n\n", | 213 | pr_info("PHB3 PHB#%d Diag-data (Version: %d)\n\n", |
| 199 | hose->global_number, common->version); | 214 | hose->global_number, common->version); |
| 200 | 215 | if (data->brdgCtl) | |
| 201 | pr_info(" brdgCtl: %08x\n", data->brdgCtl); | 216 | pr_info(" brdgCtl: %08x\n", |
| 202 | 217 | data->brdgCtl); | |
| 203 | pr_info(" portStatusReg: %08x\n", data->portStatusReg); | 218 | if (data->portStatusReg || data->rootCmplxStatus || |
| 204 | pr_info(" rootCmplxStatus: %08x\n", data->rootCmplxStatus); | 219 | data->busAgentStatus) |
| 205 | pr_info(" busAgentStatus: %08x\n", data->busAgentStatus); | 220 | pr_info(" UtlSts: %08x %08x %08x\n", |
| 206 | 221 | data->portStatusReg, data->rootCmplxStatus, | |
| 207 | pr_info(" deviceStatus: %08x\n", data->deviceStatus); | 222 | data->busAgentStatus); |
| 208 | pr_info(" slotStatus: %08x\n", data->slotStatus); | 223 | if (data->deviceStatus || data->slotStatus || |
| 209 | pr_info(" linkStatus: %08x\n", data->linkStatus); | 224 | data->linkStatus || data->devCmdStatus || |
| 210 | pr_info(" devCmdStatus: %08x\n", data->devCmdStatus); | 225 | data->devSecStatus) |
| 211 | pr_info(" devSecStatus: %08x\n", data->devSecStatus); | 226 | pr_info(" RootSts: %08x %08x %08x %08x %08x\n", |
| 212 | 227 | data->deviceStatus, data->slotStatus, | |
| 213 | pr_info(" rootErrorStatus: %08x\n", data->rootErrorStatus); | 228 | data->linkStatus, data->devCmdStatus, |
| 214 | pr_info(" uncorrErrorStatus: %08x\n", data->uncorrErrorStatus); | 229 | data->devSecStatus); |
| 215 | pr_info(" corrErrorStatus: %08x\n", data->corrErrorStatus); | 230 | if (data->rootErrorStatus || data->uncorrErrorStatus || |
| 216 | pr_info(" tlpHdr1: %08x\n", data->tlpHdr1); | 231 | data->corrErrorStatus) |
| 217 | pr_info(" tlpHdr2: %08x\n", data->tlpHdr2); | 232 | pr_info(" RootErrSts: %08x %08x %08x\n", |
| 218 | pr_info(" tlpHdr3: %08x\n", data->tlpHdr3); | 233 | data->rootErrorStatus, data->uncorrErrorStatus, |
| 219 | pr_info(" tlpHdr4: %08x\n", data->tlpHdr4); | 234 | data->corrErrorStatus); |
| 220 | pr_info(" sourceId: %08x\n", data->sourceId); | 235 | if (data->tlpHdr1 || data->tlpHdr2 || |
| 221 | pr_info(" errorClass: %016llx\n", data->errorClass); | 236 | data->tlpHdr3 || data->tlpHdr4) |
| 222 | pr_info(" correlator: %016llx\n", data->correlator); | 237 | pr_info(" RootErrLog: %08x %08x %08x %08x\n", |
| 223 | 238 | data->tlpHdr1, data->tlpHdr2, | |
| 224 | pr_info(" nFir: %016llx\n", data->nFir); | 239 | data->tlpHdr3, data->tlpHdr4); |
| 225 | pr_info(" nFirMask: %016llx\n", data->nFirMask); | 240 | if (data->sourceId || data->errorClass || |
| 226 | pr_info(" nFirWOF: %016llx\n", data->nFirWOF); | 241 | data->correlator) |
| 227 | pr_info(" PhbPlssr: %016llx\n", data->phbPlssr); | 242 | pr_info(" RootErrLog1: %08x %016llx %016llx\n", |
| 228 | pr_info(" PhbCsr: %016llx\n", data->phbCsr); | 243 | data->sourceId, data->errorClass, |
| 229 | pr_info(" lemFir: %016llx\n", data->lemFir); | 244 | data->correlator); |
| 230 | pr_info(" lemErrorMask: %016llx\n", data->lemErrorMask); | 245 | if (data->nFir || data->nFirMask || |
| 231 | pr_info(" lemWOF: %016llx\n", data->lemWOF); | 246 | data->nFirWOF) |
| 232 | pr_info(" phbErrorStatus: %016llx\n", data->phbErrorStatus); | 247 | pr_info(" nFir: %016llx %016llx %016llx\n", |
| 233 | pr_info(" phbFirstErrorStatus: %016llx\n", data->phbFirstErrorStatus); | 248 | data->nFir, data->nFirMask, |
| 234 | pr_info(" phbErrorLog0: %016llx\n", data->phbErrorLog0); | 249 | data->nFirWOF); |
| 235 | pr_info(" phbErrorLog1: %016llx\n", data->phbErrorLog1); | 250 | if (data->phbPlssr || data->phbCsr) |
| 236 | pr_info(" mmioErrorStatus: %016llx\n", data->mmioErrorStatus); | 251 | pr_info(" PhbSts: %016llx %016llx\n", |
| 237 | pr_info(" mmioFirstErrorStatus: %016llx\n", data->mmioFirstErrorStatus); | 252 | data->phbPlssr, data->phbCsr); |
| 238 | pr_info(" mmioErrorLog0: %016llx\n", data->mmioErrorLog0); | 253 | if (data->lemFir || data->lemErrorMask || |
| 239 | pr_info(" mmioErrorLog1: %016llx\n", data->mmioErrorLog1); | 254 | data->lemWOF) |
| 240 | pr_info(" dma0ErrorStatus: %016llx\n", data->dma0ErrorStatus); | 255 | pr_info(" Lem: %016llx %016llx %016llx\n", |
| 241 | pr_info(" dma0FirstErrorStatus: %016llx\n", data->dma0FirstErrorStatus); | 256 | data->lemFir, data->lemErrorMask, |
| 242 | pr_info(" dma0ErrorLog0: %016llx\n", data->dma0ErrorLog0); | 257 | data->lemWOF); |
| 243 | pr_info(" dma0ErrorLog1: %016llx\n", data->dma0ErrorLog1); | 258 | if (data->phbErrorStatus || data->phbFirstErrorStatus || |
| 244 | pr_info(" dma1ErrorStatus: %016llx\n", data->dma1ErrorStatus); | 259 | data->phbErrorLog0 || data->phbErrorLog1) |
| 245 | pr_info(" dma1FirstErrorStatus: %016llx\n", data->dma1FirstErrorStatus); | 260 | pr_info(" PhbErr: %016llx %016llx %016llx %016llx\n", |
| 246 | pr_info(" dma1ErrorLog0: %016llx\n", data->dma1ErrorLog0); | 261 | data->phbErrorStatus, data->phbFirstErrorStatus, |
| 247 | pr_info(" dma1ErrorLog1: %016llx\n", data->dma1ErrorLog1); | 262 | data->phbErrorLog0, data->phbErrorLog1); |
| 263 | if (data->mmioErrorStatus || data->mmioFirstErrorStatus || | ||
| 264 | data->mmioErrorLog0 || data->mmioErrorLog1) | ||
| 265 | pr_info(" OutErr: %016llx %016llx %016llx %016llx\n", | ||
| 266 | data->mmioErrorStatus, data->mmioFirstErrorStatus, | ||
| 267 | data->mmioErrorLog0, data->mmioErrorLog1); | ||
| 268 | if (data->dma0ErrorStatus || data->dma0FirstErrorStatus || | ||
| 269 | data->dma0ErrorLog0 || data->dma0ErrorLog1) | ||
| 270 | pr_info(" InAErr: %016llx %016llx %016llx %016llx\n", | ||
| 271 | data->dma0ErrorStatus, data->dma0FirstErrorStatus, | ||
| 272 | data->dma0ErrorLog0, data->dma0ErrorLog1); | ||
| 273 | if (data->dma1ErrorStatus || data->dma1FirstErrorStatus || | ||
| 274 | data->dma1ErrorLog0 || data->dma1ErrorLog1) | ||
| 275 | pr_info(" InBErr: %016llx %016llx %016llx %016llx\n", | ||
| 276 | data->dma1ErrorStatus, data->dma1FirstErrorStatus, | ||
| 277 | data->dma1ErrorLog0, data->dma1ErrorLog1); | ||
| 248 | 278 | ||
| 249 | for (i = 0; i < OPAL_PHB3_NUM_PEST_REGS; i++) { | 279 | for (i = 0; i < OPAL_PHB3_NUM_PEST_REGS; i++) { |
| 250 | if ((data->pestA[i] >> 63) == 0 && | 280 | if ((data->pestA[i] >> 63) == 0 && |
| 251 | (data->pestB[i] >> 63) == 0) | 281 | (data->pestB[i] >> 63) == 0) |
| 252 | continue; | 282 | continue; |
| 253 | 283 | ||
| 254 | pr_info(" PE[%3d] PESTA: %016llx\n", i, data->pestA[i]); | 284 | pr_info(" PE[%3d] A/B: %016llx %016llx\n", |
| 255 | pr_info(" PESTB: %016llx\n", data->pestB[i]); | 285 | i, data->pestA[i], data->pestB[i]); |
| 256 | } | 286 | } |
| 257 | } | 287 | } |
| 258 | 288 | ||
diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c index 110f4fbd319f..81a7a0a79be7 100644 --- a/arch/powerpc/platforms/powernv/setup.c +++ b/arch/powerpc/platforms/powernv/setup.c | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | #include <linux/of_fdt.h> | 26 | #include <linux/of_fdt.h> |
| 27 | #include <linux/interrupt.h> | 27 | #include <linux/interrupt.h> |
| 28 | #include <linux/bug.h> | 28 | #include <linux/bug.h> |
| 29 | #include <linux/cpuidle.h> | ||
| 30 | #include <linux/pci.h> | 29 | #include <linux/pci.h> |
| 31 | 30 | ||
| 32 | #include <asm/machdep.h> | 31 | #include <asm/machdep.h> |
| @@ -225,16 +224,6 @@ static int __init pnv_probe(void) | |||
| 225 | return 1; | 224 | return 1; |
| 226 | } | 225 | } |
| 227 | 226 | ||
| 228 | void powernv_idle(void) | ||
| 229 | { | ||
| 230 | /* Hook to cpuidle framework if available, else | ||
| 231 | * call on default platform idle code | ||
| 232 | */ | ||
| 233 | if (cpuidle_idle_call()) { | ||
| 234 | power7_idle(); | ||
| 235 | } | ||
| 236 | } | ||
| 237 | |||
| 238 | define_machine(powernv) { | 227 | define_machine(powernv) { |
| 239 | .name = "PowerNV", | 228 | .name = "PowerNV", |
| 240 | .probe = pnv_probe, | 229 | .probe = pnv_probe, |
| @@ -244,7 +233,7 @@ define_machine(powernv) { | |||
| 244 | .show_cpuinfo = pnv_show_cpuinfo, | 233 | .show_cpuinfo = pnv_show_cpuinfo, |
| 245 | .progress = pnv_progress, | 234 | .progress = pnv_progress, |
| 246 | .machine_shutdown = pnv_shutdown, | 235 | .machine_shutdown = pnv_shutdown, |
| 247 | .power_save = powernv_idle, | 236 | .power_save = power7_idle, |
| 248 | .calibrate_decr = generic_calibrate_decr, | 237 | .calibrate_decr = generic_calibrate_decr, |
| 249 | .dma_set_mask = pnv_dma_set_mask, | 238 | .dma_set_mask = pnv_dma_set_mask, |
| 250 | #ifdef CONFIG_KEXEC | 239 | #ifdef CONFIG_KEXEC |
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c index 82789e79e539..0ea99e3d4815 100644 --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c | |||
| @@ -35,12 +35,7 @@ | |||
| 35 | #include "offline_states.h" | 35 | #include "offline_states.h" |
| 36 | 36 | ||
| 37 | /* This version can't take the spinlock, because it never returns */ | 37 | /* This version can't take the spinlock, because it never returns */ |
| 38 | static struct rtas_args rtas_stop_self_args = { | 38 | static int rtas_stop_self_token = RTAS_UNKNOWN_SERVICE; |
| 39 | .token = RTAS_UNKNOWN_SERVICE, | ||
| 40 | .nargs = 0, | ||
| 41 | .nret = 1, | ||
| 42 | .rets = &rtas_stop_self_args.args[0], | ||
| 43 | }; | ||
| 44 | 39 | ||
| 45 | static DEFINE_PER_CPU(enum cpu_state_vals, preferred_offline_state) = | 40 | static DEFINE_PER_CPU(enum cpu_state_vals, preferred_offline_state) = |
| 46 | CPU_STATE_OFFLINE; | 41 | CPU_STATE_OFFLINE; |
| @@ -93,15 +88,20 @@ void set_default_offline_state(int cpu) | |||
| 93 | 88 | ||
| 94 | static void rtas_stop_self(void) | 89 | static void rtas_stop_self(void) |
| 95 | { | 90 | { |
| 96 | struct rtas_args *args = &rtas_stop_self_args; | 91 | struct rtas_args args = { |
| 92 | .token = cpu_to_be32(rtas_stop_self_token), | ||
| 93 | .nargs = 0, | ||
| 94 | .nret = 1, | ||
| 95 | .rets = &args.args[0], | ||
| 96 | }; | ||
| 97 | 97 | ||
| 98 | local_irq_disable(); | 98 | local_irq_disable(); |
| 99 | 99 | ||
| 100 | BUG_ON(args->token == RTAS_UNKNOWN_SERVICE); | 100 | BUG_ON(rtas_stop_self_token == RTAS_UNKNOWN_SERVICE); |
| 101 | 101 | ||
| 102 | printk("cpu %u (hwid %u) Ready to die...\n", | 102 | printk("cpu %u (hwid %u) Ready to die...\n", |
| 103 | smp_processor_id(), hard_smp_processor_id()); | 103 | smp_processor_id(), hard_smp_processor_id()); |
| 104 | enter_rtas(__pa(args)); | 104 | enter_rtas(__pa(&args)); |
| 105 | 105 | ||
| 106 | panic("Alas, I survived.\n"); | 106 | panic("Alas, I survived.\n"); |
| 107 | } | 107 | } |
| @@ -392,10 +392,10 @@ static int __init pseries_cpu_hotplug_init(void) | |||
| 392 | } | 392 | } |
| 393 | } | 393 | } |
| 394 | 394 | ||
| 395 | rtas_stop_self_args.token = rtas_token("stop-self"); | 395 | rtas_stop_self_token = rtas_token("stop-self"); |
| 396 | qcss_tok = rtas_token("query-cpu-stopped-state"); | 396 | qcss_tok = rtas_token("query-cpu-stopped-state"); |
| 397 | 397 | ||
| 398 | if (rtas_stop_self_args.token == RTAS_UNKNOWN_SERVICE || | 398 | if (rtas_stop_self_token == RTAS_UNKNOWN_SERVICE || |
| 399 | qcss_tok == RTAS_UNKNOWN_SERVICE) { | 399 | qcss_tok == RTAS_UNKNOWN_SERVICE) { |
| 400 | printk(KERN_INFO "CPU Hotplug not supported by firmware " | 400 | printk(KERN_INFO "CPU Hotplug not supported by firmware " |
| 401 | "- disabling.\n"); | 401 | "- disabling.\n"); |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 972df0ffd4dc..2db8cc691bf4 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
| @@ -39,7 +39,6 @@ | |||
| 39 | #include <linux/irq.h> | 39 | #include <linux/irq.h> |
| 40 | #include <linux/seq_file.h> | 40 | #include <linux/seq_file.h> |
| 41 | #include <linux/root_dev.h> | 41 | #include <linux/root_dev.h> |
| 42 | #include <linux/cpuidle.h> | ||
| 43 | #include <linux/of.h> | 42 | #include <linux/of.h> |
| 44 | #include <linux/kexec.h> | 43 | #include <linux/kexec.h> |
| 45 | 44 | ||
| @@ -356,29 +355,24 @@ early_initcall(alloc_dispatch_log_kmem_cache); | |||
| 356 | 355 | ||
| 357 | static void pseries_lpar_idle(void) | 356 | static void pseries_lpar_idle(void) |
| 358 | { | 357 | { |
| 359 | /* This would call on the cpuidle framework, and the back-end pseries | 358 | /* |
| 360 | * driver to go to idle states | 359 | * Default handler to go into low thread priority and possibly |
| 360 | * low power mode by cedeing processor to hypervisor | ||
| 361 | */ | 361 | */ |
| 362 | if (cpuidle_idle_call()) { | ||
| 363 | /* On error, execute default handler | ||
| 364 | * to go into low thread priority and possibly | ||
| 365 | * low power mode by cedeing processor to hypervisor | ||
| 366 | */ | ||
| 367 | 362 | ||
| 368 | /* Indicate to hypervisor that we are idle. */ | 363 | /* Indicate to hypervisor that we are idle. */ |
| 369 | get_lppaca()->idle = 1; | 364 | get_lppaca()->idle = 1; |
| 370 | 365 | ||
| 371 | /* | 366 | /* |
| 372 | * Yield the processor to the hypervisor. We return if | 367 | * Yield the processor to the hypervisor. We return if |
| 373 | * an external interrupt occurs (which are driven prior | 368 | * an external interrupt occurs (which are driven prior |
| 374 | * to returning here) or if a prod occurs from another | 369 | * to returning here) or if a prod occurs from another |
| 375 | * processor. When returning here, external interrupts | 370 | * processor. When returning here, external interrupts |
| 376 | * are enabled. | 371 | * are enabled. |
| 377 | */ | 372 | */ |
| 378 | cede_processor(); | 373 | cede_processor(); |
| 379 | 374 | ||
| 380 | get_lppaca()->idle = 0; | 375 | get_lppaca()->idle = 0; |
| 381 | } | ||
| 382 | } | 376 | } |
| 383 | 377 | ||
| 384 | /* | 378 | /* |
diff --git a/arch/powerpc/sysdev/ehv_pic.c b/arch/powerpc/sysdev/ehv_pic.c index b74085cea1af..2d20f10a4203 100644 --- a/arch/powerpc/sysdev/ehv_pic.c +++ b/arch/powerpc/sysdev/ehv_pic.c | |||
| @@ -28,8 +28,6 @@ | |||
| 28 | #include <asm/ehv_pic.h> | 28 | #include <asm/ehv_pic.h> |
| 29 | #include <asm/fsl_hcalls.h> | 29 | #include <asm/fsl_hcalls.h> |
| 30 | 30 | ||
| 31 | #include "../../../kernel/irq/settings.h" | ||
| 32 | |||
| 33 | static struct ehv_pic *global_ehv_pic; | 31 | static struct ehv_pic *global_ehv_pic; |
| 34 | static DEFINE_SPINLOCK(ehv_pic_lock); | 32 | static DEFINE_SPINLOCK(ehv_pic_lock); |
| 35 | 33 | ||
| @@ -113,17 +111,13 @@ static unsigned int ehv_pic_type_to_vecpri(unsigned int type) | |||
| 113 | int ehv_pic_set_irq_type(struct irq_data *d, unsigned int flow_type) | 111 | int ehv_pic_set_irq_type(struct irq_data *d, unsigned int flow_type) |
| 114 | { | 112 | { |
| 115 | unsigned int src = virq_to_hw(d->irq); | 113 | unsigned int src = virq_to_hw(d->irq); |
| 116 | struct irq_desc *desc = irq_to_desc(d->irq); | ||
| 117 | unsigned int vecpri, vold, vnew, prio, cpu_dest; | 114 | unsigned int vecpri, vold, vnew, prio, cpu_dest; |
| 118 | unsigned long flags; | 115 | unsigned long flags; |
| 119 | 116 | ||
| 120 | if (flow_type == IRQ_TYPE_NONE) | 117 | if (flow_type == IRQ_TYPE_NONE) |
| 121 | flow_type = IRQ_TYPE_LEVEL_LOW; | 118 | flow_type = IRQ_TYPE_LEVEL_LOW; |
| 122 | 119 | ||
| 123 | irq_settings_clr_level(desc); | 120 | irqd_set_trigger_type(d, flow_type); |
| 124 | irq_settings_set_trigger_mask(desc, flow_type); | ||
| 125 | if (flow_type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) | ||
| 126 | irq_settings_set_level(desc); | ||
| 127 | 121 | ||
| 128 | vecpri = ehv_pic_type_to_vecpri(flow_type); | 122 | vecpri = ehv_pic_type_to_vecpri(flow_type); |
| 129 | 123 | ||
| @@ -144,7 +138,7 @@ int ehv_pic_set_irq_type(struct irq_data *d, unsigned int flow_type) | |||
| 144 | ev_int_set_config(src, vecpri, prio, cpu_dest); | 138 | ev_int_set_config(src, vecpri, prio, cpu_dest); |
| 145 | 139 | ||
| 146 | spin_unlock_irqrestore(&ehv_pic_lock, flags); | 140 | spin_unlock_irqrestore(&ehv_pic_lock, flags); |
| 147 | return 0; | 141 | return IRQ_SET_MASK_OK_NOCOPY; |
| 148 | } | 142 | } |
| 149 | 143 | ||
| 150 | static struct irq_chip ehv_pic_irq_chip = { | 144 | static struct irq_chip ehv_pic_irq_chip = { |
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 65a07750f4f9..953f17c8d17c 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
| @@ -117,6 +117,7 @@ config S390 | |||
| 117 | select HAVE_FUNCTION_GRAPH_TRACER | 117 | select HAVE_FUNCTION_GRAPH_TRACER |
| 118 | select HAVE_FUNCTION_TRACER | 118 | select HAVE_FUNCTION_TRACER |
| 119 | select HAVE_FUNCTION_TRACE_MCOUNT_TEST | 119 | select HAVE_FUNCTION_TRACE_MCOUNT_TEST |
| 120 | select HAVE_FUTEX_CMPXCHG if FUTEX | ||
| 120 | select HAVE_KERNEL_BZIP2 | 121 | select HAVE_KERNEL_BZIP2 |
| 121 | select HAVE_KERNEL_GZIP | 122 | select HAVE_KERNEL_GZIP |
| 122 | select HAVE_KERNEL_LZ4 | 123 | select HAVE_KERNEL_LZ4 |
| @@ -140,6 +141,7 @@ config S390 | |||
| 140 | select OLD_SIGACTION | 141 | select OLD_SIGACTION |
| 141 | select OLD_SIGSUSPEND3 | 142 | select OLD_SIGSUSPEND3 |
| 142 | select SYSCTL_EXCEPTION_TRACE | 143 | select SYSCTL_EXCEPTION_TRACE |
| 144 | select TTY | ||
| 143 | select VIRT_CPU_ACCOUNTING | 145 | select VIRT_CPU_ACCOUNTING |
| 144 | select VIRT_TO_BUS | 146 | select VIRT_TO_BUS |
| 145 | 147 | ||
| @@ -415,6 +417,10 @@ config ARCH_ENABLE_MEMORY_HOTPLUG | |||
| 415 | config ARCH_ENABLE_MEMORY_HOTREMOVE | 417 | config ARCH_ENABLE_MEMORY_HOTREMOVE |
| 416 | def_bool y | 418 | def_bool y |
| 417 | 419 | ||
| 420 | config ARCH_ENABLE_SPLIT_PMD_PTLOCK | ||
| 421 | def_bool y | ||
| 422 | depends on 64BIT | ||
| 423 | |||
| 418 | config FORCE_MAX_ZONEORDER | 424 | config FORCE_MAX_ZONEORDER |
| 419 | int | 425 | int |
| 420 | default "9" | 426 | default "9" |
diff --git a/arch/s390/appldata/appldata_os.c b/arch/s390/appldata/appldata_os.c index de8e2b3b0180..69b23b25ac34 100644 --- a/arch/s390/appldata/appldata_os.c +++ b/arch/s390/appldata/appldata_os.c | |||
| @@ -171,7 +171,7 @@ static int __init appldata_os_init(void) | |||
| 171 | int rc, max_size; | 171 | int rc, max_size; |
| 172 | 172 | ||
| 173 | max_size = sizeof(struct appldata_os_data) + | 173 | max_size = sizeof(struct appldata_os_data) + |
| 174 | (NR_CPUS * sizeof(struct appldata_os_per_cpu)); | 174 | (num_possible_cpus() * sizeof(struct appldata_os_per_cpu)); |
| 175 | if (max_size > APPLDATA_MAX_REC_SIZE) { | 175 | if (max_size > APPLDATA_MAX_REC_SIZE) { |
| 176 | pr_err("Maximum OS record size %i exceeds the maximum " | 176 | pr_err("Maximum OS record size %i exceeds the maximum " |
| 177 | "record size %i\n", max_size, APPLDATA_MAX_REC_SIZE); | 177 | "record size %i\n", max_size, APPLDATA_MAX_REC_SIZE); |
diff --git a/arch/s390/configs/default_defconfig b/arch/s390/configs/default_defconfig index e0af2ee58751..ddaae2f5c913 100644 --- a/arch/s390/configs/default_defconfig +++ b/arch/s390/configs/default_defconfig | |||
| @@ -46,6 +46,7 @@ CONFIG_UNIXWARE_DISKLABEL=y | |||
| 46 | CONFIG_CFQ_GROUP_IOSCHED=y | 46 | CONFIG_CFQ_GROUP_IOSCHED=y |
| 47 | CONFIG_DEFAULT_DEADLINE=y | 47 | CONFIG_DEFAULT_DEADLINE=y |
| 48 | CONFIG_MARCH_Z9_109=y | 48 | CONFIG_MARCH_Z9_109=y |
| 49 | CONFIG_NR_CPUS=256 | ||
| 49 | CONFIG_PREEMPT=y | 50 | CONFIG_PREEMPT=y |
| 50 | CONFIG_HZ_100=y | 51 | CONFIG_HZ_100=y |
| 51 | CONFIG_MEMORY_HOTPLUG=y | 52 | CONFIG_MEMORY_HOTPLUG=y |
| @@ -58,7 +59,6 @@ CONFIG_HOTPLUG_PCI=y | |||
| 58 | CONFIG_HOTPLUG_PCI_S390=y | 59 | CONFIG_HOTPLUG_PCI_S390=y |
| 59 | CONFIG_CHSC_SCH=y | 60 | CONFIG_CHSC_SCH=y |
| 60 | CONFIG_CRASH_DUMP=y | 61 | CONFIG_CRASH_DUMP=y |
| 61 | CONFIG_ZFCPDUMP=y | ||
| 62 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | 62 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set |
| 63 | CONFIG_BINFMT_MISC=m | 63 | CONFIG_BINFMT_MISC=m |
| 64 | CONFIG_HIBERNATION=y | 64 | CONFIG_HIBERNATION=y |
| @@ -101,7 +101,6 @@ CONFIG_TCP_CONG_VENO=m | |||
| 101 | CONFIG_TCP_CONG_YEAH=m | 101 | CONFIG_TCP_CONG_YEAH=m |
| 102 | CONFIG_TCP_CONG_ILLINOIS=m | 102 | CONFIG_TCP_CONG_ILLINOIS=m |
| 103 | CONFIG_IPV6=y | 103 | CONFIG_IPV6=y |
| 104 | CONFIG_IPV6_PRIVACY=y | ||
| 105 | CONFIG_IPV6_ROUTER_PREF=y | 104 | CONFIG_IPV6_ROUTER_PREF=y |
| 106 | CONFIG_INET6_AH=m | 105 | CONFIG_INET6_AH=m |
| 107 | CONFIG_INET6_ESP=m | 106 | CONFIG_INET6_ESP=m |
| @@ -111,6 +110,7 @@ CONFIG_INET6_XFRM_MODE_TRANSPORT=m | |||
| 111 | CONFIG_INET6_XFRM_MODE_TUNNEL=m | 110 | CONFIG_INET6_XFRM_MODE_TUNNEL=m |
| 112 | CONFIG_INET6_XFRM_MODE_BEET=m | 111 | CONFIG_INET6_XFRM_MODE_BEET=m |
| 113 | CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m | 112 | CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m |
| 113 | CONFIG_IPV6_VTI=m | ||
| 114 | CONFIG_IPV6_SIT=m | 114 | CONFIG_IPV6_SIT=m |
| 115 | CONFIG_IPV6_GRE=m | 115 | CONFIG_IPV6_GRE=m |
| 116 | CONFIG_IPV6_MULTIPLE_TABLES=y | 116 | CONFIG_IPV6_MULTIPLE_TABLES=y |
| @@ -135,7 +135,17 @@ CONFIG_NF_CONNTRACK_SIP=m | |||
| 135 | CONFIG_NF_CONNTRACK_TFTP=m | 135 | CONFIG_NF_CONNTRACK_TFTP=m |
| 136 | CONFIG_NF_CT_NETLINK=m | 136 | CONFIG_NF_CT_NETLINK=m |
| 137 | CONFIG_NF_CT_NETLINK_TIMEOUT=m | 137 | CONFIG_NF_CT_NETLINK_TIMEOUT=m |
| 138 | CONFIG_NETFILTER_TPROXY=m | 138 | CONFIG_NF_TABLES=m |
| 139 | CONFIG_NFT_EXTHDR=m | ||
| 140 | CONFIG_NFT_META=m | ||
| 141 | CONFIG_NFT_CT=m | ||
| 142 | CONFIG_NFT_RBTREE=m | ||
| 143 | CONFIG_NFT_HASH=m | ||
| 144 | CONFIG_NFT_COUNTER=m | ||
| 145 | CONFIG_NFT_LOG=m | ||
| 146 | CONFIG_NFT_LIMIT=m | ||
| 147 | CONFIG_NFT_NAT=m | ||
| 148 | CONFIG_NFT_COMPAT=m | ||
| 139 | CONFIG_NETFILTER_XT_SET=m | 149 | CONFIG_NETFILTER_XT_SET=m |
| 140 | CONFIG_NETFILTER_XT_TARGET_AUDIT=m | 150 | CONFIG_NETFILTER_XT_TARGET_AUDIT=m |
| 141 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m | 151 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m |
| @@ -204,7 +214,9 @@ CONFIG_IP_SET_HASH_IP=m | |||
| 204 | CONFIG_IP_SET_HASH_IPPORT=m | 214 | CONFIG_IP_SET_HASH_IPPORT=m |
| 205 | CONFIG_IP_SET_HASH_IPPORTIP=m | 215 | CONFIG_IP_SET_HASH_IPPORTIP=m |
| 206 | CONFIG_IP_SET_HASH_IPPORTNET=m | 216 | CONFIG_IP_SET_HASH_IPPORTNET=m |
| 217 | CONFIG_IP_SET_HASH_NETPORTNET=m | ||
| 207 | CONFIG_IP_SET_HASH_NET=m | 218 | CONFIG_IP_SET_HASH_NET=m |
| 219 | CONFIG_IP_SET_HASH_NETNET=m | ||
| 208 | CONFIG_IP_SET_HASH_NETPORT=m | 220 | CONFIG_IP_SET_HASH_NETPORT=m |
| 209 | CONFIG_IP_SET_HASH_NETIFACE=m | 221 | CONFIG_IP_SET_HASH_NETIFACE=m |
| 210 | CONFIG_IP_SET_LIST_SET=m | 222 | CONFIG_IP_SET_LIST_SET=m |
| @@ -227,6 +239,11 @@ CONFIG_IP_VS_FTP=m | |||
| 227 | CONFIG_IP_VS_PE_SIP=m | 239 | CONFIG_IP_VS_PE_SIP=m |
| 228 | CONFIG_NF_CONNTRACK_IPV4=m | 240 | CONFIG_NF_CONNTRACK_IPV4=m |
| 229 | # CONFIG_NF_CONNTRACK_PROC_COMPAT is not set | 241 | # CONFIG_NF_CONNTRACK_PROC_COMPAT is not set |
| 242 | CONFIG_NF_TABLES_IPV4=m | ||
| 243 | CONFIG_NFT_REJECT_IPV4=m | ||
| 244 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m | ||
| 245 | CONFIG_NFT_CHAIN_NAT_IPV4=m | ||
| 246 | CONFIG_NF_TABLES_ARP=m | ||
| 230 | CONFIG_IP_NF_IPTABLES=m | 247 | CONFIG_IP_NF_IPTABLES=m |
| 231 | CONFIG_IP_NF_MATCH_AH=m | 248 | CONFIG_IP_NF_MATCH_AH=m |
| 232 | CONFIG_IP_NF_MATCH_ECN=m | 249 | CONFIG_IP_NF_MATCH_ECN=m |
| @@ -249,6 +266,9 @@ CONFIG_IP_NF_ARPTABLES=m | |||
| 249 | CONFIG_IP_NF_ARPFILTER=m | 266 | CONFIG_IP_NF_ARPFILTER=m |
| 250 | CONFIG_IP_NF_ARP_MANGLE=m | 267 | CONFIG_IP_NF_ARP_MANGLE=m |
| 251 | CONFIG_NF_CONNTRACK_IPV6=m | 268 | CONFIG_NF_CONNTRACK_IPV6=m |
| 269 | CONFIG_NF_TABLES_IPV6=m | ||
| 270 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m | ||
| 271 | CONFIG_NFT_CHAIN_NAT_IPV6=m | ||
| 252 | CONFIG_IP6_NF_IPTABLES=m | 272 | CONFIG_IP6_NF_IPTABLES=m |
| 253 | CONFIG_IP6_NF_MATCH_AH=m | 273 | CONFIG_IP6_NF_MATCH_AH=m |
| 254 | CONFIG_IP6_NF_MATCH_EUI64=m | 274 | CONFIG_IP6_NF_MATCH_EUI64=m |
| @@ -268,6 +288,7 @@ CONFIG_IP6_NF_SECURITY=m | |||
| 268 | CONFIG_NF_NAT_IPV6=m | 288 | CONFIG_NF_NAT_IPV6=m |
| 269 | CONFIG_IP6_NF_TARGET_MASQUERADE=m | 289 | CONFIG_IP6_NF_TARGET_MASQUERADE=m |
| 270 | CONFIG_IP6_NF_TARGET_NPT=m | 290 | CONFIG_IP6_NF_TARGET_NPT=m |
| 291 | CONFIG_NF_TABLES_BRIDGE=m | ||
| 271 | CONFIG_NET_SCTPPROBE=m | 292 | CONFIG_NET_SCTPPROBE=m |
| 272 | CONFIG_RDS=m | 293 | CONFIG_RDS=m |
| 273 | CONFIG_RDS_RDMA=m | 294 | CONFIG_RDS_RDMA=m |
| @@ -314,6 +335,7 @@ CONFIG_NET_CLS_RSVP=m | |||
| 314 | CONFIG_NET_CLS_RSVP6=m | 335 | CONFIG_NET_CLS_RSVP6=m |
| 315 | CONFIG_NET_CLS_FLOW=m | 336 | CONFIG_NET_CLS_FLOW=m |
| 316 | CONFIG_NET_CLS_CGROUP=y | 337 | CONFIG_NET_CLS_CGROUP=y |
| 338 | CONFIG_NET_CLS_BPF=m | ||
| 317 | CONFIG_NET_CLS_ACT=y | 339 | CONFIG_NET_CLS_ACT=y |
| 318 | CONFIG_NET_ACT_POLICE=m | 340 | CONFIG_NET_ACT_POLICE=m |
| 319 | CONFIG_NET_ACT_GACT=m | 341 | CONFIG_NET_ACT_GACT=m |
| @@ -381,8 +403,8 @@ CONFIG_BLK_DEV_DM=m | |||
| 381 | CONFIG_DM_CRYPT=m | 403 | CONFIG_DM_CRYPT=m |
| 382 | CONFIG_DM_SNAPSHOT=m | 404 | CONFIG_DM_SNAPSHOT=m |
| 383 | CONFIG_DM_MIRROR=m | 405 | CONFIG_DM_MIRROR=m |
| 384 | CONFIG_DM_RAID=m | ||
| 385 | CONFIG_DM_LOG_USERSPACE=m | 406 | CONFIG_DM_LOG_USERSPACE=m |
| 407 | CONFIG_DM_RAID=m | ||
| 386 | CONFIG_DM_ZERO=m | 408 | CONFIG_DM_ZERO=m |
| 387 | CONFIG_DM_MULTIPATH=m | 409 | CONFIG_DM_MULTIPATH=m |
| 388 | CONFIG_DM_MULTIPATH_QL=m | 410 | CONFIG_DM_MULTIPATH_QL=m |
| @@ -434,7 +456,6 @@ CONFIG_TN3270_FS=y | |||
| 434 | CONFIG_WATCHDOG=y | 456 | CONFIG_WATCHDOG=y |
| 435 | CONFIG_WATCHDOG_NOWAYOUT=y | 457 | CONFIG_WATCHDOG_NOWAYOUT=y |
| 436 | CONFIG_SOFT_WATCHDOG=m | 458 | CONFIG_SOFT_WATCHDOG=m |
| 437 | CONFIG_ZVM_WATCHDOG=m | ||
| 438 | # CONFIG_HID is not set | 459 | # CONFIG_HID is not set |
| 439 | # CONFIG_USB_SUPPORT is not set | 460 | # CONFIG_USB_SUPPORT is not set |
| 440 | CONFIG_INFINIBAND=m | 461 | CONFIG_INFINIBAND=m |
| @@ -534,13 +555,23 @@ CONFIG_UNUSED_SYMBOLS=y | |||
| 534 | CONFIG_MAGIC_SYSRQ=y | 555 | CONFIG_MAGIC_SYSRQ=y |
| 535 | CONFIG_DEBUG_KERNEL=y | 556 | CONFIG_DEBUG_KERNEL=y |
| 536 | CONFIG_DEBUG_PAGEALLOC=y | 557 | CONFIG_DEBUG_PAGEALLOC=y |
| 558 | CONFIG_DEBUG_OBJECTS=y | ||
| 559 | CONFIG_DEBUG_OBJECTS_SELFTEST=y | ||
| 560 | CONFIG_DEBUG_OBJECTS_FREE=y | ||
| 561 | CONFIG_DEBUG_OBJECTS_TIMERS=y | ||
| 562 | CONFIG_DEBUG_OBJECTS_WORK=y | ||
| 563 | CONFIG_DEBUG_OBJECTS_RCU_HEAD=y | ||
| 564 | CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y | ||
| 537 | CONFIG_SLUB_DEBUG_ON=y | 565 | CONFIG_SLUB_DEBUG_ON=y |
| 538 | CONFIG_SLUB_STATS=y | 566 | CONFIG_SLUB_STATS=y |
| 567 | CONFIG_DEBUG_KMEMLEAK=y | ||
| 539 | CONFIG_DEBUG_STACK_USAGE=y | 568 | CONFIG_DEBUG_STACK_USAGE=y |
| 540 | CONFIG_DEBUG_VM=y | 569 | CONFIG_DEBUG_VM=y |
| 541 | CONFIG_DEBUG_VM_RB=y | 570 | CONFIG_DEBUG_VM_RB=y |
| 542 | CONFIG_MEMORY_NOTIFIER_ERROR_INJECT=m | 571 | CONFIG_MEMORY_NOTIFIER_ERROR_INJECT=m |
| 543 | CONFIG_DEBUG_PER_CPU_MAPS=y | 572 | CONFIG_DEBUG_PER_CPU_MAPS=y |
| 573 | CONFIG_DEBUG_SHIRQ=y | ||
| 574 | CONFIG_DETECT_HUNG_TASK=y | ||
| 544 | CONFIG_TIMER_STATS=y | 575 | CONFIG_TIMER_STATS=y |
| 545 | CONFIG_DEBUG_RT_MUTEXES=y | 576 | CONFIG_DEBUG_RT_MUTEXES=y |
| 546 | CONFIG_RT_MUTEX_TESTER=y | 577 | CONFIG_RT_MUTEX_TESTER=y |
| @@ -573,9 +604,11 @@ CONFIG_DEBUG_STRICT_USER_COPY_CHECKS=y | |||
| 573 | CONFIG_BLK_DEV_IO_TRACE=y | 604 | CONFIG_BLK_DEV_IO_TRACE=y |
| 574 | # CONFIG_KPROBE_EVENT is not set | 605 | # CONFIG_KPROBE_EVENT is not set |
| 575 | CONFIG_LKDTM=m | 606 | CONFIG_LKDTM=m |
| 607 | CONFIG_TEST_LIST_SORT=y | ||
| 576 | CONFIG_KPROBES_SANITY_TEST=y | 608 | CONFIG_KPROBES_SANITY_TEST=y |
| 577 | CONFIG_RBTREE_TEST=m | 609 | CONFIG_RBTREE_TEST=y |
| 578 | CONFIG_INTERVAL_TREE_TEST=m | 610 | CONFIG_INTERVAL_TREE_TEST=m |
| 611 | CONFIG_PERCPU_TEST=m | ||
| 579 | CONFIG_ATOMIC64_SELFTEST=y | 612 | CONFIG_ATOMIC64_SELFTEST=y |
| 580 | CONFIG_DMA_API_DEBUG=y | 613 | CONFIG_DMA_API_DEBUG=y |
| 581 | # CONFIG_STRICT_DEVMEM is not set | 614 | # CONFIG_STRICT_DEVMEM is not set |
| @@ -638,7 +671,6 @@ CONFIG_CRYPTO_AES_S390=m | |||
| 638 | CONFIG_CRYPTO_GHASH_S390=m | 671 | CONFIG_CRYPTO_GHASH_S390=m |
| 639 | CONFIG_ASYMMETRIC_KEY_TYPE=m | 672 | CONFIG_ASYMMETRIC_KEY_TYPE=m |
| 640 | CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=m | 673 | CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=m |
| 641 | CONFIG_PUBLIC_KEY_ALGO_RSA=m | ||
| 642 | CONFIG_X509_CERTIFICATE_PARSER=m | 674 | CONFIG_X509_CERTIFICATE_PARSER=m |
| 643 | CONFIG_CRC7=m | 675 | CONFIG_CRC7=m |
| 644 | CONFIG_CRC8=m | 676 | CONFIG_CRC8=m |
diff --git a/arch/s390/configs/gcov_defconfig b/arch/s390/configs/gcov_defconfig index b9f6b4cab927..c81a74e3e25a 100644 --- a/arch/s390/configs/gcov_defconfig +++ b/arch/s390/configs/gcov_defconfig | |||
| @@ -46,6 +46,7 @@ CONFIG_UNIXWARE_DISKLABEL=y | |||
| 46 | CONFIG_CFQ_GROUP_IOSCHED=y | 46 | CONFIG_CFQ_GROUP_IOSCHED=y |
| 47 | CONFIG_DEFAULT_DEADLINE=y | 47 | CONFIG_DEFAULT_DEADLINE=y |
| 48 | CONFIG_MARCH_Z9_109=y | 48 | CONFIG_MARCH_Z9_109=y |
| 49 | CONFIG_NR_CPUS=256 | ||
| 49 | CONFIG_HZ_100=y | 50 | CONFIG_HZ_100=y |
| 50 | CONFIG_MEMORY_HOTPLUG=y | 51 | CONFIG_MEMORY_HOTPLUG=y |
| 51 | CONFIG_MEMORY_HOTREMOVE=y | 52 | CONFIG_MEMORY_HOTREMOVE=y |
| @@ -56,7 +57,6 @@ CONFIG_HOTPLUG_PCI=y | |||
| 56 | CONFIG_HOTPLUG_PCI_S390=y | 57 | CONFIG_HOTPLUG_PCI_S390=y |
| 57 | CONFIG_CHSC_SCH=y | 58 | CONFIG_CHSC_SCH=y |
| 58 | CONFIG_CRASH_DUMP=y | 59 | CONFIG_CRASH_DUMP=y |
| 59 | CONFIG_ZFCPDUMP=y | ||
| 60 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | 60 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set |
| 61 | CONFIG_BINFMT_MISC=m | 61 | CONFIG_BINFMT_MISC=m |
| 62 | CONFIG_HIBERNATION=y | 62 | CONFIG_HIBERNATION=y |
| @@ -99,7 +99,6 @@ CONFIG_TCP_CONG_VENO=m | |||
| 99 | CONFIG_TCP_CONG_YEAH=m | 99 | CONFIG_TCP_CONG_YEAH=m |
| 100 | CONFIG_TCP_CONG_ILLINOIS=m | 100 | CONFIG_TCP_CONG_ILLINOIS=m |
| 101 | CONFIG_IPV6=y | 101 | CONFIG_IPV6=y |
| 102 | CONFIG_IPV6_PRIVACY=y | ||
| 103 | CONFIG_IPV6_ROUTER_PREF=y | 102 | CONFIG_IPV6_ROUTER_PREF=y |
| 104 | CONFIG_INET6_AH=m | 103 | CONFIG_INET6_AH=m |
| 105 | CONFIG_INET6_ESP=m | 104 | CONFIG_INET6_ESP=m |
| @@ -109,6 +108,7 @@ CONFIG_INET6_XFRM_MODE_TRANSPORT=m | |||
| 109 | CONFIG_INET6_XFRM_MODE_TUNNEL=m | 108 | CONFIG_INET6_XFRM_MODE_TUNNEL=m |
| 110 | CONFIG_INET6_XFRM_MODE_BEET=m | 109 | CONFIG_INET6_XFRM_MODE_BEET=m |
| 111 | CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m | 110 | CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m |
| 111 | CONFIG_IPV6_VTI=m | ||
| 112 | CONFIG_IPV6_SIT=m | 112 | CONFIG_IPV6_SIT=m |
| 113 | CONFIG_IPV6_GRE=m | 113 | CONFIG_IPV6_GRE=m |
| 114 | CONFIG_IPV6_MULTIPLE_TABLES=y | 114 | CONFIG_IPV6_MULTIPLE_TABLES=y |
| @@ -133,7 +133,17 @@ CONFIG_NF_CONNTRACK_SIP=m | |||
| 133 | CONFIG_NF_CONNTRACK_TFTP=m | 133 | CONFIG_NF_CONNTRACK_TFTP=m |
| 134 | CONFIG_NF_CT_NETLINK=m | 134 | CONFIG_NF_CT_NETLINK=m |
| 135 | CONFIG_NF_CT_NETLINK_TIMEOUT=m | 135 | CONFIG_NF_CT_NETLINK_TIMEOUT=m |
| 136 | CONFIG_NETFILTER_TPROXY=m | 136 | CONFIG_NF_TABLES=m |
| 137 | CONFIG_NFT_EXTHDR=m | ||
| 138 | CONFIG_NFT_META=m | ||
| 139 | CONFIG_NFT_CT=m | ||
| 140 | CONFIG_NFT_RBTREE=m | ||
| 141 | CONFIG_NFT_HASH=m | ||
| 142 | CONFIG_NFT_COUNTER=m | ||
| 143 | CONFIG_NFT_LOG=m | ||
| 144 | CONFIG_NFT_LIMIT=m | ||
| 145 | CONFIG_NFT_NAT=m | ||
| 146 | CONFIG_NFT_COMPAT=m | ||
| 137 | CONFIG_NETFILTER_XT_SET=m | 147 | CONFIG_NETFILTER_XT_SET=m |
| 138 | CONFIG_NETFILTER_XT_TARGET_AUDIT=m | 148 | CONFIG_NETFILTER_XT_TARGET_AUDIT=m |
| 139 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m | 149 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m |
| @@ -202,7 +212,9 @@ CONFIG_IP_SET_HASH_IP=m | |||
| 202 | CONFIG_IP_SET_HASH_IPPORT=m | 212 | CONFIG_IP_SET_HASH_IPPORT=m |
| 203 | CONFIG_IP_SET_HASH_IPPORTIP=m | 213 | CONFIG_IP_SET_HASH_IPPORTIP=m |
| 204 | CONFIG_IP_SET_HASH_IPPORTNET=m | 214 | CONFIG_IP_SET_HASH_IPPORTNET=m |
| 215 | CONFIG_IP_SET_HASH_NETPORTNET=m | ||
| 205 | CONFIG_IP_SET_HASH_NET=m | 216 | CONFIG_IP_SET_HASH_NET=m |
| 217 | CONFIG_IP_SET_HASH_NETNET=m | ||
| 206 | CONFIG_IP_SET_HASH_NETPORT=m | 218 | CONFIG_IP_SET_HASH_NETPORT=m |
| 207 | CONFIG_IP_SET_HASH_NETIFACE=m | 219 | CONFIG_IP_SET_HASH_NETIFACE=m |
| 208 | CONFIG_IP_SET_LIST_SET=m | 220 | CONFIG_IP_SET_LIST_SET=m |
| @@ -225,6 +237,11 @@ CONFIG_IP_VS_FTP=m | |||
| 225 | CONFIG_IP_VS_PE_SIP=m | 237 | CONFIG_IP_VS_PE_SIP=m |
| 226 | CONFIG_NF_CONNTRACK_IPV4=m | 238 | CONFIG_NF_CONNTRACK_IPV4=m |
| 227 | # CONFIG_NF_CONNTRACK_PROC_COMPAT is not set | 239 | # CONFIG_NF_CONNTRACK_PROC_COMPAT is not set |
| 240 | CONFIG_NF_TABLES_IPV4=m | ||
| 241 | CONFIG_NFT_REJECT_IPV4=m | ||
| 242 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m | ||
| 243 | CONFIG_NFT_CHAIN_NAT_IPV4=m | ||
| 244 | CONFIG_NF_TABLES_ARP=m | ||
| 228 | CONFIG_IP_NF_IPTABLES=m | 245 | CONFIG_IP_NF_IPTABLES=m |
| 229 | CONFIG_IP_NF_MATCH_AH=m | 246 | CONFIG_IP_NF_MATCH_AH=m |
| 230 | CONFIG_IP_NF_MATCH_ECN=m | 247 | CONFIG_IP_NF_MATCH_ECN=m |
| @@ -247,6 +264,9 @@ CONFIG_IP_NF_ARPTABLES=m | |||
| 247 | CONFIG_IP_NF_ARPFILTER=m | 264 | CONFIG_IP_NF_ARPFILTER=m |
| 248 | CONFIG_IP_NF_ARP_MANGLE=m | 265 | CONFIG_IP_NF_ARP_MANGLE=m |
| 249 | CONFIG_NF_CONNTRACK_IPV6=m | 266 | CONFIG_NF_CONNTRACK_IPV6=m |
| 267 | CONFIG_NF_TABLES_IPV6=m | ||
| 268 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m | ||
| 269 | CONFIG_NFT_CHAIN_NAT_IPV6=m | ||
| 250 | CONFIG_IP6_NF_IPTABLES=m | 270 | CONFIG_IP6_NF_IPTABLES=m |
| 251 | CONFIG_IP6_NF_MATCH_AH=m | 271 | CONFIG_IP6_NF_MATCH_AH=m |
| 252 | CONFIG_IP6_NF_MATCH_EUI64=m | 272 | CONFIG_IP6_NF_MATCH_EUI64=m |
| @@ -266,6 +286,7 @@ CONFIG_IP6_NF_SECURITY=m | |||
| 266 | CONFIG_NF_NAT_IPV6=m | 286 | CONFIG_NF_NAT_IPV6=m |
| 267 | CONFIG_IP6_NF_TARGET_MASQUERADE=m | 287 | CONFIG_IP6_NF_TARGET_MASQUERADE=m |
| 268 | CONFIG_IP6_NF_TARGET_NPT=m | 288 | CONFIG_IP6_NF_TARGET_NPT=m |
| 289 | CONFIG_NF_TABLES_BRIDGE=m | ||
| 269 | CONFIG_NET_SCTPPROBE=m | 290 | CONFIG_NET_SCTPPROBE=m |
| 270 | CONFIG_RDS=m | 291 | CONFIG_RDS=m |
| 271 | CONFIG_RDS_RDMA=m | 292 | CONFIG_RDS_RDMA=m |
| @@ -311,6 +332,7 @@ CONFIG_NET_CLS_RSVP=m | |||
| 311 | CONFIG_NET_CLS_RSVP6=m | 332 | CONFIG_NET_CLS_RSVP6=m |
| 312 | CONFIG_NET_CLS_FLOW=m | 333 | CONFIG_NET_CLS_FLOW=m |
| 313 | CONFIG_NET_CLS_CGROUP=y | 334 | CONFIG_NET_CLS_CGROUP=y |
| 335 | CONFIG_NET_CLS_BPF=m | ||
| 314 | CONFIG_NET_CLS_ACT=y | 336 | CONFIG_NET_CLS_ACT=y |
| 315 | CONFIG_NET_ACT_POLICE=m | 337 | CONFIG_NET_ACT_POLICE=m |
| 316 | CONFIG_NET_ACT_GACT=m | 338 | CONFIG_NET_ACT_GACT=m |
| @@ -378,8 +400,8 @@ CONFIG_BLK_DEV_DM=m | |||
| 378 | CONFIG_DM_CRYPT=m | 400 | CONFIG_DM_CRYPT=m |
| 379 | CONFIG_DM_SNAPSHOT=m | 401 | CONFIG_DM_SNAPSHOT=m |
| 380 | CONFIG_DM_MIRROR=m | 402 | CONFIG_DM_MIRROR=m |
| 381 | CONFIG_DM_RAID=m | ||
| 382 | CONFIG_DM_LOG_USERSPACE=m | 403 | CONFIG_DM_LOG_USERSPACE=m |
| 404 | CONFIG_DM_RAID=m | ||
| 383 | CONFIG_DM_ZERO=m | 405 | CONFIG_DM_ZERO=m |
| 384 | CONFIG_DM_MULTIPATH=m | 406 | CONFIG_DM_MULTIPATH=m |
| 385 | CONFIG_DM_MULTIPATH_QL=m | 407 | CONFIG_DM_MULTIPATH_QL=m |
| @@ -431,7 +453,6 @@ CONFIG_TN3270_FS=y | |||
| 431 | CONFIG_WATCHDOG=y | 453 | CONFIG_WATCHDOG=y |
| 432 | CONFIG_WATCHDOG_NOWAYOUT=y | 454 | CONFIG_WATCHDOG_NOWAYOUT=y |
| 433 | CONFIG_SOFT_WATCHDOG=m | 455 | CONFIG_SOFT_WATCHDOG=m |
| 434 | CONFIG_ZVM_WATCHDOG=m | ||
| 435 | # CONFIG_HID is not set | 456 | # CONFIG_HID is not set |
| 436 | # CONFIG_USB_SUPPORT is not set | 457 | # CONFIG_USB_SUPPORT is not set |
| 437 | CONFIG_INFINIBAND=m | 458 | CONFIG_INFINIBAND=m |
| @@ -540,6 +561,7 @@ CONFIG_BLK_DEV_IO_TRACE=y | |||
| 540 | CONFIG_LKDTM=m | 561 | CONFIG_LKDTM=m |
| 541 | CONFIG_RBTREE_TEST=m | 562 | CONFIG_RBTREE_TEST=m |
| 542 | CONFIG_INTERVAL_TREE_TEST=m | 563 | CONFIG_INTERVAL_TREE_TEST=m |
| 564 | CONFIG_PERCPU_TEST=m | ||
| 543 | CONFIG_ATOMIC64_SELFTEST=y | 565 | CONFIG_ATOMIC64_SELFTEST=y |
| 544 | # CONFIG_STRICT_DEVMEM is not set | 566 | # CONFIG_STRICT_DEVMEM is not set |
| 545 | CONFIG_S390_PTDUMP=y | 567 | CONFIG_S390_PTDUMP=y |
| @@ -601,7 +623,6 @@ CONFIG_CRYPTO_AES_S390=m | |||
| 601 | CONFIG_CRYPTO_GHASH_S390=m | 623 | CONFIG_CRYPTO_GHASH_S390=m |
| 602 | CONFIG_ASYMMETRIC_KEY_TYPE=m | 624 | CONFIG_ASYMMETRIC_KEY_TYPE=m |
| 603 | CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=m | 625 | CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=m |
| 604 | CONFIG_PUBLIC_KEY_ALGO_RSA=m | ||
| 605 | CONFIG_X509_CERTIFICATE_PARSER=m | 626 | CONFIG_X509_CERTIFICATE_PARSER=m |
| 606 | CONFIG_CRC7=m | 627 | CONFIG_CRC7=m |
| 607 | CONFIG_CRC8=m | 628 | CONFIG_CRC8=m |
diff --git a/arch/s390/configs/performance_defconfig b/arch/s390/configs/performance_defconfig index 91087b43e8fa..b5ba8fe1cc64 100644 --- a/arch/s390/configs/performance_defconfig +++ b/arch/s390/configs/performance_defconfig | |||
| @@ -44,6 +44,7 @@ CONFIG_UNIXWARE_DISKLABEL=y | |||
| 44 | CONFIG_CFQ_GROUP_IOSCHED=y | 44 | CONFIG_CFQ_GROUP_IOSCHED=y |
| 45 | CONFIG_DEFAULT_DEADLINE=y | 45 | CONFIG_DEFAULT_DEADLINE=y |
| 46 | CONFIG_MARCH_Z9_109=y | 46 | CONFIG_MARCH_Z9_109=y |
| 47 | CONFIG_NR_CPUS=256 | ||
| 47 | CONFIG_HZ_100=y | 48 | CONFIG_HZ_100=y |
| 48 | CONFIG_MEMORY_HOTPLUG=y | 49 | CONFIG_MEMORY_HOTPLUG=y |
| 49 | CONFIG_MEMORY_HOTREMOVE=y | 50 | CONFIG_MEMORY_HOTREMOVE=y |
| @@ -54,7 +55,6 @@ CONFIG_HOTPLUG_PCI=y | |||
| 54 | CONFIG_HOTPLUG_PCI_S390=y | 55 | CONFIG_HOTPLUG_PCI_S390=y |
| 55 | CONFIG_CHSC_SCH=y | 56 | CONFIG_CHSC_SCH=y |
| 56 | CONFIG_CRASH_DUMP=y | 57 | CONFIG_CRASH_DUMP=y |
| 57 | CONFIG_ZFCPDUMP=y | ||
| 58 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | 58 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set |
| 59 | CONFIG_BINFMT_MISC=m | 59 | CONFIG_BINFMT_MISC=m |
| 60 | CONFIG_HIBERNATION=y | 60 | CONFIG_HIBERNATION=y |
| @@ -97,7 +97,6 @@ CONFIG_TCP_CONG_VENO=m | |||
| 97 | CONFIG_TCP_CONG_YEAH=m | 97 | CONFIG_TCP_CONG_YEAH=m |
| 98 | CONFIG_TCP_CONG_ILLINOIS=m | 98 | CONFIG_TCP_CONG_ILLINOIS=m |
| 99 | CONFIG_IPV6=y | 99 | CONFIG_IPV6=y |
| 100 | CONFIG_IPV6_PRIVACY=y | ||
| 101 | CONFIG_IPV6_ROUTER_PREF=y | 100 | CONFIG_IPV6_ROUTER_PREF=y |
| 102 | CONFIG_INET6_AH=m | 101 | CONFIG_INET6_AH=m |
| 103 | CONFIG_INET6_ESP=m | 102 | CONFIG_INET6_ESP=m |
| @@ -107,6 +106,7 @@ CONFIG_INET6_XFRM_MODE_TRANSPORT=m | |||
| 107 | CONFIG_INET6_XFRM_MODE_TUNNEL=m | 106 | CONFIG_INET6_XFRM_MODE_TUNNEL=m |
| 108 | CONFIG_INET6_XFRM_MODE_BEET=m | 107 | CONFIG_INET6_XFRM_MODE_BEET=m |
| 109 | CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m | 108 | CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m |
| 109 | CONFIG_IPV6_VTI=m | ||
| 110 | CONFIG_IPV6_SIT=m | 110 | CONFIG_IPV6_SIT=m |
| 111 | CONFIG_IPV6_GRE=m | 111 | CONFIG_IPV6_GRE=m |
| 112 | CONFIG_IPV6_MULTIPLE_TABLES=y | 112 | CONFIG_IPV6_MULTIPLE_TABLES=y |
| @@ -131,7 +131,17 @@ CONFIG_NF_CONNTRACK_SIP=m | |||
| 131 | CONFIG_NF_CONNTRACK_TFTP=m | 131 | CONFIG_NF_CONNTRACK_TFTP=m |
| 132 | CONFIG_NF_CT_NETLINK=m | 132 | CONFIG_NF_CT_NETLINK=m |
| 133 | CONFIG_NF_CT_NETLINK_TIMEOUT=m | 133 | CONFIG_NF_CT_NETLINK_TIMEOUT=m |
| 134 | CONFIG_NETFILTER_TPROXY=m | 134 | CONFIG_NF_TABLES=m |
| 135 | CONFIG_NFT_EXTHDR=m | ||
| 136 | CONFIG_NFT_META=m | ||
| 137 | CONFIG_NFT_CT=m | ||
| 138 | CONFIG_NFT_RBTREE=m | ||
| 139 | CONFIG_NFT_HASH=m | ||
| 140 | CONFIG_NFT_COUNTER=m | ||
| 141 | CONFIG_NFT_LOG=m | ||
| 142 | CONFIG_NFT_LIMIT=m | ||
| 143 | CONFIG_NFT_NAT=m | ||
| 144 | CONFIG_NFT_COMPAT=m | ||
| 135 | CONFIG_NETFILTER_XT_SET=m | 145 | CONFIG_NETFILTER_XT_SET=m |
| 136 | CONFIG_NETFILTER_XT_TARGET_AUDIT=m | 146 | CONFIG_NETFILTER_XT_TARGET_AUDIT=m |
| 137 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m | 147 | CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m |
| @@ -200,7 +210,9 @@ CONFIG_IP_SET_HASH_IP=m | |||
| 200 | CONFIG_IP_SET_HASH_IPPORT=m | 210 | CONFIG_IP_SET_HASH_IPPORT=m |
| 201 | CONFIG_IP_SET_HASH_IPPORTIP=m | 211 | CONFIG_IP_SET_HASH_IPPORTIP=m |
| 202 | CONFIG_IP_SET_HASH_IPPORTNET=m | 212 | CONFIG_IP_SET_HASH_IPPORTNET=m |
| 213 | CONFIG_IP_SET_HASH_NETPORTNET=m | ||
| 203 | CONFIG_IP_SET_HASH_NET=m | 214 | CONFIG_IP_SET_HASH_NET=m |
| 215 | CONFIG_IP_SET_HASH_NETNET=m | ||
| 204 | CONFIG_IP_SET_HASH_NETPORT=m | 216 | CONFIG_IP_SET_HASH_NETPORT=m |
| 205 | CONFIG_IP_SET_HASH_NETIFACE=m | 217 | CONFIG_IP_SET_HASH_NETIFACE=m |
| 206 | CONFIG_IP_SET_LIST_SET=m | 218 | CONFIG_IP_SET_LIST_SET=m |
| @@ -223,6 +235,11 @@ CONFIG_IP_VS_FTP=m | |||
| 223 | CONFIG_IP_VS_PE_SIP=m | 235 | CONFIG_IP_VS_PE_SIP=m |
| 224 | CONFIG_NF_CONNTRACK_IPV4=m | 236 | CONFIG_NF_CONNTRACK_IPV4=m |
| 225 | # CONFIG_NF_CONNTRACK_PROC_COMPAT is not set | 237 | # CONFIG_NF_CONNTRACK_PROC_COMPAT is not set |
| 238 | CONFIG_NF_TABLES_IPV4=m | ||
| 239 | CONFIG_NFT_REJECT_IPV4=m | ||
| 240 | CONFIG_NFT_CHAIN_ROUTE_IPV4=m | ||
| 241 | CONFIG_NFT_CHAIN_NAT_IPV4=m | ||
| 242 | CONFIG_NF_TABLES_ARP=m | ||
| 226 | CONFIG_IP_NF_IPTABLES=m | 243 | CONFIG_IP_NF_IPTABLES=m |
| 227 | CONFIG_IP_NF_MATCH_AH=m | 244 | CONFIG_IP_NF_MATCH_AH=m |
| 228 | CONFIG_IP_NF_MATCH_ECN=m | 245 | CONFIG_IP_NF_MATCH_ECN=m |
| @@ -245,6 +262,9 @@ CONFIG_IP_NF_ARPTABLES=m | |||
| 245 | CONFIG_IP_NF_ARPFILTER=m | 262 | CONFIG_IP_NF_ARPFILTER=m |
| 246 | CONFIG_IP_NF_ARP_MANGLE=m | 263 | CONFIG_IP_NF_ARP_MANGLE=m |
| 247 | CONFIG_NF_CONNTRACK_IPV6=m | 264 | CONFIG_NF_CONNTRACK_IPV6=m |
| 265 | CONFIG_NF_TABLES_IPV6=m | ||
| 266 | CONFIG_NFT_CHAIN_ROUTE_IPV6=m | ||
| 267 | CONFIG_NFT_CHAIN_NAT_IPV6=m | ||
| 248 | CONFIG_IP6_NF_IPTABLES=m | 268 | CONFIG_IP6_NF_IPTABLES=m |
| 249 | CONFIG_IP6_NF_MATCH_AH=m | 269 | CONFIG_IP6_NF_MATCH_AH=m |
| 250 | CONFIG_IP6_NF_MATCH_EUI64=m | 270 | CONFIG_IP6_NF_MATCH_EUI64=m |
| @@ -264,6 +284,7 @@ CONFIG_IP6_NF_SECURITY=m | |||
| 264 | CONFIG_NF_NAT_IPV6=m | 284 | CONFIG_NF_NAT_IPV6=m |
| 265 | CONFIG_IP6_NF_TARGET_MASQUERADE=m | 285 | CONFIG_IP6_NF_TARGET_MASQUERADE=m |
| 266 | CONFIG_IP6_NF_TARGET_NPT=m | 286 | CONFIG_IP6_NF_TARGET_NPT=m |
| 287 | CONFIG_NF_TABLES_BRIDGE=m | ||
| 267 | CONFIG_NET_SCTPPROBE=m | 288 | CONFIG_NET_SCTPPROBE=m |
| 268 | CONFIG_RDS=m | 289 | CONFIG_RDS=m |
| 269 | CONFIG_RDS_RDMA=m | 290 | CONFIG_RDS_RDMA=m |
| @@ -309,6 +330,7 @@ CONFIG_NET_CLS_RSVP=m | |||
| 309 | CONFIG_NET_CLS_RSVP6=m | 330 | CONFIG_NET_CLS_RSVP6=m |
| 310 | CONFIG_NET_CLS_FLOW=m | 331 | CONFIG_NET_CLS_FLOW=m |
| 311 | CONFIG_NET_CLS_CGROUP=y | 332 | CONFIG_NET_CLS_CGROUP=y |
| 333 | CONFIG_NET_CLS_BPF=m | ||
| 312 | CONFIG_NET_CLS_ACT=y | 334 | CONFIG_NET_CLS_ACT=y |
| 313 | CONFIG_NET_ACT_POLICE=m | 335 | CONFIG_NET_ACT_POLICE=m |
| 314 | CONFIG_NET_ACT_GACT=m | 336 | CONFIG_NET_ACT_GACT=m |
| @@ -376,8 +398,8 @@ CONFIG_BLK_DEV_DM=m | |||
| 376 | CONFIG_DM_CRYPT=m | 398 | CONFIG_DM_CRYPT=m |
| 377 | CONFIG_DM_SNAPSHOT=m | 399 | CONFIG_DM_SNAPSHOT=m |
| 378 | CONFIG_DM_MIRROR=m | 400 | CONFIG_DM_MIRROR=m |
| 379 | CONFIG_DM_RAID=m | ||
| 380 | CONFIG_DM_LOG_USERSPACE=m | 401 | CONFIG_DM_LOG_USERSPACE=m |
| 402 | CONFIG_DM_RAID=m | ||
| 381 | CONFIG_DM_ZERO=m | 403 | CONFIG_DM_ZERO=m |
| 382 | CONFIG_DM_MULTIPATH=m | 404 | CONFIG_DM_MULTIPATH=m |
| 383 | CONFIG_DM_MULTIPATH_QL=m | 405 | CONFIG_DM_MULTIPATH_QL=m |
| @@ -429,7 +451,6 @@ CONFIG_TN3270_FS=y | |||
| 429 | CONFIG_WATCHDOG=y | 451 | CONFIG_WATCHDOG=y |
| 430 | CONFIG_WATCHDOG_NOWAYOUT=y | 452 | CONFIG_WATCHDOG_NOWAYOUT=y |
| 431 | CONFIG_SOFT_WATCHDOG=m | 453 | CONFIG_SOFT_WATCHDOG=m |
| 432 | CONFIG_ZVM_WATCHDOG=m | ||
| 433 | # CONFIG_HID is not set | 454 | # CONFIG_HID is not set |
| 434 | # CONFIG_USB_SUPPORT is not set | 455 | # CONFIG_USB_SUPPORT is not set |
| 435 | CONFIG_INFINIBAND=m | 456 | CONFIG_INFINIBAND=m |
| @@ -532,6 +553,7 @@ CONFIG_LATENCYTOP=y | |||
| 532 | CONFIG_BLK_DEV_IO_TRACE=y | 553 | CONFIG_BLK_DEV_IO_TRACE=y |
| 533 | # CONFIG_KPROBE_EVENT is not set | 554 | # CONFIG_KPROBE_EVENT is not set |
| 534 | CONFIG_LKDTM=m | 555 | CONFIG_LKDTM=m |
| 556 | CONFIG_PERCPU_TEST=m | ||
| 535 | CONFIG_ATOMIC64_SELFTEST=y | 557 | CONFIG_ATOMIC64_SELFTEST=y |
| 536 | # CONFIG_STRICT_DEVMEM is not set | 558 | # CONFIG_STRICT_DEVMEM is not set |
| 537 | CONFIG_S390_PTDUMP=y | 559 | CONFIG_S390_PTDUMP=y |
| @@ -593,7 +615,6 @@ CONFIG_CRYPTO_AES_S390=m | |||
| 593 | CONFIG_CRYPTO_GHASH_S390=m | 615 | CONFIG_CRYPTO_GHASH_S390=m |
| 594 | CONFIG_ASYMMETRIC_KEY_TYPE=m | 616 | CONFIG_ASYMMETRIC_KEY_TYPE=m |
| 595 | CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=m | 617 | CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=m |
| 596 | CONFIG_PUBLIC_KEY_ALGO_RSA=m | ||
| 597 | CONFIG_X509_CERTIFICATE_PARSER=m | 618 | CONFIG_X509_CERTIFICATE_PARSER=m |
| 598 | CONFIG_CRC7=m | 619 | CONFIG_CRC7=m |
| 599 | CONFIG_CRC8=m | 620 | CONFIG_CRC8=m |
diff --git a/arch/s390/configs/zfcpdump_defconfig b/arch/s390/configs/zfcpdump_defconfig index d725c4d956e4..cef073ca1f07 100644 --- a/arch/s390/configs/zfcpdump_defconfig +++ b/arch/s390/configs/zfcpdump_defconfig | |||
| @@ -19,7 +19,6 @@ CONFIG_HZ_100=y | |||
| 19 | # CONFIG_CHSC_SCH is not set | 19 | # CONFIG_CHSC_SCH is not set |
| 20 | # CONFIG_SCM_BUS is not set | 20 | # CONFIG_SCM_BUS is not set |
| 21 | CONFIG_CRASH_DUMP=y | 21 | CONFIG_CRASH_DUMP=y |
| 22 | CONFIG_ZFCPDUMP=y | ||
| 23 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | 22 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set |
| 24 | # CONFIG_SECCOMP is not set | 23 | # CONFIG_SECCOMP is not set |
| 25 | # CONFIG_IUCV is not set | 24 | # CONFIG_IUCV is not set |
diff --git a/arch/s390/defconfig b/arch/s390/defconfig index 33f57514f424..4557cb7ffddf 100644 --- a/arch/s390/defconfig +++ b/arch/s390/defconfig | |||
| @@ -40,6 +40,7 @@ CONFIG_PARTITION_ADVANCED=y | |||
| 40 | CONFIG_IBM_PARTITION=y | 40 | CONFIG_IBM_PARTITION=y |
| 41 | CONFIG_DEFAULT_DEADLINE=y | 41 | CONFIG_DEFAULT_DEADLINE=y |
| 42 | CONFIG_MARCH_Z196=y | 42 | CONFIG_MARCH_Z196=y |
| 43 | CONFIG_NR_CPUS=256 | ||
| 43 | CONFIG_HZ_100=y | 44 | CONFIG_HZ_100=y |
| 44 | CONFIG_MEMORY_HOTPLUG=y | 45 | CONFIG_MEMORY_HOTPLUG=y |
| 45 | CONFIG_MEMORY_HOTREMOVE=y | 46 | CONFIG_MEMORY_HOTREMOVE=y |
| @@ -122,22 +123,31 @@ CONFIG_TMPFS=y | |||
| 122 | CONFIG_TMPFS_POSIX_ACL=y | 123 | CONFIG_TMPFS_POSIX_ACL=y |
| 123 | CONFIG_HUGETLBFS=y | 124 | CONFIG_HUGETLBFS=y |
| 124 | # CONFIG_NETWORK_FILESYSTEMS is not set | 125 | # CONFIG_NETWORK_FILESYSTEMS is not set |
| 126 | CONFIG_UNUSED_SYMBOLS=y | ||
| 127 | CONFIG_DEBUG_SECTION_MISMATCH=y | ||
| 125 | CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y | 128 | CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y |
| 126 | CONFIG_MAGIC_SYSRQ=y | 129 | CONFIG_MAGIC_SYSRQ=y |
| 127 | CONFIG_DEBUG_PAGEALLOC=y | 130 | CONFIG_DEBUG_PAGEALLOC=y |
| 131 | CONFIG_DETECT_HUNG_TASK=y | ||
| 128 | CONFIG_TIMER_STATS=y | 132 | CONFIG_TIMER_STATS=y |
| 133 | CONFIG_DEBUG_RT_MUTEXES=y | ||
| 129 | CONFIG_PROVE_LOCKING=y | 134 | CONFIG_PROVE_LOCKING=y |
| 130 | CONFIG_LOCK_STAT=y | 135 | CONFIG_LOCK_STAT=y |
| 131 | CONFIG_DEBUG_LOCKDEP=y | 136 | CONFIG_DEBUG_LOCKDEP=y |
| 137 | CONFIG_DEBUG_ATOMIC_SLEEP=y | ||
| 138 | CONFIG_DEBUG_WRITECOUNT=y | ||
| 132 | CONFIG_DEBUG_LIST=y | 139 | CONFIG_DEBUG_LIST=y |
| 140 | CONFIG_DEBUG_SG=y | ||
| 133 | CONFIG_DEBUG_NOTIFIERS=y | 141 | CONFIG_DEBUG_NOTIFIERS=y |
| 134 | CONFIG_PROVE_RCU=y | 142 | CONFIG_PROVE_RCU=y |
| 135 | CONFIG_RCU_CPU_STALL_TIMEOUT=60 | 143 | CONFIG_RCU_CPU_STALL_TIMEOUT=60 |
| 136 | CONFIG_RCU_TRACE=y | 144 | CONFIG_RCU_TRACE=y |
| 137 | CONFIG_LATENCYTOP=y | 145 | CONFIG_LATENCYTOP=y |
| 146 | CONFIG_DEBUG_STRICT_USER_COPY_CHECKS=y | ||
| 138 | CONFIG_BLK_DEV_IO_TRACE=y | 147 | CONFIG_BLK_DEV_IO_TRACE=y |
| 139 | CONFIG_KPROBES_SANITY_TEST=y | 148 | CONFIG_KPROBES_SANITY_TEST=y |
| 140 | # CONFIG_STRICT_DEVMEM is not set | 149 | # CONFIG_STRICT_DEVMEM is not set |
| 150 | CONFIG_S390_PTDUMP=y | ||
| 141 | CONFIG_CRYPTO_CRYPTD=m | 151 | CONFIG_CRYPTO_CRYPTD=m |
| 142 | CONFIG_CRYPTO_AUTHENC=m | 152 | CONFIG_CRYPTO_AUTHENC=m |
| 143 | CONFIG_CRYPTO_TEST=m | 153 | CONFIG_CRYPTO_TEST=m |
diff --git a/arch/s390/hypfs/hypfs_vm.c b/arch/s390/hypfs/hypfs_vm.c index 24908ce149f1..32040ace00ea 100644 --- a/arch/s390/hypfs/hypfs_vm.c +++ b/arch/s390/hypfs/hypfs_vm.c | |||
| @@ -32,7 +32,7 @@ struct diag2fc_data { | |||
| 32 | __u32 pcpus; | 32 | __u32 pcpus; |
| 33 | __u32 lcpus; | 33 | __u32 lcpus; |
| 34 | __u32 vcpus; | 34 | __u32 vcpus; |
| 35 | __u32 cpu_min; | 35 | __u32 ocpus; |
| 36 | __u32 cpu_max; | 36 | __u32 cpu_max; |
| 37 | __u32 cpu_shares; | 37 | __u32 cpu_shares; |
| 38 | __u32 cpu_use_samp; | 38 | __u32 cpu_use_samp; |
| @@ -142,7 +142,12 @@ static int hpyfs_vm_create_guest(struct dentry *systems_dir, | |||
| 142 | ATTRIBUTE(cpus_dir, "capped", capped_value); | 142 | ATTRIBUTE(cpus_dir, "capped", capped_value); |
| 143 | ATTRIBUTE(cpus_dir, "dedicated", dedicated_flag); | 143 | ATTRIBUTE(cpus_dir, "dedicated", dedicated_flag); |
| 144 | ATTRIBUTE(cpus_dir, "count", data->vcpus); | 144 | ATTRIBUTE(cpus_dir, "count", data->vcpus); |
| 145 | ATTRIBUTE(cpus_dir, "weight_min", data->cpu_min); | 145 | /* |
| 146 | * Note: The "weight_min" attribute got the wrong name. | ||
| 147 | * The value represents the number of non-stopped (operating) | ||
| 148 | * CPUS. | ||
| 149 | */ | ||
| 150 | ATTRIBUTE(cpus_dir, "weight_min", data->ocpus); | ||
| 146 | ATTRIBUTE(cpus_dir, "weight_max", data->cpu_max); | 151 | ATTRIBUTE(cpus_dir, "weight_max", data->cpu_max); |
| 147 | ATTRIBUTE(cpus_dir, "weight_cur", data->cpu_shares); | 152 | ATTRIBUTE(cpus_dir, "weight_cur", data->cpu_shares); |
| 148 | 153 | ||
diff --git a/arch/s390/include/asm/Kbuild b/arch/s390/include/asm/Kbuild index 8386a4a1f19a..57892a8a9055 100644 --- a/arch/s390/include/asm/Kbuild +++ b/arch/s390/include/asm/Kbuild | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | 1 | ||
| 2 | 2 | ||
| 3 | generic-y += clkdev.h | 3 | generic-y += clkdev.h |
| 4 | generic-y += trace_clock.h | ||
| 5 | generic-y += preempt.h | ||
| 6 | generic-y += hash.h | 4 | generic-y += hash.h |
| 5 | generic-y += mcs_spinlock.h | ||
| 6 | generic-y += preempt.h | ||
| 7 | generic-y += trace_clock.h | ||
diff --git a/arch/s390/include/asm/airq.h b/arch/s390/include/asm/airq.h index 4bbb5957ed1b..bd93ff6661b8 100644 --- a/arch/s390/include/asm/airq.h +++ b/arch/s390/include/asm/airq.h | |||
| @@ -44,11 +44,21 @@ struct airq_iv { | |||
| 44 | 44 | ||
| 45 | struct airq_iv *airq_iv_create(unsigned long bits, unsigned long flags); | 45 | struct airq_iv *airq_iv_create(unsigned long bits, unsigned long flags); |
| 46 | void airq_iv_release(struct airq_iv *iv); | 46 | void airq_iv_release(struct airq_iv *iv); |
| 47 | unsigned long airq_iv_alloc_bit(struct airq_iv *iv); | 47 | unsigned long airq_iv_alloc(struct airq_iv *iv, unsigned long num); |
| 48 | void airq_iv_free_bit(struct airq_iv *iv, unsigned long bit); | 48 | void airq_iv_free(struct airq_iv *iv, unsigned long bit, unsigned long num); |
| 49 | unsigned long airq_iv_scan(struct airq_iv *iv, unsigned long start, | 49 | unsigned long airq_iv_scan(struct airq_iv *iv, unsigned long start, |
| 50 | unsigned long end); | 50 | unsigned long end); |
| 51 | 51 | ||
| 52 | static inline unsigned long airq_iv_alloc_bit(struct airq_iv *iv) | ||
| 53 | { | ||
| 54 | return airq_iv_alloc(iv, 1); | ||
| 55 | } | ||
| 56 | |||
| 57 | static inline void airq_iv_free_bit(struct airq_iv *iv, unsigned long bit) | ||
| 58 | { | ||
| 59 | airq_iv_free(iv, bit, 1); | ||
| 60 | } | ||
| 61 | |||
| 52 | static inline unsigned long airq_iv_end(struct airq_iv *iv) | 62 | static inline unsigned long airq_iv_end(struct airq_iv *iv) |
| 53 | { | 63 | { |
| 54 | return iv->end; | 64 | return iv->end; |
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h index 6e6ad0680829..ec5ef891db6b 100644 --- a/arch/s390/include/asm/bitops.h +++ b/arch/s390/include/asm/bitops.h | |||
| @@ -13,9 +13,9 @@ | |||
| 13 | * | 13 | * |
| 14 | * The bitop functions are defined to work on unsigned longs, so for an | 14 | * The bitop functions are defined to work on unsigned longs, so for an |
| 15 | * s390x system the bits end up numbered: | 15 | * s390x system the bits end up numbered: |
| 16 | * |63..............0|127............64|191...........128|255...........196| | 16 | * |63..............0|127............64|191...........128|255...........192| |
| 17 | * and on s390: | 17 | * and on s390: |
| 18 | * |31.....0|63....31|95....64|127...96|159..128|191..160|223..192|255..224| | 18 | * |31.....0|63....32|95....64|127...96|159..128|191..160|223..192|255..224| |
| 19 | * | 19 | * |
| 20 | * There are a few little-endian macros used mostly for filesystem | 20 | * There are a few little-endian macros used mostly for filesystem |
| 21 | * bitmaps, these work on similar bit arrays layouts, but | 21 | * bitmaps, these work on similar bit arrays layouts, but |
| @@ -30,7 +30,7 @@ | |||
| 30 | * on an s390x system the bits are numbered: | 30 | * on an s390x system the bits are numbered: |
| 31 | * |0..............63|64............127|128...........191|192...........255| | 31 | * |0..............63|64............127|128...........191|192...........255| |
| 32 | * and on s390: | 32 | * and on s390: |
| 33 | * |0.....31|31....63|64....95|96...127|128..159|160..191|192..223|224..255| | 33 | * |0.....31|32....63|64....95|96...127|128..159|160..191|192..223|224..255| |
| 34 | * | 34 | * |
| 35 | * The main difference is that bit 0-63 (64b) or 0-31 (32b) in the bit | 35 | * The main difference is that bit 0-63 (64b) or 0-31 (32b) in the bit |
| 36 | * number field needs to be reversed compared to the LSB0 encoded bit | 36 | * number field needs to be reversed compared to the LSB0 encoded bit |
| @@ -304,7 +304,7 @@ static inline int test_bit(unsigned long nr, const volatile unsigned long *ptr) | |||
| 304 | * On an s390x system the bits are numbered: | 304 | * On an s390x system the bits are numbered: |
| 305 | * |0..............63|64............127|128...........191|192...........255| | 305 | * |0..............63|64............127|128...........191|192...........255| |
| 306 | * and on s390: | 306 | * and on s390: |
| 307 | * |0.....31|31....63|64....95|96...127|128..159|160..191|192..223|224..255| | 307 | * |0.....31|32....63|64....95|96...127|128..159|160..191|192..223|224..255| |
| 308 | */ | 308 | */ |
| 309 | unsigned long find_first_bit_inv(const unsigned long *addr, unsigned long size); | 309 | unsigned long find_first_bit_inv(const unsigned long *addr, unsigned long size); |
| 310 | unsigned long find_next_bit_inv(const unsigned long *addr, unsigned long size, | 310 | unsigned long find_next_bit_inv(const unsigned long *addr, unsigned long size, |
diff --git a/arch/s390/include/asm/ccwdev.h b/arch/s390/include/asm/ccwdev.h index f201af8be580..a9c2c0686177 100644 --- a/arch/s390/include/asm/ccwdev.h +++ b/arch/s390/include/asm/ccwdev.h | |||
| @@ -219,7 +219,9 @@ extern void ccw_device_get_id(struct ccw_device *, struct ccw_dev_id *); | |||
| 219 | #define to_ccwdev(n) container_of(n, struct ccw_device, dev) | 219 | #define to_ccwdev(n) container_of(n, struct ccw_device, dev) |
| 220 | #define to_ccwdrv(n) container_of(n, struct ccw_driver, driver) | 220 | #define to_ccwdrv(n) container_of(n, struct ccw_driver, driver) |
| 221 | 221 | ||
| 222 | extern struct ccw_device *ccw_device_probe_console(void); | 222 | extern struct ccw_device *ccw_device_create_console(struct ccw_driver *); |
| 223 | extern void ccw_device_destroy_console(struct ccw_device *); | ||
| 224 | extern int ccw_device_enable_console(struct ccw_device *); | ||
| 223 | extern void ccw_device_wait_idle(struct ccw_device *); | 225 | extern void ccw_device_wait_idle(struct ccw_device *); |
| 224 | extern int ccw_device_force_console(struct ccw_device *); | 226 | extern int ccw_device_force_console(struct ccw_device *); |
| 225 | 227 | ||
diff --git a/arch/s390/include/asm/checksum.h b/arch/s390/include/asm/checksum.h index 4f57a4f3909a..740364856355 100644 --- a/arch/s390/include/asm/checksum.h +++ b/arch/s390/include/asm/checksum.h | |||
| @@ -44,22 +44,15 @@ csum_partial(const void *buff, int len, __wsum sum) | |||
| 44 | * here even more important to align src and dst on a 32-bit (or even | 44 | * here even more important to align src and dst on a 32-bit (or even |
| 45 | * better 64-bit) boundary | 45 | * better 64-bit) boundary |
| 46 | * | 46 | * |
| 47 | * Copy from userspace and compute checksum. If we catch an exception | 47 | * Copy from userspace and compute checksum. |
| 48 | * then zero the rest of the buffer. | ||
| 49 | */ | 48 | */ |
| 50 | static inline __wsum | 49 | static inline __wsum |
| 51 | csum_partial_copy_from_user(const void __user *src, void *dst, | 50 | csum_partial_copy_from_user(const void __user *src, void *dst, |
| 52 | int len, __wsum sum, | 51 | int len, __wsum sum, |
| 53 | int *err_ptr) | 52 | int *err_ptr) |
| 54 | { | 53 | { |
| 55 | int missing; | 54 | if (unlikely(copy_from_user(dst, src, len))) |
| 56 | |||
| 57 | missing = copy_from_user(dst, src, len); | ||
| 58 | if (missing) { | ||
| 59 | memset(dst + len - missing, 0, missing); | ||
| 60 | *err_ptr = -EFAULT; | 55 | *err_ptr = -EFAULT; |
| 61 | } | ||
| 62 | |||
| 63 | return csum_partial(dst, len, sum); | 56 | return csum_partial(dst, len, sum); |
| 64 | } | 57 | } |
| 65 | 58 | ||
diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h index 5d7e8cf83bd6..d350ed9d0fbb 100644 --- a/arch/s390/include/asm/compat.h +++ b/arch/s390/include/asm/compat.h | |||
| @@ -8,7 +8,11 @@ | |||
| 8 | #include <linux/thread_info.h> | 8 | #include <linux/thread_info.h> |
| 9 | 9 | ||
| 10 | #define __TYPE_IS_PTR(t) (!__builtin_types_compatible_p(typeof(0?(t)0:0ULL), u64)) | 10 | #define __TYPE_IS_PTR(t) (!__builtin_types_compatible_p(typeof(0?(t)0:0ULL), u64)) |
| 11 | #define __SC_DELOUSE(t,v) (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)) | 11 | |
| 12 | #define __SC_DELOUSE(t,v) ({ \ | ||
| 13 | BUILD_BUG_ON(sizeof(t) > 4 && !__TYPE_IS_PTR(t)); \ | ||
| 14 | (t)(__TYPE_IS_PTR(t) ? ((v) & 0x7fffffff) : (v)); \ | ||
| 15 | }) | ||
| 12 | 16 | ||
| 13 | #define PSW32_MASK_PER 0x40000000UL | 17 | #define PSW32_MASK_PER 0x40000000UL |
| 14 | #define PSW32_MASK_DAT 0x04000000UL | 18 | #define PSW32_MASK_DAT 0x04000000UL |
diff --git a/arch/s390/include/asm/futex.h b/arch/s390/include/asm/futex.h index 51bcaa0fdeef..fda46bd38c99 100644 --- a/arch/s390/include/asm/futex.h +++ b/arch/s390/include/asm/futex.h | |||
| @@ -5,7 +5,10 @@ | |||
| 5 | #include <linux/uaccess.h> | 5 | #include <linux/uaccess.h> |
| 6 | #include <asm/errno.h> | 6 | #include <asm/errno.h> |
| 7 | 7 | ||
| 8 | static inline int futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr) | 8 | int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, u32 oldval, u32 newval); |
| 9 | int __futex_atomic_op_inuser(int op, u32 __user *uaddr, int oparg, int *old); | ||
| 10 | |||
| 11 | static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr) | ||
| 9 | { | 12 | { |
| 10 | int op = (encoded_op >> 28) & 7; | 13 | int op = (encoded_op >> 28) & 7; |
| 11 | int cmp = (encoded_op >> 24) & 15; | 14 | int cmp = (encoded_op >> 24) & 15; |
| @@ -17,7 +20,7 @@ static inline int futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr) | |||
| 17 | oparg = 1 << oparg; | 20 | oparg = 1 << oparg; |
| 18 | 21 | ||
| 19 | pagefault_disable(); | 22 | pagefault_disable(); |
| 20 | ret = uaccess.futex_atomic_op(op, uaddr, oparg, &oldval); | 23 | ret = __futex_atomic_op_inuser(op, uaddr, oparg, &oldval); |
| 21 | pagefault_enable(); | 24 | pagefault_enable(); |
| 22 | 25 | ||
| 23 | if (!ret) { | 26 | if (!ret) { |
| @@ -34,10 +37,4 @@ static inline int futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr) | |||
| 34 | return ret; | 37 | return ret; |
| 35 | } | 38 | } |
| 36 | 39 | ||
| 37 | static inline int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, | ||
| 38 | u32 oldval, u32 newval) | ||
| 39 | { | ||
| 40 | return uaccess.futex_atomic_cmpxchg(uval, uaddr, oldval, newval); | ||
| 41 | } | ||
| 42 | |||
| 43 | #endif /* _ASM_S390_FUTEX_H */ | 40 | #endif /* _ASM_S390_FUTEX_H */ |
diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h index eef3dd3fd9a9..9bf95bb30f1a 100644 --- a/arch/s390/include/asm/kvm_host.h +++ b/arch/s390/include/asm/kvm_host.h | |||
| @@ -106,7 +106,9 @@ struct kvm_s390_sie_block { | |||
| 106 | __u64 gbea; /* 0x0180 */ | 106 | __u64 gbea; /* 0x0180 */ |
| 107 | __u8 reserved188[24]; /* 0x0188 */ | 107 | __u8 reserved188[24]; /* 0x0188 */ |
| 108 | __u32 fac; /* 0x01a0 */ | 108 | __u32 fac; /* 0x01a0 */ |
| 109 | __u8 reserved1a4[68]; /* 0x01a4 */ | 109 | __u8 reserved1a4[20]; /* 0x01a4 */ |
| 110 | __u64 cbrlo; /* 0x01b8 */ | ||
| 111 | __u8 reserved1c0[40]; /* 0x01c0 */ | ||
| 110 | __u64 itdba; /* 0x01e8 */ | 112 | __u64 itdba; /* 0x01e8 */ |
| 111 | __u8 reserved1f0[16]; /* 0x01f0 */ | 113 | __u8 reserved1f0[16]; /* 0x01f0 */ |
| 112 | } __attribute__((packed)); | 114 | } __attribute__((packed)); |
| @@ -155,6 +157,7 @@ struct kvm_vcpu_stat { | |||
| 155 | u32 instruction_stsi; | 157 | u32 instruction_stsi; |
| 156 | u32 instruction_stfl; | 158 | u32 instruction_stfl; |
| 157 | u32 instruction_tprot; | 159 | u32 instruction_tprot; |
| 160 | u32 instruction_essa; | ||
| 158 | u32 instruction_sigp_sense; | 161 | u32 instruction_sigp_sense; |
| 159 | u32 instruction_sigp_sense_running; | 162 | u32 instruction_sigp_sense_running; |
| 160 | u32 instruction_sigp_external_call; | 163 | u32 instruction_sigp_external_call; |
diff --git a/arch/s390/include/asm/mmu_context.h b/arch/s390/include/asm/mmu_context.h index 5d1f950704dc..38149b63dc44 100644 --- a/arch/s390/include/asm/mmu_context.h +++ b/arch/s390/include/asm/mmu_context.h | |||
| @@ -48,13 +48,42 @@ static inline void update_mm(struct mm_struct *mm, struct task_struct *tsk) | |||
| 48 | static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, | 48 | static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, |
| 49 | struct task_struct *tsk) | 49 | struct task_struct *tsk) |
| 50 | { | 50 | { |
| 51 | cpumask_set_cpu(smp_processor_id(), mm_cpumask(next)); | 51 | int cpu = smp_processor_id(); |
| 52 | update_mm(next, tsk); | 52 | |
| 53 | if (prev == next) | ||
| 54 | return; | ||
| 55 | if (atomic_inc_return(&next->context.attach_count) >> 16) { | ||
| 56 | /* Delay update_mm until all TLB flushes are done. */ | ||
| 57 | set_tsk_thread_flag(tsk, TIF_TLB_WAIT); | ||
| 58 | } else { | ||
| 59 | cpumask_set_cpu(cpu, mm_cpumask(next)); | ||
| 60 | update_mm(next, tsk); | ||
| 61 | if (next->context.flush_mm) | ||
| 62 | /* Flush pending TLBs */ | ||
| 63 | __tlb_flush_mm(next); | ||
| 64 | } | ||
| 53 | atomic_dec(&prev->context.attach_count); | 65 | atomic_dec(&prev->context.attach_count); |
| 54 | WARN_ON(atomic_read(&prev->context.attach_count) < 0); | 66 | WARN_ON(atomic_read(&prev->context.attach_count) < 0); |
| 55 | atomic_inc(&next->context.attach_count); | 67 | } |
| 56 | /* Check for TLBs not flushed yet */ | 68 | |
| 57 | __tlb_flush_mm_lazy(next); | 69 | #define finish_arch_post_lock_switch finish_arch_post_lock_switch |
| 70 | static inline void finish_arch_post_lock_switch(void) | ||
| 71 | { | ||
| 72 | struct task_struct *tsk = current; | ||
| 73 | struct mm_struct *mm = tsk->mm; | ||
| 74 | |||
| 75 | if (!test_tsk_thread_flag(tsk, TIF_TLB_WAIT)) | ||
| 76 | return; | ||
| 77 | preempt_disable(); | ||
| 78 | clear_tsk_thread_flag(tsk, TIF_TLB_WAIT); | ||
| 79 | while (atomic_read(&mm->context.attach_count) >> 16) | ||
| 80 | cpu_relax(); | ||
| 81 | |||
| 82 | cpumask_set_cpu(smp_processor_id(), mm_cpumask(mm)); | ||
| 83 | update_mm(mm, tsk); | ||
| 84 | if (mm->context.flush_mm) | ||
| 85 | __tlb_flush_mm(mm); | ||
| 86 | preempt_enable(); | ||
| 58 | } | 87 | } |
| 59 | 88 | ||
| 60 | #define enter_lazy_tlb(mm,tsk) do { } while (0) | 89 | #define enter_lazy_tlb(mm,tsk) do { } while (0) |
diff --git a/arch/s390/include/asm/pgalloc.h b/arch/s390/include/asm/pgalloc.h index e1408ddb94f8..884017cbfa9f 100644 --- a/arch/s390/include/asm/pgalloc.h +++ b/arch/s390/include/asm/pgalloc.h | |||
| @@ -22,6 +22,7 @@ unsigned long *page_table_alloc(struct mm_struct *, unsigned long); | |||
| 22 | void page_table_free(struct mm_struct *, unsigned long *); | 22 | void page_table_free(struct mm_struct *, unsigned long *); |
| 23 | void page_table_free_rcu(struct mmu_gather *, unsigned long *); | 23 | void page_table_free_rcu(struct mmu_gather *, unsigned long *); |
| 24 | 24 | ||
| 25 | void page_table_reset_pgste(struct mm_struct *, unsigned long, unsigned long); | ||
| 25 | int set_guest_storage_key(struct mm_struct *mm, unsigned long addr, | 26 | int set_guest_storage_key(struct mm_struct *mm, unsigned long addr, |
| 26 | unsigned long key, bool nq); | 27 | unsigned long key, bool nq); |
| 27 | 28 | ||
| @@ -91,11 +92,22 @@ static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long address) | |||
| 91 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr) | 92 | static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr) |
| 92 | { | 93 | { |
| 93 | unsigned long *table = crst_table_alloc(mm); | 94 | unsigned long *table = crst_table_alloc(mm); |
| 94 | if (table) | 95 | |
| 95 | crst_table_init(table, _SEGMENT_ENTRY_EMPTY); | 96 | if (!table) |
| 97 | return NULL; | ||
| 98 | crst_table_init(table, _SEGMENT_ENTRY_EMPTY); | ||
| 99 | if (!pgtable_pmd_page_ctor(virt_to_page(table))) { | ||
| 100 | crst_table_free(mm, table); | ||
| 101 | return NULL; | ||
| 102 | } | ||
| 96 | return (pmd_t *) table; | 103 | return (pmd_t *) table; |
| 97 | } | 104 | } |
| 98 | #define pmd_free(mm, pmd) crst_table_free(mm, (unsigned long *) pmd) | 105 | |
| 106 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) | ||
| 107 | { | ||
| 108 | pgtable_pmd_page_dtor(virt_to_page(pmd)); | ||
| 109 | crst_table_free(mm, (unsigned long *) pmd); | ||
| 110 | } | ||
| 99 | 111 | ||
| 100 | static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud) | 112 | static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud) |
| 101 | { | 113 | { |
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index 2204400d0bd5..1ab75eaacbd4 100644 --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h | |||
| @@ -229,6 +229,7 @@ extern unsigned long MODULES_END; | |||
| 229 | #define _PAGE_READ 0x010 /* SW pte read bit */ | 229 | #define _PAGE_READ 0x010 /* SW pte read bit */ |
| 230 | #define _PAGE_WRITE 0x020 /* SW pte write bit */ | 230 | #define _PAGE_WRITE 0x020 /* SW pte write bit */ |
| 231 | #define _PAGE_SPECIAL 0x040 /* SW associated with special page */ | 231 | #define _PAGE_SPECIAL 0x040 /* SW associated with special page */ |
| 232 | #define _PAGE_UNUSED 0x080 /* SW bit for pgste usage state */ | ||
| 232 | #define __HAVE_ARCH_PTE_SPECIAL | 233 | #define __HAVE_ARCH_PTE_SPECIAL |
| 233 | 234 | ||
| 234 | /* Set of bits not changed in pte_modify */ | 235 | /* Set of bits not changed in pte_modify */ |
| @@ -394,6 +395,12 @@ extern unsigned long MODULES_END; | |||
| 394 | 395 | ||
| 395 | #endif /* CONFIG_64BIT */ | 396 | #endif /* CONFIG_64BIT */ |
| 396 | 397 | ||
| 398 | /* Guest Page State used for virtualization */ | ||
| 399 | #define _PGSTE_GPS_ZERO 0x0000000080000000UL | ||
| 400 | #define _PGSTE_GPS_USAGE_MASK 0x0000000003000000UL | ||
| 401 | #define _PGSTE_GPS_USAGE_STABLE 0x0000000000000000UL | ||
| 402 | #define _PGSTE_GPS_USAGE_UNUSED 0x0000000001000000UL | ||
| 403 | |||
| 397 | /* | 404 | /* |
| 398 | * A user page table pointer has the space-switch-event bit, the | 405 | * A user page table pointer has the space-switch-event bit, the |
| 399 | * private-space-control bit and the storage-alteration-event-control | 406 | * private-space-control bit and the storage-alteration-event-control |
| @@ -617,6 +624,14 @@ static inline int pte_none(pte_t pte) | |||
| 617 | return pte_val(pte) == _PAGE_INVALID; | 624 | return pte_val(pte) == _PAGE_INVALID; |
| 618 | } | 625 | } |
| 619 | 626 | ||
| 627 | static inline int pte_swap(pte_t pte) | ||
| 628 | { | ||
| 629 | /* Bit pattern: (pte & 0x603) == 0x402 */ | ||
| 630 | return (pte_val(pte) & (_PAGE_INVALID | _PAGE_PROTECT | | ||
| 631 | _PAGE_TYPE | _PAGE_PRESENT)) | ||
| 632 | == (_PAGE_INVALID | _PAGE_TYPE); | ||
| 633 | } | ||
| 634 | |||
| 620 | static inline int pte_file(pte_t pte) | 635 | static inline int pte_file(pte_t pte) |
| 621 | { | 636 | { |
| 622 | /* Bit pattern: (pte & 0x601) == 0x600 */ | 637 | /* Bit pattern: (pte & 0x601) == 0x600 */ |
| @@ -821,20 +836,20 @@ unsigned long gmap_translate(unsigned long address, struct gmap *); | |||
| 821 | unsigned long __gmap_fault(unsigned long address, struct gmap *); | 836 | unsigned long __gmap_fault(unsigned long address, struct gmap *); |
| 822 | unsigned long gmap_fault(unsigned long address, struct gmap *); | 837 | unsigned long gmap_fault(unsigned long address, struct gmap *); |
| 823 | void gmap_discard(unsigned long from, unsigned long to, struct gmap *); | 838 | void gmap_discard(unsigned long from, unsigned long to, struct gmap *); |
| 839 | void __gmap_zap(unsigned long address, struct gmap *); | ||
| 824 | 840 | ||
| 825 | void gmap_register_ipte_notifier(struct gmap_notifier *); | 841 | void gmap_register_ipte_notifier(struct gmap_notifier *); |
| 826 | void gmap_unregister_ipte_notifier(struct gmap_notifier *); | 842 | void gmap_unregister_ipte_notifier(struct gmap_notifier *); |
| 827 | int gmap_ipte_notify(struct gmap *, unsigned long start, unsigned long len); | 843 | int gmap_ipte_notify(struct gmap *, unsigned long start, unsigned long len); |
| 828 | void gmap_do_ipte_notify(struct mm_struct *, unsigned long addr, pte_t *); | 844 | void gmap_do_ipte_notify(struct mm_struct *, pte_t *); |
| 829 | 845 | ||
| 830 | static inline pgste_t pgste_ipte_notify(struct mm_struct *mm, | 846 | static inline pgste_t pgste_ipte_notify(struct mm_struct *mm, |
| 831 | unsigned long addr, | ||
| 832 | pte_t *ptep, pgste_t pgste) | 847 | pte_t *ptep, pgste_t pgste) |
| 833 | { | 848 | { |
| 834 | #ifdef CONFIG_PGSTE | 849 | #ifdef CONFIG_PGSTE |
| 835 | if (pgste_val(pgste) & PGSTE_IN_BIT) { | 850 | if (pgste_val(pgste) & PGSTE_IN_BIT) { |
| 836 | pgste_val(pgste) &= ~PGSTE_IN_BIT; | 851 | pgste_val(pgste) &= ~PGSTE_IN_BIT; |
| 837 | gmap_do_ipte_notify(mm, addr, ptep); | 852 | gmap_do_ipte_notify(mm, ptep); |
| 838 | } | 853 | } |
| 839 | #endif | 854 | #endif |
| 840 | return pgste; | 855 | return pgste; |
| @@ -852,6 +867,7 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, | |||
| 852 | 867 | ||
| 853 | if (mm_has_pgste(mm)) { | 868 | if (mm_has_pgste(mm)) { |
| 854 | pgste = pgste_get_lock(ptep); | 869 | pgste = pgste_get_lock(ptep); |
| 870 | pgste_val(pgste) &= ~_PGSTE_GPS_ZERO; | ||
| 855 | pgste_set_key(ptep, pgste, entry); | 871 | pgste_set_key(ptep, pgste, entry); |
| 856 | pgste_set_pte(ptep, entry); | 872 | pgste_set_pte(ptep, entry); |
| 857 | pgste_set_unlock(ptep, pgste); | 873 | pgste_set_unlock(ptep, pgste); |
| @@ -881,6 +897,12 @@ static inline int pte_young(pte_t pte) | |||
| 881 | return (pte_val(pte) & _PAGE_YOUNG) != 0; | 897 | return (pte_val(pte) & _PAGE_YOUNG) != 0; |
| 882 | } | 898 | } |
| 883 | 899 | ||
| 900 | #define __HAVE_ARCH_PTE_UNUSED | ||
| 901 | static inline int pte_unused(pte_t pte) | ||
| 902 | { | ||
| 903 | return pte_val(pte) & _PAGE_UNUSED; | ||
| 904 | } | ||
| 905 | |||
| 884 | /* | 906 | /* |
| 885 | * pgd/pmd/pte modification functions | 907 | * pgd/pmd/pte modification functions |
| 886 | */ | 908 | */ |
| @@ -1034,30 +1056,41 @@ static inline int ptep_test_and_clear_user_young(struct mm_struct *mm, | |||
| 1034 | 1056 | ||
| 1035 | static inline void __ptep_ipte(unsigned long address, pte_t *ptep) | 1057 | static inline void __ptep_ipte(unsigned long address, pte_t *ptep) |
| 1036 | { | 1058 | { |
| 1037 | if (!(pte_val(*ptep) & _PAGE_INVALID)) { | 1059 | unsigned long pto = (unsigned long) ptep; |
| 1060 | |||
| 1038 | #ifndef CONFIG_64BIT | 1061 | #ifndef CONFIG_64BIT |
| 1039 | /* pto must point to the start of the segment table */ | 1062 | /* pto in ESA mode must point to the start of the segment table */ |
| 1040 | pte_t *pto = (pte_t *) (((unsigned long) ptep) & 0x7ffffc00); | 1063 | pto &= 0x7ffffc00; |
| 1041 | #else | ||
| 1042 | /* ipte in zarch mode can do the math */ | ||
| 1043 | pte_t *pto = ptep; | ||
| 1044 | #endif | 1064 | #endif |
| 1045 | asm volatile( | 1065 | /* Invalidation + global TLB flush for the pte */ |
| 1046 | " ipte %2,%3" | 1066 | asm volatile( |
| 1047 | : "=m" (*ptep) : "m" (*ptep), | 1067 | " ipte %2,%3" |
| 1048 | "a" (pto), "a" (address)); | 1068 | : "=m" (*ptep) : "m" (*ptep), "a" (pto), "a" (address)); |
| 1049 | } | 1069 | } |
| 1070 | |||
| 1071 | static inline void ptep_flush_direct(struct mm_struct *mm, | ||
| 1072 | unsigned long address, pte_t *ptep) | ||
| 1073 | { | ||
| 1074 | if (pte_val(*ptep) & _PAGE_INVALID) | ||
| 1075 | return; | ||
| 1076 | __ptep_ipte(address, ptep); | ||
| 1050 | } | 1077 | } |
| 1051 | 1078 | ||
| 1052 | static inline void ptep_flush_lazy(struct mm_struct *mm, | 1079 | static inline void ptep_flush_lazy(struct mm_struct *mm, |
| 1053 | unsigned long address, pte_t *ptep) | 1080 | unsigned long address, pte_t *ptep) |
| 1054 | { | 1081 | { |
| 1055 | int active = (mm == current->active_mm) ? 1 : 0; | 1082 | int active, count; |
| 1056 | 1083 | ||
| 1057 | if (atomic_read(&mm->context.attach_count) > active) | 1084 | if (pte_val(*ptep) & _PAGE_INVALID) |
| 1058 | __ptep_ipte(address, ptep); | 1085 | return; |
| 1059 | else | 1086 | active = (mm == current->active_mm) ? 1 : 0; |
| 1087 | count = atomic_add_return(0x10000, &mm->context.attach_count); | ||
| 1088 | if ((count & 0xffff) <= active) { | ||
| 1089 | pte_val(*ptep) |= _PAGE_INVALID; | ||
| 1060 | mm->context.flush_mm = 1; | 1090 | mm->context.flush_mm = 1; |
| 1091 | } else | ||
| 1092 | __ptep_ipte(address, ptep); | ||
| 1093 | atomic_sub(0x10000, &mm->context.attach_count); | ||
| 1061 | } | 1094 | } |
| 1062 | 1095 | ||
| 1063 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG | 1096 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG |
| @@ -1070,11 +1103,11 @@ static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, | |||
| 1070 | 1103 | ||
| 1071 | if (mm_has_pgste(vma->vm_mm)) { | 1104 | if (mm_has_pgste(vma->vm_mm)) { |
| 1072 | pgste = pgste_get_lock(ptep); | 1105 | pgste = pgste_get_lock(ptep); |
| 1073 | pgste = pgste_ipte_notify(vma->vm_mm, addr, ptep, pgste); | 1106 | pgste = pgste_ipte_notify(vma->vm_mm, ptep, pgste); |
| 1074 | } | 1107 | } |
| 1075 | 1108 | ||
| 1076 | pte = *ptep; | 1109 | pte = *ptep; |
| 1077 | __ptep_ipte(addr, ptep); | 1110 | ptep_flush_direct(vma->vm_mm, addr, ptep); |
| 1078 | young = pte_young(pte); | 1111 | young = pte_young(pte); |
| 1079 | pte = pte_mkold(pte); | 1112 | pte = pte_mkold(pte); |
| 1080 | 1113 | ||
| @@ -1116,7 +1149,7 @@ static inline pte_t ptep_get_and_clear(struct mm_struct *mm, | |||
| 1116 | 1149 | ||
| 1117 | if (mm_has_pgste(mm)) { | 1150 | if (mm_has_pgste(mm)) { |
| 1118 | pgste = pgste_get_lock(ptep); | 1151 | pgste = pgste_get_lock(ptep); |
| 1119 | pgste = pgste_ipte_notify(mm, address, ptep, pgste); | 1152 | pgste = pgste_ipte_notify(mm, ptep, pgste); |
| 1120 | } | 1153 | } |
| 1121 | 1154 | ||
| 1122 | pte = *ptep; | 1155 | pte = *ptep; |
| @@ -1140,12 +1173,11 @@ static inline pte_t ptep_modify_prot_start(struct mm_struct *mm, | |||
| 1140 | 1173 | ||
| 1141 | if (mm_has_pgste(mm)) { | 1174 | if (mm_has_pgste(mm)) { |
| 1142 | pgste = pgste_get_lock(ptep); | 1175 | pgste = pgste_get_lock(ptep); |
| 1143 | pgste_ipte_notify(mm, address, ptep, pgste); | 1176 | pgste_ipte_notify(mm, ptep, pgste); |
| 1144 | } | 1177 | } |
| 1145 | 1178 | ||
| 1146 | pte = *ptep; | 1179 | pte = *ptep; |
| 1147 | ptep_flush_lazy(mm, address, ptep); | 1180 | ptep_flush_lazy(mm, address, ptep); |
| 1148 | pte_val(*ptep) |= _PAGE_INVALID; | ||
| 1149 | 1181 | ||
| 1150 | if (mm_has_pgste(mm)) { | 1182 | if (mm_has_pgste(mm)) { |
| 1151 | pgste = pgste_update_all(&pte, pgste); | 1183 | pgste = pgste_update_all(&pte, pgste); |
| @@ -1178,14 +1210,17 @@ static inline pte_t ptep_clear_flush(struct vm_area_struct *vma, | |||
| 1178 | 1210 | ||
| 1179 | if (mm_has_pgste(vma->vm_mm)) { | 1211 | if (mm_has_pgste(vma->vm_mm)) { |
| 1180 | pgste = pgste_get_lock(ptep); | 1212 | pgste = pgste_get_lock(ptep); |
| 1181 | pgste = pgste_ipte_notify(vma->vm_mm, address, ptep, pgste); | 1213 | pgste = pgste_ipte_notify(vma->vm_mm, ptep, pgste); |
| 1182 | } | 1214 | } |
| 1183 | 1215 | ||
| 1184 | pte = *ptep; | 1216 | pte = *ptep; |
| 1185 | __ptep_ipte(address, ptep); | 1217 | ptep_flush_direct(vma->vm_mm, address, ptep); |
| 1186 | pte_val(*ptep) = _PAGE_INVALID; | 1218 | pte_val(*ptep) = _PAGE_INVALID; |
| 1187 | 1219 | ||
| 1188 | if (mm_has_pgste(vma->vm_mm)) { | 1220 | if (mm_has_pgste(vma->vm_mm)) { |
| 1221 | if ((pgste_val(pgste) & _PGSTE_GPS_USAGE_MASK) == | ||
| 1222 | _PGSTE_GPS_USAGE_UNUSED) | ||
| 1223 | pte_val(pte) |= _PAGE_UNUSED; | ||
| 1189 | pgste = pgste_update_all(&pte, pgste); | 1224 | pgste = pgste_update_all(&pte, pgste); |
| 1190 | pgste_set_unlock(ptep, pgste); | 1225 | pgste_set_unlock(ptep, pgste); |
| 1191 | } | 1226 | } |
| @@ -1209,7 +1244,7 @@ static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, | |||
| 1209 | 1244 | ||
| 1210 | if (!full && mm_has_pgste(mm)) { | 1245 | if (!full && mm_has_pgste(mm)) { |
| 1211 | pgste = pgste_get_lock(ptep); | 1246 | pgste = pgste_get_lock(ptep); |
| 1212 | pgste = pgste_ipte_notify(mm, address, ptep, pgste); | 1247 | pgste = pgste_ipte_notify(mm, ptep, pgste); |
| 1213 | } | 1248 | } |
| 1214 | 1249 | ||
| 1215 | pte = *ptep; | 1250 | pte = *ptep; |
| @@ -1234,7 +1269,7 @@ static inline pte_t ptep_set_wrprotect(struct mm_struct *mm, | |||
| 1234 | if (pte_write(pte)) { | 1269 | if (pte_write(pte)) { |
| 1235 | if (mm_has_pgste(mm)) { | 1270 | if (mm_has_pgste(mm)) { |
| 1236 | pgste = pgste_get_lock(ptep); | 1271 | pgste = pgste_get_lock(ptep); |
| 1237 | pgste = pgste_ipte_notify(mm, address, ptep, pgste); | 1272 | pgste = pgste_ipte_notify(mm, ptep, pgste); |
| 1238 | } | 1273 | } |
| 1239 | 1274 | ||
| 1240 | ptep_flush_lazy(mm, address, ptep); | 1275 | ptep_flush_lazy(mm, address, ptep); |
| @@ -1260,10 +1295,10 @@ static inline int ptep_set_access_flags(struct vm_area_struct *vma, | |||
| 1260 | return 0; | 1295 | return 0; |
| 1261 | if (mm_has_pgste(vma->vm_mm)) { | 1296 | if (mm_has_pgste(vma->vm_mm)) { |
| 1262 | pgste = pgste_get_lock(ptep); | 1297 | pgste = pgste_get_lock(ptep); |
| 1263 | pgste = pgste_ipte_notify(vma->vm_mm, address, ptep, pgste); | 1298 | pgste = pgste_ipte_notify(vma->vm_mm, ptep, pgste); |
| 1264 | } | 1299 | } |
| 1265 | 1300 | ||
| 1266 | __ptep_ipte(address, ptep); | 1301 | ptep_flush_direct(vma->vm_mm, address, ptep); |
| 1267 | 1302 | ||
| 1268 | if (mm_has_pgste(vma->vm_mm)) { | 1303 | if (mm_has_pgste(vma->vm_mm)) { |
| 1269 | pgste_set_pte(ptep, entry); | 1304 | pgste_set_pte(ptep, entry); |
| @@ -1447,12 +1482,16 @@ static inline pmd_t pmd_mkwrite(pmd_t pmd) | |||
| 1447 | static inline void pmdp_flush_lazy(struct mm_struct *mm, | 1482 | static inline void pmdp_flush_lazy(struct mm_struct *mm, |
| 1448 | unsigned long address, pmd_t *pmdp) | 1483 | unsigned long address, pmd_t *pmdp) |
| 1449 | { | 1484 | { |
| 1450 | int active = (mm == current->active_mm) ? 1 : 0; | 1485 | int active, count; |
| 1451 | 1486 | ||
| 1452 | if ((atomic_read(&mm->context.attach_count) & 0xffff) > active) | 1487 | active = (mm == current->active_mm) ? 1 : 0; |
| 1453 | __pmd_idte(address, pmdp); | 1488 | count = atomic_add_return(0x10000, &mm->context.attach_count); |
| 1454 | else | 1489 | if ((count & 0xffff) <= active) { |
| 1490 | pmd_val(*pmdp) |= _SEGMENT_ENTRY_INVALID; | ||
| 1455 | mm->context.flush_mm = 1; | 1491 | mm->context.flush_mm = 1; |
| 1492 | } else | ||
| 1493 | __pmd_idte(address, pmdp); | ||
| 1494 | atomic_sub(0x10000, &mm->context.attach_count); | ||
| 1456 | } | 1495 | } |
| 1457 | 1496 | ||
| 1458 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 1497 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
diff --git a/arch/s390/include/asm/ptrace.h b/arch/s390/include/asm/ptrace.h index 9c82cebddabd..f4783c0b7b43 100644 --- a/arch/s390/include/asm/ptrace.h +++ b/arch/s390/include/asm/ptrace.h | |||
| @@ -83,6 +83,7 @@ struct per_struct_kernel { | |||
| 83 | * These are defined as per linux/ptrace.h, which see. | 83 | * These are defined as per linux/ptrace.h, which see. |
| 84 | */ | 84 | */ |
| 85 | #define arch_has_single_step() (1) | 85 | #define arch_has_single_step() (1) |
| 86 | #define arch_has_block_step() (1) | ||
| 86 | 87 | ||
| 87 | #define user_mode(regs) (((regs)->psw.mask & PSW_MASK_PSTATE) != 0) | 88 | #define user_mode(regs) (((regs)->psw.mask & PSW_MASK_PSTATE) != 0) |
| 88 | #define instruction_pointer(regs) ((regs)->psw.addr & PSW_ADDR_INSN) | 89 | #define instruction_pointer(regs) ((regs)->psw.addr & PSW_ADDR_INSN) |
diff --git a/arch/s390/include/asm/sclp.h b/arch/s390/include/asm/sclp.h index abaca2275c7a..2f5e9932b4de 100644 --- a/arch/s390/include/asm/sclp.h +++ b/arch/s390/include/asm/sclp.h | |||
| @@ -46,6 +46,7 @@ int sclp_cpu_configure(u8 cpu); | |||
| 46 | int sclp_cpu_deconfigure(u8 cpu); | 46 | int sclp_cpu_deconfigure(u8 cpu); |
| 47 | unsigned long long sclp_get_rnmax(void); | 47 | unsigned long long sclp_get_rnmax(void); |
| 48 | unsigned long long sclp_get_rzm(void); | 48 | unsigned long long sclp_get_rzm(void); |
| 49 | unsigned int sclp_get_max_cpu(void); | ||
| 49 | int sclp_sdias_blk_count(void); | 50 | int sclp_sdias_blk_count(void); |
| 50 | int sclp_sdias_copy(void *dest, int blk_num, int nr_blks); | 51 | int sclp_sdias_copy(void *dest, int blk_num, int nr_blks); |
| 51 | int sclp_chp_configure(struct chp_id chpid); | 52 | int sclp_chp_configure(struct chp_id chpid); |
diff --git a/arch/s390/include/asm/setup.h b/arch/s390/include/asm/setup.h index 94cfbe442f12..406f3a1e63ef 100644 --- a/arch/s390/include/asm/setup.h +++ b/arch/s390/include/asm/setup.h | |||
| @@ -59,7 +59,6 @@ void create_mem_hole(struct mem_chunk mem_chunk[], unsigned long addr, | |||
| 59 | #define MACHINE_FLAG_DIAG44 (1UL << 4) | 59 | #define MACHINE_FLAG_DIAG44 (1UL << 4) |
| 60 | #define MACHINE_FLAG_IDTE (1UL << 5) | 60 | #define MACHINE_FLAG_IDTE (1UL << 5) |
| 61 | #define MACHINE_FLAG_DIAG9C (1UL << 6) | 61 | #define MACHINE_FLAG_DIAG9C (1UL << 6) |
| 62 | #define MACHINE_FLAG_MVCOS (1UL << 7) | ||
| 63 | #define MACHINE_FLAG_KVM (1UL << 8) | 62 | #define MACHINE_FLAG_KVM (1UL << 8) |
| 64 | #define MACHINE_FLAG_ESOP (1UL << 9) | 63 | #define MACHINE_FLAG_ESOP (1UL << 9) |
| 65 | #define MACHINE_FLAG_EDAT1 (1UL << 10) | 64 | #define MACHINE_FLAG_EDAT1 (1UL << 10) |
| @@ -85,7 +84,6 @@ void create_mem_hole(struct mem_chunk mem_chunk[], unsigned long addr, | |||
| 85 | #define MACHINE_HAS_IDTE (0) | 84 | #define MACHINE_HAS_IDTE (0) |
| 86 | #define MACHINE_HAS_DIAG44 (1) | 85 | #define MACHINE_HAS_DIAG44 (1) |
| 87 | #define MACHINE_HAS_MVPG (S390_lowcore.machine_flags & MACHINE_FLAG_MVPG) | 86 | #define MACHINE_HAS_MVPG (S390_lowcore.machine_flags & MACHINE_FLAG_MVPG) |
| 88 | #define MACHINE_HAS_MVCOS (0) | ||
| 89 | #define MACHINE_HAS_EDAT1 (0) | 87 | #define MACHINE_HAS_EDAT1 (0) |
| 90 | #define MACHINE_HAS_EDAT2 (0) | 88 | #define MACHINE_HAS_EDAT2 (0) |
| 91 | #define MACHINE_HAS_LPP (0) | 89 | #define MACHINE_HAS_LPP (0) |
| @@ -98,7 +96,6 @@ void create_mem_hole(struct mem_chunk mem_chunk[], unsigned long addr, | |||
| 98 | #define MACHINE_HAS_IDTE (S390_lowcore.machine_flags & MACHINE_FLAG_IDTE) | 96 | #define MACHINE_HAS_IDTE (S390_lowcore.machine_flags & MACHINE_FLAG_IDTE) |
| 99 | #define MACHINE_HAS_DIAG44 (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG44) | 97 | #define MACHINE_HAS_DIAG44 (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG44) |
| 100 | #define MACHINE_HAS_MVPG (1) | 98 | #define MACHINE_HAS_MVPG (1) |
| 101 | #define MACHINE_HAS_MVCOS (S390_lowcore.machine_flags & MACHINE_FLAG_MVCOS) | ||
| 102 | #define MACHINE_HAS_EDAT1 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT1) | 99 | #define MACHINE_HAS_EDAT1 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT1) |
| 103 | #define MACHINE_HAS_EDAT2 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT2) | 100 | #define MACHINE_HAS_EDAT2 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT2) |
| 104 | #define MACHINE_HAS_LPP (S390_lowcore.machine_flags & MACHINE_FLAG_LPP) | 101 | #define MACHINE_HAS_LPP (S390_lowcore.machine_flags & MACHINE_FLAG_LPP) |
diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h index 10e0fcd3633d..3ccd71b90345 100644 --- a/arch/s390/include/asm/thread_info.h +++ b/arch/s390/include/asm/thread_info.h | |||
| @@ -81,6 +81,7 @@ static inline struct thread_info *current_thread_info(void) | |||
| 81 | #define TIF_NOTIFY_RESUME 1 /* callback before returning to user */ | 81 | #define TIF_NOTIFY_RESUME 1 /* callback before returning to user */ |
| 82 | #define TIF_SIGPENDING 2 /* signal pending */ | 82 | #define TIF_SIGPENDING 2 /* signal pending */ |
| 83 | #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ | 83 | #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ |
| 84 | #define TIF_TLB_WAIT 4 /* wait for TLB flush completion */ | ||
| 84 | #define TIF_PER_TRAP 6 /* deliver sigtrap on return to user */ | 85 | #define TIF_PER_TRAP 6 /* deliver sigtrap on return to user */ |
| 85 | #define TIF_MCCK_PENDING 7 /* machine check handling is pending */ | 86 | #define TIF_MCCK_PENDING 7 /* machine check handling is pending */ |
| 86 | #define TIF_SYSCALL_TRACE 8 /* syscall trace active */ | 87 | #define TIF_SYSCALL_TRACE 8 /* syscall trace active */ |
| @@ -91,11 +92,13 @@ static inline struct thread_info *current_thread_info(void) | |||
| 91 | #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ | 92 | #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ |
| 92 | #define TIF_RESTORE_SIGMASK 19 /* restore signal mask in do_signal() */ | 93 | #define TIF_RESTORE_SIGMASK 19 /* restore signal mask in do_signal() */ |
| 93 | #define TIF_SINGLE_STEP 20 /* This task is single stepped */ | 94 | #define TIF_SINGLE_STEP 20 /* This task is single stepped */ |
| 95 | #define TIF_BLOCK_STEP 21 /* This task is block stepped */ | ||
| 94 | 96 | ||
| 95 | #define _TIF_SYSCALL (1<<TIF_SYSCALL) | 97 | #define _TIF_SYSCALL (1<<TIF_SYSCALL) |
| 96 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) | 98 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) |
| 97 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) | 99 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) |
| 98 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) | 100 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) |
| 101 | #define _TIF_TLB_WAIT (1<<TIF_TLB_WAIT) | ||
| 99 | #define _TIF_PER_TRAP (1<<TIF_PER_TRAP) | 102 | #define _TIF_PER_TRAP (1<<TIF_PER_TRAP) |
| 100 | #define _TIF_MCCK_PENDING (1<<TIF_MCCK_PENDING) | 103 | #define _TIF_MCCK_PENDING (1<<TIF_MCCK_PENDING) |
| 101 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | 104 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) |
diff --git a/arch/s390/include/asm/uaccess.h b/arch/s390/include/asm/uaccess.h index 79330af9a5f8..4133b3f72fb0 100644 --- a/arch/s390/include/asm/uaccess.h +++ b/arch/s390/include/asm/uaccess.h | |||
| @@ -92,33 +92,58 @@ static inline unsigned long extable_fixup(const struct exception_table_entry *x) | |||
| 92 | #define ARCH_HAS_SORT_EXTABLE | 92 | #define ARCH_HAS_SORT_EXTABLE |
| 93 | #define ARCH_HAS_SEARCH_EXTABLE | 93 | #define ARCH_HAS_SEARCH_EXTABLE |
| 94 | 94 | ||
| 95 | struct uaccess_ops { | 95 | int __handle_fault(unsigned long, unsigned long, int); |
| 96 | size_t (*copy_from_user)(size_t, const void __user *, void *); | ||
| 97 | size_t (*copy_to_user)(size_t, void __user *, const void *); | ||
| 98 | size_t (*copy_in_user)(size_t, void __user *, const void __user *); | ||
| 99 | size_t (*clear_user)(size_t, void __user *); | ||
| 100 | size_t (*strnlen_user)(size_t, const char __user *); | ||
| 101 | size_t (*strncpy_from_user)(size_t, const char __user *, char *); | ||
| 102 | int (*futex_atomic_op)(int op, u32 __user *, int oparg, int *old); | ||
| 103 | int (*futex_atomic_cmpxchg)(u32 *, u32 __user *, u32 old, u32 new); | ||
| 104 | }; | ||
| 105 | 96 | ||
| 106 | extern struct uaccess_ops uaccess; | 97 | /** |
| 107 | extern struct uaccess_ops uaccess_mvcos; | 98 | * __copy_from_user: - Copy a block of data from user space, with less checking. |
| 108 | extern struct uaccess_ops uaccess_pt; | 99 | * @to: Destination address, in kernel space. |
| 100 | * @from: Source address, in user space. | ||
| 101 | * @n: Number of bytes to copy. | ||
| 102 | * | ||
| 103 | * Context: User context only. This function may sleep. | ||
| 104 | * | ||
| 105 | * Copy data from user space to kernel space. Caller must check | ||
| 106 | * the specified block with access_ok() before calling this function. | ||
| 107 | * | ||
| 108 | * Returns number of bytes that could not be copied. | ||
| 109 | * On success, this will be zero. | ||
| 110 | * | ||
| 111 | * If some data could not be copied, this function will pad the copied | ||
| 112 | * data to the requested size using zero bytes. | ||
| 113 | */ | ||
| 114 | unsigned long __must_check __copy_from_user(void *to, const void __user *from, | ||
| 115 | unsigned long n); | ||
| 116 | |||
| 117 | /** | ||
| 118 | * __copy_to_user: - Copy a block of data into user space, with less checking. | ||
| 119 | * @to: Destination address, in user space. | ||
| 120 | * @from: Source address, in kernel space. | ||
| 121 | * @n: Number of bytes to copy. | ||
| 122 | * | ||
| 123 | * Context: User context only. This function may sleep. | ||
| 124 | * | ||
| 125 | * Copy data from kernel space to user space. Caller must check | ||
| 126 | * the specified block with access_ok() before calling this function. | ||
| 127 | * | ||
| 128 | * Returns number of bytes that could not be copied. | ||
| 129 | * On success, this will be zero. | ||
| 130 | */ | ||
| 131 | unsigned long __must_check __copy_to_user(void __user *to, const void *from, | ||
| 132 | unsigned long n); | ||
| 109 | 133 | ||
| 110 | extern int __handle_fault(unsigned long, unsigned long, int); | 134 | #define __copy_to_user_inatomic __copy_to_user |
| 135 | #define __copy_from_user_inatomic __copy_from_user | ||
| 111 | 136 | ||
| 112 | static inline int __put_user_fn(size_t size, void __user *ptr, void *x) | 137 | static inline int __put_user_fn(void *x, void __user *ptr, unsigned long size) |
| 113 | { | 138 | { |
| 114 | size = uaccess.copy_to_user(size, ptr, x); | 139 | size = __copy_to_user(ptr, x, size); |
| 115 | return size ? -EFAULT : size; | 140 | return size ? -EFAULT : 0; |
| 116 | } | 141 | } |
| 117 | 142 | ||
| 118 | static inline int __get_user_fn(size_t size, const void __user *ptr, void *x) | 143 | static inline int __get_user_fn(void *x, const void __user *ptr, unsigned long size) |
| 119 | { | 144 | { |
| 120 | size = uaccess.copy_from_user(size, ptr, x); | 145 | size = __copy_from_user(x, ptr, size); |
| 121 | return size ? -EFAULT : size; | 146 | return size ? -EFAULT : 0; |
| 122 | } | 147 | } |
| 123 | 148 | ||
| 124 | /* | 149 | /* |
| @@ -135,8 +160,8 @@ static inline int __get_user_fn(size_t size, const void __user *ptr, void *x) | |||
| 135 | case 2: \ | 160 | case 2: \ |
| 136 | case 4: \ | 161 | case 4: \ |
| 137 | case 8: \ | 162 | case 8: \ |
| 138 | __pu_err = __put_user_fn(sizeof (*(ptr)), \ | 163 | __pu_err = __put_user_fn(&__x, ptr, \ |
| 139 | ptr, &__x); \ | 164 | sizeof(*(ptr))); \ |
| 140 | break; \ | 165 | break; \ |
| 141 | default: \ | 166 | default: \ |
| 142 | __put_user_bad(); \ | 167 | __put_user_bad(); \ |
| @@ -152,7 +177,7 @@ static inline int __get_user_fn(size_t size, const void __user *ptr, void *x) | |||
| 152 | }) | 177 | }) |
| 153 | 178 | ||
| 154 | 179 | ||
| 155 | extern int __put_user_bad(void) __attribute__((noreturn)); | 180 | int __put_user_bad(void) __attribute__((noreturn)); |
| 156 | 181 | ||
| 157 | #define __get_user(x, ptr) \ | 182 | #define __get_user(x, ptr) \ |
| 158 | ({ \ | 183 | ({ \ |
| @@ -161,29 +186,29 @@ extern int __put_user_bad(void) __attribute__((noreturn)); | |||
| 161 | switch (sizeof(*(ptr))) { \ | 186 | switch (sizeof(*(ptr))) { \ |
| 162 | case 1: { \ | 187 | case 1: { \ |
| 163 | unsigned char __x; \ | 188 | unsigned char __x; \ |
| 164 | __gu_err = __get_user_fn(sizeof (*(ptr)), \ | 189 | __gu_err = __get_user_fn(&__x, ptr, \ |
| 165 | ptr, &__x); \ | 190 | sizeof(*(ptr))); \ |
| 166 | (x) = *(__force __typeof__(*(ptr)) *) &__x; \ | 191 | (x) = *(__force __typeof__(*(ptr)) *) &__x; \ |
| 167 | break; \ | 192 | break; \ |
| 168 | }; \ | 193 | }; \ |
| 169 | case 2: { \ | 194 | case 2: { \ |
| 170 | unsigned short __x; \ | 195 | unsigned short __x; \ |
| 171 | __gu_err = __get_user_fn(sizeof (*(ptr)), \ | 196 | __gu_err = __get_user_fn(&__x, ptr, \ |
| 172 | ptr, &__x); \ | 197 | sizeof(*(ptr))); \ |
| 173 | (x) = *(__force __typeof__(*(ptr)) *) &__x; \ | 198 | (x) = *(__force __typeof__(*(ptr)) *) &__x; \ |
| 174 | break; \ | 199 | break; \ |
| 175 | }; \ | 200 | }; \ |
| 176 | case 4: { \ | 201 | case 4: { \ |
| 177 | unsigned int __x; \ | 202 | unsigned int __x; \ |
| 178 | __gu_err = __get_user_fn(sizeof (*(ptr)), \ | 203 | __gu_err = __get_user_fn(&__x, ptr, \ |
| 179 | ptr, &__x); \ | 204 | sizeof(*(ptr))); \ |
| 180 | (x) = *(__force __typeof__(*(ptr)) *) &__x; \ | 205 | (x) = *(__force __typeof__(*(ptr)) *) &__x; \ |
| 181 | break; \ | 206 | break; \ |
| 182 | }; \ | 207 | }; \ |
| 183 | case 8: { \ | 208 | case 8: { \ |
| 184 | unsigned long long __x; \ | 209 | unsigned long long __x; \ |
| 185 | __gu_err = __get_user_fn(sizeof (*(ptr)), \ | 210 | __gu_err = __get_user_fn(&__x, ptr, \ |
| 186 | ptr, &__x); \ | 211 | sizeof(*(ptr))); \ |
| 187 | (x) = *(__force __typeof__(*(ptr)) *) &__x; \ | 212 | (x) = *(__force __typeof__(*(ptr)) *) &__x; \ |
| 188 | break; \ | 213 | break; \ |
| 189 | }; \ | 214 | }; \ |
| @@ -200,35 +225,12 @@ extern int __put_user_bad(void) __attribute__((noreturn)); | |||
| 200 | __get_user(x, ptr); \ | 225 | __get_user(x, ptr); \ |
| 201 | }) | 226 | }) |
| 202 | 227 | ||
| 203 | extern int __get_user_bad(void) __attribute__((noreturn)); | 228 | int __get_user_bad(void) __attribute__((noreturn)); |
| 204 | 229 | ||
| 205 | #define __put_user_unaligned __put_user | 230 | #define __put_user_unaligned __put_user |
| 206 | #define __get_user_unaligned __get_user | 231 | #define __get_user_unaligned __get_user |
| 207 | 232 | ||
| 208 | /** | 233 | /** |
| 209 | * __copy_to_user: - Copy a block of data into user space, with less checking. | ||
| 210 | * @to: Destination address, in user space. | ||
| 211 | * @from: Source address, in kernel space. | ||
| 212 | * @n: Number of bytes to copy. | ||
| 213 | * | ||
| 214 | * Context: User context only. This function may sleep. | ||
| 215 | * | ||
| 216 | * Copy data from kernel space to user space. Caller must check | ||
| 217 | * the specified block with access_ok() before calling this function. | ||
| 218 | * | ||
| 219 | * Returns number of bytes that could not be copied. | ||
| 220 | * On success, this will be zero. | ||
| 221 | */ | ||
| 222 | static inline unsigned long __must_check | ||
| 223 | __copy_to_user(void __user *to, const void *from, unsigned long n) | ||
| 224 | { | ||
| 225 | return uaccess.copy_to_user(n, to, from); | ||
| 226 | } | ||
| 227 | |||
| 228 | #define __copy_to_user_inatomic __copy_to_user | ||
| 229 | #define __copy_from_user_inatomic __copy_from_user | ||
| 230 | |||
| 231 | /** | ||
| 232 | * copy_to_user: - Copy a block of data into user space. | 234 | * copy_to_user: - Copy a block of data into user space. |
| 233 | * @to: Destination address, in user space. | 235 | * @to: Destination address, in user space. |
| 234 | * @from: Source address, in kernel space. | 236 | * @from: Source address, in kernel space. |
| @@ -248,30 +250,7 @@ copy_to_user(void __user *to, const void *from, unsigned long n) | |||
| 248 | return __copy_to_user(to, from, n); | 250 | return __copy_to_user(to, from, n); |
| 249 | } | 251 | } |
| 250 | 252 | ||
| 251 | /** | 253 | void copy_from_user_overflow(void) |
| 252 | * __copy_from_user: - Copy a block of data from user space, with less checking. | ||
| 253 | * @to: Destination address, in kernel space. | ||
| 254 | * @from: Source address, in user space. | ||
| 255 | * @n: Number of bytes to copy. | ||
| 256 | * | ||
| 257 | * Context: User context only. This function may sleep. | ||
| 258 | * | ||
| 259 | * Copy data from user space to kernel space. Caller must check | ||
| 260 | * the specified block with access_ok() before calling this function. | ||
| 261 | * | ||
| 262 | * Returns number of bytes that could not be copied. | ||
| 263 | * On success, this will be zero. | ||
| 264 | * | ||
| 265 | * If some data could not be copied, this function will pad the copied | ||
| 266 | * data to the requested size using zero bytes. | ||
| 267 | */ | ||
| 268 | static inline unsigned long __must_check | ||
| 269 | __copy_from_user(void *to, const void __user *from, unsigned long n) | ||
| 270 | { | ||
| 271 | return uaccess.copy_from_user(n, from, to); | ||
| 272 | } | ||
| 273 | |||
| 274 | extern void copy_from_user_overflow(void) | ||
| 275 | #ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS | 254 | #ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS |
| 276 | __compiletime_warning("copy_from_user() buffer size is not provably correct") | 255 | __compiletime_warning("copy_from_user() buffer size is not provably correct") |
| 277 | #endif | 256 | #endif |
| @@ -306,11 +285,8 @@ copy_from_user(void *to, const void __user *from, unsigned long n) | |||
| 306 | return __copy_from_user(to, from, n); | 285 | return __copy_from_user(to, from, n); |
| 307 | } | 286 | } |
| 308 | 287 | ||
| 309 | static inline unsigned long __must_check | 288 | unsigned long __must_check |
| 310 | __copy_in_user(void __user *to, const void __user *from, unsigned long n) | 289 | __copy_in_user(void __user *to, const void __user *from, unsigned long n); |
| 311 | { | ||
| 312 | return uaccess.copy_in_user(n, to, from); | ||
| 313 | } | ||
| 314 | 290 | ||
| 315 | static inline unsigned long __must_check | 291 | static inline unsigned long __must_check |
| 316 | copy_in_user(void __user *to, const void __user *from, unsigned long n) | 292 | copy_in_user(void __user *to, const void __user *from, unsigned long n) |
| @@ -322,18 +298,22 @@ copy_in_user(void __user *to, const void __user *from, unsigned long n) | |||
| 322 | /* | 298 | /* |
| 323 | * Copy a null terminated string from userspace. | 299 | * Copy a null terminated string from userspace. |
| 324 | */ | 300 | */ |
| 301 | |||
| 302 | long __strncpy_from_user(char *dst, const char __user *src, long count); | ||
| 303 | |||
| 325 | static inline long __must_check | 304 | static inline long __must_check |
| 326 | strncpy_from_user(char *dst, const char __user *src, long count) | 305 | strncpy_from_user(char *dst, const char __user *src, long count) |
| 327 | { | 306 | { |
| 328 | might_fault(); | 307 | might_fault(); |
| 329 | return uaccess.strncpy_from_user(count, src, dst); | 308 | return __strncpy_from_user(dst, src, count); |
| 330 | } | 309 | } |
| 331 | 310 | ||
| 332 | static inline unsigned long | 311 | unsigned long __must_check __strnlen_user(const char __user *src, unsigned long count); |
| 333 | strnlen_user(const char __user * src, unsigned long n) | 312 | |
| 313 | static inline unsigned long strnlen_user(const char __user *src, unsigned long n) | ||
| 334 | { | 314 | { |
| 335 | might_fault(); | 315 | might_fault(); |
| 336 | return uaccess.strnlen_user(n, src); | 316 | return __strnlen_user(src, n); |
| 337 | } | 317 | } |
| 338 | 318 | ||
| 339 | /** | 319 | /** |
| @@ -355,21 +335,14 @@ strnlen_user(const char __user * src, unsigned long n) | |||
| 355 | /* | 335 | /* |
| 356 | * Zero Userspace | 336 | * Zero Userspace |
| 357 | */ | 337 | */ |
| 338 | unsigned long __must_check __clear_user(void __user *to, unsigned long size); | ||
| 358 | 339 | ||
| 359 | static inline unsigned long __must_check | 340 | static inline unsigned long __must_check clear_user(void __user *to, unsigned long n) |
| 360 | __clear_user(void __user *to, unsigned long n) | ||
| 361 | { | ||
| 362 | return uaccess.clear_user(n, to); | ||
| 363 | } | ||
| 364 | |||
| 365 | static inline unsigned long __must_check | ||
| 366 | clear_user(void __user *to, unsigned long n) | ||
| 367 | { | 341 | { |
| 368 | might_fault(); | 342 | might_fault(); |
| 369 | return uaccess.clear_user(n, to); | 343 | return __clear_user(to, n); |
| 370 | } | 344 | } |
| 371 | 345 | ||
| 372 | extern int copy_to_user_real(void __user *dest, void *src, size_t count); | 346 | int copy_to_user_real(void __user *dest, void *src, unsigned long count); |
| 373 | extern int copy_from_user_real(void *dest, void __user *src, size_t count); | ||
| 374 | 347 | ||
| 375 | #endif /* __S390_UACCESS_H */ | 348 | #endif /* __S390_UACCESS_H */ |
diff --git a/arch/s390/include/uapi/asm/ptrace.h b/arch/s390/include/uapi/asm/ptrace.h index 7e0b498a2c2b..a150f4fabe43 100644 --- a/arch/s390/include/uapi/asm/ptrace.h +++ b/arch/s390/include/uapi/asm/ptrace.h | |||
| @@ -403,6 +403,12 @@ typedef struct | |||
| 403 | #define PTRACE_TE_ABORT_RAND 0x5011 | 403 | #define PTRACE_TE_ABORT_RAND 0x5011 |
| 404 | 404 | ||
| 405 | /* | 405 | /* |
| 406 | * The numbers chosen here are somewhat arbitrary but absolutely MUST | ||
| 407 | * not overlap with any of the number assigned in <linux/ptrace.h>. | ||
| 408 | */ | ||
| 409 | #define PTRACE_SINGLEBLOCK 12 /* resume execution until next branch */ | ||
| 410 | |||
| 411 | /* | ||
| 406 | * PT_PROT definition is loosely based on hppa bsd definition in | 412 | * PT_PROT definition is loosely based on hppa bsd definition in |
| 407 | * gdb/hppab-nat.c | 413 | * gdb/hppab-nat.c |
| 408 | */ | 414 | */ |
diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile index 1b3ac09c11b6..a95c4ca99617 100644 --- a/arch/s390/kernel/Makefile +++ b/arch/s390/kernel/Makefile | |||
| @@ -47,9 +47,8 @@ obj-$(CONFIG_SCHED_BOOK) += topology.o | |||
| 47 | obj-$(CONFIG_HIBERNATION) += suspend.o swsusp_asm64.o | 47 | obj-$(CONFIG_HIBERNATION) += suspend.o swsusp_asm64.o |
| 48 | obj-$(CONFIG_AUDIT) += audit.o | 48 | obj-$(CONFIG_AUDIT) += audit.o |
| 49 | compat-obj-$(CONFIG_AUDIT) += compat_audit.o | 49 | compat-obj-$(CONFIG_AUDIT) += compat_audit.o |
| 50 | obj-$(CONFIG_COMPAT) += compat_linux.o compat_signal.o \ | 50 | obj-$(CONFIG_COMPAT) += compat_linux.o compat_signal.o |
| 51 | compat_wrapper.o compat_exec_domain.o \ | 51 | obj-$(CONFIG_COMPAT) += compat_wrapper.o $(compat-obj-y) |
| 52 | $(compat-obj-y) | ||
| 53 | 52 | ||
| 54 | obj-$(CONFIG_STACKTRACE) += stacktrace.o | 53 | obj-$(CONFIG_STACKTRACE) += stacktrace.o |
| 55 | obj-$(CONFIG_KPROBES) += kprobes.o | 54 | obj-$(CONFIG_KPROBES) += kprobes.o |
diff --git a/arch/s390/kernel/compat_exec_domain.c b/arch/s390/kernel/compat_exec_domain.c deleted file mode 100644 index 765fabdada9f..000000000000 --- a/arch/s390/kernel/compat_exec_domain.c +++ /dev/null | |||
| @@ -1,29 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Support for 32-bit Linux for S390 personality. | ||
| 3 | * | ||
| 4 | * Copyright IBM Corp. 2000 | ||
| 5 | * Author(s): Gerhard Tonn (ton@de.ibm.com) | ||
| 6 | * | ||
| 7 | * | ||
| 8 | */ | ||
| 9 | |||
| 10 | #include <linux/kernel.h> | ||
| 11 | #include <linux/init.h> | ||
| 12 | #include <linux/personality.h> | ||
| 13 | #include <linux/sched.h> | ||
| 14 | |||
| 15 | static struct exec_domain s390_exec_domain; | ||
| 16 | |||
| 17 | static int __init s390_init (void) | ||
| 18 | { | ||
| 19 | s390_exec_domain.name = "Linux/s390"; | ||
| 20 | s390_exec_domain.handler = NULL; | ||
| 21 | s390_exec_domain.pers_low = PER_LINUX32; | ||
| 22 | s390_exec_domain.pers_high = PER_LINUX32; | ||
| 23 | s390_exec_domain.signal_map = default_exec_domain.signal_map; | ||
| 24 | s390_exec_domain.signal_invmap = default_exec_domain.signal_invmap; | ||
| 25 | register_exec_domain(&s390_exec_domain); | ||
| 26 | return 0; | ||
| 27 | } | ||
| 28 | |||
| 29 | __initcall(s390_init); | ||
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c index db02052bd137..ca38139423ae 100644 --- a/arch/s390/kernel/compat_linux.c +++ b/arch/s390/kernel/compat_linux.c | |||
| @@ -86,48 +86,51 @@ | |||
| 86 | #define SET_STAT_UID(stat, uid) (stat).st_uid = high2lowuid(uid) | 86 | #define SET_STAT_UID(stat, uid) (stat).st_uid = high2lowuid(uid) |
| 87 | #define SET_STAT_GID(stat, gid) (stat).st_gid = high2lowgid(gid) | 87 | #define SET_STAT_GID(stat, gid) (stat).st_gid = high2lowgid(gid) |
| 88 | 88 | ||
| 89 | asmlinkage long sys32_chown16(const char __user * filename, u16 user, u16 group) | 89 | COMPAT_SYSCALL_DEFINE3(s390_chown16, const char __user *, filename, |
| 90 | u16, user, u16, group) | ||
| 90 | { | 91 | { |
| 91 | return sys_chown(filename, low2highuid(user), low2highgid(group)); | 92 | return sys_chown(filename, low2highuid(user), low2highgid(group)); |
| 92 | } | 93 | } |
| 93 | 94 | ||
| 94 | asmlinkage long sys32_lchown16(const char __user * filename, u16 user, u16 group) | 95 | COMPAT_SYSCALL_DEFINE3(s390_lchown16, const char __user *, |
| 96 | filename, u16, user, u16, group) | ||
| 95 | { | 97 | { |
| 96 | return sys_lchown(filename, low2highuid(user), low2highgid(group)); | 98 | return sys_lchown(filename, low2highuid(user), low2highgid(group)); |
| 97 | } | 99 | } |
| 98 | 100 | ||
| 99 | asmlinkage long sys32_fchown16(unsigned int fd, u16 user, u16 group) | 101 | COMPAT_SYSCALL_DEFINE3(s390_fchown16, unsigned int, fd, u16, user, u16, group) |
| 100 | { | 102 | { |
| 101 | return sys_fchown(fd, low2highuid(user), low2highgid(group)); | 103 | return sys_fchown(fd, low2highuid(user), low2highgid(group)); |
| 102 | } | 104 | } |
| 103 | 105 | ||
| 104 | asmlinkage long sys32_setregid16(u16 rgid, u16 egid) | 106 | COMPAT_SYSCALL_DEFINE2(s390_setregid16, u16, rgid, u16, egid) |
| 105 | { | 107 | { |
| 106 | return sys_setregid(low2highgid(rgid), low2highgid(egid)); | 108 | return sys_setregid(low2highgid(rgid), low2highgid(egid)); |
| 107 | } | 109 | } |
| 108 | 110 | ||
| 109 | asmlinkage long sys32_setgid16(u16 gid) | 111 | COMPAT_SYSCALL_DEFINE1(s390_setgid16, u16, gid) |
| 110 | { | 112 | { |
| 111 | return sys_setgid((gid_t)gid); | 113 | return sys_setgid((gid_t)gid); |
| 112 | } | 114 | } |
| 113 | 115 | ||
| 114 | asmlinkage long sys32_setreuid16(u16 ruid, u16 euid) | 116 | COMPAT_SYSCALL_DEFINE2(s390_setreuid16, u16, ruid, u16, euid) |
| 115 | { | 117 | { |
| 116 | return sys_setreuid(low2highuid(ruid), low2highuid(euid)); | 118 | return sys_setreuid(low2highuid(ruid), low2highuid(euid)); |
| 117 | } | 119 | } |
| 118 | 120 | ||
| 119 | asmlinkage long sys32_setuid16(u16 uid) | 121 | COMPAT_SYSCALL_DEFINE1(s390_setuid16, u16, uid) |
| 120 | { | 122 | { |
| 121 | return sys_setuid((uid_t)uid); | 123 | return sys_setuid((uid_t)uid); |
| 122 | } | 124 | } |
| 123 | 125 | ||
| 124 | asmlinkage long sys32_setresuid16(u16 ruid, u16 euid, u16 suid) | 126 | COMPAT_SYSCALL_DEFINE3(s390_setresuid16, u16, ruid, u16, euid, u16, suid) |
| 125 | { | 127 | { |
| 126 | return sys_setresuid(low2highuid(ruid), low2highuid(euid), | 128 | return sys_setresuid(low2highuid(ruid), low2highuid(euid), |
| 127 | low2highuid(suid)); | 129 | low2highuid(suid)); |
| 128 | } | 130 | } |
| 129 | 131 | ||
| 130 | asmlinkage long sys32_getresuid16(u16 __user *ruidp, u16 __user *euidp, u16 __user *suidp) | 132 | COMPAT_SYSCALL_DEFINE3(s390_getresuid16, u16 __user *, ruidp, |
| 133 | u16 __user *, euidp, u16 __user *, suidp) | ||
| 131 | { | 134 | { |
| 132 | const struct cred *cred = current_cred(); | 135 | const struct cred *cred = current_cred(); |
| 133 | int retval; | 136 | int retval; |
| @@ -144,13 +147,14 @@ asmlinkage long sys32_getresuid16(u16 __user *ruidp, u16 __user *euidp, u16 __us | |||
| 144 | return retval; | 147 | return retval; |
| 145 | } | 148 | } |
| 146 | 149 | ||
| 147 | asmlinkage long sys32_setresgid16(u16 rgid, u16 egid, u16 sgid) | 150 | COMPAT_SYSCALL_DEFINE3(s390_setresgid16, u16, rgid, u16, egid, u16, sgid) |
| 148 | { | 151 | { |
| 149 | return sys_setresgid(low2highgid(rgid), low2highgid(egid), | 152 | return sys_setresgid(low2highgid(rgid), low2highgid(egid), |
| 150 | low2highgid(sgid)); | 153 | low2highgid(sgid)); |
| 151 | } | 154 | } |
| 152 | 155 | ||
| 153 | asmlinkage long sys32_getresgid16(u16 __user *rgidp, u16 __user *egidp, u16 __user *sgidp) | 156 | COMPAT_SYSCALL_DEFINE3(s390_getresgid16, u16 __user *, rgidp, |
| 157 | u16 __user *, egidp, u16 __user *, sgidp) | ||
| 154 | { | 158 | { |
| 155 | const struct cred *cred = current_cred(); | 159 | const struct cred *cred = current_cred(); |
| 156 | int retval; | 160 | int retval; |
| @@ -167,12 +171,12 @@ asmlinkage long sys32_getresgid16(u16 __user *rgidp, u16 __user *egidp, u16 __us | |||
| 167 | return retval; | 171 | return retval; |
| 168 | } | 172 | } |
| 169 | 173 | ||
| 170 | asmlinkage long sys32_setfsuid16(u16 uid) | 174 | COMPAT_SYSCALL_DEFINE1(s390_setfsuid16, u16, uid) |
| 171 | { | 175 | { |
| 172 | return sys_setfsuid((uid_t)uid); | 176 | return sys_setfsuid((uid_t)uid); |
| 173 | } | 177 | } |
| 174 | 178 | ||
| 175 | asmlinkage long sys32_setfsgid16(u16 gid) | 179 | COMPAT_SYSCALL_DEFINE1(s390_setfsgid16, u16, gid) |
| 176 | { | 180 | { |
| 177 | return sys_setfsgid((gid_t)gid); | 181 | return sys_setfsgid((gid_t)gid); |
| 178 | } | 182 | } |
| @@ -215,7 +219,7 @@ static int groups16_from_user(struct group_info *group_info, u16 __user *groupli | |||
| 215 | return 0; | 219 | return 0; |
| 216 | } | 220 | } |
| 217 | 221 | ||
| 218 | asmlinkage long sys32_getgroups16(int gidsetsize, u16 __user *grouplist) | 222 | COMPAT_SYSCALL_DEFINE2(s390_getgroups16, int, gidsetsize, u16 __user *, grouplist) |
| 219 | { | 223 | { |
| 220 | const struct cred *cred = current_cred(); | 224 | const struct cred *cred = current_cred(); |
| 221 | int i; | 225 | int i; |
| @@ -240,7 +244,7 @@ out: | |||
| 240 | return i; | 244 | return i; |
| 241 | } | 245 | } |
| 242 | 246 | ||
| 243 | asmlinkage long sys32_setgroups16(int gidsetsize, u16 __user *grouplist) | 247 | COMPAT_SYSCALL_DEFINE2(s390_setgroups16, int, gidsetsize, u16 __user *, grouplist) |
| 244 | { | 248 | { |
| 245 | struct group_info *group_info; | 249 | struct group_info *group_info; |
| 246 | int retval; | 250 | int retval; |
| @@ -265,22 +269,22 @@ asmlinkage long sys32_setgroups16(int gidsetsize, u16 __user *grouplist) | |||
| 265 | return retval; | 269 | return retval; |
| 266 | } | 270 | } |
| 267 | 271 | ||
| 268 | asmlinkage long sys32_getuid16(void) | 272 | COMPAT_SYSCALL_DEFINE0(s390_getuid16) |
| 269 | { | 273 | { |
| 270 | return high2lowuid(from_kuid_munged(current_user_ns(), current_uid())); | 274 | return high2lowuid(from_kuid_munged(current_user_ns(), current_uid())); |
| 271 | } | 275 | } |
| 272 | 276 | ||
| 273 | asmlinkage long sys32_geteuid16(void) | 277 | COMPAT_SYSCALL_DEFINE0(s390_geteuid16) |
| 274 | { | 278 | { |
| 275 | return high2lowuid(from_kuid_munged(current_user_ns(), current_euid())); | 279 | return high2lowuid(from_kuid_munged(current_user_ns(), current_euid())); |
| 276 | } | 280 | } |
| 277 | 281 | ||
| 278 | asmlinkage long sys32_getgid16(void) | 282 | COMPAT_SYSCALL_DEFINE0(s390_getgid16) |
| 279 | { | 283 | { |
| 280 | return high2lowgid(from_kgid_munged(current_user_ns(), current_gid())); | 284 | return high2lowgid(from_kgid_munged(current_user_ns(), current_gid())); |
| 281 | } | 285 | } |
| 282 | 286 | ||
| 283 | asmlinkage long sys32_getegid16(void) | 287 | COMPAT_SYSCALL_DEFINE0(s390_getegid16) |
| 284 | { | 288 | { |
| 285 | return high2lowgid(from_kgid_munged(current_user_ns(), current_egid())); | 289 | return high2lowgid(from_kgid_munged(current_user_ns(), current_egid())); |
| 286 | } | 290 | } |
| @@ -295,41 +299,35 @@ COMPAT_SYSCALL_DEFINE5(s390_ipc, uint, call, int, first, compat_ulong_t, second, | |||
| 295 | } | 299 | } |
| 296 | #endif | 300 | #endif |
| 297 | 301 | ||
| 298 | asmlinkage long sys32_truncate64(const char __user * path, unsigned long high, unsigned long low) | 302 | COMPAT_SYSCALL_DEFINE3(s390_truncate64, const char __user *, path, u32, high, u32, low) |
| 299 | { | 303 | { |
| 300 | if ((int)high < 0) | 304 | return sys_truncate(path, (unsigned long)high << 32 | low); |
| 301 | return -EINVAL; | ||
| 302 | else | ||
| 303 | return sys_truncate(path, (high << 32) | low); | ||
| 304 | } | 305 | } |
| 305 | 306 | ||
| 306 | asmlinkage long sys32_ftruncate64(unsigned int fd, unsigned long high, unsigned long low) | 307 | COMPAT_SYSCALL_DEFINE3(s390_ftruncate64, unsigned int, fd, u32, high, u32, low) |
| 307 | { | 308 | { |
| 308 | if ((int)high < 0) | 309 | return sys_ftruncate(fd, (unsigned long)high << 32 | low); |
| 309 | return -EINVAL; | ||
| 310 | else | ||
| 311 | return sys_ftruncate(fd, (high << 32) | low); | ||
| 312 | } | 310 | } |
| 313 | 311 | ||
| 314 | asmlinkage long sys32_pread64(unsigned int fd, char __user *ubuf, | 312 | COMPAT_SYSCALL_DEFINE5(s390_pread64, unsigned int, fd, char __user *, ubuf, |
| 315 | size_t count, u32 poshi, u32 poslo) | 313 | compat_size_t, count, u32, high, u32, low) |
| 316 | { | 314 | { |
| 317 | if ((compat_ssize_t) count < 0) | 315 | if ((compat_ssize_t) count < 0) |
| 318 | return -EINVAL; | 316 | return -EINVAL; |
| 319 | return sys_pread64(fd, ubuf, count, ((loff_t)AA(poshi) << 32) | AA(poslo)); | 317 | return sys_pread64(fd, ubuf, count, (unsigned long)high << 32 | low); |
| 320 | } | 318 | } |
| 321 | 319 | ||
| 322 | asmlinkage long sys32_pwrite64(unsigned int fd, const char __user *ubuf, | 320 | COMPAT_SYSCALL_DEFINE5(s390_pwrite64, unsigned int, fd, const char __user *, ubuf, |
| 323 | size_t count, u32 poshi, u32 poslo) | 321 | compat_size_t, count, u32, high, u32, low) |
| 324 | { | 322 | { |
| 325 | if ((compat_ssize_t) count < 0) | 323 | if ((compat_ssize_t) count < 0) |
| 326 | return -EINVAL; | 324 | return -EINVAL; |
| 327 | return sys_pwrite64(fd, ubuf, count, ((loff_t)AA(poshi) << 32) | AA(poslo)); | 325 | return sys_pwrite64(fd, ubuf, count, (unsigned long)high << 32 | low); |
| 328 | } | 326 | } |
| 329 | 327 | ||
| 330 | asmlinkage compat_ssize_t sys32_readahead(int fd, u32 offhi, u32 offlo, s32 count) | 328 | COMPAT_SYSCALL_DEFINE4(s390_readahead, int, fd, u32, high, u32, low, s32, count) |
| 331 | { | 329 | { |
| 332 | return sys_readahead(fd, ((loff_t)AA(offhi) << 32) | AA(offlo), count); | 330 | return sys_readahead(fd, (unsigned long)high << 32 | low, count); |
| 333 | } | 331 | } |
| 334 | 332 | ||
| 335 | struct stat64_emu31 { | 333 | struct stat64_emu31 { |
| @@ -381,7 +379,7 @@ static int cp_stat64(struct stat64_emu31 __user *ubuf, struct kstat *stat) | |||
| 381 | return copy_to_user(ubuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; | 379 | return copy_to_user(ubuf,&tmp,sizeof(tmp)) ? -EFAULT : 0; |
| 382 | } | 380 | } |
| 383 | 381 | ||
| 384 | asmlinkage long sys32_stat64(const char __user * filename, struct stat64_emu31 __user * statbuf) | 382 | COMPAT_SYSCALL_DEFINE2(s390_stat64, const char __user *, filename, struct stat64_emu31 __user *, statbuf) |
| 385 | { | 383 | { |
| 386 | struct kstat stat; | 384 | struct kstat stat; |
| 387 | int ret = vfs_stat(filename, &stat); | 385 | int ret = vfs_stat(filename, &stat); |
| @@ -390,7 +388,7 @@ asmlinkage long sys32_stat64(const char __user * filename, struct stat64_emu31 _ | |||
| 390 | return ret; | 388 | return ret; |
| 391 | } | 389 | } |
| 392 | 390 | ||
| 393 | asmlinkage long sys32_lstat64(const char __user * filename, struct stat64_emu31 __user * statbuf) | 391 | COMPAT_SYSCALL_DEFINE2(s390_lstat64, const char __user *, filename, struct stat64_emu31 __user *, statbuf) |
| 394 | { | 392 | { |
| 395 | struct kstat stat; | 393 | struct kstat stat; |
| 396 | int ret = vfs_lstat(filename, &stat); | 394 | int ret = vfs_lstat(filename, &stat); |
| @@ -399,7 +397,7 @@ asmlinkage long sys32_lstat64(const char __user * filename, struct stat64_emu31 | |||
| 399 | return ret; | 397 | return ret; |
| 400 | } | 398 | } |
| 401 | 399 | ||
| 402 | asmlinkage long sys32_fstat64(unsigned long fd, struct stat64_emu31 __user * statbuf) | 400 | COMPAT_SYSCALL_DEFINE2(s390_fstat64, unsigned int, fd, struct stat64_emu31 __user *, statbuf) |
| 403 | { | 401 | { |
| 404 | struct kstat stat; | 402 | struct kstat stat; |
| 405 | int ret = vfs_fstat(fd, &stat); | 403 | int ret = vfs_fstat(fd, &stat); |
| @@ -408,8 +406,8 @@ asmlinkage long sys32_fstat64(unsigned long fd, struct stat64_emu31 __user * sta | |||
| 408 | return ret; | 406 | return ret; |
| 409 | } | 407 | } |
| 410 | 408 | ||
| 411 | asmlinkage long sys32_fstatat64(unsigned int dfd, const char __user *filename, | 409 | COMPAT_SYSCALL_DEFINE4(s390_fstatat64, unsigned int, dfd, const char __user *, filename, |
| 412 | struct stat64_emu31 __user* statbuf, int flag) | 410 | struct stat64_emu31 __user *, statbuf, int, flag) |
| 413 | { | 411 | { |
| 414 | struct kstat stat; | 412 | struct kstat stat; |
| 415 | int error; | 413 | int error; |
| @@ -435,7 +433,7 @@ struct mmap_arg_struct_emu31 { | |||
| 435 | compat_ulong_t offset; | 433 | compat_ulong_t offset; |
| 436 | }; | 434 | }; |
| 437 | 435 | ||
| 438 | asmlinkage unsigned long old32_mmap(struct mmap_arg_struct_emu31 __user *arg) | 436 | COMPAT_SYSCALL_DEFINE1(s390_old_mmap, struct mmap_arg_struct_emu31 __user *, arg) |
| 439 | { | 437 | { |
| 440 | struct mmap_arg_struct_emu31 a; | 438 | struct mmap_arg_struct_emu31 a; |
| 441 | 439 | ||
| @@ -447,7 +445,7 @@ asmlinkage unsigned long old32_mmap(struct mmap_arg_struct_emu31 __user *arg) | |||
| 447 | a.offset >> PAGE_SHIFT); | 445 | a.offset >> PAGE_SHIFT); |
| 448 | } | 446 | } |
| 449 | 447 | ||
| 450 | asmlinkage long sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg) | 448 | COMPAT_SYSCALL_DEFINE1(s390_mmap2, struct mmap_arg_struct_emu31 __user *, arg) |
| 451 | { | 449 | { |
| 452 | struct mmap_arg_struct_emu31 a; | 450 | struct mmap_arg_struct_emu31 a; |
| 453 | 451 | ||
| @@ -456,7 +454,7 @@ asmlinkage long sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg) | |||
| 456 | return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset); | 454 | return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset); |
| 457 | } | 455 | } |
| 458 | 456 | ||
| 459 | asmlinkage long sys32_read(unsigned int fd, char __user * buf, size_t count) | 457 | COMPAT_SYSCALL_DEFINE3(s390_read, unsigned int, fd, char __user *, buf, compat_size_t, count) |
| 460 | { | 458 | { |
| 461 | if ((compat_ssize_t) count < 0) | 459 | if ((compat_ssize_t) count < 0) |
| 462 | return -EINVAL; | 460 | return -EINVAL; |
| @@ -464,7 +462,7 @@ asmlinkage long sys32_read(unsigned int fd, char __user * buf, size_t count) | |||
| 464 | return sys_read(fd, buf, count); | 462 | return sys_read(fd, buf, count); |
| 465 | } | 463 | } |
| 466 | 464 | ||
| 467 | asmlinkage long sys32_write(unsigned int fd, const char __user * buf, size_t count) | 465 | COMPAT_SYSCALL_DEFINE3(s390_write, unsigned int, fd, const char __user *, buf, compat_size_t, count) |
| 468 | { | 466 | { |
| 469 | if ((compat_ssize_t) count < 0) | 467 | if ((compat_ssize_t) count < 0) |
| 470 | return -EINVAL; | 468 | return -EINVAL; |
| @@ -478,14 +476,13 @@ asmlinkage long sys32_write(unsigned int fd, const char __user * buf, size_t cou | |||
| 478 | * because the 31 bit values differ from the 64 bit values. | 476 | * because the 31 bit values differ from the 64 bit values. |
| 479 | */ | 477 | */ |
| 480 | 478 | ||
| 481 | asmlinkage long | 479 | COMPAT_SYSCALL_DEFINE5(s390_fadvise64, int, fd, u32, high, u32, low, compat_size_t, len, int, advise) |
| 482 | sys32_fadvise64(int fd, loff_t offset, size_t len, int advise) | ||
| 483 | { | 480 | { |
| 484 | if (advise == 4) | 481 | if (advise == 4) |
| 485 | advise = POSIX_FADV_DONTNEED; | 482 | advise = POSIX_FADV_DONTNEED; |
| 486 | else if (advise == 5) | 483 | else if (advise == 5) |
| 487 | advise = POSIX_FADV_NOREUSE; | 484 | advise = POSIX_FADV_NOREUSE; |
| 488 | return sys_fadvise64(fd, offset, len, advise); | 485 | return sys_fadvise64(fd, (unsigned long)high << 32 | low, len, advise); |
| 489 | } | 486 | } |
| 490 | 487 | ||
| 491 | struct fadvise64_64_args { | 488 | struct fadvise64_64_args { |
| @@ -495,8 +492,7 @@ struct fadvise64_64_args { | |||
| 495 | int advice; | 492 | int advice; |
| 496 | }; | 493 | }; |
| 497 | 494 | ||
| 498 | asmlinkage long | 495 | COMPAT_SYSCALL_DEFINE1(s390_fadvise64_64, struct fadvise64_64_args __user *, args) |
| 499 | sys32_fadvise64_64(struct fadvise64_64_args __user *args) | ||
| 500 | { | 496 | { |
| 501 | struct fadvise64_64_args a; | 497 | struct fadvise64_64_args a; |
| 502 | 498 | ||
| @@ -508,3 +504,17 @@ sys32_fadvise64_64(struct fadvise64_64_args __user *args) | |||
| 508 | a.advice = POSIX_FADV_NOREUSE; | 504 | a.advice = POSIX_FADV_NOREUSE; |
| 509 | return sys_fadvise64_64(a.fd, a.offset, a.len, a.advice); | 505 | return sys_fadvise64_64(a.fd, a.offset, a.len, a.advice); |
| 510 | } | 506 | } |
| 507 | |||
| 508 | COMPAT_SYSCALL_DEFINE6(s390_sync_file_range, int, fd, u32, offhigh, u32, offlow, | ||
| 509 | u32, nhigh, u32, nlow, unsigned int, flags) | ||
| 510 | { | ||
| 511 | return sys_sync_file_range(fd, ((loff_t)offhigh << 32) + offlow, | ||
| 512 | ((u64)nhigh << 32) + nlow, flags); | ||
| 513 | } | ||
| 514 | |||
| 515 | COMPAT_SYSCALL_DEFINE6(s390_fallocate, int, fd, int, mode, u32, offhigh, u32, offlow, | ||
| 516 | u32, lenhigh, u32, lenlow) | ||
| 517 | { | ||
| 518 | return sys_fallocate(fd, mode, ((loff_t)offhigh << 32) + offlow, | ||
| 519 | ((u64)lenhigh << 32) + lenlow); | ||
| 520 | } | ||
diff --git a/arch/s390/kernel/compat_linux.h b/arch/s390/kernel/compat_linux.h index 1bfda3eca379..39ddfdb40ae8 100644 --- a/arch/s390/kernel/compat_linux.h +++ b/arch/s390/kernel/compat_linux.h | |||
| @@ -76,46 +76,43 @@ struct stat64_emu31; | |||
| 76 | struct mmap_arg_struct_emu31; | 76 | struct mmap_arg_struct_emu31; |
| 77 | struct fadvise64_64_args; | 77 | struct fadvise64_64_args; |
| 78 | 78 | ||
| 79 | long sys32_chown16(const char __user * filename, u16 user, u16 group); | 79 | long compat_sys_s390_chown16(const char __user *filename, u16 user, u16 group); |
| 80 | long sys32_lchown16(const char __user * filename, u16 user, u16 group); | 80 | long compat_sys_s390_lchown16(const char __user *filename, u16 user, u16 group); |
| 81 | long sys32_fchown16(unsigned int fd, u16 user, u16 group); | 81 | long compat_sys_s390_fchown16(unsigned int fd, u16 user, u16 group); |
| 82 | long sys32_setregid16(u16 rgid, u16 egid); | 82 | long compat_sys_s390_setregid16(u16 rgid, u16 egid); |
| 83 | long sys32_setgid16(u16 gid); | 83 | long compat_sys_s390_setgid16(u16 gid); |
| 84 | long sys32_setreuid16(u16 ruid, u16 euid); | 84 | long compat_sys_s390_setreuid16(u16 ruid, u16 euid); |
| 85 | long sys32_setuid16(u16 uid); | 85 | long compat_sys_s390_setuid16(u16 uid); |
| 86 | long sys32_setresuid16(u16 ruid, u16 euid, u16 suid); | 86 | long compat_sys_s390_setresuid16(u16 ruid, u16 euid, u16 suid); |
| 87 | long sys32_getresuid16(u16 __user *ruid, u16 __user *euid, u16 __user *suid); | 87 | long compat_sys_s390_getresuid16(u16 __user *ruid, u16 __user *euid, u16 __user *suid); |
| 88 | long sys32_setresgid16(u16 rgid, u16 egid, u16 sgid); | 88 | long compat_sys_s390_setresgid16(u16 rgid, u16 egid, u16 sgid); |
| 89 | long sys32_getresgid16(u16 __user *rgid, u16 __user *egid, u16 __user *sgid); | 89 | long compat_sys_s390_getresgid16(u16 __user *rgid, u16 __user *egid, u16 __user *sgid); |
| 90 | long sys32_setfsuid16(u16 uid); | 90 | long compat_sys_s390_setfsuid16(u16 uid); |
| 91 | long sys32_setfsgid16(u16 gid); | 91 | long compat_sys_s390_setfsgid16(u16 gid); |
| 92 | long sys32_getgroups16(int gidsetsize, u16 __user *grouplist); | 92 | long compat_sys_s390_getgroups16(int gidsetsize, u16 __user *grouplist); |
| 93 | long sys32_setgroups16(int gidsetsize, u16 __user *grouplist); | 93 | long compat_sys_s390_setgroups16(int gidsetsize, u16 __user *grouplist); |
| 94 | long sys32_getuid16(void); | 94 | long compat_sys_s390_getuid16(void); |
| 95 | long sys32_geteuid16(void); | 95 | long compat_sys_s390_geteuid16(void); |
| 96 | long sys32_getgid16(void); | 96 | long compat_sys_s390_getgid16(void); |
| 97 | long sys32_getegid16(void); | 97 | long compat_sys_s390_getegid16(void); |
| 98 | long sys32_truncate64(const char __user * path, unsigned long high, | 98 | long compat_sys_s390_truncate64(const char __user *path, u32 high, u32 low); |
| 99 | unsigned long low); | 99 | long compat_sys_s390_ftruncate64(unsigned int fd, u32 high, u32 low); |
| 100 | long sys32_ftruncate64(unsigned int fd, unsigned long high, unsigned long low); | 100 | long compat_sys_s390_pread64(unsigned int fd, char __user *ubuf, compat_size_t count, u32 high, u32 low); |
| 101 | long sys32_init_module(void __user *umod, unsigned long len, | 101 | long compat_sys_s390_pwrite64(unsigned int fd, const char __user *ubuf, compat_size_t count, u32 high, u32 low); |
| 102 | const char __user *uargs); | 102 | long compat_sys_s390_readahead(int fd, u32 high, u32 low, s32 count); |
| 103 | long sys32_delete_module(const char __user *name_user, unsigned int flags); | 103 | long compat_sys_s390_stat64(const char __user *filename, struct stat64_emu31 __user *statbuf); |
| 104 | long sys32_pread64(unsigned int fd, char __user *ubuf, size_t count, | 104 | long compat_sys_s390_lstat64(const char __user *filename, struct stat64_emu31 __user *statbuf); |
| 105 | u32 poshi, u32 poslo); | 105 | long compat_sys_s390_fstat64(unsigned int fd, struct stat64_emu31 __user *statbuf); |
| 106 | long sys32_pwrite64(unsigned int fd, const char __user *ubuf, | 106 | long compat_sys_s390_fstatat64(unsigned int dfd, const char __user *filename, struct stat64_emu31 __user *statbuf, int flag); |
| 107 | size_t count, u32 poshi, u32 poslo); | 107 | long compat_sys_s390_old_mmap(struct mmap_arg_struct_emu31 __user *arg); |
| 108 | compat_ssize_t sys32_readahead(int fd, u32 offhi, u32 offlo, s32 count); | 108 | long compat_sys_s390_mmap2(struct mmap_arg_struct_emu31 __user *arg); |
| 109 | long sys32_stat64(const char __user * filename, struct stat64_emu31 __user * statbuf); | 109 | long compat_sys_s390_read(unsigned int fd, char __user * buf, compat_size_t count); |
| 110 | long sys32_lstat64(const char __user * filename, | 110 | long compat_sys_s390_write(unsigned int fd, const char __user * buf, compat_size_t count); |
| 111 | struct stat64_emu31 __user * statbuf); | 111 | long compat_sys_s390_fadvise64(int fd, u32 high, u32 low, compat_size_t len, int advise); |
| 112 | long sys32_fstat64(unsigned long fd, struct stat64_emu31 __user * statbuf); | 112 | long compat_sys_s390_fadvise64_64(struct fadvise64_64_args __user *args); |
| 113 | long sys32_fstatat64(unsigned int dfd, const char __user *filename, | 113 | long compat_sys_s390_sync_file_range(int fd, u32 offhigh, u32 offlow, u32 nhigh, u32 nlow, unsigned int flags); |
| 114 | struct stat64_emu31 __user* statbuf, int flag); | 114 | long compat_sys_s390_fallocate(int fd, int mode, u32 offhigh, u32 offlow, u32 lenhigh, u32 lenlow); |
| 115 | unsigned long old32_mmap(struct mmap_arg_struct_emu31 __user *arg); | 115 | long compat_sys_sigreturn(void); |
| 116 | long sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg); | 116 | long compat_sys_rt_sigreturn(void); |
| 117 | long sys32_read(unsigned int fd, char __user * buf, size_t count); | 117 | |
| 118 | long sys32_write(unsigned int fd, const char __user * buf, size_t count); | ||
| 119 | long sys32_fadvise64(int fd, loff_t offset, size_t len, int advise); | ||
| 120 | long sys32_fadvise64_64(struct fadvise64_64_args __user *args); | ||
| 121 | #endif /* _ASM_S390X_S390_H */ | 118 | #endif /* _ASM_S390X_S390_H */ |
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c index 8b84bc373e94..7df5ed9f44d7 100644 --- a/arch/s390/kernel/compat_signal.c +++ b/arch/s390/kernel/compat_signal.c | |||
| @@ -241,7 +241,7 @@ static int restore_sigregs_gprs_high(struct pt_regs *regs, __u32 __user *uregs) | |||
| 241 | return 0; | 241 | return 0; |
| 242 | } | 242 | } |
| 243 | 243 | ||
| 244 | asmlinkage long sys32_sigreturn(void) | 244 | COMPAT_SYSCALL_DEFINE0(sigreturn) |
| 245 | { | 245 | { |
| 246 | struct pt_regs *regs = task_pt_regs(current); | 246 | struct pt_regs *regs = task_pt_regs(current); |
| 247 | sigframe32 __user *frame = (sigframe32 __user *)regs->gprs[15]; | 247 | sigframe32 __user *frame = (sigframe32 __user *)regs->gprs[15]; |
| @@ -260,7 +260,7 @@ badframe: | |||
| 260 | return 0; | 260 | return 0; |
| 261 | } | 261 | } |
| 262 | 262 | ||
| 263 | asmlinkage long sys32_rt_sigreturn(void) | 263 | COMPAT_SYSCALL_DEFINE0(rt_sigreturn) |
| 264 | { | 264 | { |
| 265 | struct pt_regs *regs = task_pt_regs(current); | 265 | struct pt_regs *regs = task_pt_regs(current); |
| 266 | rt_sigframe32 __user *frame = (rt_sigframe32 __user *)regs->gprs[15]; | 266 | rt_sigframe32 __user *frame = (rt_sigframe32 __user *)regs->gprs[15]; |
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S deleted file mode 100644 index 59c8efce1b99..000000000000 --- a/arch/s390/kernel/compat_wrapper.S +++ /dev/null | |||
| @@ -1,1425 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * wrapper for 31 bit compatible system calls. | ||
| 3 | * | ||
| 4 | * Copyright IBM Corp. 2000, 2006 | ||
| 5 | * Author(s): Gerhard Tonn (ton@de.ibm.com), | ||
| 6 | * Thomas Spatzier (tspat@de.ibm.com) | ||
| 7 | */ | ||
| 8 | |||
| 9 | #include <linux/linkage.h> | ||
| 10 | |||
| 11 | ENTRY(sys32_exit_wrapper) | ||
| 12 | lgfr %r2,%r2 # int | ||
| 13 | jg sys_exit # branch to sys_exit | ||
| 14 | |||
| 15 | ENTRY(sys32_read_wrapper) | ||
| 16 | llgfr %r2,%r2 # unsigned int | ||
| 17 | llgtr %r3,%r3 # char * | ||
| 18 | llgfr %r4,%r4 # size_t | ||
| 19 | jg sys32_read # branch to sys_read | ||
| 20 | |||
| 21 | ENTRY(sys32_write_wrapper) | ||
| 22 | llgfr %r2,%r2 # unsigned int | ||
| 23 | llgtr %r3,%r3 # const char * | ||
| 24 | llgfr %r4,%r4 # size_t | ||
| 25 | jg sys32_write # branch to system call | ||
| 26 | |||
| 27 | ENTRY(sys32_close_wrapper) | ||
| 28 | llgfr %r2,%r2 # unsigned int | ||
| 29 | jg sys_close # branch to system call | ||
| 30 | |||
| 31 | ENTRY(sys32_creat_wrapper) | ||
| 32 | llgtr %r2,%r2 # const char * | ||
| 33 | lgfr %r3,%r3 # int | ||
| 34 | jg sys_creat # branch to system call | ||
| 35 | |||
| 36 | ENTRY(sys32_link_wrapper) | ||
| 37 | llgtr %r2,%r2 # const char * | ||
| 38 | llgtr %r3,%r3 # const char * | ||
| 39 | jg sys_link # branch to system call | ||
| 40 | |||
| 41 | ENTRY(sys32_unlink_wrapper) | ||
| 42 | llgtr %r2,%r2 # const char * | ||
| 43 | jg sys_unlink # branch to system call | ||
| 44 | |||
| 45 | ENTRY(sys32_chdir_wrapper) | ||
| 46 | llgtr %r2,%r2 # const char * | ||
| 47 | jg sys_chdir # branch to system call | ||
| 48 | |||
| 49 | ENTRY(sys32_time_wrapper) | ||
| 50 | llgtr %r2,%r2 # int * | ||
| 51 | jg compat_sys_time # branch to system call | ||
| 52 | |||
| 53 | ENTRY(sys32_mknod_wrapper) | ||
| 54 | llgtr %r2,%r2 # const char * | ||
| 55 | lgfr %r3,%r3 # int | ||
| 56 | llgfr %r4,%r4 # dev | ||
| 57 | jg sys_mknod # branch to system call | ||
| 58 | |||
| 59 | ENTRY(sys32_chmod_wrapper) | ||
| 60 | llgtr %r2,%r2 # const char * | ||
| 61 | llgfr %r3,%r3 # mode_t | ||
| 62 | jg sys_chmod # branch to system call | ||
| 63 | |||
| 64 | ENTRY(sys32_lchown16_wrapper) | ||
| 65 | llgtr %r2,%r2 # const char * | ||
| 66 | llgfr %r3,%r3 # __kernel_old_uid_emu31_t | ||
| 67 | llgfr %r4,%r4 # __kernel_old_uid_emu31_t | ||
| 68 | jg sys32_lchown16 # branch to system call | ||
| 69 | |||
| 70 | #sys32_getpid_wrapper # void | ||
| 71 | |||
| 72 | ENTRY(sys32_mount_wrapper) | ||
| 73 | llgtr %r2,%r2 # char * | ||
| 74 | llgtr %r3,%r3 # char * | ||
| 75 | llgtr %r4,%r4 # char * | ||
| 76 | llgfr %r5,%r5 # unsigned long | ||
| 77 | llgtr %r6,%r6 # void * | ||
| 78 | jg compat_sys_mount # branch to system call | ||
| 79 | |||
| 80 | ENTRY(sys32_oldumount_wrapper) | ||
| 81 | llgtr %r2,%r2 # char * | ||
| 82 | jg sys_oldumount # branch to system call | ||
| 83 | |||
| 84 | ENTRY(sys32_setuid16_wrapper) | ||
| 85 | llgfr %r2,%r2 # __kernel_old_uid_emu31_t | ||
| 86 | jg sys32_setuid16 # branch to system call | ||
| 87 | |||
| 88 | #sys32_getuid16_wrapper # void | ||
| 89 | |||
| 90 | ENTRY(sys32_ptrace_wrapper) | ||
| 91 | lgfr %r2,%r2 # long | ||
| 92 | lgfr %r3,%r3 # long | ||
| 93 | llgtr %r4,%r4 # long | ||
| 94 | llgfr %r5,%r5 # long | ||
| 95 | jg compat_sys_ptrace # branch to system call | ||
| 96 | |||
| 97 | ENTRY(sys32_alarm_wrapper) | ||
| 98 | llgfr %r2,%r2 # unsigned int | ||
| 99 | jg sys_alarm # branch to system call | ||
| 100 | |||
| 101 | ENTRY(compat_sys_utime_wrapper) | ||
| 102 | llgtr %r2,%r2 # char * | ||
| 103 | llgtr %r3,%r3 # struct compat_utimbuf * | ||
| 104 | jg compat_sys_utime # branch to system call | ||
| 105 | |||
| 106 | ENTRY(sys32_access_wrapper) | ||
| 107 | llgtr %r2,%r2 # const char * | ||
| 108 | lgfr %r3,%r3 # int | ||
| 109 | jg sys_access # branch to system call | ||
| 110 | |||
| 111 | ENTRY(sys32_nice_wrapper) | ||
| 112 | lgfr %r2,%r2 # int | ||
| 113 | jg sys_nice # branch to system call | ||
| 114 | |||
| 115 | #sys32_sync_wrapper # void | ||
| 116 | |||
| 117 | ENTRY(sys32_kill_wrapper) | ||
| 118 | lgfr %r2,%r2 # int | ||
| 119 | lgfr %r3,%r3 # int | ||
| 120 | jg sys_kill # branch to system call | ||
| 121 | |||
| 122 | ENTRY(sys32_rename_wrapper) | ||
| 123 | llgtr %r2,%r2 # const char * | ||
| 124 | llgtr %r3,%r3 # const char * | ||
| 125 | jg sys_rename # branch to system call | ||
| 126 | |||
| 127 | ENTRY(sys32_mkdir_wrapper) | ||
| 128 | llgtr %r2,%r2 # const char * | ||
| 129 | lgfr %r3,%r3 # int | ||
| 130 | jg sys_mkdir # branch to system call | ||
| 131 | |||
| 132 | ENTRY(sys32_rmdir_wrapper) | ||
| 133 | llgtr %r2,%r2 # const char * | ||
| 134 | jg sys_rmdir # branch to system call | ||
| 135 | |||
| 136 | ENTRY(sys32_dup_wrapper) | ||
| 137 | llgfr %r2,%r2 # unsigned int | ||
| 138 | jg sys_dup # branch to system call | ||
| 139 | |||
| 140 | ENTRY(sys32_pipe_wrapper) | ||
| 141 | llgtr %r2,%r2 # u32 * | ||
| 142 | jg sys_pipe # branch to system call | ||
| 143 | |||
| 144 | ENTRY(compat_sys_times_wrapper) | ||
| 145 | llgtr %r2,%r2 # struct compat_tms * | ||
| 146 | jg compat_sys_times # branch to system call | ||
| 147 | |||
| 148 | ENTRY(sys32_brk_wrapper) | ||
| 149 | llgtr %r2,%r2 # unsigned long | ||
| 150 | jg sys_brk # branch to system call | ||
| 151 | |||
| 152 | ENTRY(sys32_setgid16_wrapper) | ||
| 153 | llgfr %r2,%r2 # __kernel_old_gid_emu31_t | ||
| 154 | jg sys32_setgid16 # branch to system call | ||
| 155 | |||
| 156 | #sys32_getgid16_wrapper # void | ||
| 157 | |||
| 158 | ENTRY(sys32_signal_wrapper) | ||
| 159 | lgfr %r2,%r2 # int | ||
| 160 | llgtr %r3,%r3 # __sighandler_t | ||
| 161 | jg sys_signal | ||
| 162 | |||
| 163 | #sys32_geteuid16_wrapper # void | ||
| 164 | |||
| 165 | #sys32_getegid16_wrapper # void | ||
| 166 | |||
| 167 | ENTRY(sys32_acct_wrapper) | ||
| 168 | llgtr %r2,%r2 # char * | ||
| 169 | jg sys_acct # branch to system call | ||
| 170 | |||
| 171 | ENTRY(sys32_umount_wrapper) | ||
| 172 | llgtr %r2,%r2 # char * | ||
| 173 | lgfr %r3,%r3 # int | ||
| 174 | jg sys_umount # branch to system call | ||
| 175 | |||
| 176 | ENTRY(compat_sys_ioctl_wrapper) | ||
| 177 | llgfr %r2,%r2 # unsigned int | ||
| 178 | llgfr %r3,%r3 # unsigned int | ||
| 179 | llgfr %r4,%r4 # unsigned int | ||
| 180 | jg compat_sys_ioctl # branch to system call | ||
| 181 | |||
| 182 | ENTRY(compat_sys_fcntl_wrapper) | ||
| 183 | llgfr %r2,%r2 # unsigned int | ||
| 184 | llgfr %r3,%r3 # unsigned int | ||
| 185 | llgfr %r4,%r4 # unsigned long | ||
| 186 | jg compat_sys_fcntl # branch to system call | ||
| 187 | |||
| 188 | ENTRY(sys32_setpgid_wrapper) | ||
| 189 | lgfr %r2,%r2 # pid_t | ||
| 190 | lgfr %r3,%r3 # pid_t | ||
| 191 | jg sys_setpgid # branch to system call | ||
| 192 | |||
| 193 | ENTRY(sys32_umask_wrapper) | ||
| 194 | lgfr %r2,%r2 # int | ||
| 195 | jg sys_umask # branch to system call | ||
| 196 | |||
| 197 | ENTRY(sys32_chroot_wrapper) | ||
| 198 | llgtr %r2,%r2 # char * | ||
| 199 | jg sys_chroot # branch to system call | ||
| 200 | |||
| 201 | ENTRY(sys32_ustat_wrapper) | ||
| 202 | llgfr %r2,%r2 # dev_t | ||
| 203 | llgtr %r3,%r3 # struct ustat * | ||
| 204 | jg compat_sys_ustat | ||
| 205 | |||
| 206 | ENTRY(sys32_dup2_wrapper) | ||
| 207 | llgfr %r2,%r2 # unsigned int | ||
| 208 | llgfr %r3,%r3 # unsigned int | ||
| 209 | jg sys_dup2 # branch to system call | ||
| 210 | |||
| 211 | #sys32_getppid_wrapper # void | ||
| 212 | |||
| 213 | #sys32_getpgrp_wrapper # void | ||
| 214 | |||
| 215 | #sys32_setsid_wrapper # void | ||
| 216 | |||
| 217 | ENTRY(sys32_setreuid16_wrapper) | ||
| 218 | llgfr %r2,%r2 # __kernel_old_uid_emu31_t | ||
| 219 | llgfr %r3,%r3 # __kernel_old_uid_emu31_t | ||
| 220 | jg sys32_setreuid16 # branch to system call | ||
| 221 | |||
| 222 | ENTRY(sys32_setregid16_wrapper) | ||
| 223 | llgfr %r2,%r2 # __kernel_old_gid_emu31_t | ||
| 224 | llgfr %r3,%r3 # __kernel_old_gid_emu31_t | ||
| 225 | jg sys32_setregid16 # branch to system call | ||
| 226 | |||
| 227 | ENTRY(sys_sigsuspend_wrapper) | ||
| 228 | lgfr %r2,%r2 # int | ||
| 229 | lgfr %r3,%r3 # int | ||
| 230 | llgfr %r4,%r4 # old_sigset_t | ||
| 231 | jg sys_sigsuspend | ||
| 232 | |||
| 233 | ENTRY(compat_sys_sigpending_wrapper) | ||
| 234 | llgtr %r2,%r2 # compat_old_sigset_t * | ||
| 235 | jg compat_sys_sigpending # branch to system call | ||
| 236 | |||
| 237 | ENTRY(sys32_sethostname_wrapper) | ||
| 238 | llgtr %r2,%r2 # char * | ||
| 239 | lgfr %r3,%r3 # int | ||
| 240 | jg sys_sethostname # branch to system call | ||
| 241 | |||
| 242 | ENTRY(compat_sys_setrlimit_wrapper) | ||
| 243 | llgfr %r2,%r2 # unsigned int | ||
| 244 | llgtr %r3,%r3 # struct rlimit_emu31 * | ||
| 245 | jg compat_sys_setrlimit # branch to system call | ||
| 246 | |||
| 247 | ENTRY(compat_sys_old_getrlimit_wrapper) | ||
| 248 | llgfr %r2,%r2 # unsigned int | ||
| 249 | llgtr %r3,%r3 # struct rlimit_emu31 * | ||
| 250 | jg compat_sys_old_getrlimit # branch to system call | ||
| 251 | |||
| 252 | ENTRY(compat_sys_getrlimit_wrapper) | ||
| 253 | llgfr %r2,%r2 # unsigned int | ||
| 254 | llgtr %r3,%r3 # struct rlimit_emu31 * | ||
| 255 | jg compat_sys_getrlimit # branch to system call | ||
| 256 | |||
| 257 | ENTRY(sys32_mmap2_wrapper) | ||
| 258 | llgtr %r2,%r2 # struct mmap_arg_struct_emu31 * | ||
| 259 | jg sys32_mmap2 # branch to system call | ||
| 260 | |||
| 261 | ENTRY(compat_sys_gettimeofday_wrapper) | ||
| 262 | llgtr %r2,%r2 # struct timeval_emu31 * | ||
| 263 | llgtr %r3,%r3 # struct timezone * | ||
| 264 | jg compat_sys_gettimeofday # branch to system call | ||
| 265 | |||
| 266 | ENTRY(compat_sys_settimeofday_wrapper) | ||
| 267 | llgtr %r2,%r2 # struct timeval_emu31 * | ||
| 268 | llgtr %r3,%r3 # struct timezone * | ||
| 269 | jg compat_sys_settimeofday # branch to system call | ||
| 270 | |||
| 271 | ENTRY(sys32_getgroups16_wrapper) | ||
| 272 | lgfr %r2,%r2 # int | ||
| 273 | llgtr %r3,%r3 # __kernel_old_gid_emu31_t * | ||
| 274 | jg sys32_getgroups16 # branch to system call | ||
| 275 | |||
| 276 | ENTRY(sys32_setgroups16_wrapper) | ||
| 277 | lgfr %r2,%r2 # int | ||
| 278 | llgtr %r3,%r3 # __kernel_old_gid_emu31_t * | ||
| 279 | jg sys32_setgroups16 # branch to system call | ||
| 280 | |||
| 281 | ENTRY(sys32_symlink_wrapper) | ||
| 282 | llgtr %r2,%r2 # const char * | ||
| 283 | llgtr %r3,%r3 # const char * | ||
| 284 | jg sys_symlink # branch to system call | ||
| 285 | |||
| 286 | ENTRY(sys32_readlink_wrapper) | ||
| 287 | llgtr %r2,%r2 # const char * | ||
| 288 | llgtr %r3,%r3 # char * | ||
| 289 | lgfr %r4,%r4 # int | ||
| 290 | jg sys_readlink # branch to system call | ||
| 291 | |||
| 292 | ENTRY(sys32_uselib_wrapper) | ||
| 293 | llgtr %r2,%r2 # const char * | ||
| 294 | jg sys_uselib # branch to system call | ||
| 295 | |||
| 296 | ENTRY(sys32_swapon_wrapper) | ||
| 297 | llgtr %r2,%r2 # const char * | ||
| 298 | lgfr %r3,%r3 # int | ||
| 299 | jg sys_swapon # branch to system call | ||
| 300 | |||
| 301 | ENTRY(sys32_reboot_wrapper) | ||
| 302 | lgfr %r2,%r2 # int | ||
| 303 | lgfr %r3,%r3 # int | ||
| 304 | llgfr %r4,%r4 # unsigned int | ||
| 305 | llgtr %r5,%r5 # void * | ||
| 306 | jg sys_reboot # branch to system call | ||
| 307 | |||
| 308 | ENTRY(old32_readdir_wrapper) | ||
| 309 | llgfr %r2,%r2 # unsigned int | ||
| 310 | llgtr %r3,%r3 # void * | ||
| 311 | llgfr %r4,%r4 # unsigned int | ||
| 312 | jg compat_sys_old_readdir # branch to system call | ||
| 313 | |||
| 314 | ENTRY(old32_mmap_wrapper) | ||
| 315 | llgtr %r2,%r2 # struct mmap_arg_struct_emu31 * | ||
| 316 | jg old32_mmap # branch to system call | ||
| 317 | |||
| 318 | ENTRY(sys32_munmap_wrapper) | ||
| 319 | llgfr %r2,%r2 # unsigned long | ||
| 320 | llgfr %r3,%r3 # size_t | ||
| 321 | jg sys_munmap # branch to system call | ||
| 322 | |||
| 323 | ENTRY(sys32_fchmod_wrapper) | ||
| 324 | llgfr %r2,%r2 # unsigned int | ||
| 325 | llgfr %r3,%r3 # mode_t | ||
| 326 | jg sys_fchmod # branch to system call | ||
| 327 | |||
| 328 | ENTRY(sys32_fchown16_wrapper) | ||
| 329 | llgfr %r2,%r2 # unsigned int | ||
| 330 | llgfr %r3,%r3 # compat_uid_t | ||
| 331 | llgfr %r4,%r4 # compat_uid_t | ||
| 332 | jg sys32_fchown16 # branch to system call | ||
| 333 | |||
| 334 | ENTRY(sys32_getpriority_wrapper) | ||
| 335 | lgfr %r2,%r2 # int | ||
| 336 | lgfr %r3,%r3 # int | ||
| 337 | jg sys_getpriority # branch to system call | ||
| 338 | |||
| 339 | ENTRY(sys32_setpriority_wrapper) | ||
| 340 | lgfr %r2,%r2 # int | ||
| 341 | lgfr %r3,%r3 # int | ||
| 342 | lgfr %r4,%r4 # int | ||
| 343 | jg sys_setpriority # branch to system call | ||
| 344 | |||
| 345 | ENTRY(compat_sys_statfs_wrapper) | ||
| 346 | llgtr %r2,%r2 # char * | ||
| 347 | llgtr %r3,%r3 # struct compat_statfs * | ||
| 348 | jg compat_sys_statfs # branch to system call | ||
| 349 | |||
| 350 | ENTRY(compat_sys_fstatfs_wrapper) | ||
| 351 | llgfr %r2,%r2 # unsigned int | ||
| 352 | llgtr %r3,%r3 # struct compat_statfs * | ||
| 353 | jg compat_sys_fstatfs # branch to system call | ||
| 354 | |||
| 355 | ENTRY(compat_sys_socketcall_wrapper) | ||
| 356 | lgfr %r2,%r2 # int | ||
| 357 | llgtr %r3,%r3 # u32 * | ||
| 358 | jg compat_sys_socketcall # branch to system call | ||
| 359 | |||
| 360 | ENTRY(sys32_syslog_wrapper) | ||
| 361 | lgfr %r2,%r2 # int | ||
| 362 | llgtr %r3,%r3 # char * | ||
| 363 | lgfr %r4,%r4 # int | ||
| 364 | jg sys_syslog # branch to system call | ||
| 365 | |||
| 366 | ENTRY(compat_sys_newstat_wrapper) | ||
| 367 | llgtr %r2,%r2 # char * | ||
| 368 | llgtr %r3,%r3 # struct stat_emu31 * | ||
| 369 | jg compat_sys_newstat # branch to system call | ||
| 370 | |||
| 371 | ENTRY(compat_sys_newlstat_wrapper) | ||
| 372 | llgtr %r2,%r2 # char * | ||
| 373 | llgtr %r3,%r3 # struct stat_emu31 * | ||
| 374 | jg compat_sys_newlstat # branch to system call | ||
| 375 | |||
| 376 | ENTRY(compat_sys_newfstat_wrapper) | ||
| 377 | llgfr %r2,%r2 # unsigned int | ||
| 378 | llgtr %r3,%r3 # struct stat_emu31 * | ||
| 379 | jg compat_sys_newfstat # branch to system call | ||
| 380 | |||
| 381 | #sys32_vhangup_wrapper # void | ||
| 382 | |||
| 383 | ENTRY(sys32_swapoff_wrapper) | ||
| 384 | llgtr %r2,%r2 # const char * | ||
| 385 | jg sys_swapoff # branch to system call | ||
| 386 | |||
| 387 | ENTRY(compat_sys_sysinfo_wrapper) | ||
| 388 | llgtr %r2,%r2 # struct sysinfo_emu31 * | ||
| 389 | jg compat_sys_sysinfo # branch to system call | ||
| 390 | |||
| 391 | ENTRY(sys32_fsync_wrapper) | ||
| 392 | llgfr %r2,%r2 # unsigned int | ||
| 393 | jg sys_fsync # branch to system call | ||
| 394 | |||
| 395 | #sys32_sigreturn_wrapper # done in sigreturn_glue | ||
| 396 | |||
| 397 | #sys32_clone_wrapper # done in clone_glue | ||
| 398 | |||
| 399 | ENTRY(sys32_setdomainname_wrapper) | ||
| 400 | llgtr %r2,%r2 # char * | ||
| 401 | lgfr %r3,%r3 # int | ||
| 402 | jg sys_setdomainname # branch to system call | ||
| 403 | |||
| 404 | ENTRY(sys32_newuname_wrapper) | ||
| 405 | llgtr %r2,%r2 # struct new_utsname * | ||
| 406 | jg sys_newuname # branch to system call | ||
| 407 | |||
| 408 | ENTRY(compat_sys_adjtimex_wrapper) | ||
| 409 | llgtr %r2,%r2 # struct compat_timex * | ||
| 410 | jg compat_sys_adjtimex # branch to system call | ||
| 411 | |||
| 412 | ENTRY(sys32_mprotect_wrapper) | ||
| 413 | llgtr %r2,%r2 # unsigned long (actually pointer | ||
| 414 | llgfr %r3,%r3 # size_t | ||
| 415 | llgfr %r4,%r4 # unsigned long | ||
| 416 | jg sys_mprotect # branch to system call | ||
| 417 | |||
| 418 | ENTRY(sys_init_module_wrapper) | ||
| 419 | llgtr %r2,%r2 # void * | ||
| 420 | llgfr %r3,%r3 # unsigned long | ||
| 421 | llgtr %r4,%r4 # char * | ||
| 422 | jg sys_init_module # branch to system call | ||
| 423 | |||
| 424 | ENTRY(sys_delete_module_wrapper) | ||
| 425 | llgtr %r2,%r2 # const char * | ||
| 426 | llgfr %r3,%r3 # unsigned int | ||
| 427 | jg sys_delete_module # branch to system call | ||
| 428 | |||
| 429 | ENTRY(sys32_quotactl_wrapper) | ||
| 430 | llgfr %r2,%r2 # unsigned int | ||
| 431 | llgtr %r3,%r3 # const char * | ||
| 432 | llgfr %r4,%r4 # qid_t | ||
| 433 | llgtr %r5,%r5 # caddr_t | ||
| 434 | jg sys_quotactl # branch to system call | ||
| 435 | |||
| 436 | ENTRY(sys32_getpgid_wrapper) | ||
| 437 | lgfr %r2,%r2 # pid_t | ||
| 438 | jg sys_getpgid # branch to system call | ||
| 439 | |||
| 440 | ENTRY(sys32_fchdir_wrapper) | ||
| 441 | llgfr %r2,%r2 # unsigned int | ||
| 442 | jg sys_fchdir # branch to system call | ||
| 443 | |||
| 444 | ENTRY(sys32_bdflush_wrapper) | ||
| 445 | lgfr %r2,%r2 # int | ||
| 446 | lgfr %r3,%r3 # long | ||
| 447 | jg sys_bdflush # branch to system call | ||
| 448 | |||
| 449 | ENTRY(sys32_sysfs_wrapper) | ||
| 450 | lgfr %r2,%r2 # int | ||
| 451 | llgfr %r3,%r3 # unsigned long | ||
| 452 | llgfr %r4,%r4 # unsigned long | ||
| 453 | jg sys_sysfs # branch to system call | ||
| 454 | |||
| 455 | ENTRY(sys32_personality_wrapper) | ||
| 456 | llgfr %r2,%r2 # unsigned int | ||
| 457 | jg sys_s390_personality # branch to system call | ||
| 458 | |||
| 459 | ENTRY(sys32_setfsuid16_wrapper) | ||
| 460 | llgfr %r2,%r2 # __kernel_old_uid_emu31_t | ||
| 461 | jg sys32_setfsuid16 # branch to system call | ||
| 462 | |||
| 463 | ENTRY(sys32_setfsgid16_wrapper) | ||
| 464 | llgfr %r2,%r2 # __kernel_old_gid_emu31_t | ||
| 465 | jg sys32_setfsgid16 # branch to system call | ||
| 466 | |||
| 467 | ENTRY(sys32_llseek_wrapper) | ||
| 468 | llgfr %r2,%r2 # unsigned int | ||
| 469 | llgfr %r3,%r3 # unsigned long | ||
| 470 | llgfr %r4,%r4 # unsigned long | ||
| 471 | llgtr %r5,%r5 # loff_t * | ||
| 472 | llgfr %r6,%r6 # unsigned int | ||
| 473 | jg sys_llseek # branch to system call | ||
| 474 | |||
| 475 | ENTRY(sys32_getdents_wrapper) | ||
| 476 | llgfr %r2,%r2 # unsigned int | ||
| 477 | llgtr %r3,%r3 # void * | ||
| 478 | llgfr %r4,%r4 # unsigned int | ||
| 479 | jg compat_sys_getdents # branch to system call | ||
| 480 | |||
| 481 | ENTRY(compat_sys_select_wrapper) | ||
| 482 | lgfr %r2,%r2 # int | ||
| 483 | llgtr %r3,%r3 # compat_fd_set * | ||
| 484 | llgtr %r4,%r4 # compat_fd_set * | ||
| 485 | llgtr %r5,%r5 # compat_fd_set * | ||
| 486 | llgtr %r6,%r6 # struct compat_timeval * | ||
| 487 | jg compat_sys_select # branch to system call | ||
| 488 | |||
| 489 | ENTRY(sys32_flock_wrapper) | ||
| 490 | llgfr %r2,%r2 # unsigned int | ||
| 491 | llgfr %r3,%r3 # unsigned int | ||
| 492 | jg sys_flock # branch to system call | ||
| 493 | |||
| 494 | ENTRY(sys32_msync_wrapper) | ||
| 495 | llgfr %r2,%r2 # unsigned long | ||
| 496 | llgfr %r3,%r3 # size_t | ||
| 497 | lgfr %r4,%r4 # int | ||
| 498 | jg sys_msync # branch to system call | ||
| 499 | |||
| 500 | ENTRY(compat_sys_readv_wrapper) | ||
| 501 | lgfr %r2,%r2 # int | ||
| 502 | llgtr %r3,%r3 # const struct compat_iovec * | ||
| 503 | llgfr %r4,%r4 # unsigned long | ||
| 504 | jg compat_sys_readv # branch to system call | ||
| 505 | |||
| 506 | ENTRY(compat_sys_writev_wrapper) | ||
| 507 | lgfr %r2,%r2 # int | ||
| 508 | llgtr %r3,%r3 # const struct compat_iovec * | ||
| 509 | llgfr %r4,%r4 # unsigned long | ||
| 510 | jg compat_sys_writev # branch to system call | ||
| 511 | |||
| 512 | ENTRY(sys32_getsid_wrapper) | ||
| 513 | lgfr %r2,%r2 # pid_t | ||
| 514 | jg sys_getsid # branch to system call | ||
| 515 | |||
| 516 | ENTRY(sys32_fdatasync_wrapper) | ||
| 517 | llgfr %r2,%r2 # unsigned int | ||
| 518 | jg sys_fdatasync # branch to system call | ||
| 519 | |||
| 520 | ENTRY(sys32_mlock_wrapper) | ||
| 521 | llgfr %r2,%r2 # unsigned long | ||
| 522 | llgfr %r3,%r3 # size_t | ||
| 523 | jg sys_mlock # branch to system call | ||
| 524 | |||
| 525 | ENTRY(sys32_munlock_wrapper) | ||
| 526 | llgfr %r2,%r2 # unsigned long | ||
| 527 | llgfr %r3,%r3 # size_t | ||
| 528 | jg sys_munlock # branch to system call | ||
| 529 | |||
| 530 | ENTRY(sys32_mlockall_wrapper) | ||
| 531 | lgfr %r2,%r2 # int | ||
| 532 | jg sys_mlockall # branch to system call | ||
| 533 | |||
| 534 | #sys32_munlockall_wrapper # void | ||
| 535 | |||
| 536 | ENTRY(sys32_sched_setparam_wrapper) | ||
| 537 | lgfr %r2,%r2 # pid_t | ||
| 538 | llgtr %r3,%r3 # struct sched_param * | ||
| 539 | jg sys_sched_setparam # branch to system call | ||
| 540 | |||
| 541 | ENTRY(sys32_sched_getparam_wrapper) | ||
| 542 | lgfr %r2,%r2 # pid_t | ||
| 543 | llgtr %r3,%r3 # struct sched_param * | ||
| 544 | jg sys_sched_getparam # branch to system call | ||
| 545 | |||
| 546 | ENTRY(sys32_sched_setscheduler_wrapper) | ||
| 547 | lgfr %r2,%r2 # pid_t | ||
| 548 | lgfr %r3,%r3 # int | ||
| 549 | llgtr %r4,%r4 # struct sched_param * | ||
| 550 | jg sys_sched_setscheduler # branch to system call | ||
| 551 | |||
| 552 | ENTRY(sys32_sched_getscheduler_wrapper) | ||
| 553 | lgfr %r2,%r2 # pid_t | ||
| 554 | jg sys_sched_getscheduler # branch to system call | ||
| 555 | |||
| 556 | #sys32_sched_yield_wrapper # void | ||
| 557 | |||
| 558 | ENTRY(sys32_sched_get_priority_max_wrapper) | ||
| 559 | lgfr %r2,%r2 # int | ||
| 560 | jg sys_sched_get_priority_max # branch to system call | ||
| 561 | |||
| 562 | ENTRY(sys32_sched_get_priority_min_wrapper) | ||
| 563 | lgfr %r2,%r2 # int | ||
| 564 | jg sys_sched_get_priority_min # branch to system call | ||
| 565 | |||
| 566 | ENTRY(compat_sys_nanosleep_wrapper) | ||
| 567 | llgtr %r2,%r2 # struct compat_timespec * | ||
| 568 | llgtr %r3,%r3 # struct compat_timespec * | ||
| 569 | jg compat_sys_nanosleep # branch to system call | ||
| 570 | |||
| 571 | ENTRY(sys32_mremap_wrapper) | ||
| 572 | llgfr %r2,%r2 # unsigned long | ||
| 573 | llgfr %r3,%r3 # unsigned long | ||
| 574 | llgfr %r4,%r4 # unsigned long | ||
| 575 | llgfr %r5,%r5 # unsigned long | ||
| 576 | llgfr %r6,%r6 # unsigned long | ||
| 577 | jg sys_mremap # branch to system call | ||
| 578 | |||
| 579 | ENTRY(sys32_setresuid16_wrapper) | ||
| 580 | llgfr %r2,%r2 # __kernel_old_uid_emu31_t | ||
| 581 | llgfr %r3,%r3 # __kernel_old_uid_emu31_t | ||
| 582 | llgfr %r4,%r4 # __kernel_old_uid_emu31_t | ||
| 583 | jg sys32_setresuid16 # branch to system call | ||
| 584 | |||
| 585 | ENTRY(sys32_getresuid16_wrapper) | ||
| 586 | llgtr %r2,%r2 # __kernel_old_uid_emu31_t * | ||
| 587 | llgtr %r3,%r3 # __kernel_old_uid_emu31_t * | ||
| 588 | llgtr %r4,%r4 # __kernel_old_uid_emu31_t * | ||
| 589 | jg sys32_getresuid16 # branch to system call | ||
| 590 | |||
| 591 | ENTRY(sys32_poll_wrapper) | ||
| 592 | llgtr %r2,%r2 # struct pollfd * | ||
| 593 | llgfr %r3,%r3 # unsigned int | ||
| 594 | lgfr %r4,%r4 # int | ||
| 595 | jg sys_poll # branch to system call | ||
| 596 | |||
| 597 | ENTRY(sys32_setresgid16_wrapper) | ||
| 598 | llgfr %r2,%r2 # __kernel_old_gid_emu31_t | ||
| 599 | llgfr %r3,%r3 # __kernel_old_gid_emu31_t | ||
| 600 | llgfr %r4,%r4 # __kernel_old_gid_emu31_t | ||
| 601 | jg sys32_setresgid16 # branch to system call | ||
| 602 | |||
| 603 | ENTRY(sys32_getresgid16_wrapper) | ||
| 604 | llgtr %r2,%r2 # __kernel_old_gid_emu31_t * | ||
| 605 | llgtr %r3,%r3 # __kernel_old_gid_emu31_t * | ||
| 606 | llgtr %r4,%r4 # __kernel_old_gid_emu31_t * | ||
| 607 | jg sys32_getresgid16 # branch to system call | ||
| 608 | |||
| 609 | ENTRY(sys32_prctl_wrapper) | ||
| 610 | lgfr %r2,%r2 # int | ||
| 611 | llgfr %r3,%r3 # unsigned long | ||
| 612 | llgfr %r4,%r4 # unsigned long | ||
| 613 | llgfr %r5,%r5 # unsigned long | ||
| 614 | llgfr %r6,%r6 # unsigned long | ||
| 615 | jg sys_prctl # branch to system call | ||
| 616 | |||
| 617 | #sys32_rt_sigreturn_wrapper # done in rt_sigreturn_glue | ||
| 618 | |||
| 619 | ENTRY(sys32_pread64_wrapper) | ||
| 620 | llgfr %r2,%r2 # unsigned int | ||
| 621 | llgtr %r3,%r3 # char * | ||
| 622 | llgfr %r4,%r4 # size_t | ||
| 623 | llgfr %r5,%r5 # u32 | ||
| 624 | llgfr %r6,%r6 # u32 | ||
| 625 | jg sys32_pread64 # branch to system call | ||
| 626 | |||
| 627 | ENTRY(sys32_pwrite64_wrapper) | ||
| 628 | llgfr %r2,%r2 # unsigned int | ||
| 629 | llgtr %r3,%r3 # const char * | ||
| 630 | llgfr %r4,%r4 # size_t | ||
| 631 | llgfr %r5,%r5 # u32 | ||
| 632 | llgfr %r6,%r6 # u32 | ||
| 633 | jg sys32_pwrite64 # branch to system call | ||
| 634 | |||
| 635 | ENTRY(sys32_chown16_wrapper) | ||
| 636 | llgtr %r2,%r2 # const char * | ||
| 637 | llgfr %r3,%r3 # __kernel_old_uid_emu31_t | ||
| 638 | llgfr %r4,%r4 # __kernel_old_gid_emu31_t | ||
| 639 | jg sys32_chown16 # branch to system call | ||
| 640 | |||
| 641 | ENTRY(sys32_getcwd_wrapper) | ||
| 642 | llgtr %r2,%r2 # char * | ||
| 643 | llgfr %r3,%r3 # unsigned long | ||
| 644 | jg sys_getcwd # branch to system call | ||
| 645 | |||
| 646 | ENTRY(sys32_capget_wrapper) | ||
| 647 | llgtr %r2,%r2 # cap_user_header_t | ||
| 648 | llgtr %r3,%r3 # cap_user_data_t | ||
| 649 | jg sys_capget # branch to system call | ||
| 650 | |||
| 651 | ENTRY(sys32_capset_wrapper) | ||
| 652 | llgtr %r2,%r2 # cap_user_header_t | ||
| 653 | llgtr %r3,%r3 # const cap_user_data_t | ||
| 654 | jg sys_capset # branch to system call | ||
| 655 | |||
| 656 | #sys32_vfork_wrapper # done in vfork_glue | ||
| 657 | |||
| 658 | ENTRY(sys32_truncate64_wrapper) | ||
| 659 | llgtr %r2,%r2 # const char * | ||
| 660 | llgfr %r3,%r3 # unsigned long | ||
| 661 | llgfr %r4,%r4 # unsigned long | ||
| 662 | jg sys32_truncate64 # branch to system call | ||
| 663 | |||
| 664 | ENTRY(sys32_ftruncate64_wrapper) | ||
| 665 | llgfr %r2,%r2 # unsigned int | ||
| 666 | llgfr %r3,%r3 # unsigned long | ||
| 667 | llgfr %r4,%r4 # unsigned long | ||
| 668 | jg sys32_ftruncate64 # branch to system call | ||
| 669 | |||
| 670 | ENTRY(sys32_lchown_wrapper) | ||
| 671 | llgtr %r2,%r2 # const char * | ||
| 672 | llgfr %r3,%r3 # uid_t | ||
| 673 | llgfr %r4,%r4 # gid_t | ||
| 674 | jg sys_lchown # branch to system call | ||
| 675 | |||
| 676 | #sys32_getuid_wrapper # void | ||
| 677 | #sys32_getgid_wrapper # void | ||
| 678 | #sys32_geteuid_wrapper # void | ||
| 679 | #sys32_getegid_wrapper # void | ||
| 680 | |||
| 681 | ENTRY(sys32_setreuid_wrapper) | ||
| 682 | llgfr %r2,%r2 # uid_t | ||
| 683 | llgfr %r3,%r3 # uid_t | ||
| 684 | jg sys_setreuid # branch to system call | ||
| 685 | |||
| 686 | ENTRY(sys32_setregid_wrapper) | ||
| 687 | llgfr %r2,%r2 # gid_t | ||
| 688 | llgfr %r3,%r3 # gid_t | ||
| 689 | jg sys_setregid # branch to system call | ||
| 690 | |||
| 691 | ENTRY(sys32_getgroups_wrapper) | ||
| 692 | lgfr %r2,%r2 # int | ||
| 693 | llgtr %r3,%r3 # gid_t * | ||
| 694 | jg sys_getgroups # branch to system call | ||
| 695 | |||
| 696 | ENTRY(sys32_setgroups_wrapper) | ||
| 697 | lgfr %r2,%r2 # int | ||
| 698 | llgtr %r3,%r3 # gid_t * | ||
| 699 | jg sys_setgroups # branch to system call | ||
| 700 | |||
| 701 | ENTRY(sys32_fchown_wrapper) | ||
| 702 | llgfr %r2,%r2 # unsigned int | ||
| 703 | llgfr %r3,%r3 # uid_t | ||
| 704 | llgfr %r4,%r4 # gid_t | ||
| 705 | jg sys_fchown # branch to system call | ||
| 706 | |||
| 707 | ENTRY(sys32_setresuid_wrapper) | ||
| 708 | llgfr %r2,%r2 # uid_t | ||
| 709 | llgfr %r3,%r3 # uid_t | ||
| 710 | llgfr %r4,%r4 # uid_t | ||
| 711 | jg sys_setresuid # branch to system call | ||
| 712 | |||
| 713 | ENTRY(sys32_getresuid_wrapper) | ||
| 714 | llgtr %r2,%r2 # uid_t * | ||
| 715 | llgtr %r3,%r3 # uid_t * | ||
| 716 | llgtr %r4,%r4 # uid_t * | ||
| 717 | jg sys_getresuid # branch to system call | ||
| 718 | |||
| 719 | ENTRY(sys32_setresgid_wrapper) | ||
| 720 | llgfr %r2,%r2 # gid_t | ||
| 721 | llgfr %r3,%r3 # gid_t | ||
| 722 | llgfr %r4,%r4 # gid_t | ||
| 723 | jg sys_setresgid # branch to system call | ||
| 724 | |||
| 725 | ENTRY(sys32_getresgid_wrapper) | ||
| 726 | llgtr %r2,%r2 # gid_t * | ||
| 727 | llgtr %r3,%r3 # gid_t * | ||
| 728 | llgtr %r4,%r4 # gid_t * | ||
| 729 | jg sys_getresgid # branch to system call | ||
| 730 | |||
| 731 | ENTRY(sys32_chown_wrapper) | ||
| 732 | llgtr %r2,%r2 # const char * | ||
| 733 | llgfr %r3,%r3 # uid_t | ||
| 734 | llgfr %r4,%r4 # gid_t | ||
| 735 | jg sys_chown # branch to system call | ||
| 736 | |||
| 737 | ENTRY(sys32_setuid_wrapper) | ||
| 738 | llgfr %r2,%r2 # uid_t | ||
| 739 | jg sys_setuid # branch to system call | ||
| 740 | |||
| 741 | ENTRY(sys32_setgid_wrapper) | ||
| 742 | llgfr %r2,%r2 # gid_t | ||
| 743 | jg sys_setgid # branch to system call | ||
| 744 | |||
| 745 | ENTRY(sys32_setfsuid_wrapper) | ||
| 746 | llgfr %r2,%r2 # uid_t | ||
| 747 | jg sys_setfsuid # branch to system call | ||
| 748 | |||
| 749 | ENTRY(sys32_setfsgid_wrapper) | ||
| 750 | llgfr %r2,%r2 # gid_t | ||
| 751 | jg sys_setfsgid # branch to system call | ||
| 752 | |||
| 753 | ENTRY(sys32_pivot_root_wrapper) | ||
| 754 | llgtr %r2,%r2 # const char * | ||
| 755 | llgtr %r3,%r3 # const char * | ||
| 756 | jg sys_pivot_root # branch to system call | ||
| 757 | |||
| 758 | ENTRY(sys32_mincore_wrapper) | ||
| 759 | llgfr %r2,%r2 # unsigned long | ||
| 760 | llgfr %r3,%r3 # size_t | ||
| 761 | llgtr %r4,%r4 # unsigned char * | ||
| 762 | jg sys_mincore # branch to system call | ||
| 763 | |||
| 764 | ENTRY(sys32_madvise_wrapper) | ||
| 765 | llgfr %r2,%r2 # unsigned long | ||
| 766 | llgfr %r3,%r3 # size_t | ||
| 767 | lgfr %r4,%r4 # int | ||
| 768 | jg sys_madvise # branch to system call | ||
| 769 | |||
| 770 | ENTRY(sys32_getdents64_wrapper) | ||
| 771 | llgfr %r2,%r2 # unsigned int | ||
| 772 | llgtr %r3,%r3 # void * | ||
| 773 | llgfr %r4,%r4 # unsigned int | ||
| 774 | jg sys_getdents64 # branch to system call | ||
| 775 | |||
| 776 | ENTRY(compat_sys_fcntl64_wrapper) | ||
| 777 | llgfr %r2,%r2 # unsigned int | ||
| 778 | llgfr %r3,%r3 # unsigned int | ||
| 779 | llgfr %r4,%r4 # unsigned long | ||
| 780 | jg compat_sys_fcntl64 # branch to system call | ||
| 781 | |||
| 782 | ENTRY(sys32_stat64_wrapper) | ||
| 783 | llgtr %r2,%r2 # char * | ||
| 784 | llgtr %r3,%r3 # struct stat64 * | ||
| 785 | jg sys32_stat64 # branch to system call | ||
| 786 | |||
| 787 | ENTRY(sys32_lstat64_wrapper) | ||
| 788 | llgtr %r2,%r2 # char * | ||
| 789 | llgtr %r3,%r3 # struct stat64 * | ||
| 790 | jg sys32_lstat64 # branch to system call | ||
| 791 | |||
| 792 | ENTRY(sys32_stime_wrapper) | ||
| 793 | llgtr %r2,%r2 # long * | ||
| 794 | jg compat_sys_stime # branch to system call | ||
| 795 | |||
| 796 | ENTRY(sys32_fstat64_wrapper) | ||
| 797 | llgfr %r2,%r2 # unsigned long | ||
| 798 | llgtr %r3,%r3 # struct stat64 * | ||
| 799 | jg sys32_fstat64 # branch to system call | ||
| 800 | |||
| 801 | ENTRY(sys32_setxattr_wrapper) | ||
| 802 | llgtr %r2,%r2 # char * | ||
| 803 | llgtr %r3,%r3 # char * | ||
| 804 | llgtr %r4,%r4 # void * | ||
| 805 | llgfr %r5,%r5 # size_t | ||
| 806 | lgfr %r6,%r6 # int | ||
| 807 | jg sys_setxattr | ||
| 808 | |||
| 809 | ENTRY(sys32_lsetxattr_wrapper) | ||
| 810 | llgtr %r2,%r2 # char * | ||
| 811 | llgtr %r3,%r3 # char * | ||
| 812 | llgtr %r4,%r4 # void * | ||
| 813 | llgfr %r5,%r5 # size_t | ||
| 814 | lgfr %r6,%r6 # int | ||
| 815 | jg sys_lsetxattr | ||
| 816 | |||
| 817 | ENTRY(sys32_fsetxattr_wrapper) | ||
| 818 | lgfr %r2,%r2 # int | ||
| 819 | llgtr %r3,%r3 # char * | ||
| 820 | llgtr %r4,%r4 # void * | ||
| 821 | llgfr %r5,%r5 # size_t | ||
| 822 | lgfr %r6,%r6 # int | ||
| 823 | jg sys_fsetxattr | ||
| 824 | |||
| 825 | ENTRY(sys32_getxattr_wrapper) | ||
| 826 | llgtr %r2,%r2 # char * | ||
| 827 | llgtr %r3,%r3 # char * | ||
| 828 | llgtr %r4,%r4 # void * | ||
| 829 | llgfr %r5,%r5 # size_t | ||
| 830 | jg sys_getxattr | ||
| 831 | |||
| 832 | ENTRY(sys32_lgetxattr_wrapper) | ||
| 833 | llgtr %r2,%r2 # char * | ||
| 834 | llgtr %r3,%r3 # char * | ||
| 835 | llgtr %r4,%r4 # void * | ||
| 836 | llgfr %r5,%r5 # size_t | ||
| 837 | jg sys_lgetxattr | ||
| 838 | |||
| 839 | ENTRY(sys32_fgetxattr_wrapper) | ||
| 840 | lgfr %r2,%r2 # int | ||
| 841 | llgtr %r3,%r3 # char * | ||
| 842 | llgtr %r4,%r4 # void * | ||
| 843 | llgfr %r5,%r5 # size_t | ||
| 844 | jg sys_fgetxattr | ||
| 845 | |||
| 846 | ENTRY(sys32_listxattr_wrapper) | ||
| 847 | llgtr %r2,%r2 # char * | ||
| 848 | llgtr %r3,%r3 # char * | ||
| 849 | llgfr %r4,%r4 # size_t | ||
| 850 | jg sys_listxattr | ||
| 851 | |||
| 852 | ENTRY(sys32_llistxattr_wrapper) | ||
| 853 | llgtr %r2,%r2 # char * | ||
| 854 | llgtr %r3,%r3 # char * | ||
| 855 | llgfr %r4,%r4 # size_t | ||
| 856 | jg sys_llistxattr | ||
| 857 | |||
| 858 | ENTRY(sys32_flistxattr_wrapper) | ||
| 859 | lgfr %r2,%r2 # int | ||
| 860 | llgtr %r3,%r3 # char * | ||
| 861 | llgfr %r4,%r4 # size_t | ||
| 862 | jg sys_flistxattr | ||
| 863 | |||
| 864 | ENTRY(sys32_removexattr_wrapper) | ||
| 865 | llgtr %r2,%r2 # char * | ||
| 866 | llgtr %r3,%r3 # char * | ||
| 867 | jg sys_removexattr | ||
| 868 | |||
| 869 | ENTRY(sys32_lremovexattr_wrapper) | ||
| 870 | llgtr %r2,%r2 # char * | ||
| 871 | llgtr %r3,%r3 # char * | ||
| 872 | jg sys_lremovexattr | ||
| 873 | |||
| 874 | ENTRY(sys32_fremovexattr_wrapper) | ||
| 875 | lgfr %r2,%r2 # int | ||
| 876 | llgtr %r3,%r3 # char * | ||
| 877 | jg sys_fremovexattr | ||
| 878 | |||
| 879 | ENTRY(sys32_sched_setaffinity_wrapper) | ||
| 880 | lgfr %r2,%r2 # int | ||
| 881 | llgfr %r3,%r3 # unsigned int | ||
| 882 | llgtr %r4,%r4 # unsigned long * | ||
| 883 | jg compat_sys_sched_setaffinity | ||
| 884 | |||
| 885 | ENTRY(sys32_sched_getaffinity_wrapper) | ||
| 886 | lgfr %r2,%r2 # int | ||
| 887 | llgfr %r3,%r3 # unsigned int | ||
| 888 | llgtr %r4,%r4 # unsigned long * | ||
| 889 | jg compat_sys_sched_getaffinity | ||
| 890 | |||
| 891 | ENTRY(sys32_exit_group_wrapper) | ||
| 892 | lgfr %r2,%r2 # int | ||
| 893 | jg sys_exit_group # branch to system call | ||
| 894 | |||
| 895 | ENTRY(sys32_set_tid_address_wrapper) | ||
| 896 | llgtr %r2,%r2 # int * | ||
| 897 | jg sys_set_tid_address # branch to system call | ||
| 898 | |||
| 899 | ENTRY(sys_epoll_create_wrapper) | ||
| 900 | lgfr %r2,%r2 # int | ||
| 901 | jg sys_epoll_create # branch to system call | ||
| 902 | |||
| 903 | ENTRY(sys_epoll_ctl_wrapper) | ||
| 904 | lgfr %r2,%r2 # int | ||
| 905 | lgfr %r3,%r3 # int | ||
| 906 | lgfr %r4,%r4 # int | ||
| 907 | llgtr %r5,%r5 # struct epoll_event * | ||
| 908 | jg sys_epoll_ctl # branch to system call | ||
| 909 | |||
| 910 | ENTRY(sys_epoll_wait_wrapper) | ||
| 911 | lgfr %r2,%r2 # int | ||
| 912 | llgtr %r3,%r3 # struct epoll_event * | ||
| 913 | lgfr %r4,%r4 # int | ||
| 914 | lgfr %r5,%r5 # int | ||
| 915 | jg sys_epoll_wait # branch to system call | ||
| 916 | |||
| 917 | ENTRY(sys32_fadvise64_wrapper) | ||
| 918 | lgfr %r2,%r2 # int | ||
| 919 | sllg %r3,%r3,32 # get high word of 64bit loff_t | ||
| 920 | or %r3,%r4 # get low word of 64bit loff_t | ||
| 921 | llgfr %r4,%r5 # size_t (unsigned long) | ||
| 922 | lgfr %r5,%r6 # int | ||
| 923 | jg sys32_fadvise64 | ||
| 924 | |||
| 925 | ENTRY(sys32_fadvise64_64_wrapper) | ||
| 926 | llgtr %r2,%r2 # struct fadvise64_64_args * | ||
| 927 | jg sys32_fadvise64_64 | ||
| 928 | |||
| 929 | ENTRY(sys32_clock_settime_wrapper) | ||
| 930 | lgfr %r2,%r2 # clockid_t (int) | ||
| 931 | llgtr %r3,%r3 # struct compat_timespec * | ||
| 932 | jg compat_sys_clock_settime | ||
| 933 | |||
| 934 | ENTRY(sys32_clock_gettime_wrapper) | ||
| 935 | lgfr %r2,%r2 # clockid_t (int) | ||
| 936 | llgtr %r3,%r3 # struct compat_timespec * | ||
| 937 | jg compat_sys_clock_gettime | ||
| 938 | |||
| 939 | ENTRY(sys32_clock_getres_wrapper) | ||
| 940 | lgfr %r2,%r2 # clockid_t (int) | ||
| 941 | llgtr %r3,%r3 # struct compat_timespec * | ||
| 942 | jg compat_sys_clock_getres | ||
| 943 | |||
| 944 | ENTRY(sys32_clock_nanosleep_wrapper) | ||
| 945 | lgfr %r2,%r2 # clockid_t (int) | ||
| 946 | lgfr %r3,%r3 # int | ||
| 947 | llgtr %r4,%r4 # struct compat_timespec * | ||
| 948 | llgtr %r5,%r5 # struct compat_timespec * | ||
| 949 | jg compat_sys_clock_nanosleep | ||
| 950 | |||
| 951 | ENTRY(sys32_timer_create_wrapper) | ||
| 952 | lgfr %r2,%r2 # timer_t (int) | ||
| 953 | llgtr %r3,%r3 # struct compat_sigevent * | ||
| 954 | llgtr %r4,%r4 # timer_t * | ||
| 955 | jg compat_sys_timer_create | ||
| 956 | |||
| 957 | ENTRY(sys32_timer_settime_wrapper) | ||
| 958 | lgfr %r2,%r2 # timer_t (int) | ||
| 959 | lgfr %r3,%r3 # int | ||
| 960 | llgtr %r4,%r4 # struct compat_itimerspec * | ||
| 961 | llgtr %r5,%r5 # struct compat_itimerspec * | ||
| 962 | jg compat_sys_timer_settime | ||
| 963 | |||
| 964 | ENTRY(sys32_timer_gettime_wrapper) | ||
| 965 | lgfr %r2,%r2 # timer_t (int) | ||
| 966 | llgtr %r3,%r3 # struct compat_itimerspec * | ||
| 967 | jg compat_sys_timer_gettime | ||
| 968 | |||
| 969 | ENTRY(sys32_timer_getoverrun_wrapper) | ||
| 970 | lgfr %r2,%r2 # timer_t (int) | ||
| 971 | jg sys_timer_getoverrun | ||
| 972 | |||
| 973 | ENTRY(sys32_timer_delete_wrapper) | ||
| 974 | lgfr %r2,%r2 # timer_t (int) | ||
| 975 | jg sys_timer_delete | ||
| 976 | |||
| 977 | ENTRY(sys32_io_setup_wrapper) | ||
| 978 | llgfr %r2,%r2 # unsigned int | ||
| 979 | llgtr %r3,%r3 # u32 * | ||
| 980 | jg compat_sys_io_setup | ||
| 981 | |||
| 982 | ENTRY(sys32_io_destroy_wrapper) | ||
| 983 | llgfr %r2,%r2 # (aio_context_t) u32 | ||
| 984 | jg sys_io_destroy | ||
| 985 | |||
| 986 | ENTRY(sys32_io_getevents_wrapper) | ||
| 987 | llgfr %r2,%r2 # (aio_context_t) u32 | ||
| 988 | lgfr %r3,%r3 # long | ||
| 989 | lgfr %r4,%r4 # long | ||
| 990 | llgtr %r5,%r5 # struct io_event * | ||
| 991 | llgtr %r6,%r6 # struct compat_timespec * | ||
| 992 | jg compat_sys_io_getevents | ||
| 993 | |||
| 994 | ENTRY(sys32_io_submit_wrapper) | ||
| 995 | llgfr %r2,%r2 # (aio_context_t) u32 | ||
| 996 | lgfr %r3,%r3 # long | ||
| 997 | llgtr %r4,%r4 # struct iocb ** | ||
| 998 | jg compat_sys_io_submit | ||
| 999 | |||
| 1000 | ENTRY(sys32_io_cancel_wrapper) | ||
| 1001 | llgfr %r2,%r2 # (aio_context_t) u32 | ||
| 1002 | llgtr %r3,%r3 # struct iocb * | ||
| 1003 | llgtr %r4,%r4 # struct io_event * | ||
| 1004 | jg sys_io_cancel | ||
| 1005 | |||
| 1006 | ENTRY(compat_sys_statfs64_wrapper) | ||
| 1007 | llgtr %r2,%r2 # const char * | ||
| 1008 | llgfr %r3,%r3 # compat_size_t | ||
| 1009 | llgtr %r4,%r4 # struct compat_statfs64 * | ||
| 1010 | jg compat_sys_statfs64 | ||
| 1011 | |||
| 1012 | ENTRY(compat_sys_fstatfs64_wrapper) | ||
| 1013 | llgfr %r2,%r2 # unsigned int fd | ||
| 1014 | llgfr %r3,%r3 # compat_size_t | ||
| 1015 | llgtr %r4,%r4 # struct compat_statfs64 * | ||
| 1016 | jg compat_sys_fstatfs64 | ||
| 1017 | |||
| 1018 | ENTRY(compat_sys_mq_open_wrapper) | ||
| 1019 | llgtr %r2,%r2 # const char * | ||
| 1020 | lgfr %r3,%r3 # int | ||
| 1021 | llgfr %r4,%r4 # mode_t | ||
| 1022 | llgtr %r5,%r5 # struct compat_mq_attr * | ||
| 1023 | jg compat_sys_mq_open | ||
| 1024 | |||
| 1025 | ENTRY(sys32_mq_unlink_wrapper) | ||
| 1026 | llgtr %r2,%r2 # const char * | ||
| 1027 | jg sys_mq_unlink | ||
| 1028 | |||
| 1029 | ENTRY(compat_sys_mq_timedsend_wrapper) | ||
| 1030 | lgfr %r2,%r2 # mqd_t | ||
| 1031 | llgtr %r3,%r3 # const char * | ||
| 1032 | llgfr %r4,%r4 # size_t | ||
| 1033 | llgfr %r5,%r5 # unsigned int | ||
| 1034 | llgtr %r6,%r6 # const struct compat_timespec * | ||
| 1035 | jg compat_sys_mq_timedsend | ||
| 1036 | |||
| 1037 | ENTRY(compat_sys_mq_timedreceive_wrapper) | ||
| 1038 | lgfr %r2,%r2 # mqd_t | ||
| 1039 | llgtr %r3,%r3 # char * | ||
| 1040 | llgfr %r4,%r4 # size_t | ||
| 1041 | llgtr %r5,%r5 # unsigned int * | ||
| 1042 | llgtr %r6,%r6 # const struct compat_timespec * | ||
| 1043 | jg compat_sys_mq_timedreceive | ||
| 1044 | |||
| 1045 | ENTRY(compat_sys_mq_notify_wrapper) | ||
| 1046 | lgfr %r2,%r2 # mqd_t | ||
| 1047 | llgtr %r3,%r3 # struct compat_sigevent * | ||
| 1048 | jg compat_sys_mq_notify | ||
| 1049 | |||
| 1050 | ENTRY(compat_sys_mq_getsetattr_wrapper) | ||
| 1051 | lgfr %r2,%r2 # mqd_t | ||
| 1052 | llgtr %r3,%r3 # struct compat_mq_attr * | ||
| 1053 | llgtr %r4,%r4 # struct compat_mq_attr * | ||
| 1054 | jg compat_sys_mq_getsetattr | ||
| 1055 | |||
| 1056 | ENTRY(compat_sys_add_key_wrapper) | ||
| 1057 | llgtr %r2,%r2 # const char * | ||
| 1058 | llgtr %r3,%r3 # const char * | ||
| 1059 | llgtr %r4,%r4 # const void * | ||
| 1060 | llgfr %r5,%r5 # size_t | ||
| 1061 | llgfr %r6,%r6 # (key_serial_t) u32 | ||
| 1062 | jg sys_add_key | ||
| 1063 | |||
| 1064 | ENTRY(compat_sys_request_key_wrapper) | ||
| 1065 | llgtr %r2,%r2 # const char * | ||
| 1066 | llgtr %r3,%r3 # const char * | ||
| 1067 | llgtr %r4,%r4 # const void * | ||
| 1068 | llgfr %r5,%r5 # (key_serial_t) u32 | ||
| 1069 | jg sys_request_key | ||
| 1070 | |||
| 1071 | ENTRY(sys32_remap_file_pages_wrapper) | ||
| 1072 | llgfr %r2,%r2 # unsigned long | ||
| 1073 | llgfr %r3,%r3 # unsigned long | ||
| 1074 | llgfr %r4,%r4 # unsigned long | ||
| 1075 | llgfr %r5,%r5 # unsigned long | ||
| 1076 | llgfr %r6,%r6 # unsigned long | ||
| 1077 | jg sys_remap_file_pages | ||
| 1078 | |||
| 1079 | ENTRY(compat_sys_kexec_load_wrapper) | ||
| 1080 | llgfr %r2,%r2 # unsigned long | ||
| 1081 | llgfr %r3,%r3 # unsigned long | ||
| 1082 | llgtr %r4,%r4 # struct kexec_segment * | ||
| 1083 | llgfr %r5,%r5 # unsigned long | ||
| 1084 | jg compat_sys_kexec_load | ||
| 1085 | |||
| 1086 | ENTRY(sys_ioprio_set_wrapper) | ||
| 1087 | lgfr %r2,%r2 # int | ||
| 1088 | lgfr %r3,%r3 # int | ||
| 1089 | lgfr %r4,%r4 # int | ||
| 1090 | jg sys_ioprio_set | ||
| 1091 | |||
| 1092 | ENTRY(sys_ioprio_get_wrapper) | ||
| 1093 | lgfr %r2,%r2 # int | ||
| 1094 | lgfr %r3,%r3 # int | ||
| 1095 | jg sys_ioprio_get | ||
| 1096 | |||
| 1097 | ENTRY(sys_inotify_add_watch_wrapper) | ||
| 1098 | lgfr %r2,%r2 # int | ||
| 1099 | llgtr %r3,%r3 # const char * | ||
| 1100 | llgfr %r4,%r4 # u32 | ||
| 1101 | jg sys_inotify_add_watch | ||
| 1102 | |||
| 1103 | ENTRY(sys_inotify_rm_watch_wrapper) | ||
| 1104 | lgfr %r2,%r2 # int | ||
| 1105 | llgfr %r3,%r3 # u32 | ||
| 1106 | jg sys_inotify_rm_watch | ||
| 1107 | |||
| 1108 | ENTRY(sys_mkdirat_wrapper) | ||
| 1109 | lgfr %r2,%r2 # int | ||
| 1110 | llgtr %r3,%r3 # const char * | ||
| 1111 | lgfr %r4,%r4 # int | ||
| 1112 | jg sys_mkdirat | ||
| 1113 | |||
| 1114 | ENTRY(sys_mknodat_wrapper) | ||
| 1115 | lgfr %r2,%r2 # int | ||
| 1116 | llgtr %r3,%r3 # const char * | ||
| 1117 | lgfr %r4,%r4 # int | ||
| 1118 | llgfr %r5,%r5 # unsigned int | ||
| 1119 | jg sys_mknodat | ||
| 1120 | |||
| 1121 | ENTRY(sys_fchownat_wrapper) | ||
| 1122 | lgfr %r2,%r2 # int | ||
| 1123 | llgtr %r3,%r3 # const char * | ||
| 1124 | llgfr %r4,%r4 # uid_t | ||
| 1125 | llgfr %r5,%r5 # gid_t | ||
| 1126 | lgfr %r6,%r6 # int | ||
| 1127 | jg sys_fchownat | ||
| 1128 | |||
| 1129 | ENTRY(compat_sys_futimesat_wrapper) | ||
| 1130 | llgfr %r2,%r2 # unsigned int | ||
| 1131 | llgtr %r3,%r3 # char * | ||
| 1132 | llgtr %r4,%r4 # struct timeval * | ||
| 1133 | jg compat_sys_futimesat | ||
| 1134 | |||
| 1135 | ENTRY(sys32_fstatat64_wrapper) | ||
| 1136 | llgfr %r2,%r2 # unsigned int | ||
| 1137 | llgtr %r3,%r3 # char * | ||
| 1138 | llgtr %r4,%r4 # struct stat64 * | ||
| 1139 | lgfr %r5,%r5 # int | ||
| 1140 | jg sys32_fstatat64 | ||
| 1141 | |||
| 1142 | ENTRY(sys_unlinkat_wrapper) | ||
| 1143 | lgfr %r2,%r2 # int | ||
| 1144 | llgtr %r3,%r3 # const char * | ||
| 1145 | lgfr %r4,%r4 # int | ||
| 1146 | jg sys_unlinkat | ||
| 1147 | |||
| 1148 | ENTRY(sys_renameat_wrapper) | ||
| 1149 | lgfr %r2,%r2 # int | ||
| 1150 | llgtr %r3,%r3 # const char * | ||
| 1151 | lgfr %r4,%r4 # int | ||
| 1152 | llgtr %r5,%r5 # const char * | ||
| 1153 | jg sys_renameat | ||
| 1154 | |||
| 1155 | ENTRY(sys_linkat_wrapper) | ||
| 1156 | lgfr %r2,%r2 # int | ||
| 1157 | llgtr %r3,%r3 # const char * | ||
| 1158 | lgfr %r4,%r4 # int | ||
| 1159 | llgtr %r5,%r5 # const char * | ||
| 1160 | lgfr %r6,%r6 # int | ||
| 1161 | jg sys_linkat | ||
| 1162 | |||
| 1163 | ENTRY(sys_symlinkat_wrapper) | ||
| 1164 | llgtr %r2,%r2 # const char * | ||
| 1165 | lgfr %r3,%r3 # int | ||
| 1166 | llgtr %r4,%r4 # const char * | ||
| 1167 | jg sys_symlinkat | ||
| 1168 | |||
| 1169 | ENTRY(sys_readlinkat_wrapper) | ||
| 1170 | lgfr %r2,%r2 # int | ||
| 1171 | llgtr %r3,%r3 # const char * | ||
| 1172 | llgtr %r4,%r4 # char * | ||
| 1173 | lgfr %r5,%r5 # int | ||
| 1174 | jg sys_readlinkat | ||
| 1175 | |||
| 1176 | ENTRY(sys_fchmodat_wrapper) | ||
| 1177 | lgfr %r2,%r2 # int | ||
| 1178 | llgtr %r3,%r3 # const char * | ||
| 1179 | llgfr %r4,%r4 # mode_t | ||
| 1180 | jg sys_fchmodat | ||
| 1181 | |||
| 1182 | ENTRY(sys_faccessat_wrapper) | ||
| 1183 | lgfr %r2,%r2 # int | ||
| 1184 | llgtr %r3,%r3 # const char * | ||
| 1185 | lgfr %r4,%r4 # int | ||
| 1186 | jg sys_faccessat | ||
| 1187 | |||
| 1188 | ENTRY(compat_sys_pselect6_wrapper) | ||
| 1189 | lgfr %r2,%r2 # int | ||
| 1190 | llgtr %r3,%r3 # fd_set * | ||
| 1191 | llgtr %r4,%r4 # fd_set * | ||
| 1192 | llgtr %r5,%r5 # fd_set * | ||
| 1193 | llgtr %r6,%r6 # struct timespec * | ||
| 1194 | llgt %r0,164(%r15) # void * | ||
| 1195 | stg %r0,160(%r15) | ||
| 1196 | jg compat_sys_pselect6 | ||
| 1197 | |||
| 1198 | ENTRY(compat_sys_ppoll_wrapper) | ||
| 1199 | llgtr %r2,%r2 # struct pollfd * | ||
| 1200 | llgfr %r3,%r3 # unsigned int | ||
| 1201 | llgtr %r4,%r4 # struct timespec * | ||
| 1202 | llgtr %r5,%r5 # const sigset_t * | ||
| 1203 | llgfr %r6,%r6 # size_t | ||
| 1204 | jg compat_sys_ppoll | ||
| 1205 | |||
| 1206 | ENTRY(sys_unshare_wrapper) | ||
| 1207 | llgfr %r2,%r2 # unsigned long | ||
| 1208 | jg sys_unshare | ||
| 1209 | |||
| 1210 | ENTRY(sys_splice_wrapper) | ||
| 1211 | lgfr %r2,%r2 # int | ||
| 1212 | llgtr %r3,%r3 # loff_t * | ||
| 1213 | lgfr %r4,%r4 # int | ||
| 1214 | llgtr %r5,%r5 # loff_t * | ||
| 1215 | llgfr %r6,%r6 # size_t | ||
| 1216 | llgf %r0,164(%r15) # unsigned int | ||
| 1217 | stg %r0,160(%r15) | ||
| 1218 | jg sys_splice | ||
| 1219 | |||
| 1220 | ENTRY(sys_sync_file_range_wrapper) | ||
| 1221 | lgfr %r2,%r2 # int | ||
| 1222 | sllg %r3,%r3,32 # get high word of 64bit loff_t | ||
| 1223 | or %r3,%r4 # get low word of 64bit loff_t | ||
| 1224 | sllg %r4,%r5,32 # get high word of 64bit loff_t | ||
| 1225 | or %r4,%r6 # get low word of 64bit loff_t | ||
| 1226 | llgf %r5,164(%r15) # unsigned int | ||
| 1227 | jg sys_sync_file_range | ||
| 1228 | |||
| 1229 | ENTRY(sys_tee_wrapper) | ||
| 1230 | lgfr %r2,%r2 # int | ||
| 1231 | lgfr %r3,%r3 # int | ||
| 1232 | llgfr %r4,%r4 # size_t | ||
| 1233 | llgfr %r5,%r5 # unsigned int | ||
| 1234 | jg sys_tee | ||
| 1235 | |||
| 1236 | ENTRY(sys_getcpu_wrapper) | ||
| 1237 | llgtr %r2,%r2 # unsigned * | ||
| 1238 | llgtr %r3,%r3 # unsigned * | ||
| 1239 | llgtr %r4,%r4 # struct getcpu_cache * | ||
| 1240 | jg sys_getcpu | ||
| 1241 | |||
| 1242 | ENTRY(compat_sys_utimes_wrapper) | ||
| 1243 | llgtr %r2,%r2 # char * | ||
| 1244 | llgtr %r3,%r3 # struct compat_timeval * | ||
| 1245 | jg compat_sys_utimes | ||
| 1246 | |||
| 1247 | ENTRY(compat_sys_utimensat_wrapper) | ||
| 1248 | llgfr %r2,%r2 # unsigned int | ||
| 1249 | llgtr %r3,%r3 # char * | ||
| 1250 | llgtr %r4,%r4 # struct compat_timespec * | ||
| 1251 | lgfr %r5,%r5 # int | ||
| 1252 | jg compat_sys_utimensat | ||
| 1253 | |||
| 1254 | ENTRY(sys_eventfd_wrapper) | ||
| 1255 | llgfr %r2,%r2 # unsigned int | ||
| 1256 | jg sys_eventfd | ||
| 1257 | |||
| 1258 | ENTRY(sys_fallocate_wrapper) | ||
| 1259 | lgfr %r2,%r2 # int | ||
| 1260 | lgfr %r3,%r3 # int | ||
| 1261 | sllg %r4,%r4,32 # get high word of 64bit loff_t | ||
| 1262 | lr %r4,%r5 # get low word of 64bit loff_t | ||
| 1263 | sllg %r5,%r6,32 # get high word of 64bit loff_t | ||
| 1264 | l %r5,164(%r15) # get low word of 64bit loff_t | ||
| 1265 | jg sys_fallocate | ||
| 1266 | |||
| 1267 | ENTRY(sys_timerfd_create_wrapper) | ||
| 1268 | lgfr %r2,%r2 # int | ||
| 1269 | lgfr %r3,%r3 # int | ||
| 1270 | jg sys_timerfd_create | ||
| 1271 | |||
| 1272 | ENTRY(sys_eventfd2_wrapper) | ||
| 1273 | llgfr %r2,%r2 # unsigned int | ||
| 1274 | lgfr %r3,%r3 # int | ||
| 1275 | jg sys_eventfd2 | ||
| 1276 | |||
| 1277 | ENTRY(sys_inotify_init1_wrapper) | ||
| 1278 | lgfr %r2,%r2 # int | ||
| 1279 | jg sys_inotify_init1 | ||
| 1280 | |||
| 1281 | ENTRY(sys_pipe2_wrapper) | ||
| 1282 | llgtr %r2,%r2 # u32 * | ||
| 1283 | lgfr %r3,%r3 # int | ||
| 1284 | jg sys_pipe2 # branch to system call | ||
| 1285 | |||
| 1286 | ENTRY(sys_dup3_wrapper) | ||
| 1287 | llgfr %r2,%r2 # unsigned int | ||
| 1288 | llgfr %r3,%r3 # unsigned int | ||
| 1289 | lgfr %r4,%r4 # int | ||
| 1290 | jg sys_dup3 # branch to system call | ||
| 1291 | |||
| 1292 | ENTRY(sys_epoll_create1_wrapper) | ||
| 1293 | lgfr %r2,%r2 # int | ||
| 1294 | jg sys_epoll_create1 # branch to system call | ||
| 1295 | |||
| 1296 | ENTRY(sys32_readahead_wrapper) | ||
| 1297 | lgfr %r2,%r2 # int | ||
| 1298 | llgfr %r3,%r3 # u32 | ||
| 1299 | llgfr %r4,%r4 # u32 | ||
| 1300 | lgfr %r5,%r5 # s32 | ||
| 1301 | jg sys32_readahead # branch to system call | ||
| 1302 | |||
| 1303 | ENTRY(sys_tkill_wrapper) | ||
| 1304 | lgfr %r2,%r2 # pid_t | ||
| 1305 | lgfr %r3,%r3 # int | ||
| 1306 | jg sys_tkill # branch to system call | ||
| 1307 | |||
| 1308 | ENTRY(sys_tgkill_wrapper) | ||
| 1309 | lgfr %r2,%r2 # pid_t | ||
| 1310 | lgfr %r3,%r3 # pid_t | ||
| 1311 | lgfr %r4,%r4 # int | ||
| 1312 | jg sys_tgkill # branch to system call | ||
| 1313 | |||
| 1314 | ENTRY(compat_sys_keyctl_wrapper) | ||
| 1315 | llgfr %r2,%r2 # u32 | ||
| 1316 | llgfr %r3,%r3 # u32 | ||
| 1317 | llgfr %r4,%r4 # u32 | ||
| 1318 | llgfr %r5,%r5 # u32 | ||
| 1319 | llgfr %r6,%r6 # u32 | ||
| 1320 | jg compat_sys_keyctl # branch to system call | ||
| 1321 | |||
| 1322 | ENTRY(sys_perf_event_open_wrapper) | ||
| 1323 | llgtr %r2,%r2 # const struct perf_event_attr * | ||
| 1324 | lgfr %r3,%r3 # pid_t | ||
| 1325 | lgfr %r4,%r4 # int | ||
| 1326 | lgfr %r5,%r5 # int | ||
| 1327 | llgfr %r6,%r6 # unsigned long | ||
| 1328 | jg sys_perf_event_open # branch to system call | ||
| 1329 | |||
| 1330 | ENTRY(sys_clone_wrapper) | ||
| 1331 | llgfr %r2,%r2 # unsigned long | ||
| 1332 | llgfr %r3,%r3 # unsigned long | ||
| 1333 | llgtr %r4,%r4 # int * | ||
| 1334 | llgtr %r5,%r5 # int * | ||
| 1335 | jg sys_clone # branch to system call | ||
| 1336 | |||
| 1337 | ENTRY(sys32_execve_wrapper) | ||
| 1338 | llgtr %r2,%r2 # char * | ||
| 1339 | llgtr %r3,%r3 # compat_uptr_t * | ||
| 1340 | llgtr %r4,%r4 # compat_uptr_t * | ||
| 1341 | jg compat_sys_execve # branch to system call | ||
| 1342 | |||
| 1343 | ENTRY(sys_fanotify_init_wrapper) | ||
| 1344 | llgfr %r2,%r2 # unsigned int | ||
| 1345 | llgfr %r3,%r3 # unsigned int | ||
| 1346 | jg sys_fanotify_init # branch to system call | ||
| 1347 | |||
| 1348 | ENTRY(sys_prlimit64_wrapper) | ||
| 1349 | lgfr %r2,%r2 # pid_t | ||
| 1350 | llgfr %r3,%r3 # unsigned int | ||
| 1351 | llgtr %r4,%r4 # const struct rlimit64 __user * | ||
| 1352 | llgtr %r5,%r5 # struct rlimit64 __user * | ||
| 1353 | jg sys_prlimit64 # branch to system call | ||
| 1354 | |||
| 1355 | ENTRY(sys_name_to_handle_at_wrapper) | ||
| 1356 | lgfr %r2,%r2 # int | ||
| 1357 | llgtr %r3,%r3 # const char __user * | ||
| 1358 | llgtr %r4,%r4 # struct file_handle __user * | ||
| 1359 | llgtr %r5,%r5 # int __user * | ||
| 1360 | lgfr %r6,%r6 # int | ||
| 1361 | jg sys_name_to_handle_at | ||
| 1362 | |||
| 1363 | ENTRY(compat_sys_clock_adjtime_wrapper) | ||
| 1364 | lgfr %r2,%r2 # clockid_t (int) | ||
| 1365 | llgtr %r3,%r3 # struct compat_timex __user * | ||
| 1366 | jg compat_sys_clock_adjtime | ||
| 1367 | |||
| 1368 | ENTRY(sys_syncfs_wrapper) | ||
| 1369 | lgfr %r2,%r2 # int | ||
| 1370 | jg sys_syncfs | ||
| 1371 | |||
| 1372 | ENTRY(sys_setns_wrapper) | ||
| 1373 | lgfr %r2,%r2 # int | ||
| 1374 | lgfr %r3,%r3 # int | ||
| 1375 | jg sys_setns | ||
| 1376 | |||
| 1377 | ENTRY(compat_sys_process_vm_readv_wrapper) | ||
| 1378 | lgfr %r2,%r2 # compat_pid_t | ||
| 1379 | llgtr %r3,%r3 # struct compat_iovec __user * | ||
| 1380 | llgfr %r4,%r4 # unsigned long | ||
| 1381 | llgtr %r5,%r5 # struct compat_iovec __user * | ||
| 1382 | llgfr %r6,%r6 # unsigned long | ||
| 1383 | llgf %r0,164(%r15) # unsigned long | ||
| 1384 | stg %r0,160(%r15) | ||
| 1385 | jg compat_sys_process_vm_readv | ||
| 1386 | |||
| 1387 | ENTRY(compat_sys_process_vm_writev_wrapper) | ||
| 1388 | lgfr %r2,%r2 # compat_pid_t | ||
| 1389 | llgtr %r3,%r3 # struct compat_iovec __user * | ||
| 1390 | llgfr %r4,%r4 # unsigned long | ||
| 1391 | llgtr %r5,%r5 # struct compat_iovec __user * | ||
| 1392 | llgfr %r6,%r6 # unsigned long | ||
| 1393 | llgf %r0,164(%r15) # unsigned long | ||
| 1394 | stg %r0,160(%r15) | ||
| 1395 | jg compat_sys_process_vm_writev | ||
| 1396 | |||
| 1397 | ENTRY(sys_s390_runtime_instr_wrapper) | ||
| 1398 | lgfr %r2,%r2 # int | ||
| 1399 | lgfr %r3,%r3 # int | ||
| 1400 | jg sys_s390_runtime_instr | ||
| 1401 | |||
| 1402 | ENTRY(sys_kcmp_wrapper) | ||
| 1403 | lgfr %r2,%r2 # pid_t | ||
| 1404 | lgfr %r3,%r3 # pid_t | ||
| 1405 | lgfr %r4,%r4 # int | ||
| 1406 | llgfr %r5,%r5 # unsigned long | ||
| 1407 | llgfr %r6,%r6 # unsigned long | ||
| 1408 | jg sys_kcmp | ||
| 1409 | |||
| 1410 | ENTRY(sys_finit_module_wrapper) | ||
| 1411 | lgfr %r2,%r2 # int | ||
| 1412 | llgtr %r3,%r3 # const char __user * | ||
| 1413 | lgfr %r4,%r4 # int | ||
| 1414 | jg sys_finit_module | ||
| 1415 | |||
| 1416 | ENTRY(sys_sched_setattr_wrapper) | ||
| 1417 | lgfr %r2,%r2 # pid_t | ||
| 1418 | llgtr %r3,%r3 # struct sched_attr __user * | ||
| 1419 | jg sys_sched_setattr | ||
| 1420 | |||
| 1421 | ENTRY(sys_sched_getattr_wrapper) | ||
| 1422 | lgfr %r2,%r2 # pid_t | ||
| 1423 | llgtr %r3,%r3 # const char __user * | ||
| 1424 | llgfr %r3,%r3 # unsigned int | ||
| 1425 | jg sys_sched_getattr | ||
diff --git a/arch/s390/kernel/compat_wrapper.c b/arch/s390/kernel/compat_wrapper.c new file mode 100644 index 000000000000..824c39dfddfc --- /dev/null +++ b/arch/s390/kernel/compat_wrapper.c | |||
| @@ -0,0 +1,215 @@ | |||
| 1 | /* | ||
| 2 | * Compat sytem call wrappers. | ||
| 3 | * | ||
| 4 | * Copyright IBM Corp. 2014 | ||
| 5 | */ | ||
| 6 | |||
| 7 | #include <linux/syscalls.h> | ||
| 8 | #include <linux/compat.h> | ||
| 9 | #include "entry.h" | ||
| 10 | |||
| 11 | #define COMPAT_SYSCALL_WRAP1(name, ...) \ | ||
| 12 | COMPAT_SYSCALL_WRAPx(1, _##name, __VA_ARGS__) | ||
| 13 | #define COMPAT_SYSCALL_WRAP2(name, ...) \ | ||
| 14 | COMPAT_SYSCALL_WRAPx(2, _##name, __VA_ARGS__) | ||
| 15 | #define COMPAT_SYSCALL_WRAP3(name, ...) \ | ||
| 16 | COMPAT_SYSCALL_WRAPx(3, _##name, __VA_ARGS__) | ||
| 17 | #define COMPAT_SYSCALL_WRAP4(name, ...) \ | ||
| 18 | COMPAT_SYSCALL_WRAPx(4, _##name, __VA_ARGS__) | ||
| 19 | #define COMPAT_SYSCALL_WRAP5(name, ...) \ | ||
| 20 | COMPAT_SYSCALL_WRAPx(5, _##name, __VA_ARGS__) | ||
| 21 | #define COMPAT_SYSCALL_WRAP6(name, ...) \ | ||
| 22 | COMPAT_SYSCALL_WRAPx(6, _##name, __VA_ARGS__) | ||
| 23 | |||
| 24 | #define __SC_COMPAT_TYPE(t, a) \ | ||
| 25 | __typeof(__builtin_choose_expr(sizeof(t) > 4, 0L, (t)0)) a | ||
| 26 | |||
| 27 | #define __SC_COMPAT_CAST(t, a) \ | ||
| 28 | ({ \ | ||
| 29 | long __ReS = a; \ | ||
| 30 | \ | ||
| 31 | BUILD_BUG_ON((sizeof(t) > 4) && !__TYPE_IS_L(t) && \ | ||
| 32 | !__TYPE_IS_UL(t) && !__TYPE_IS_PTR(t)); \ | ||
| 33 | if (__TYPE_IS_L(t)) \ | ||
| 34 | __ReS = (s32)a; \ | ||
| 35 | if (__TYPE_IS_UL(t)) \ | ||
| 36 | __ReS = (u32)a; \ | ||
| 37 | if (__TYPE_IS_PTR(t)) \ | ||
| 38 | __ReS = a & 0x7fffffff; \ | ||
| 39 | (t)__ReS; \ | ||
| 40 | }) | ||
| 41 | |||
| 42 | /* | ||
| 43 | * The COMPAT_SYSCALL_WRAP macro generates system call wrappers to be used by | ||
| 44 | * compat tasks. These wrappers will only be used for system calls where only | ||
| 45 | * the system call arguments need sign or zero extension or zeroing of the upper | ||
| 46 | * 33 bits of pointers. | ||
| 47 | * Note: since the wrapper function will afterwards call a system call which | ||
| 48 | * again performs zero and sign extension for all system call arguments with | ||
| 49 | * a size of less than eight bytes, these compat wrappers only touch those | ||
| 50 | * system call arguments with a size of eight bytes ((unsigned) long and | ||
| 51 | * pointers). Zero and sign extension for e.g. int parameters will be done by | ||
| 52 | * the regular system call wrappers. | ||
| 53 | */ | ||
| 54 | #define COMPAT_SYSCALL_WRAPx(x, name, ...) \ | ||
| 55 | asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \ | ||
| 56 | asmlinkage long compat_sys##name(__MAP(x,__SC_COMPAT_TYPE,__VA_ARGS__));\ | ||
| 57 | asmlinkage long compat_sys##name(__MAP(x,__SC_COMPAT_TYPE,__VA_ARGS__)) \ | ||
| 58 | { \ | ||
| 59 | return sys##name(__MAP(x,__SC_COMPAT_CAST,__VA_ARGS__)); \ | ||
| 60 | } | ||
| 61 | |||
| 62 | COMPAT_SYSCALL_WRAP1(exit, int, error_code); | ||
| 63 | COMPAT_SYSCALL_WRAP1(close, unsigned int, fd); | ||
| 64 | COMPAT_SYSCALL_WRAP2(creat, const char __user *, pathname, umode_t, mode); | ||
| 65 | COMPAT_SYSCALL_WRAP2(link, const char __user *, oldname, const char __user *, newname); | ||
| 66 | COMPAT_SYSCALL_WRAP1(unlink, const char __user *, pathname); | ||
| 67 | COMPAT_SYSCALL_WRAP1(chdir, const char __user *, filename); | ||
| 68 | COMPAT_SYSCALL_WRAP3(mknod, const char __user *, filename, umode_t, mode, unsigned, dev); | ||
| 69 | COMPAT_SYSCALL_WRAP2(chmod, const char __user *, filename, umode_t, mode); | ||
| 70 | COMPAT_SYSCALL_WRAP1(oldumount, char __user *, name); | ||
| 71 | COMPAT_SYSCALL_WRAP1(alarm, unsigned int, seconds); | ||
| 72 | COMPAT_SYSCALL_WRAP2(access, const char __user *, filename, int, mode); | ||
| 73 | COMPAT_SYSCALL_WRAP1(nice, int, increment); | ||
| 74 | COMPAT_SYSCALL_WRAP2(kill, int, pid, int, sig); | ||
| 75 | COMPAT_SYSCALL_WRAP2(rename, const char __user *, oldname, const char __user *, newname); | ||
| 76 | COMPAT_SYSCALL_WRAP2(mkdir, const char __user *, pathname, umode_t, mode); | ||
| 77 | COMPAT_SYSCALL_WRAP1(rmdir, const char __user *, pathname); | ||
| 78 | COMPAT_SYSCALL_WRAP1(dup, unsigned int, fildes); | ||
| 79 | COMPAT_SYSCALL_WRAP1(pipe, int __user *, fildes); | ||
| 80 | COMPAT_SYSCALL_WRAP1(brk, unsigned long, brk); | ||
| 81 | COMPAT_SYSCALL_WRAP2(signal, int, sig, __sighandler_t, handler); | ||
| 82 | COMPAT_SYSCALL_WRAP1(acct, const char __user *, name); | ||
| 83 | COMPAT_SYSCALL_WRAP2(umount, char __user *, name, int, flags); | ||
| 84 | COMPAT_SYSCALL_WRAP2(setpgid, pid_t, pid, pid_t, pgid); | ||
| 85 | COMPAT_SYSCALL_WRAP1(umask, int, mask); | ||
| 86 | COMPAT_SYSCALL_WRAP1(chroot, const char __user *, filename); | ||
| 87 | COMPAT_SYSCALL_WRAP2(dup2, unsigned int, oldfd, unsigned int, newfd); | ||
| 88 | COMPAT_SYSCALL_WRAP3(sigsuspend, int, unused1, int, unused2, old_sigset_t, mask); | ||
| 89 | COMPAT_SYSCALL_WRAP2(sethostname, char __user *, name, int, len); | ||
| 90 | COMPAT_SYSCALL_WRAP2(symlink, const char __user *, old, const char __user *, new); | ||
| 91 | COMPAT_SYSCALL_WRAP3(readlink, const char __user *, path, char __user *, buf, int, bufsiz); | ||
| 92 | COMPAT_SYSCALL_WRAP1(uselib, const char __user *, library); | ||
| 93 | COMPAT_SYSCALL_WRAP2(swapon, const char __user *, specialfile, int, swap_flags); | ||
| 94 | COMPAT_SYSCALL_WRAP4(reboot, int, magic1, int, magic2, unsigned int, cmd, void __user *, arg); | ||
| 95 | COMPAT_SYSCALL_WRAP2(munmap, unsigned long, addr, size_t, len); | ||
| 96 | COMPAT_SYSCALL_WRAP2(fchmod, unsigned int, fd, umode_t, mode); | ||
| 97 | COMPAT_SYSCALL_WRAP2(getpriority, int, which, int, who); | ||
| 98 | COMPAT_SYSCALL_WRAP3(setpriority, int, which, int, who, int, niceval); | ||
| 99 | COMPAT_SYSCALL_WRAP3(syslog, int, type, char __user *, buf, int, len); | ||
| 100 | COMPAT_SYSCALL_WRAP1(swapoff, const char __user *, specialfile); | ||
| 101 | COMPAT_SYSCALL_WRAP1(fsync, unsigned int, fd); | ||
| 102 | COMPAT_SYSCALL_WRAP2(setdomainname, char __user *, name, int, len); | ||
| 103 | COMPAT_SYSCALL_WRAP1(newuname, struct new_utsname __user *, name); | ||
| 104 | COMPAT_SYSCALL_WRAP3(mprotect, unsigned long, start, size_t, len, unsigned long, prot); | ||
| 105 | COMPAT_SYSCALL_WRAP3(init_module, void __user *, umod, unsigned long, len, const char __user *, uargs); | ||
| 106 | COMPAT_SYSCALL_WRAP2(delete_module, const char __user *, name_user, unsigned int, flags); | ||
| 107 | COMPAT_SYSCALL_WRAP4(quotactl, unsigned int, cmd, const char __user *, special, qid_t, id, void __user *, addr); | ||
| 108 | COMPAT_SYSCALL_WRAP1(getpgid, pid_t, pid); | ||
| 109 | COMPAT_SYSCALL_WRAP1(fchdir, unsigned int, fd); | ||
| 110 | COMPAT_SYSCALL_WRAP2(bdflush, int, func, long, data); | ||
| 111 | COMPAT_SYSCALL_WRAP3(sysfs, int, option, unsigned long, arg1, unsigned long, arg2); | ||
| 112 | COMPAT_SYSCALL_WRAP1(s390_personality, unsigned int, personality); | ||
| 113 | COMPAT_SYSCALL_WRAP5(llseek, unsigned int, fd, unsigned long, high, unsigned long, low, loff_t __user *, result, unsigned int, whence); | ||
| 114 | COMPAT_SYSCALL_WRAP2(flock, unsigned int, fd, unsigned int, cmd); | ||
| 115 | COMPAT_SYSCALL_WRAP3(msync, unsigned long, start, size_t, len, int, flags); | ||
| 116 | COMPAT_SYSCALL_WRAP1(getsid, pid_t, pid); | ||
| 117 | COMPAT_SYSCALL_WRAP1(fdatasync, unsigned int, fd); | ||
| 118 | COMPAT_SYSCALL_WRAP2(mlock, unsigned long, start, size_t, len); | ||
| 119 | COMPAT_SYSCALL_WRAP2(munlock, unsigned long, start, size_t, len); | ||
| 120 | COMPAT_SYSCALL_WRAP1(mlockall, int, flags); | ||
| 121 | COMPAT_SYSCALL_WRAP2(sched_setparam, pid_t, pid, struct sched_param __user *, param); | ||
| 122 | COMPAT_SYSCALL_WRAP2(sched_getparam, pid_t, pid, struct sched_param __user *, param); | ||
| 123 | COMPAT_SYSCALL_WRAP3(sched_setscheduler, pid_t, pid, int, policy, struct sched_param __user *, param); | ||
| 124 | COMPAT_SYSCALL_WRAP1(sched_getscheduler, pid_t, pid); | ||
| 125 | COMPAT_SYSCALL_WRAP1(sched_get_priority_max, int, policy); | ||
| 126 | COMPAT_SYSCALL_WRAP1(sched_get_priority_min, int, policy); | ||
| 127 | COMPAT_SYSCALL_WRAP5(mremap, unsigned long, addr, unsigned long, old_len, unsigned long, new_len, unsigned long, flags, unsigned long, new_addr); | ||
| 128 | COMPAT_SYSCALL_WRAP3(poll, struct pollfd __user *, ufds, unsigned int, nfds, int, timeout); | ||
| 129 | COMPAT_SYSCALL_WRAP5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, unsigned long, arg4, unsigned long, arg5); | ||
| 130 | COMPAT_SYSCALL_WRAP2(getcwd, char __user *, buf, unsigned long, size); | ||
| 131 | COMPAT_SYSCALL_WRAP2(capget, cap_user_header_t, header, cap_user_data_t, dataptr); | ||
| 132 | COMPAT_SYSCALL_WRAP2(capset, cap_user_header_t, header, const cap_user_data_t, data); | ||
| 133 | COMPAT_SYSCALL_WRAP3(lchown, const char __user *, filename, uid_t, user, gid_t, group); | ||
| 134 | COMPAT_SYSCALL_WRAP2(setreuid, uid_t, ruid, uid_t, euid); | ||
| 135 | COMPAT_SYSCALL_WRAP2(setregid, gid_t, rgid, gid_t, egid); | ||
| 136 | COMPAT_SYSCALL_WRAP2(getgroups, int, gidsetsize, gid_t __user *, grouplist); | ||
| 137 | COMPAT_SYSCALL_WRAP2(setgroups, int, gidsetsize, gid_t __user *, grouplist); | ||
| 138 | COMPAT_SYSCALL_WRAP3(fchown, unsigned int, fd, uid_t, user, gid_t, group); | ||
| 139 | COMPAT_SYSCALL_WRAP3(setresuid, uid_t, ruid, uid_t, euid, uid_t, suid); | ||
| 140 | COMPAT_SYSCALL_WRAP3(getresuid, uid_t __user *, ruid, uid_t __user *, euid, uid_t __user *, suid); | ||
| 141 | COMPAT_SYSCALL_WRAP3(setresgid, gid_t, rgid, gid_t, egid, gid_t, sgid); | ||
| 142 | COMPAT_SYSCALL_WRAP3(getresgid, gid_t __user *, rgid, gid_t __user *, egid, gid_t __user *, sgid); | ||
| 143 | COMPAT_SYSCALL_WRAP3(chown, const char __user *, filename, uid_t, user, gid_t, group); | ||
| 144 | COMPAT_SYSCALL_WRAP1(setuid, uid_t, uid); | ||
| 145 | COMPAT_SYSCALL_WRAP1(setgid, gid_t, gid); | ||
| 146 | COMPAT_SYSCALL_WRAP1(setfsuid, uid_t, uid); | ||
| 147 | COMPAT_SYSCALL_WRAP1(setfsgid, gid_t, gid); | ||
| 148 | COMPAT_SYSCALL_WRAP2(pivot_root, const char __user *, new_root, const char __user *, put_old); | ||
| 149 | COMPAT_SYSCALL_WRAP3(mincore, unsigned long, start, size_t, len, unsigned char __user *, vec); | ||
| 150 | COMPAT_SYSCALL_WRAP3(madvise, unsigned long, start, size_t, len, int, behavior); | ||
| 151 | COMPAT_SYSCALL_WRAP5(setxattr, const char __user *, path, const char __user *, name, const void __user *, value, size_t, size, int, flags); | ||
| 152 | COMPAT_SYSCALL_WRAP5(lsetxattr, const char __user *, path, const char __user *, name, const void __user *, value, size_t, size, int, flags); | ||
| 153 | COMPAT_SYSCALL_WRAP5(fsetxattr, int, fd, const char __user *, name, const void __user *, value, size_t, size, int, flags); | ||
| 154 | COMPAT_SYSCALL_WRAP3(getdents64, unsigned int, fd, struct linux_dirent64 __user *, dirent, unsigned int, count); | ||
| 155 | COMPAT_SYSCALL_WRAP4(getxattr, const char __user *, path, const char __user *, name, void __user *, value, size_t, size); | ||
| 156 | COMPAT_SYSCALL_WRAP4(lgetxattr, const char __user *, path, const char __user *, name, void __user *, value, size_t, size); | ||
| 157 | COMPAT_SYSCALL_WRAP4(fgetxattr, int, fd, const char __user *, name, void __user *, value, size_t, size); | ||
| 158 | COMPAT_SYSCALL_WRAP3(listxattr, const char __user *, path, char __user *, list, size_t, size); | ||
| 159 | COMPAT_SYSCALL_WRAP3(llistxattr, const char __user *, path, char __user *, list, size_t, size); | ||
| 160 | COMPAT_SYSCALL_WRAP3(flistxattr, int, fd, char __user *, list, size_t, size); | ||
| 161 | COMPAT_SYSCALL_WRAP2(removexattr, const char __user *, path, const char __user *, name); | ||
| 162 | COMPAT_SYSCALL_WRAP2(lremovexattr, const char __user *, path, const char __user *, name); | ||
| 163 | COMPAT_SYSCALL_WRAP2(fremovexattr, int, fd, const char __user *, name); | ||
| 164 | COMPAT_SYSCALL_WRAP1(exit_group, int, error_code); | ||
| 165 | COMPAT_SYSCALL_WRAP1(set_tid_address, int __user *, tidptr); | ||
| 166 | COMPAT_SYSCALL_WRAP1(epoll_create, int, size); | ||
| 167 | COMPAT_SYSCALL_WRAP4(epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event __user *, event); | ||
| 168 | COMPAT_SYSCALL_WRAP4(epoll_wait, int, epfd, struct epoll_event __user *, events, int, maxevents, int, timeout); | ||
| 169 | COMPAT_SYSCALL_WRAP1(timer_getoverrun, timer_t, timer_id); | ||
| 170 | COMPAT_SYSCALL_WRAP1(timer_delete, compat_timer_t, compat_timer_id); | ||
| 171 | COMPAT_SYSCALL_WRAP1(io_destroy, aio_context_t, ctx); | ||
| 172 | COMPAT_SYSCALL_WRAP3(io_cancel, aio_context_t, ctx_id, struct iocb __user *, iocb, struct io_event __user *, result); | ||
| 173 | COMPAT_SYSCALL_WRAP1(mq_unlink, const char __user *, name); | ||
| 174 | COMPAT_SYSCALL_WRAP5(add_key, const char __user *, tp, const char __user *, dsc, const void __user *, pld, size_t, len, key_serial_t, id); | ||
| 175 | COMPAT_SYSCALL_WRAP4(request_key, const char __user *, tp, const char __user *, dsc, const char __user *, info, key_serial_t, id); | ||
| 176 | COMPAT_SYSCALL_WRAP5(remap_file_pages, unsigned long, start, unsigned long, size, unsigned long, prot, unsigned long, pgoff, unsigned long, flags); | ||
| 177 | COMPAT_SYSCALL_WRAP3(ioprio_set, int, which, int, who, int, ioprio); | ||
| 178 | COMPAT_SYSCALL_WRAP2(ioprio_get, int, which, int, who); | ||
| 179 | COMPAT_SYSCALL_WRAP3(inotify_add_watch, int, fd, const char __user *, path, u32, mask); | ||
| 180 | COMPAT_SYSCALL_WRAP2(inotify_rm_watch, int, fd, __s32, wd); | ||
| 181 | COMPAT_SYSCALL_WRAP3(mkdirat, int, dfd, const char __user *, pathname, umode_t, mode); | ||
| 182 | COMPAT_SYSCALL_WRAP4(mknodat, int, dfd, const char __user *, filename, umode_t, mode, unsigned, dev); | ||
| 183 | COMPAT_SYSCALL_WRAP5(fchownat, int, dfd, const char __user *, filename, uid_t, user, gid_t, group, int, flag); | ||
| 184 | COMPAT_SYSCALL_WRAP3(unlinkat, int, dfd, const char __user *, pathname, int, flag); | ||
| 185 | COMPAT_SYSCALL_WRAP4(renameat, int, olddfd, const char __user *, oldname, int, newdfd, const char __user *, newname); | ||
| 186 | COMPAT_SYSCALL_WRAP5(linkat, int, olddfd, const char __user *, oldname, int, newdfd, const char __user *, newname, int, flags); | ||
| 187 | COMPAT_SYSCALL_WRAP3(symlinkat, const char __user *, oldname, int, newdfd, const char __user *, newname); | ||
| 188 | COMPAT_SYSCALL_WRAP4(readlinkat, int, dfd, const char __user *, path, char __user *, buf, int, bufsiz); | ||
| 189 | COMPAT_SYSCALL_WRAP3(fchmodat, int, dfd, const char __user *, filename, umode_t, mode); | ||
| 190 | COMPAT_SYSCALL_WRAP3(faccessat, int, dfd, const char __user *, filename, int, mode); | ||
| 191 | COMPAT_SYSCALL_WRAP1(unshare, unsigned long, unshare_flags); | ||
| 192 | COMPAT_SYSCALL_WRAP6(splice, int, fd_in, loff_t __user *, off_in, int, fd_out, loff_t __user *, off_out, size_t, len, unsigned int, flags); | ||
| 193 | COMPAT_SYSCALL_WRAP4(tee, int, fdin, int, fdout, size_t, len, unsigned int, flags); | ||
| 194 | COMPAT_SYSCALL_WRAP3(getcpu, unsigned __user *, cpu, unsigned __user *, node, struct getcpu_cache __user *, cache); | ||
| 195 | COMPAT_SYSCALL_WRAP1(eventfd, unsigned int, count); | ||
| 196 | COMPAT_SYSCALL_WRAP2(timerfd_create, int, clockid, int, flags); | ||
| 197 | COMPAT_SYSCALL_WRAP2(eventfd2, unsigned int, count, int, flags); | ||
| 198 | COMPAT_SYSCALL_WRAP1(inotify_init1, int, flags); | ||
| 199 | COMPAT_SYSCALL_WRAP2(pipe2, int __user *, fildes, int, flags); | ||
| 200 | COMPAT_SYSCALL_WRAP3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags); | ||
| 201 | COMPAT_SYSCALL_WRAP1(epoll_create1, int, flags); | ||
| 202 | COMPAT_SYSCALL_WRAP2(tkill, int, pid, int, sig); | ||
| 203 | COMPAT_SYSCALL_WRAP3(tgkill, int, tgid, int, pid, int, sig); | ||
| 204 | COMPAT_SYSCALL_WRAP5(perf_event_open, struct perf_event_attr __user *, attr_uptr, pid_t, pid, int, cpu, int, group_fd, unsigned long, flags); | ||
| 205 | COMPAT_SYSCALL_WRAP5(clone, unsigned long, newsp, unsigned long, clone_flags, int __user *, parent_tidptr, int __user *, child_tidptr, int, tls_val); | ||
| 206 | COMPAT_SYSCALL_WRAP2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags); | ||
| 207 | COMPAT_SYSCALL_WRAP4(prlimit64, pid_t, pid, unsigned int, resource, const struct rlimit64 __user *, new_rlim, struct rlimit64 __user *, old_rlim); | ||
| 208 | COMPAT_SYSCALL_WRAP5(name_to_handle_at, int, dfd, const char __user *, name, struct file_handle __user *, handle, int __user *, mnt_id, int, flag); | ||
| 209 | COMPAT_SYSCALL_WRAP1(syncfs, int, fd); | ||
| 210 | COMPAT_SYSCALL_WRAP2(setns, int, fd, int, nstype); | ||
| 211 | COMPAT_SYSCALL_WRAP2(s390_runtime_instr, int, command, int, signum); | ||
| 212 | COMPAT_SYSCALL_WRAP5(kcmp, pid_t, pid1, pid_t, pid2, int, type, unsigned long, idx1, unsigned long, idx2); | ||
| 213 | COMPAT_SYSCALL_WRAP3(finit_module, int, fd, const char __user *, uargs, int, flags); | ||
| 214 | COMPAT_SYSCALL_WRAP3(sched_setattr, pid_t, pid, struct sched_attr __user *, attr, unsigned int, flags); | ||
| 215 | COMPAT_SYSCALL_WRAP4(sched_getattr, pid_t, pid, struct sched_attr __user *, attr, unsigned int, size, unsigned int, flags); | ||
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index fca20b5fe79e..6b594439cca5 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c | |||
| @@ -380,8 +380,6 @@ static __init void detect_machine_facilities(void) | |||
| 380 | S390_lowcore.machine_flags |= MACHINE_FLAG_EDAT2; | 380 | S390_lowcore.machine_flags |= MACHINE_FLAG_EDAT2; |
| 381 | if (test_facility(3)) | 381 | if (test_facility(3)) |
| 382 | S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE; | 382 | S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE; |
| 383 | if (test_facility(27)) | ||
| 384 | S390_lowcore.machine_flags |= MACHINE_FLAG_MVCOS; | ||
| 385 | if (test_facility(40)) | 383 | if (test_facility(40)) |
| 386 | S390_lowcore.machine_flags |= MACHINE_FLAG_LPP; | 384 | S390_lowcore.machine_flags |= MACHINE_FLAG_LPP; |
| 387 | if (test_facility(50) && test_facility(73)) | 385 | if (test_facility(50) && test_facility(73)) |
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S index 0dc2b6d0a1ec..526d3735ed29 100644 --- a/arch/s390/kernel/entry.S +++ b/arch/s390/kernel/entry.S | |||
| @@ -43,6 +43,7 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \ | |||
| 43 | _TIF_MCCK_PENDING) | 43 | _TIF_MCCK_PENDING) |
| 44 | _TIF_TRACE = (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SECCOMP | \ | 44 | _TIF_TRACE = (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SECCOMP | \ |
| 45 | _TIF_SYSCALL_TRACEPOINT) | 45 | _TIF_SYSCALL_TRACEPOINT) |
| 46 | _TIF_TRANSFER = (_TIF_MCCK_PENDING | _TIF_TLB_WAIT) | ||
| 46 | 47 | ||
| 47 | STACK_SHIFT = PAGE_SHIFT + THREAD_ORDER | 48 | STACK_SHIFT = PAGE_SHIFT + THREAD_ORDER |
| 48 | STACK_SIZE = 1 << STACK_SHIFT | 49 | STACK_SIZE = 1 << STACK_SHIFT |
| @@ -159,10 +160,12 @@ ENTRY(__switch_to) | |||
| 159 | lctl %c4,%c4,__TASK_pid(%r3) # load pid to control reg. 4 | 160 | lctl %c4,%c4,__TASK_pid(%r3) # load pid to control reg. 4 |
| 160 | mvc __LC_CURRENT_PID(4,%r0),__TASK_pid(%r3) # store pid of next | 161 | mvc __LC_CURRENT_PID(4,%r0),__TASK_pid(%r3) # store pid of next |
| 161 | l %r15,__THREAD_ksp(%r3) # load kernel stack of next | 162 | l %r15,__THREAD_ksp(%r3) # load kernel stack of next |
| 162 | tm __TI_flags+3(%r4),_TIF_MCCK_PENDING # machine check pending? | 163 | lhi %r6,_TIF_TRANSFER # transfer TIF bits |
| 164 | n %r6,__TI_flags(%r4) # isolate TIF bits | ||
| 163 | jz 0f | 165 | jz 0f |
| 164 | ni __TI_flags+3(%r4),255-_TIF_MCCK_PENDING # clear flag in prev | 166 | o %r6,__TI_flags(%r5) # set TIF bits of next |
| 165 | oi __TI_flags+3(%r5),_TIF_MCCK_PENDING # set it in next | 167 | st %r6,__TI_flags(%r5) |
| 168 | ni __TI_flags+3(%r4),255-_TIF_TRANSFER # clear TIF bits of prev | ||
| 166 | 0: lm %r6,%r15,__SF_GPRS(%r15) # load gprs of next task | 169 | 0: lm %r6,%r15,__SF_GPRS(%r15) # load gprs of next task |
| 167 | br %r14 | 170 | br %r14 |
| 168 | 171 | ||
diff --git a/arch/s390/kernel/entry.h b/arch/s390/kernel/entry.h index cb533f78c09e..6ac78192455f 100644 --- a/arch/s390/kernel/entry.h +++ b/arch/s390/kernel/entry.h | |||
| @@ -67,9 +67,7 @@ struct s390_mmap_arg_struct; | |||
| 67 | struct fadvise64_64_args; | 67 | struct fadvise64_64_args; |
| 68 | struct old_sigaction; | 68 | struct old_sigaction; |
| 69 | 69 | ||
| 70 | long sys_sigreturn(void); | 70 | long sys_s390_personality(unsigned int personality); |
| 71 | long sys_rt_sigreturn(void); | 71 | long sys_s390_runtime_instr(int command, int signum); |
| 72 | long sys32_sigreturn(void); | ||
| 73 | long sys32_rt_sigreturn(void); | ||
| 74 | 72 | ||
| 75 | #endif /* _ENTRY_H */ | 73 | #endif /* _ENTRY_H */ |
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S index 384e609b4711..e09dbe5f2901 100644 --- a/arch/s390/kernel/entry64.S +++ b/arch/s390/kernel/entry64.S | |||
| @@ -48,6 +48,7 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \ | |||
| 48 | _TIF_MCCK_PENDING) | 48 | _TIF_MCCK_PENDING) |
| 49 | _TIF_TRACE = (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SECCOMP | \ | 49 | _TIF_TRACE = (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SECCOMP | \ |
| 50 | _TIF_SYSCALL_TRACEPOINT) | 50 | _TIF_SYSCALL_TRACEPOINT) |
| 51 | _TIF_TRANSFER = (_TIF_MCCK_PENDING | _TIF_TLB_WAIT) | ||
| 51 | 52 | ||
| 52 | #define BASED(name) name-system_call(%r13) | 53 | #define BASED(name) name-system_call(%r13) |
| 53 | 54 | ||
| @@ -189,10 +190,12 @@ ENTRY(__switch_to) | |||
| 189 | lctl %c4,%c4,__TASK_pid(%r3) # load pid to control reg. 4 | 190 | lctl %c4,%c4,__TASK_pid(%r3) # load pid to control reg. 4 |
| 190 | mvc __LC_CURRENT_PID+4(4,%r0),__TASK_pid(%r3) # store pid of next | 191 | mvc __LC_CURRENT_PID+4(4,%r0),__TASK_pid(%r3) # store pid of next |
| 191 | lg %r15,__THREAD_ksp(%r3) # load kernel stack of next | 192 | lg %r15,__THREAD_ksp(%r3) # load kernel stack of next |
| 192 | tm __TI_flags+7(%r4),_TIF_MCCK_PENDING # machine check pending? | 193 | llill %r6,_TIF_TRANSFER # transfer TIF bits |
| 194 | ng %r6,__TI_flags(%r4) # isolate TIF bits | ||
| 193 | jz 0f | 195 | jz 0f |
| 194 | ni __TI_flags+7(%r4),255-_TIF_MCCK_PENDING # clear flag in prev | 196 | og %r6,__TI_flags(%r5) # set TIF bits of next |
| 195 | oi __TI_flags+7(%r5),_TIF_MCCK_PENDING # set it in next | 197 | stg %r6,__TI_flags(%r5) |
| 198 | ni __TI_flags+7(%r4),255-_TIF_TRANSFER # clear TIF bits of prev | ||
| 196 | 0: lmg %r6,%r15,__SF_GPRS(%r15) # load gprs of next task | 199 | 0: lmg %r6,%r15,__SF_GPRS(%r15) # load gprs of next task |
| 197 | br %r14 | 200 | br %r14 |
| 198 | 201 | ||
diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c index bb27a262c44a..a770be97db4d 100644 --- a/arch/s390/kernel/irq.c +++ b/arch/s390/kernel/irq.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/errno.h> | 18 | #include <linux/errno.h> |
| 19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
| 20 | #include <linux/cpu.h> | 20 | #include <linux/cpu.h> |
| 21 | #include <linux/irq.h> | ||
| 21 | #include <asm/irq_regs.h> | 22 | #include <asm/irq_regs.h> |
| 22 | #include <asm/cputime.h> | 23 | #include <asm/cputime.h> |
| 23 | #include <asm/lowcore.h> | 24 | #include <asm/lowcore.h> |
diff --git a/arch/s390/kernel/perf_event.c b/arch/s390/kernel/perf_event.c index 5d2dfa31c4ef..61595c1f0a0f 100644 --- a/arch/s390/kernel/perf_event.c +++ b/arch/s390/kernel/perf_event.c | |||
| @@ -121,7 +121,7 @@ unsigned long perf_misc_flags(struct pt_regs *regs) | |||
| 121 | : PERF_RECORD_MISC_KERNEL; | 121 | : PERF_RECORD_MISC_KERNEL; |
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | void print_debug_cf(void) | 124 | static void print_debug_cf(void) |
| 125 | { | 125 | { |
| 126 | struct cpumf_ctr_info cf_info; | 126 | struct cpumf_ctr_info cf_info; |
| 127 | int cpu = smp_processor_id(); | 127 | int cpu = smp_processor_id(); |
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c index f6be6087a0e9..4ac8fafec95f 100644 --- a/arch/s390/kernel/ptrace.c +++ b/arch/s390/kernel/ptrace.c | |||
| @@ -85,7 +85,10 @@ void update_cr_regs(struct task_struct *task) | |||
| 85 | 85 | ||
| 86 | /* merge TIF_SINGLE_STEP into user specified PER registers. */ | 86 | /* merge TIF_SINGLE_STEP into user specified PER registers. */ |
| 87 | if (test_tsk_thread_flag(task, TIF_SINGLE_STEP)) { | 87 | if (test_tsk_thread_flag(task, TIF_SINGLE_STEP)) { |
| 88 | new.control |= PER_EVENT_IFETCH; | 88 | if (test_tsk_thread_flag(task, TIF_BLOCK_STEP)) |
| 89 | new.control |= PER_EVENT_BRANCH; | ||
| 90 | else | ||
| 91 | new.control |= PER_EVENT_IFETCH; | ||
| 89 | #ifdef CONFIG_64BIT | 92 | #ifdef CONFIG_64BIT |
| 90 | new.control |= PER_CONTROL_SUSPENSION; | 93 | new.control |= PER_CONTROL_SUSPENSION; |
| 91 | new.control |= PER_EVENT_TRANSACTION_END; | 94 | new.control |= PER_EVENT_TRANSACTION_END; |
| @@ -107,14 +110,22 @@ void update_cr_regs(struct task_struct *task) | |||
| 107 | 110 | ||
| 108 | void user_enable_single_step(struct task_struct *task) | 111 | void user_enable_single_step(struct task_struct *task) |
| 109 | { | 112 | { |
| 113 | clear_tsk_thread_flag(task, TIF_BLOCK_STEP); | ||
| 110 | set_tsk_thread_flag(task, TIF_SINGLE_STEP); | 114 | set_tsk_thread_flag(task, TIF_SINGLE_STEP); |
| 111 | } | 115 | } |
| 112 | 116 | ||
| 113 | void user_disable_single_step(struct task_struct *task) | 117 | void user_disable_single_step(struct task_struct *task) |
| 114 | { | 118 | { |
| 119 | clear_tsk_thread_flag(task, TIF_BLOCK_STEP); | ||
| 115 | clear_tsk_thread_flag(task, TIF_SINGLE_STEP); | 120 | clear_tsk_thread_flag(task, TIF_SINGLE_STEP); |
| 116 | } | 121 | } |
| 117 | 122 | ||
| 123 | void user_enable_block_step(struct task_struct *task) | ||
| 124 | { | ||
| 125 | set_tsk_thread_flag(task, TIF_SINGLE_STEP); | ||
| 126 | set_tsk_thread_flag(task, TIF_BLOCK_STEP); | ||
| 127 | } | ||
| 128 | |||
| 118 | /* | 129 | /* |
| 119 | * Called by kernel/ptrace.c when detaching.. | 130 | * Called by kernel/ptrace.c when detaching.. |
| 120 | * | 131 | * |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 09e2f468f48b..f70f2489fa5f 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
| @@ -47,7 +47,6 @@ | |||
| 47 | #include <linux/compat.h> | 47 | #include <linux/compat.h> |
| 48 | 48 | ||
| 49 | #include <asm/ipl.h> | 49 | #include <asm/ipl.h> |
| 50 | #include <asm/uaccess.h> | ||
| 51 | #include <asm/facility.h> | 50 | #include <asm/facility.h> |
| 52 | #include <asm/smp.h> | 51 | #include <asm/smp.h> |
| 53 | #include <asm/mmu_context.h> | 52 | #include <asm/mmu_context.h> |
| @@ -65,12 +64,6 @@ | |||
| 65 | #include "entry.h" | 64 | #include "entry.h" |
| 66 | 65 | ||
| 67 | /* | 66 | /* |
| 68 | * User copy operations. | ||
| 69 | */ | ||
| 70 | struct uaccess_ops uaccess; | ||
| 71 | EXPORT_SYMBOL(uaccess); | ||
| 72 | |||
| 73 | /* | ||
| 74 | * Machine setup.. | 67 | * Machine setup.. |
| 75 | */ | 68 | */ |
| 76 | unsigned int console_mode = 0; | 69 | unsigned int console_mode = 0; |
| @@ -294,14 +287,6 @@ static int __init parse_vmalloc(char *arg) | |||
| 294 | } | 287 | } |
| 295 | early_param("vmalloc", parse_vmalloc); | 288 | early_param("vmalloc", parse_vmalloc); |
| 296 | 289 | ||
| 297 | static int __init early_parse_user_mode(char *p) | ||
| 298 | { | ||
| 299 | if (!p || strcmp(p, "primary") == 0) | ||
| 300 | return 0; | ||
| 301 | return 1; | ||
| 302 | } | ||
| 303 | early_param("user_mode", early_parse_user_mode); | ||
| 304 | |||
| 305 | void *restart_stack __attribute__((__section__(".data"))); | 290 | void *restart_stack __attribute__((__section__(".data"))); |
| 306 | 291 | ||
| 307 | static void __init setup_lowcore(void) | 292 | static void __init setup_lowcore(void) |
| @@ -1009,8 +994,6 @@ void __init setup_arch(char **cmdline_p) | |||
| 1009 | init_mm.end_data = (unsigned long) &_edata; | 994 | init_mm.end_data = (unsigned long) &_edata; |
| 1010 | init_mm.brk = (unsigned long) &_end; | 995 | init_mm.brk = (unsigned long) &_end; |
| 1011 | 996 | ||
| 1012 | uaccess = MACHINE_HAS_MVCOS ? uaccess_mvcos : uaccess_pt; | ||
| 1013 | |||
| 1014 | parse_early_param(); | 997 | parse_early_param(); |
| 1015 | detect_memory_layout(memory_chunk, memory_end); | 998 | detect_memory_layout(memory_chunk, memory_end); |
| 1016 | os_info_init(); | 999 | os_info_init(); |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index a7125b62a9a6..8827883310dd 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
| @@ -773,11 +773,11 @@ void __noreturn cpu_die(void) | |||
| 773 | 773 | ||
| 774 | void __init smp_fill_possible_mask(void) | 774 | void __init smp_fill_possible_mask(void) |
| 775 | { | 775 | { |
| 776 | unsigned int possible, cpu; | 776 | unsigned int possible, sclp, cpu; |
| 777 | 777 | ||
| 778 | possible = setup_possible_cpus; | 778 | sclp = sclp_get_max_cpu() ?: nr_cpu_ids; |
| 779 | if (!possible) | 779 | possible = setup_possible_cpus ?: nr_cpu_ids; |
| 780 | possible = MACHINE_IS_VM ? 64 : nr_cpu_ids; | 780 | possible = min(possible, sclp); |
| 781 | for (cpu = 0; cpu < possible && cpu < nr_cpu_ids; cpu++) | 781 | for (cpu = 0; cpu < possible && cpu < nr_cpu_ids; cpu++) |
| 782 | set_cpu_possible(cpu, true); | 782 | set_cpu_possible(cpu, true); |
| 783 | } | 783 | } |
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index 143992152ec9..542ef488bac1 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
| @@ -9,349 +9,349 @@ | |||
| 9 | #define NI_SYSCALL SYSCALL(sys_ni_syscall,sys_ni_syscall,sys_ni_syscall) | 9 | #define NI_SYSCALL SYSCALL(sys_ni_syscall,sys_ni_syscall,sys_ni_syscall) |
| 10 | 10 | ||
| 11 | NI_SYSCALL /* 0 */ | 11 | NI_SYSCALL /* 0 */ |
| 12 | SYSCALL(sys_exit,sys_exit,sys32_exit_wrapper) | 12 | SYSCALL(sys_exit,sys_exit,compat_sys_exit) |
| 13 | SYSCALL(sys_fork,sys_fork,sys_fork) | 13 | SYSCALL(sys_fork,sys_fork,sys_fork) |
| 14 | SYSCALL(sys_read,sys_read,sys32_read_wrapper) | 14 | SYSCALL(sys_read,sys_read,compat_sys_s390_read) |
| 15 | SYSCALL(sys_write,sys_write,sys32_write_wrapper) | 15 | SYSCALL(sys_write,sys_write,compat_sys_s390_write) |
| 16 | SYSCALL(sys_open,sys_open,compat_sys_open) /* 5 */ | 16 | SYSCALL(sys_open,sys_open,compat_sys_open) /* 5 */ |
| 17 | SYSCALL(sys_close,sys_close,sys32_close_wrapper) | 17 | SYSCALL(sys_close,sys_close,compat_sys_close) |
| 18 | SYSCALL(sys_restart_syscall,sys_restart_syscall,sys_restart_syscall) | 18 | SYSCALL(sys_restart_syscall,sys_restart_syscall,sys_restart_syscall) |
| 19 | SYSCALL(sys_creat,sys_creat,sys32_creat_wrapper) | 19 | SYSCALL(sys_creat,sys_creat,compat_sys_creat) |
| 20 | SYSCALL(sys_link,sys_link,sys32_link_wrapper) | 20 | SYSCALL(sys_link,sys_link,compat_sys_link) |
| 21 | SYSCALL(sys_unlink,sys_unlink,sys32_unlink_wrapper) /* 10 */ | 21 | SYSCALL(sys_unlink,sys_unlink,compat_sys_unlink) /* 10 */ |
| 22 | SYSCALL(sys_execve,sys_execve,sys32_execve_wrapper) | 22 | SYSCALL(sys_execve,sys_execve,compat_sys_execve) |
| 23 | SYSCALL(sys_chdir,sys_chdir,sys32_chdir_wrapper) | 23 | SYSCALL(sys_chdir,sys_chdir,compat_sys_chdir) |
| 24 | SYSCALL(sys_time,sys_ni_syscall,sys32_time_wrapper) /* old time syscall */ | 24 | SYSCALL(sys_time,sys_ni_syscall,compat_sys_time) /* old time syscall */ |
| 25 | SYSCALL(sys_mknod,sys_mknod,sys32_mknod_wrapper) | 25 | SYSCALL(sys_mknod,sys_mknod,compat_sys_mknod) |
| 26 | SYSCALL(sys_chmod,sys_chmod,sys32_chmod_wrapper) /* 15 */ | 26 | SYSCALL(sys_chmod,sys_chmod,compat_sys_chmod) /* 15 */ |
| 27 | SYSCALL(sys_lchown16,sys_ni_syscall,sys32_lchown16_wrapper) /* old lchown16 syscall*/ | 27 | SYSCALL(sys_lchown16,sys_ni_syscall,compat_sys_s390_lchown16) /* old lchown16 syscall*/ |
| 28 | NI_SYSCALL /* old break syscall holder */ | 28 | NI_SYSCALL /* old break syscall holder */ |
| 29 | NI_SYSCALL /* old stat syscall holder */ | 29 | NI_SYSCALL /* old stat syscall holder */ |
| 30 | SYSCALL(sys_lseek,sys_lseek,compat_sys_lseek) | 30 | SYSCALL(sys_lseek,sys_lseek,compat_sys_lseek) |
| 31 | SYSCALL(sys_getpid,sys_getpid,sys_getpid) /* 20 */ | 31 | SYSCALL(sys_getpid,sys_getpid,sys_getpid) /* 20 */ |
| 32 | SYSCALL(sys_mount,sys_mount,sys32_mount_wrapper) | 32 | SYSCALL(sys_mount,sys_mount,compat_sys_mount) |
| 33 | SYSCALL(sys_oldumount,sys_oldumount,sys32_oldumount_wrapper) | 33 | SYSCALL(sys_oldumount,sys_oldumount,compat_sys_oldumount) |
| 34 | SYSCALL(sys_setuid16,sys_ni_syscall,sys32_setuid16_wrapper) /* old setuid16 syscall*/ | 34 | SYSCALL(sys_setuid16,sys_ni_syscall,compat_sys_s390_setuid16) /* old setuid16 syscall*/ |
| 35 | SYSCALL(sys_getuid16,sys_ni_syscall,sys32_getuid16) /* old getuid16 syscall*/ | 35 | SYSCALL(sys_getuid16,sys_ni_syscall,compat_sys_s390_getuid16) /* old getuid16 syscall*/ |
| 36 | SYSCALL(sys_stime,sys_ni_syscall,sys32_stime_wrapper) /* 25 old stime syscall */ | 36 | SYSCALL(sys_stime,sys_ni_syscall,compat_sys_stime) /* 25 old stime syscall */ |
| 37 | SYSCALL(sys_ptrace,sys_ptrace,sys32_ptrace_wrapper) | 37 | SYSCALL(sys_ptrace,sys_ptrace,compat_sys_ptrace) |
| 38 | SYSCALL(sys_alarm,sys_alarm,sys32_alarm_wrapper) | 38 | SYSCALL(sys_alarm,sys_alarm,compat_sys_alarm) |
| 39 | NI_SYSCALL /* old fstat syscall */ | 39 | NI_SYSCALL /* old fstat syscall */ |
| 40 | SYSCALL(sys_pause,sys_pause,sys_pause) | 40 | SYSCALL(sys_pause,sys_pause,sys_pause) |
| 41 | SYSCALL(sys_utime,sys_utime,compat_sys_utime_wrapper) /* 30 */ | 41 | SYSCALL(sys_utime,sys_utime,compat_sys_utime) /* 30 */ |
| 42 | NI_SYSCALL /* old stty syscall */ | 42 | NI_SYSCALL /* old stty syscall */ |
| 43 | NI_SYSCALL /* old gtty syscall */ | 43 | NI_SYSCALL /* old gtty syscall */ |
| 44 | SYSCALL(sys_access,sys_access,sys32_access_wrapper) | 44 | SYSCALL(sys_access,sys_access,compat_sys_access) |
| 45 | SYSCALL(sys_nice,sys_nice,sys32_nice_wrapper) | 45 | SYSCALL(sys_nice,sys_nice,compat_sys_nice) |
| 46 | NI_SYSCALL /* 35 old ftime syscall */ | 46 | NI_SYSCALL /* 35 old ftime syscall */ |
| 47 | SYSCALL(sys_sync,sys_sync,sys_sync) | 47 | SYSCALL(sys_sync,sys_sync,sys_sync) |
| 48 | SYSCALL(sys_kill,sys_kill,sys32_kill_wrapper) | 48 | SYSCALL(sys_kill,sys_kill,compat_sys_kill) |
| 49 | SYSCALL(sys_rename,sys_rename,sys32_rename_wrapper) | 49 | SYSCALL(sys_rename,sys_rename,compat_sys_rename) |
| 50 | SYSCALL(sys_mkdir,sys_mkdir,sys32_mkdir_wrapper) | 50 | SYSCALL(sys_mkdir,sys_mkdir,compat_sys_mkdir) |
| 51 | SYSCALL(sys_rmdir,sys_rmdir,sys32_rmdir_wrapper) /* 40 */ | 51 | SYSCALL(sys_rmdir,sys_rmdir,compat_sys_rmdir) /* 40 */ |
| 52 | SYSCALL(sys_dup,sys_dup,sys32_dup_wrapper) | 52 | SYSCALL(sys_dup,sys_dup,compat_sys_dup) |
| 53 | SYSCALL(sys_pipe,sys_pipe,sys32_pipe_wrapper) | 53 | SYSCALL(sys_pipe,sys_pipe,compat_sys_pipe) |
| 54 | SYSCALL(sys_times,sys_times,compat_sys_times_wrapper) | 54 | SYSCALL(sys_times,sys_times,compat_sys_times) |
| 55 | NI_SYSCALL /* old prof syscall */ | 55 | NI_SYSCALL /* old prof syscall */ |
| 56 | SYSCALL(sys_brk,sys_brk,sys32_brk_wrapper) /* 45 */ | 56 | SYSCALL(sys_brk,sys_brk,compat_sys_brk) /* 45 */ |
| 57 | SYSCALL(sys_setgid16,sys_ni_syscall,sys32_setgid16_wrapper) /* old setgid16 syscall*/ | 57 | SYSCALL(sys_setgid16,sys_ni_syscall,compat_sys_s390_setgid16) /* old setgid16 syscall*/ |
| 58 | SYSCALL(sys_getgid16,sys_ni_syscall,sys32_getgid16) /* old getgid16 syscall*/ | 58 | SYSCALL(sys_getgid16,sys_ni_syscall,compat_sys_s390_getgid16) /* old getgid16 syscall*/ |
| 59 | SYSCALL(sys_signal,sys_signal,sys32_signal_wrapper) | 59 | SYSCALL(sys_signal,sys_signal,compat_sys_signal) |
| 60 | SYSCALL(sys_geteuid16,sys_ni_syscall,sys32_geteuid16) /* old geteuid16 syscall */ | 60 | SYSCALL(sys_geteuid16,sys_ni_syscall,compat_sys_s390_geteuid16) /* old geteuid16 syscall */ |
| 61 | SYSCALL(sys_getegid16,sys_ni_syscall,sys32_getegid16) /* 50 old getegid16 syscall */ | 61 | SYSCALL(sys_getegid16,sys_ni_syscall,compat_sys_s390_getegid16) /* 50 old getegid16 syscall */ |
| 62 | SYSCALL(sys_acct,sys_acct,sys32_acct_wrapper) | 62 | SYSCALL(sys_acct,sys_acct,compat_sys_acct) |
| 63 | SYSCALL(sys_umount,sys_umount,sys32_umount_wrapper) | 63 | SYSCALL(sys_umount,sys_umount,compat_sys_umount) |
| 64 | NI_SYSCALL /* old lock syscall */ | 64 | NI_SYSCALL /* old lock syscall */ |
| 65 | SYSCALL(sys_ioctl,sys_ioctl,compat_sys_ioctl_wrapper) | 65 | SYSCALL(sys_ioctl,sys_ioctl,compat_sys_ioctl) |
| 66 | SYSCALL(sys_fcntl,sys_fcntl,compat_sys_fcntl_wrapper) /* 55 */ | 66 | SYSCALL(sys_fcntl,sys_fcntl,compat_sys_fcntl) /* 55 */ |
| 67 | NI_SYSCALL /* intel mpx syscall */ | 67 | NI_SYSCALL /* intel mpx syscall */ |
| 68 | SYSCALL(sys_setpgid,sys_setpgid,sys32_setpgid_wrapper) | 68 | SYSCALL(sys_setpgid,sys_setpgid,compat_sys_setpgid) |
| 69 | NI_SYSCALL /* old ulimit syscall */ | 69 | NI_SYSCALL /* old ulimit syscall */ |
| 70 | NI_SYSCALL /* old uname syscall */ | 70 | NI_SYSCALL /* old uname syscall */ |
| 71 | SYSCALL(sys_umask,sys_umask,sys32_umask_wrapper) /* 60 */ | 71 | SYSCALL(sys_umask,sys_umask,compat_sys_umask) /* 60 */ |
| 72 | SYSCALL(sys_chroot,sys_chroot,sys32_chroot_wrapper) | 72 | SYSCALL(sys_chroot,sys_chroot,compat_sys_chroot) |
| 73 | SYSCALL(sys_ustat,sys_ustat,sys32_ustat_wrapper) | 73 | SYSCALL(sys_ustat,sys_ustat,compat_sys_ustat) |
| 74 | SYSCALL(sys_dup2,sys_dup2,sys32_dup2_wrapper) | 74 | SYSCALL(sys_dup2,sys_dup2,compat_sys_dup2) |
| 75 | SYSCALL(sys_getppid,sys_getppid,sys_getppid) | 75 | SYSCALL(sys_getppid,sys_getppid,sys_getppid) |
| 76 | SYSCALL(sys_getpgrp,sys_getpgrp,sys_getpgrp) /* 65 */ | 76 | SYSCALL(sys_getpgrp,sys_getpgrp,sys_getpgrp) /* 65 */ |
| 77 | SYSCALL(sys_setsid,sys_setsid,sys_setsid) | 77 | SYSCALL(sys_setsid,sys_setsid,sys_setsid) |
| 78 | SYSCALL(sys_sigaction,sys_sigaction,compat_sys_sigaction) | 78 | SYSCALL(sys_sigaction,sys_sigaction,compat_sys_sigaction) |
| 79 | NI_SYSCALL /* old sgetmask syscall*/ | 79 | NI_SYSCALL /* old sgetmask syscall*/ |
| 80 | NI_SYSCALL /* old ssetmask syscall*/ | 80 | NI_SYSCALL /* old ssetmask syscall*/ |
| 81 | SYSCALL(sys_setreuid16,sys_ni_syscall,sys32_setreuid16_wrapper) /* old setreuid16 syscall */ | 81 | SYSCALL(sys_setreuid16,sys_ni_syscall,compat_sys_s390_setreuid16) /* old setreuid16 syscall */ |
| 82 | SYSCALL(sys_setregid16,sys_ni_syscall,sys32_setregid16_wrapper) /* old setregid16 syscall */ | 82 | SYSCALL(sys_setregid16,sys_ni_syscall,compat_sys_s390_setregid16) /* old setregid16 syscall */ |
| 83 | SYSCALL(sys_sigsuspend,sys_sigsuspend,sys_sigsuspend_wrapper) | 83 | SYSCALL(sys_sigsuspend,sys_sigsuspend,compat_sys_sigsuspend) |
| 84 | SYSCALL(sys_sigpending,sys_sigpending,compat_sys_sigpending_wrapper) | 84 | SYSCALL(sys_sigpending,sys_sigpending,compat_sys_sigpending) |
| 85 | SYSCALL(sys_sethostname,sys_sethostname,sys32_sethostname_wrapper) | 85 | SYSCALL(sys_sethostname,sys_sethostname,compat_sys_sethostname) |
| 86 | SYSCALL(sys_setrlimit,sys_setrlimit,compat_sys_setrlimit_wrapper) /* 75 */ | 86 | SYSCALL(sys_setrlimit,sys_setrlimit,compat_sys_setrlimit) /* 75 */ |
| 87 | SYSCALL(sys_old_getrlimit,sys_getrlimit,compat_sys_old_getrlimit_wrapper) | 87 | SYSCALL(sys_old_getrlimit,sys_getrlimit,compat_sys_old_getrlimit) |
| 88 | SYSCALL(sys_getrusage,sys_getrusage,compat_sys_getrusage) | 88 | SYSCALL(sys_getrusage,sys_getrusage,compat_sys_getrusage) |
| 89 | SYSCALL(sys_gettimeofday,sys_gettimeofday,compat_sys_gettimeofday_wrapper) | 89 | SYSCALL(sys_gettimeofday,sys_gettimeofday,compat_sys_gettimeofday) |
| 90 | SYSCALL(sys_settimeofday,sys_settimeofday,compat_sys_settimeofday_wrapper) | 90 | SYSCALL(sys_settimeofday,sys_settimeofday,compat_sys_settimeofday) |
| 91 | SYSCALL(sys_getgroups16,sys_ni_syscall,sys32_getgroups16_wrapper) /* 80 old getgroups16 syscall */ | 91 | SYSCALL(sys_getgroups16,sys_ni_syscall,compat_sys_s390_getgroups16) /* 80 old getgroups16 syscall */ |
| 92 | SYSCALL(sys_setgroups16,sys_ni_syscall,sys32_setgroups16_wrapper) /* old setgroups16 syscall */ | 92 | SYSCALL(sys_setgroups16,sys_ni_syscall,compat_sys_s390_setgroups16) /* old setgroups16 syscall */ |
| 93 | NI_SYSCALL /* old select syscall */ | 93 | NI_SYSCALL /* old select syscall */ |
| 94 | SYSCALL(sys_symlink,sys_symlink,sys32_symlink_wrapper) | 94 | SYSCALL(sys_symlink,sys_symlink,compat_sys_symlink) |
| 95 | NI_SYSCALL /* old lstat syscall */ | 95 | NI_SYSCALL /* old lstat syscall */ |
| 96 | SYSCALL(sys_readlink,sys_readlink,sys32_readlink_wrapper) /* 85 */ | 96 | SYSCALL(sys_readlink,sys_readlink,compat_sys_readlink) /* 85 */ |
| 97 | SYSCALL(sys_uselib,sys_uselib,sys32_uselib_wrapper) | 97 | SYSCALL(sys_uselib,sys_uselib,compat_sys_uselib) |
| 98 | SYSCALL(sys_swapon,sys_swapon,sys32_swapon_wrapper) | 98 | SYSCALL(sys_swapon,sys_swapon,compat_sys_swapon) |
| 99 | SYSCALL(sys_reboot,sys_reboot,sys32_reboot_wrapper) | 99 | SYSCALL(sys_reboot,sys_reboot,compat_sys_reboot) |
| 100 | SYSCALL(sys_ni_syscall,sys_ni_syscall,old32_readdir_wrapper) /* old readdir syscall */ | 100 | SYSCALL(sys_ni_syscall,sys_ni_syscall,compat_sys_old_readdir) /* old readdir syscall */ |
| 101 | SYSCALL(sys_old_mmap,sys_old_mmap,old32_mmap_wrapper) /* 90 */ | 101 | SYSCALL(sys_old_mmap,sys_old_mmap,compat_sys_s390_old_mmap) /* 90 */ |
| 102 | SYSCALL(sys_munmap,sys_munmap,sys32_munmap_wrapper) | 102 | SYSCALL(sys_munmap,sys_munmap,compat_sys_munmap) |
| 103 | SYSCALL(sys_truncate,sys_truncate,compat_sys_truncate) | 103 | SYSCALL(sys_truncate,sys_truncate,compat_sys_truncate) |
| 104 | SYSCALL(sys_ftruncate,sys_ftruncate,compat_sys_ftruncate) | 104 | SYSCALL(sys_ftruncate,sys_ftruncate,compat_sys_ftruncate) |
| 105 | SYSCALL(sys_fchmod,sys_fchmod,sys32_fchmod_wrapper) | 105 | SYSCALL(sys_fchmod,sys_fchmod,compat_sys_fchmod) |
| 106 | SYSCALL(sys_fchown16,sys_ni_syscall,sys32_fchown16_wrapper) /* 95 old fchown16 syscall*/ | 106 | SYSCALL(sys_fchown16,sys_ni_syscall,compat_sys_s390_fchown16) /* 95 old fchown16 syscall*/ |
| 107 | SYSCALL(sys_getpriority,sys_getpriority,sys32_getpriority_wrapper) | 107 | SYSCALL(sys_getpriority,sys_getpriority,compat_sys_getpriority) |
| 108 | SYSCALL(sys_setpriority,sys_setpriority,sys32_setpriority_wrapper) | 108 | SYSCALL(sys_setpriority,sys_setpriority,compat_sys_setpriority) |
| 109 | NI_SYSCALL /* old profil syscall */ | 109 | NI_SYSCALL /* old profil syscall */ |
| 110 | SYSCALL(sys_statfs,sys_statfs,compat_sys_statfs_wrapper) | 110 | SYSCALL(sys_statfs,sys_statfs,compat_sys_statfs) |
| 111 | SYSCALL(sys_fstatfs,sys_fstatfs,compat_sys_fstatfs_wrapper) /* 100 */ | 111 | SYSCALL(sys_fstatfs,sys_fstatfs,compat_sys_fstatfs) /* 100 */ |
| 112 | NI_SYSCALL /* ioperm for i386 */ | 112 | NI_SYSCALL /* ioperm for i386 */ |
| 113 | SYSCALL(sys_socketcall,sys_socketcall,compat_sys_socketcall_wrapper) | 113 | SYSCALL(sys_socketcall,sys_socketcall,compat_sys_socketcall) |
| 114 | SYSCALL(sys_syslog,sys_syslog,sys32_syslog_wrapper) | 114 | SYSCALL(sys_syslog,sys_syslog,compat_sys_syslog) |
| 115 | SYSCALL(sys_setitimer,sys_setitimer,compat_sys_setitimer) | 115 | SYSCALL(sys_setitimer,sys_setitimer,compat_sys_setitimer) |
| 116 | SYSCALL(sys_getitimer,sys_getitimer,compat_sys_getitimer) /* 105 */ | 116 | SYSCALL(sys_getitimer,sys_getitimer,compat_sys_getitimer) /* 105 */ |
| 117 | SYSCALL(sys_newstat,sys_newstat,compat_sys_newstat_wrapper) | 117 | SYSCALL(sys_newstat,sys_newstat,compat_sys_newstat) |
| 118 | SYSCALL(sys_newlstat,sys_newlstat,compat_sys_newlstat_wrapper) | 118 | SYSCALL(sys_newlstat,sys_newlstat,compat_sys_newlstat) |
| 119 | SYSCALL(sys_newfstat,sys_newfstat,compat_sys_newfstat_wrapper) | 119 | SYSCALL(sys_newfstat,sys_newfstat,compat_sys_newfstat) |
| 120 | NI_SYSCALL /* old uname syscall */ | 120 | NI_SYSCALL /* old uname syscall */ |
| 121 | SYSCALL(sys_lookup_dcookie,sys_lookup_dcookie,compat_sys_lookup_dcookie) /* 110 */ | 121 | SYSCALL(sys_lookup_dcookie,sys_lookup_dcookie,compat_sys_lookup_dcookie) /* 110 */ |
| 122 | SYSCALL(sys_vhangup,sys_vhangup,sys_vhangup) | 122 | SYSCALL(sys_vhangup,sys_vhangup,sys_vhangup) |
| 123 | NI_SYSCALL /* old "idle" system call */ | 123 | NI_SYSCALL /* old "idle" system call */ |
| 124 | NI_SYSCALL /* vm86old for i386 */ | 124 | NI_SYSCALL /* vm86old for i386 */ |
| 125 | SYSCALL(sys_wait4,sys_wait4,compat_sys_wait4) | 125 | SYSCALL(sys_wait4,sys_wait4,compat_sys_wait4) |
| 126 | SYSCALL(sys_swapoff,sys_swapoff,sys32_swapoff_wrapper) /* 115 */ | 126 | SYSCALL(sys_swapoff,sys_swapoff,compat_sys_swapoff) /* 115 */ |
| 127 | SYSCALL(sys_sysinfo,sys_sysinfo,compat_sys_sysinfo_wrapper) | 127 | SYSCALL(sys_sysinfo,sys_sysinfo,compat_sys_sysinfo) |
| 128 | SYSCALL(sys_s390_ipc,sys_s390_ipc,compat_sys_s390_ipc) | 128 | SYSCALL(sys_s390_ipc,sys_s390_ipc,compat_sys_s390_ipc) |
| 129 | SYSCALL(sys_fsync,sys_fsync,sys32_fsync_wrapper) | 129 | SYSCALL(sys_fsync,sys_fsync,compat_sys_fsync) |
| 130 | SYSCALL(sys_sigreturn,sys_sigreturn,sys32_sigreturn) | 130 | SYSCALL(sys_sigreturn,sys_sigreturn,compat_sys_sigreturn) |
| 131 | SYSCALL(sys_clone,sys_clone,sys_clone_wrapper) /* 120 */ | 131 | SYSCALL(sys_clone,sys_clone,compat_sys_clone) /* 120 */ |
| 132 | SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper) | 132 | SYSCALL(sys_setdomainname,sys_setdomainname,compat_sys_setdomainname) |
| 133 | SYSCALL(sys_newuname,sys_newuname,sys32_newuname_wrapper) | 133 | SYSCALL(sys_newuname,sys_newuname,compat_sys_newuname) |
| 134 | NI_SYSCALL /* modify_ldt for i386 */ | 134 | NI_SYSCALL /* modify_ldt for i386 */ |
| 135 | SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper) | 135 | SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex) |
| 136 | SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper) /* 125 */ | 136 | SYSCALL(sys_mprotect,sys_mprotect,compat_sys_mprotect) /* 125 */ |
| 137 | SYSCALL(sys_sigprocmask,sys_sigprocmask,compat_sys_sigprocmask) | 137 | SYSCALL(sys_sigprocmask,sys_sigprocmask,compat_sys_sigprocmask) |
| 138 | NI_SYSCALL /* old "create module" */ | 138 | NI_SYSCALL /* old "create module" */ |
| 139 | SYSCALL(sys_init_module,sys_init_module,sys_init_module_wrapper) | 139 | SYSCALL(sys_init_module,sys_init_module,compat_sys_init_module) |
| 140 | SYSCALL(sys_delete_module,sys_delete_module,sys_delete_module_wrapper) | 140 | SYSCALL(sys_delete_module,sys_delete_module,compat_sys_delete_module) |
| 141 | NI_SYSCALL /* 130: old get_kernel_syms */ | 141 | NI_SYSCALL /* 130: old get_kernel_syms */ |
| 142 | SYSCALL(sys_quotactl,sys_quotactl,sys32_quotactl_wrapper) | 142 | SYSCALL(sys_quotactl,sys_quotactl,compat_sys_quotactl) |
| 143 | SYSCALL(sys_getpgid,sys_getpgid,sys32_getpgid_wrapper) | 143 | SYSCALL(sys_getpgid,sys_getpgid,compat_sys_getpgid) |
| 144 | SYSCALL(sys_fchdir,sys_fchdir,sys32_fchdir_wrapper) | 144 | SYSCALL(sys_fchdir,sys_fchdir,compat_sys_fchdir) |
| 145 | SYSCALL(sys_bdflush,sys_bdflush,sys32_bdflush_wrapper) | 145 | SYSCALL(sys_bdflush,sys_bdflush,compat_sys_bdflush) |
| 146 | SYSCALL(sys_sysfs,sys_sysfs,sys32_sysfs_wrapper) /* 135 */ | 146 | SYSCALL(sys_sysfs,sys_sysfs,compat_sys_sysfs) /* 135 */ |
| 147 | SYSCALL(sys_personality,sys_s390_personality,sys32_personality_wrapper) | 147 | SYSCALL(sys_personality,sys_s390_personality,compat_sys_s390_personality) |
| 148 | NI_SYSCALL /* for afs_syscall */ | 148 | NI_SYSCALL /* for afs_syscall */ |
| 149 | SYSCALL(sys_setfsuid16,sys_ni_syscall,sys32_setfsuid16_wrapper) /* old setfsuid16 syscall */ | 149 | SYSCALL(sys_setfsuid16,sys_ni_syscall,compat_sys_s390_setfsuid16) /* old setfsuid16 syscall */ |
| 150 | SYSCALL(sys_setfsgid16,sys_ni_syscall,sys32_setfsgid16_wrapper) /* old setfsgid16 syscall */ | 150 | SYSCALL(sys_setfsgid16,sys_ni_syscall,compat_sys_s390_setfsgid16) /* old setfsgid16 syscall */ |
| 151 | SYSCALL(sys_llseek,sys_llseek,sys32_llseek_wrapper) /* 140 */ | 151 | SYSCALL(sys_llseek,sys_llseek,compat_sys_llseek) /* 140 */ |
| 152 | SYSCALL(sys_getdents,sys_getdents,sys32_getdents_wrapper) | 152 | SYSCALL(sys_getdents,sys_getdents,compat_sys_getdents) |
| 153 | SYSCALL(sys_select,sys_select,compat_sys_select_wrapper) | 153 | SYSCALL(sys_select,sys_select,compat_sys_select) |
| 154 | SYSCALL(sys_flock,sys_flock,sys32_flock_wrapper) | 154 | SYSCALL(sys_flock,sys_flock,compat_sys_flock) |
| 155 | SYSCALL(sys_msync,sys_msync,sys32_msync_wrapper) | 155 | SYSCALL(sys_msync,sys_msync,compat_sys_msync) |
| 156 | SYSCALL(sys_readv,sys_readv,compat_sys_readv_wrapper) /* 145 */ | 156 | SYSCALL(sys_readv,sys_readv,compat_sys_readv) /* 145 */ |
| 157 | SYSCALL(sys_writev,sys_writev,compat_sys_writev_wrapper) | 157 | SYSCALL(sys_writev,sys_writev,compat_sys_writev) |
| 158 | SYSCALL(sys_getsid,sys_getsid,sys32_getsid_wrapper) | 158 | SYSCALL(sys_getsid,sys_getsid,compat_sys_getsid) |
| 159 | SYSCALL(sys_fdatasync,sys_fdatasync,sys32_fdatasync_wrapper) | 159 | SYSCALL(sys_fdatasync,sys_fdatasync,compat_sys_fdatasync) |
| 160 | SYSCALL(sys_sysctl,sys_sysctl,compat_sys_sysctl) | 160 | SYSCALL(sys_sysctl,sys_sysctl,compat_sys_sysctl) |
| 161 | SYSCALL(sys_mlock,sys_mlock,sys32_mlock_wrapper) /* 150 */ | 161 | SYSCALL(sys_mlock,sys_mlock,compat_sys_mlock) /* 150 */ |
| 162 | SYSCALL(sys_munlock,sys_munlock,sys32_munlock_wrapper) | 162 | SYSCALL(sys_munlock,sys_munlock,compat_sys_munlock) |
| 163 | SYSCALL(sys_mlockall,sys_mlockall,sys32_mlockall_wrapper) | 163 | SYSCALL(sys_mlockall,sys_mlockall,compat_sys_mlockall) |
| 164 | SYSCALL(sys_munlockall,sys_munlockall,sys_munlockall) | 164 | SYSCALL(sys_munlockall,sys_munlockall,sys_munlockall) |
| 165 | SYSCALL(sys_sched_setparam,sys_sched_setparam,sys32_sched_setparam_wrapper) | 165 | SYSCALL(sys_sched_setparam,sys_sched_setparam,compat_sys_sched_setparam) |
| 166 | SYSCALL(sys_sched_getparam,sys_sched_getparam,sys32_sched_getparam_wrapper) /* 155 */ | 166 | SYSCALL(sys_sched_getparam,sys_sched_getparam,compat_sys_sched_getparam) /* 155 */ |
| 167 | SYSCALL(sys_sched_setscheduler,sys_sched_setscheduler,sys32_sched_setscheduler_wrapper) | 167 | SYSCALL(sys_sched_setscheduler,sys_sched_setscheduler,compat_sys_sched_setscheduler) |
| 168 | SYSCALL(sys_sched_getscheduler,sys_sched_getscheduler,sys32_sched_getscheduler_wrapper) | 168 | SYSCALL(sys_sched_getscheduler,sys_sched_getscheduler,compat_sys_sched_getscheduler) |
| 169 | SYSCALL(sys_sched_yield,sys_sched_yield,sys_sched_yield) | 169 | SYSCALL(sys_sched_yield,sys_sched_yield,sys_sched_yield) |
| 170 | SYSCALL(sys_sched_get_priority_max,sys_sched_get_priority_max,sys32_sched_get_priority_max_wrapper) | 170 | SYSCALL(sys_sched_get_priority_max,sys_sched_get_priority_max,compat_sys_sched_get_priority_max) |
| 171 | SYSCALL(sys_sched_get_priority_min,sys_sched_get_priority_min,sys32_sched_get_priority_min_wrapper) /* 160 */ | 171 | SYSCALL(sys_sched_get_priority_min,sys_sched_get_priority_min,compat_sys_sched_get_priority_min) /* 160 */ |
| 172 | SYSCALL(sys_sched_rr_get_interval,sys_sched_rr_get_interval,compat_sys_sched_rr_get_interval) | 172 | SYSCALL(sys_sched_rr_get_interval,sys_sched_rr_get_interval,compat_sys_sched_rr_get_interval) |
| 173 | SYSCALL(sys_nanosleep,sys_nanosleep,compat_sys_nanosleep_wrapper) | 173 | SYSCALL(sys_nanosleep,sys_nanosleep,compat_sys_nanosleep) |
| 174 | SYSCALL(sys_mremap,sys_mremap,sys32_mremap_wrapper) | 174 | SYSCALL(sys_mremap,sys_mremap,compat_sys_mremap) |
| 175 | SYSCALL(sys_setresuid16,sys_ni_syscall,sys32_setresuid16_wrapper) /* old setresuid16 syscall */ | 175 | SYSCALL(sys_setresuid16,sys_ni_syscall,compat_sys_s390_setresuid16) /* old setresuid16 syscall */ |
| 176 | SYSCALL(sys_getresuid16,sys_ni_syscall,sys32_getresuid16_wrapper) /* 165 old getresuid16 syscall */ | 176 | SYSCALL(sys_getresuid16,sys_ni_syscall,compat_sys_s390_getresuid16) /* 165 old getresuid16 syscall */ |
| 177 | NI_SYSCALL /* for vm86 */ | 177 | NI_SYSCALL /* for vm86 */ |
| 178 | NI_SYSCALL /* old sys_query_module */ | 178 | NI_SYSCALL /* old sys_query_module */ |
| 179 | SYSCALL(sys_poll,sys_poll,sys32_poll_wrapper) | 179 | SYSCALL(sys_poll,sys_poll,compat_sys_poll) |
| 180 | NI_SYSCALL /* old nfsservctl */ | 180 | NI_SYSCALL /* old nfsservctl */ |
| 181 | SYSCALL(sys_setresgid16,sys_ni_syscall,sys32_setresgid16_wrapper) /* 170 old setresgid16 syscall */ | 181 | SYSCALL(sys_setresgid16,sys_ni_syscall,compat_sys_s390_setresgid16) /* 170 old setresgid16 syscall */ |
| 182 | SYSCALL(sys_getresgid16,sys_ni_syscall,sys32_getresgid16_wrapper) /* old getresgid16 syscall */ | 182 | SYSCALL(sys_getresgid16,sys_ni_syscall,compat_sys_s390_getresgid16) /* old getresgid16 syscall */ |
| 183 | SYSCALL(sys_prctl,sys_prctl,sys32_prctl_wrapper) | 183 | SYSCALL(sys_prctl,sys_prctl,compat_sys_prctl) |
| 184 | SYSCALL(sys_rt_sigreturn,sys_rt_sigreturn,sys32_rt_sigreturn) | 184 | SYSCALL(sys_rt_sigreturn,sys_rt_sigreturn,compat_sys_rt_sigreturn) |
| 185 | SYSCALL(sys_rt_sigaction,sys_rt_sigaction,compat_sys_rt_sigaction) | 185 | SYSCALL(sys_rt_sigaction,sys_rt_sigaction,compat_sys_rt_sigaction) |
| 186 | SYSCALL(sys_rt_sigprocmask,sys_rt_sigprocmask,compat_sys_rt_sigprocmask) /* 175 */ | 186 | SYSCALL(sys_rt_sigprocmask,sys_rt_sigprocmask,compat_sys_rt_sigprocmask) /* 175 */ |
| 187 | SYSCALL(sys_rt_sigpending,sys_rt_sigpending,compat_sys_rt_sigpending) | 187 | SYSCALL(sys_rt_sigpending,sys_rt_sigpending,compat_sys_rt_sigpending) |
| 188 | SYSCALL(sys_rt_sigtimedwait,sys_rt_sigtimedwait,compat_sys_rt_sigtimedwait) | 188 | SYSCALL(sys_rt_sigtimedwait,sys_rt_sigtimedwait,compat_sys_rt_sigtimedwait) |
| 189 | SYSCALL(sys_rt_sigqueueinfo,sys_rt_sigqueueinfo,compat_sys_rt_sigqueueinfo) | 189 | SYSCALL(sys_rt_sigqueueinfo,sys_rt_sigqueueinfo,compat_sys_rt_sigqueueinfo) |
| 190 | SYSCALL(sys_rt_sigsuspend,sys_rt_sigsuspend,compat_sys_rt_sigsuspend) | 190 | SYSCALL(sys_rt_sigsuspend,sys_rt_sigsuspend,compat_sys_rt_sigsuspend) |
| 191 | SYSCALL(sys_pread64,sys_pread64,sys32_pread64_wrapper) /* 180 */ | 191 | SYSCALL(sys_pread64,sys_pread64,compat_sys_s390_pread64) /* 180 */ |
| 192 | SYSCALL(sys_pwrite64,sys_pwrite64,sys32_pwrite64_wrapper) | 192 | SYSCALL(sys_pwrite64,sys_pwrite64,compat_sys_s390_pwrite64) |
| 193 | SYSCALL(sys_chown16,sys_ni_syscall,sys32_chown16_wrapper) /* old chown16 syscall */ | 193 | SYSCALL(sys_chown16,sys_ni_syscall,compat_sys_s390_chown16) /* old chown16 syscall */ |
| 194 | SYSCALL(sys_getcwd,sys_getcwd,sys32_getcwd_wrapper) | 194 | SYSCALL(sys_getcwd,sys_getcwd,compat_sys_getcwd) |
| 195 | SYSCALL(sys_capget,sys_capget,sys32_capget_wrapper) | 195 | SYSCALL(sys_capget,sys_capget,compat_sys_capget) |
| 196 | SYSCALL(sys_capset,sys_capset,sys32_capset_wrapper) /* 185 */ | 196 | SYSCALL(sys_capset,sys_capset,compat_sys_capset) /* 185 */ |
| 197 | SYSCALL(sys_sigaltstack,sys_sigaltstack,compat_sys_sigaltstack) | 197 | SYSCALL(sys_sigaltstack,sys_sigaltstack,compat_sys_sigaltstack) |
| 198 | SYSCALL(sys_sendfile,sys_sendfile64,compat_sys_sendfile) | 198 | SYSCALL(sys_sendfile,sys_sendfile64,compat_sys_sendfile) |
| 199 | NI_SYSCALL /* streams1 */ | 199 | NI_SYSCALL /* streams1 */ |
| 200 | NI_SYSCALL /* streams2 */ | 200 | NI_SYSCALL /* streams2 */ |
| 201 | SYSCALL(sys_vfork,sys_vfork,sys_vfork) /* 190 */ | 201 | SYSCALL(sys_vfork,sys_vfork,sys_vfork) /* 190 */ |
| 202 | SYSCALL(sys_getrlimit,sys_getrlimit,compat_sys_getrlimit_wrapper) | 202 | SYSCALL(sys_getrlimit,sys_getrlimit,compat_sys_getrlimit) |
| 203 | SYSCALL(sys_mmap2,sys_mmap2,sys32_mmap2_wrapper) | 203 | SYSCALL(sys_mmap2,sys_mmap2,compat_sys_s390_mmap2) |
| 204 | SYSCALL(sys_truncate64,sys_ni_syscall,sys32_truncate64_wrapper) | 204 | SYSCALL(sys_truncate64,sys_ni_syscall,compat_sys_s390_truncate64) |
| 205 | SYSCALL(sys_ftruncate64,sys_ni_syscall,sys32_ftruncate64_wrapper) | 205 | SYSCALL(sys_ftruncate64,sys_ni_syscall,compat_sys_s390_ftruncate64) |
| 206 | SYSCALL(sys_stat64,sys_ni_syscall,sys32_stat64_wrapper) /* 195 */ | 206 | SYSCALL(sys_stat64,sys_ni_syscall,compat_sys_s390_stat64) /* 195 */ |
| 207 | SYSCALL(sys_lstat64,sys_ni_syscall,sys32_lstat64_wrapper) | 207 | SYSCALL(sys_lstat64,sys_ni_syscall,compat_sys_s390_lstat64) |
| 208 | SYSCALL(sys_fstat64,sys_ni_syscall,sys32_fstat64_wrapper) | 208 | SYSCALL(sys_fstat64,sys_ni_syscall,compat_sys_s390_fstat64) |
| 209 | SYSCALL(sys_lchown,sys_lchown,sys32_lchown_wrapper) | 209 | SYSCALL(sys_lchown,sys_lchown,compat_sys_lchown) |
| 210 | SYSCALL(sys_getuid,sys_getuid,sys_getuid) | 210 | SYSCALL(sys_getuid,sys_getuid,sys_getuid) |
| 211 | SYSCALL(sys_getgid,sys_getgid,sys_getgid) /* 200 */ | 211 | SYSCALL(sys_getgid,sys_getgid,sys_getgid) /* 200 */ |
| 212 | SYSCALL(sys_geteuid,sys_geteuid,sys_geteuid) | 212 | SYSCALL(sys_geteuid,sys_geteuid,sys_geteuid) |
| 213 | SYSCALL(sys_getegid,sys_getegid,sys_getegid) | 213 | SYSCALL(sys_getegid,sys_getegid,sys_getegid) |
| 214 | SYSCALL(sys_setreuid,sys_setreuid,sys32_setreuid_wrapper) | 214 | SYSCALL(sys_setreuid,sys_setreuid,compat_sys_setreuid) |
| 215 | SYSCALL(sys_setregid,sys_setregid,sys32_setregid_wrapper) | 215 | SYSCALL(sys_setregid,sys_setregid,compat_sys_setregid) |
| 216 | SYSCALL(sys_getgroups,sys_getgroups,sys32_getgroups_wrapper) /* 205 */ | 216 | SYSCALL(sys_getgroups,sys_getgroups,compat_sys_getgroups) /* 205 */ |
| 217 | SYSCALL(sys_setgroups,sys_setgroups,sys32_setgroups_wrapper) | 217 | SYSCALL(sys_setgroups,sys_setgroups,compat_sys_setgroups) |
| 218 | SYSCALL(sys_fchown,sys_fchown,sys32_fchown_wrapper) | 218 | SYSCALL(sys_fchown,sys_fchown,compat_sys_fchown) |
| 219 | SYSCALL(sys_setresuid,sys_setresuid,sys32_setresuid_wrapper) | 219 | SYSCALL(sys_setresuid,sys_setresuid,compat_sys_setresuid) |
| 220 | SYSCALL(sys_getresuid,sys_getresuid,sys32_getresuid_wrapper) | 220 | SYSCALL(sys_getresuid,sys_getresuid,compat_sys_getresuid) |
| 221 | SYSCALL(sys_setresgid,sys_setresgid,sys32_setresgid_wrapper) /* 210 */ | 221 | SYSCALL(sys_setresgid,sys_setresgid,compat_sys_setresgid) /* 210 */ |
| 222 | SYSCALL(sys_getresgid,sys_getresgid,sys32_getresgid_wrapper) | 222 | SYSCALL(sys_getresgid,sys_getresgid,compat_sys_getresgid) |
| 223 | SYSCALL(sys_chown,sys_chown,sys32_chown_wrapper) | 223 | SYSCALL(sys_chown,sys_chown,compat_sys_chown) |
| 224 | SYSCALL(sys_setuid,sys_setuid,sys32_setuid_wrapper) | 224 | SYSCALL(sys_setuid,sys_setuid,compat_sys_setuid) |
| 225 | SYSCALL(sys_setgid,sys_setgid,sys32_setgid_wrapper) | 225 | SYSCALL(sys_setgid,sys_setgid,compat_sys_setgid) |
| 226 | SYSCALL(sys_setfsuid,sys_setfsuid,sys32_setfsuid_wrapper) /* 215 */ | 226 | SYSCALL(sys_setfsuid,sys_setfsuid,compat_sys_setfsuid) /* 215 */ |
| 227 | SYSCALL(sys_setfsgid,sys_setfsgid,sys32_setfsgid_wrapper) | 227 | SYSCALL(sys_setfsgid,sys_setfsgid,compat_sys_setfsgid) |
| 228 | SYSCALL(sys_pivot_root,sys_pivot_root,sys32_pivot_root_wrapper) | 228 | SYSCALL(sys_pivot_root,sys_pivot_root,compat_sys_pivot_root) |
| 229 | SYSCALL(sys_mincore,sys_mincore,sys32_mincore_wrapper) | 229 | SYSCALL(sys_mincore,sys_mincore,compat_sys_mincore) |
| 230 | SYSCALL(sys_madvise,sys_madvise,sys32_madvise_wrapper) | 230 | SYSCALL(sys_madvise,sys_madvise,compat_sys_madvise) |
| 231 | SYSCALL(sys_getdents64,sys_getdents64,sys32_getdents64_wrapper) /* 220 */ | 231 | SYSCALL(sys_getdents64,sys_getdents64,compat_sys_getdents64) /* 220 */ |
| 232 | SYSCALL(sys_fcntl64,sys_ni_syscall,compat_sys_fcntl64_wrapper) | 232 | SYSCALL(sys_fcntl64,sys_ni_syscall,compat_sys_fcntl64) |
| 233 | SYSCALL(sys_readahead,sys_readahead,sys32_readahead_wrapper) | 233 | SYSCALL(sys_readahead,sys_readahead,compat_sys_s390_readahead) |
| 234 | SYSCALL(sys_sendfile64,sys_ni_syscall,compat_sys_sendfile64) | 234 | SYSCALL(sys_sendfile64,sys_ni_syscall,compat_sys_sendfile64) |
| 235 | SYSCALL(sys_setxattr,sys_setxattr,sys32_setxattr_wrapper) | 235 | SYSCALL(sys_setxattr,sys_setxattr,compat_sys_setxattr) |
| 236 | SYSCALL(sys_lsetxattr,sys_lsetxattr,sys32_lsetxattr_wrapper) /* 225 */ | 236 | SYSCALL(sys_lsetxattr,sys_lsetxattr,compat_sys_lsetxattr) /* 225 */ |
| 237 | SYSCALL(sys_fsetxattr,sys_fsetxattr,sys32_fsetxattr_wrapper) | 237 | SYSCALL(sys_fsetxattr,sys_fsetxattr,compat_sys_fsetxattr) |
| 238 | SYSCALL(sys_getxattr,sys_getxattr,sys32_getxattr_wrapper) | 238 | SYSCALL(sys_getxattr,sys_getxattr,compat_sys_getxattr) |
| 239 | SYSCALL(sys_lgetxattr,sys_lgetxattr,sys32_lgetxattr_wrapper) | 239 | SYSCALL(sys_lgetxattr,sys_lgetxattr,compat_sys_lgetxattr) |
| 240 | SYSCALL(sys_fgetxattr,sys_fgetxattr,sys32_fgetxattr_wrapper) | 240 | SYSCALL(sys_fgetxattr,sys_fgetxattr,compat_sys_fgetxattr) |
| 241 | SYSCALL(sys_listxattr,sys_listxattr,sys32_listxattr_wrapper) /* 230 */ | 241 | SYSCALL(sys_listxattr,sys_listxattr,compat_sys_listxattr) /* 230 */ |
| 242 | SYSCALL(sys_llistxattr,sys_llistxattr,sys32_llistxattr_wrapper) | 242 | SYSCALL(sys_llistxattr,sys_llistxattr,compat_sys_llistxattr) |
| 243 | SYSCALL(sys_flistxattr,sys_flistxattr,sys32_flistxattr_wrapper) | 243 | SYSCALL(sys_flistxattr,sys_flistxattr,compat_sys_flistxattr) |
| 244 | SYSCALL(sys_removexattr,sys_removexattr,sys32_removexattr_wrapper) | 244 | SYSCALL(sys_removexattr,sys_removexattr,compat_sys_removexattr) |
| 245 | SYSCALL(sys_lremovexattr,sys_lremovexattr,sys32_lremovexattr_wrapper) | 245 | SYSCALL(sys_lremovexattr,sys_lremovexattr,compat_sys_lremovexattr) |
| 246 | SYSCALL(sys_fremovexattr,sys_fremovexattr,sys32_fremovexattr_wrapper) /* 235 */ | 246 | SYSCALL(sys_fremovexattr,sys_fremovexattr,compat_sys_fremovexattr) /* 235 */ |
| 247 | SYSCALL(sys_gettid,sys_gettid,sys_gettid) | 247 | SYSCALL(sys_gettid,sys_gettid,sys_gettid) |
| 248 | SYSCALL(sys_tkill,sys_tkill,sys_tkill_wrapper) | 248 | SYSCALL(sys_tkill,sys_tkill,compat_sys_tkill) |
| 249 | SYSCALL(sys_futex,sys_futex,compat_sys_futex) | 249 | SYSCALL(sys_futex,sys_futex,compat_sys_futex) |
| 250 | SYSCALL(sys_sched_setaffinity,sys_sched_setaffinity,sys32_sched_setaffinity_wrapper) | 250 | SYSCALL(sys_sched_setaffinity,sys_sched_setaffinity,compat_sys_sched_setaffinity) |
| 251 | SYSCALL(sys_sched_getaffinity,sys_sched_getaffinity,sys32_sched_getaffinity_wrapper) /* 240 */ | 251 | SYSCALL(sys_sched_getaffinity,sys_sched_getaffinity,compat_sys_sched_getaffinity) /* 240 */ |
| 252 | SYSCALL(sys_tgkill,sys_tgkill,sys_tgkill_wrapper) | 252 | SYSCALL(sys_tgkill,sys_tgkill,compat_sys_tgkill) |
| 253 | NI_SYSCALL /* reserved for TUX */ | 253 | NI_SYSCALL /* reserved for TUX */ |
| 254 | SYSCALL(sys_io_setup,sys_io_setup,sys32_io_setup_wrapper) | 254 | SYSCALL(sys_io_setup,sys_io_setup,compat_sys_io_setup) |
| 255 | SYSCALL(sys_io_destroy,sys_io_destroy,sys32_io_destroy_wrapper) | 255 | SYSCALL(sys_io_destroy,sys_io_destroy,compat_sys_io_destroy) |
| 256 | SYSCALL(sys_io_getevents,sys_io_getevents,sys32_io_getevents_wrapper) /* 245 */ | 256 | SYSCALL(sys_io_getevents,sys_io_getevents,compat_sys_io_getevents) /* 245 */ |
| 257 | SYSCALL(sys_io_submit,sys_io_submit,sys32_io_submit_wrapper) | 257 | SYSCALL(sys_io_submit,sys_io_submit,compat_sys_io_submit) |
| 258 | SYSCALL(sys_io_cancel,sys_io_cancel,sys32_io_cancel_wrapper) | 258 | SYSCALL(sys_io_cancel,sys_io_cancel,compat_sys_io_cancel) |
| 259 | SYSCALL(sys_exit_group,sys_exit_group,sys32_exit_group_wrapper) | 259 | SYSCALL(sys_exit_group,sys_exit_group,compat_sys_exit_group) |
| 260 | SYSCALL(sys_epoll_create,sys_epoll_create,sys_epoll_create_wrapper) | 260 | SYSCALL(sys_epoll_create,sys_epoll_create,compat_sys_epoll_create) |
| 261 | SYSCALL(sys_epoll_ctl,sys_epoll_ctl,sys_epoll_ctl_wrapper) /* 250 */ | 261 | SYSCALL(sys_epoll_ctl,sys_epoll_ctl,compat_sys_epoll_ctl) /* 250 */ |
| 262 | SYSCALL(sys_epoll_wait,sys_epoll_wait,sys_epoll_wait_wrapper) | 262 | SYSCALL(sys_epoll_wait,sys_epoll_wait,compat_sys_epoll_wait) |
| 263 | SYSCALL(sys_set_tid_address,sys_set_tid_address,sys32_set_tid_address_wrapper) | 263 | SYSCALL(sys_set_tid_address,sys_set_tid_address,compat_sys_set_tid_address) |
| 264 | SYSCALL(sys_s390_fadvise64,sys_fadvise64_64,sys32_fadvise64_wrapper) | 264 | SYSCALL(sys_s390_fadvise64,sys_fadvise64_64,compat_sys_s390_fadvise64) |
| 265 | SYSCALL(sys_timer_create,sys_timer_create,sys32_timer_create_wrapper) | 265 | SYSCALL(sys_timer_create,sys_timer_create,compat_sys_timer_create) |
| 266 | SYSCALL(sys_timer_settime,sys_timer_settime,sys32_timer_settime_wrapper) /* 255 */ | 266 | SYSCALL(sys_timer_settime,sys_timer_settime,compat_sys_timer_settime) /* 255 */ |
| 267 | SYSCALL(sys_timer_gettime,sys_timer_gettime,sys32_timer_gettime_wrapper) | 267 | SYSCALL(sys_timer_gettime,sys_timer_gettime,compat_sys_timer_gettime) |
| 268 | SYSCALL(sys_timer_getoverrun,sys_timer_getoverrun,sys32_timer_getoverrun_wrapper) | 268 | SYSCALL(sys_timer_getoverrun,sys_timer_getoverrun,compat_sys_timer_getoverrun) |
| 269 | SYSCALL(sys_timer_delete,sys_timer_delete,sys32_timer_delete_wrapper) | 269 | SYSCALL(sys_timer_delete,sys_timer_delete,compat_sys_timer_delete) |
| 270 | SYSCALL(sys_clock_settime,sys_clock_settime,sys32_clock_settime_wrapper) | 270 | SYSCALL(sys_clock_settime,sys_clock_settime,compat_sys_clock_settime) |
| 271 | SYSCALL(sys_clock_gettime,sys_clock_gettime,sys32_clock_gettime_wrapper) /* 260 */ | 271 | SYSCALL(sys_clock_gettime,sys_clock_gettime,compat_sys_clock_gettime) /* 260 */ |
| 272 | SYSCALL(sys_clock_getres,sys_clock_getres,sys32_clock_getres_wrapper) | 272 | SYSCALL(sys_clock_getres,sys_clock_getres,compat_sys_clock_getres) |
| 273 | SYSCALL(sys_clock_nanosleep,sys_clock_nanosleep,sys32_clock_nanosleep_wrapper) | 273 | SYSCALL(sys_clock_nanosleep,sys_clock_nanosleep,compat_sys_clock_nanosleep) |
| 274 | NI_SYSCALL /* reserved for vserver */ | 274 | NI_SYSCALL /* reserved for vserver */ |
| 275 | SYSCALL(sys_s390_fadvise64_64,sys_ni_syscall,sys32_fadvise64_64_wrapper) | 275 | SYSCALL(sys_s390_fadvise64_64,sys_ni_syscall,compat_sys_s390_fadvise64_64) |
| 276 | SYSCALL(sys_statfs64,sys_statfs64,compat_sys_statfs64_wrapper) | 276 | SYSCALL(sys_statfs64,sys_statfs64,compat_sys_statfs64) |
| 277 | SYSCALL(sys_fstatfs64,sys_fstatfs64,compat_sys_fstatfs64_wrapper) | 277 | SYSCALL(sys_fstatfs64,sys_fstatfs64,compat_sys_fstatfs64) |
| 278 | SYSCALL(sys_remap_file_pages,sys_remap_file_pages,sys32_remap_file_pages_wrapper) | 278 | SYSCALL(sys_remap_file_pages,sys_remap_file_pages,compat_sys_remap_file_pages) |
| 279 | NI_SYSCALL /* 268 sys_mbind */ | 279 | NI_SYSCALL /* 268 sys_mbind */ |
| 280 | NI_SYSCALL /* 269 sys_get_mempolicy */ | 280 | NI_SYSCALL /* 269 sys_get_mempolicy */ |
| 281 | NI_SYSCALL /* 270 sys_set_mempolicy */ | 281 | NI_SYSCALL /* 270 sys_set_mempolicy */ |
| 282 | SYSCALL(sys_mq_open,sys_mq_open,compat_sys_mq_open_wrapper) | 282 | SYSCALL(sys_mq_open,sys_mq_open,compat_sys_mq_open) |
| 283 | SYSCALL(sys_mq_unlink,sys_mq_unlink,sys32_mq_unlink_wrapper) | 283 | SYSCALL(sys_mq_unlink,sys_mq_unlink,compat_sys_mq_unlink) |
| 284 | SYSCALL(sys_mq_timedsend,sys_mq_timedsend,compat_sys_mq_timedsend_wrapper) | 284 | SYSCALL(sys_mq_timedsend,sys_mq_timedsend,compat_sys_mq_timedsend) |
| 285 | SYSCALL(sys_mq_timedreceive,sys_mq_timedreceive,compat_sys_mq_timedreceive_wrapper) | 285 | SYSCALL(sys_mq_timedreceive,sys_mq_timedreceive,compat_sys_mq_timedreceive) |
| 286 | SYSCALL(sys_mq_notify,sys_mq_notify,compat_sys_mq_notify_wrapper) /* 275 */ | 286 | SYSCALL(sys_mq_notify,sys_mq_notify,compat_sys_mq_notify) /* 275 */ |
| 287 | SYSCALL(sys_mq_getsetattr,sys_mq_getsetattr,compat_sys_mq_getsetattr_wrapper) | 287 | SYSCALL(sys_mq_getsetattr,sys_mq_getsetattr,compat_sys_mq_getsetattr) |
| 288 | SYSCALL(sys_kexec_load,sys_kexec_load,compat_sys_kexec_load_wrapper) | 288 | SYSCALL(sys_kexec_load,sys_kexec_load,compat_sys_kexec_load) |
| 289 | SYSCALL(sys_add_key,sys_add_key,compat_sys_add_key_wrapper) | 289 | SYSCALL(sys_add_key,sys_add_key,compat_sys_add_key) |
| 290 | SYSCALL(sys_request_key,sys_request_key,compat_sys_request_key_wrapper) | 290 | SYSCALL(sys_request_key,sys_request_key,compat_sys_request_key) |
| 291 | SYSCALL(sys_keyctl,sys_keyctl,compat_sys_keyctl_wrapper) /* 280 */ | 291 | SYSCALL(sys_keyctl,sys_keyctl,compat_sys_keyctl) /* 280 */ |
| 292 | SYSCALL(sys_waitid,sys_waitid,compat_sys_waitid) | 292 | SYSCALL(sys_waitid,sys_waitid,compat_sys_waitid) |
| 293 | SYSCALL(sys_ioprio_set,sys_ioprio_set,sys_ioprio_set_wrapper) | 293 | SYSCALL(sys_ioprio_set,sys_ioprio_set,compat_sys_ioprio_set) |
| 294 | SYSCALL(sys_ioprio_get,sys_ioprio_get,sys_ioprio_get_wrapper) | 294 | SYSCALL(sys_ioprio_get,sys_ioprio_get,compat_sys_ioprio_get) |
| 295 | SYSCALL(sys_inotify_init,sys_inotify_init,sys_inotify_init) | 295 | SYSCALL(sys_inotify_init,sys_inotify_init,sys_inotify_init) |
| 296 | SYSCALL(sys_inotify_add_watch,sys_inotify_add_watch,sys_inotify_add_watch_wrapper) /* 285 */ | 296 | SYSCALL(sys_inotify_add_watch,sys_inotify_add_watch,compat_sys_inotify_add_watch) /* 285 */ |
| 297 | SYSCALL(sys_inotify_rm_watch,sys_inotify_rm_watch,sys_inotify_rm_watch_wrapper) | 297 | SYSCALL(sys_inotify_rm_watch,sys_inotify_rm_watch,compat_sys_inotify_rm_watch) |
| 298 | NI_SYSCALL /* 287 sys_migrate_pages */ | 298 | NI_SYSCALL /* 287 sys_migrate_pages */ |
| 299 | SYSCALL(sys_openat,sys_openat,compat_sys_openat) | 299 | SYSCALL(sys_openat,sys_openat,compat_sys_openat) |
| 300 | SYSCALL(sys_mkdirat,sys_mkdirat,sys_mkdirat_wrapper) | 300 | SYSCALL(sys_mkdirat,sys_mkdirat,compat_sys_mkdirat) |
| 301 | SYSCALL(sys_mknodat,sys_mknodat,sys_mknodat_wrapper) /* 290 */ | 301 | SYSCALL(sys_mknodat,sys_mknodat,compat_sys_mknodat) /* 290 */ |
| 302 | SYSCALL(sys_fchownat,sys_fchownat,sys_fchownat_wrapper) | 302 | SYSCALL(sys_fchownat,sys_fchownat,compat_sys_fchownat) |
| 303 | SYSCALL(sys_futimesat,sys_futimesat,compat_sys_futimesat_wrapper) | 303 | SYSCALL(sys_futimesat,sys_futimesat,compat_sys_futimesat) |
| 304 | SYSCALL(sys_fstatat64,sys_newfstatat,sys32_fstatat64_wrapper) | 304 | SYSCALL(sys_fstatat64,sys_newfstatat,compat_sys_s390_fstatat64) |
| 305 | SYSCALL(sys_unlinkat,sys_unlinkat,sys_unlinkat_wrapper) | 305 | SYSCALL(sys_unlinkat,sys_unlinkat,compat_sys_unlinkat) |
| 306 | SYSCALL(sys_renameat,sys_renameat,sys_renameat_wrapper) /* 295 */ | 306 | SYSCALL(sys_renameat,sys_renameat,compat_sys_renameat) /* 295 */ |
| 307 | SYSCALL(sys_linkat,sys_linkat,sys_linkat_wrapper) | 307 | SYSCALL(sys_linkat,sys_linkat,compat_sys_linkat) |
| 308 | SYSCALL(sys_symlinkat,sys_symlinkat,sys_symlinkat_wrapper) | 308 | SYSCALL(sys_symlinkat,sys_symlinkat,compat_sys_symlinkat) |
| 309 | SYSCALL(sys_readlinkat,sys_readlinkat,sys_readlinkat_wrapper) | 309 | SYSCALL(sys_readlinkat,sys_readlinkat,compat_sys_readlinkat) |
| 310 | SYSCALL(sys_fchmodat,sys_fchmodat,sys_fchmodat_wrapper) | 310 | SYSCALL(sys_fchmodat,sys_fchmodat,compat_sys_fchmodat) |
| 311 | SYSCALL(sys_faccessat,sys_faccessat,sys_faccessat_wrapper) /* 300 */ | 311 | SYSCALL(sys_faccessat,sys_faccessat,compat_sys_faccessat) /* 300 */ |
| 312 | SYSCALL(sys_pselect6,sys_pselect6,compat_sys_pselect6_wrapper) | 312 | SYSCALL(sys_pselect6,sys_pselect6,compat_sys_pselect6) |
| 313 | SYSCALL(sys_ppoll,sys_ppoll,compat_sys_ppoll_wrapper) | 313 | SYSCALL(sys_ppoll,sys_ppoll,compat_sys_ppoll) |
| 314 | SYSCALL(sys_unshare,sys_unshare,sys_unshare_wrapper) | 314 | SYSCALL(sys_unshare,sys_unshare,compat_sys_unshare) |
| 315 | SYSCALL(sys_set_robust_list,sys_set_robust_list,compat_sys_set_robust_list) | 315 | SYSCALL(sys_set_robust_list,sys_set_robust_list,compat_sys_set_robust_list) |
| 316 | SYSCALL(sys_get_robust_list,sys_get_robust_list,compat_sys_get_robust_list) | 316 | SYSCALL(sys_get_robust_list,sys_get_robust_list,compat_sys_get_robust_list) |
| 317 | SYSCALL(sys_splice,sys_splice,sys_splice_wrapper) | 317 | SYSCALL(sys_splice,sys_splice,compat_sys_splice) |
| 318 | SYSCALL(sys_sync_file_range,sys_sync_file_range,sys_sync_file_range_wrapper) | 318 | SYSCALL(sys_sync_file_range,sys_sync_file_range,compat_sys_s390_sync_file_range) |
| 319 | SYSCALL(sys_tee,sys_tee,sys_tee_wrapper) | 319 | SYSCALL(sys_tee,sys_tee,compat_sys_tee) |
| 320 | SYSCALL(sys_vmsplice,sys_vmsplice,compat_sys_vmsplice) | 320 | SYSCALL(sys_vmsplice,sys_vmsplice,compat_sys_vmsplice) |
| 321 | NI_SYSCALL /* 310 sys_move_pages */ | 321 | NI_SYSCALL /* 310 sys_move_pages */ |
| 322 | SYSCALL(sys_getcpu,sys_getcpu,sys_getcpu_wrapper) | 322 | SYSCALL(sys_getcpu,sys_getcpu,compat_sys_getcpu) |
| 323 | SYSCALL(sys_epoll_pwait,sys_epoll_pwait,compat_sys_epoll_pwait) | 323 | SYSCALL(sys_epoll_pwait,sys_epoll_pwait,compat_sys_epoll_pwait) |
| 324 | SYSCALL(sys_utimes,sys_utimes,compat_sys_utimes_wrapper) | 324 | SYSCALL(sys_utimes,sys_utimes,compat_sys_utimes) |
| 325 | SYSCALL(sys_s390_fallocate,sys_fallocate,sys_fallocate_wrapper) | 325 | SYSCALL(sys_s390_fallocate,sys_fallocate,compat_sys_s390_fallocate) |
| 326 | SYSCALL(sys_utimensat,sys_utimensat,compat_sys_utimensat_wrapper) /* 315 */ | 326 | SYSCALL(sys_utimensat,sys_utimensat,compat_sys_utimensat) /* 315 */ |
| 327 | SYSCALL(sys_signalfd,sys_signalfd,compat_sys_signalfd) | 327 | SYSCALL(sys_signalfd,sys_signalfd,compat_sys_signalfd) |
| 328 | NI_SYSCALL /* 317 old sys_timer_fd */ | 328 | NI_SYSCALL /* 317 old sys_timer_fd */ |
| 329 | SYSCALL(sys_eventfd,sys_eventfd,sys_eventfd_wrapper) | 329 | SYSCALL(sys_eventfd,sys_eventfd,compat_sys_eventfd) |
| 330 | SYSCALL(sys_timerfd_create,sys_timerfd_create,sys_timerfd_create_wrapper) | 330 | SYSCALL(sys_timerfd_create,sys_timerfd_create,compat_sys_timerfd_create) |
| 331 | SYSCALL(sys_timerfd_settime,sys_timerfd_settime,compat_sys_timerfd_settime) /* 320 */ | 331 | SYSCALL(sys_timerfd_settime,sys_timerfd_settime,compat_sys_timerfd_settime) /* 320 */ |
| 332 | SYSCALL(sys_timerfd_gettime,sys_timerfd_gettime,compat_sys_timerfd_gettime) | 332 | SYSCALL(sys_timerfd_gettime,sys_timerfd_gettime,compat_sys_timerfd_gettime) |
| 333 | SYSCALL(sys_signalfd4,sys_signalfd4,compat_sys_signalfd4) | 333 | SYSCALL(sys_signalfd4,sys_signalfd4,compat_sys_signalfd4) |
| 334 | SYSCALL(sys_eventfd2,sys_eventfd2,sys_eventfd2_wrapper) | 334 | SYSCALL(sys_eventfd2,sys_eventfd2,compat_sys_eventfd2) |
| 335 | SYSCALL(sys_inotify_init1,sys_inotify_init1,sys_inotify_init1_wrapper) | 335 | SYSCALL(sys_inotify_init1,sys_inotify_init1,compat_sys_inotify_init1) |
| 336 | SYSCALL(sys_pipe2,sys_pipe2,sys_pipe2_wrapper) /* 325 */ | 336 | SYSCALL(sys_pipe2,sys_pipe2,compat_sys_pipe2) /* 325 */ |
| 337 | SYSCALL(sys_dup3,sys_dup3,sys_dup3_wrapper) | 337 | SYSCALL(sys_dup3,sys_dup3,compat_sys_dup3) |
| 338 | SYSCALL(sys_epoll_create1,sys_epoll_create1,sys_epoll_create1_wrapper) | 338 | SYSCALL(sys_epoll_create1,sys_epoll_create1,compat_sys_epoll_create1) |
| 339 | SYSCALL(sys_preadv,sys_preadv,compat_sys_preadv) | 339 | SYSCALL(sys_preadv,sys_preadv,compat_sys_preadv) |
| 340 | SYSCALL(sys_pwritev,sys_pwritev,compat_sys_pwritev) | 340 | SYSCALL(sys_pwritev,sys_pwritev,compat_sys_pwritev) |
| 341 | SYSCALL(sys_rt_tgsigqueueinfo,sys_rt_tgsigqueueinfo,compat_sys_rt_tgsigqueueinfo) /* 330 */ | 341 | SYSCALL(sys_rt_tgsigqueueinfo,sys_rt_tgsigqueueinfo,compat_sys_rt_tgsigqueueinfo) /* 330 */ |
| 342 | SYSCALL(sys_perf_event_open,sys_perf_event_open,sys_perf_event_open_wrapper) | 342 | SYSCALL(sys_perf_event_open,sys_perf_event_open,compat_sys_perf_event_open) |
| 343 | SYSCALL(sys_fanotify_init,sys_fanotify_init,sys_fanotify_init_wrapper) | 343 | SYSCALL(sys_fanotify_init,sys_fanotify_init,compat_sys_fanotify_init) |
| 344 | SYSCALL(sys_fanotify_mark,sys_fanotify_mark,compat_sys_fanotify_mark) | 344 | SYSCALL(sys_fanotify_mark,sys_fanotify_mark,compat_sys_fanotify_mark) |
| 345 | SYSCALL(sys_prlimit64,sys_prlimit64,sys_prlimit64_wrapper) | 345 | SYSCALL(sys_prlimit64,sys_prlimit64,compat_sys_prlimit64) |
| 346 | SYSCALL(sys_name_to_handle_at,sys_name_to_handle_at,sys_name_to_handle_at_wrapper) /* 335 */ | 346 | SYSCALL(sys_name_to_handle_at,sys_name_to_handle_at,compat_sys_name_to_handle_at) /* 335 */ |
| 347 | SYSCALL(sys_open_by_handle_at,sys_open_by_handle_at,compat_sys_open_by_handle_at) | 347 | SYSCALL(sys_open_by_handle_at,sys_open_by_handle_at,compat_sys_open_by_handle_at) |
| 348 | SYSCALL(sys_clock_adjtime,sys_clock_adjtime,compat_sys_clock_adjtime_wrapper) | 348 | SYSCALL(sys_clock_adjtime,sys_clock_adjtime,compat_sys_clock_adjtime) |
| 349 | SYSCALL(sys_syncfs,sys_syncfs,sys_syncfs_wrapper) | 349 | SYSCALL(sys_syncfs,sys_syncfs,compat_sys_syncfs) |
| 350 | SYSCALL(sys_setns,sys_setns,sys_setns_wrapper) | 350 | SYSCALL(sys_setns,sys_setns,compat_sys_setns) |
| 351 | SYSCALL(sys_process_vm_readv,sys_process_vm_readv,compat_sys_process_vm_readv_wrapper) /* 340 */ | 351 | SYSCALL(sys_process_vm_readv,sys_process_vm_readv,compat_sys_process_vm_readv) /* 340 */ |
| 352 | SYSCALL(sys_process_vm_writev,sys_process_vm_writev,compat_sys_process_vm_writev_wrapper) | 352 | SYSCALL(sys_process_vm_writev,sys_process_vm_writev,compat_sys_process_vm_writev) |
| 353 | SYSCALL(sys_ni_syscall,sys_s390_runtime_instr,sys_s390_runtime_instr_wrapper) | 353 | SYSCALL(sys_ni_syscall,sys_s390_runtime_instr,compat_sys_s390_runtime_instr) |
| 354 | SYSCALL(sys_kcmp,sys_kcmp,sys_kcmp_wrapper) | 354 | SYSCALL(sys_kcmp,sys_kcmp,compat_sys_kcmp) |
| 355 | SYSCALL(sys_finit_module,sys_finit_module,sys_finit_module_wrapper) | 355 | SYSCALL(sys_finit_module,sys_finit_module,compat_sys_finit_module) |
| 356 | SYSCALL(sys_sched_setattr,sys_sched_setattr,sys_sched_setattr_wrapper) /* 345 */ | 356 | SYSCALL(sys_sched_setattr,sys_sched_setattr,compat_sys_sched_setattr) /* 345 */ |
| 357 | SYSCALL(sys_sched_getattr,sys_sched_getattr,sys_sched_getattr_wrapper) | 357 | SYSCALL(sys_sched_getattr,sys_sched_getattr,compat_sys_sched_getattr) |
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c index 4b2e3e317004..6298fed11ced 100644 --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c | |||
| @@ -451,7 +451,6 @@ static int __init topology_init(void) | |||
| 451 | } | 451 | } |
| 452 | set_topology_timer(); | 452 | set_topology_timer(); |
| 453 | out: | 453 | out: |
| 454 | update_cpu_masks(); | ||
| 455 | return device_create_file(cpu_subsys.dev_root, &dev_attr_dispatching); | 454 | return device_create_file(cpu_subsys.dev_root, &dev_attr_dispatching); |
| 456 | } | 455 | } |
| 457 | device_initcall(topology_init); | 456 | device_initcall(topology_init); |
diff --git a/arch/s390/kvm/diag.c b/arch/s390/kvm/diag.c index 8216c0e0b2e2..6f9cfa500372 100644 --- a/arch/s390/kvm/diag.c +++ b/arch/s390/kvm/diag.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | #include <linux/kvm.h> | 14 | #include <linux/kvm.h> |
| 15 | #include <linux/kvm_host.h> | 15 | #include <linux/kvm_host.h> |
| 16 | #include <asm/pgalloc.h> | ||
| 16 | #include <asm/virtio-ccw.h> | 17 | #include <asm/virtio-ccw.h> |
| 17 | #include "kvm-s390.h" | 18 | #include "kvm-s390.h" |
| 18 | #include "trace.h" | 19 | #include "trace.h" |
| @@ -86,9 +87,11 @@ static int __diag_ipl_functions(struct kvm_vcpu *vcpu) | |||
| 86 | switch (subcode) { | 87 | switch (subcode) { |
| 87 | case 3: | 88 | case 3: |
| 88 | vcpu->run->s390_reset_flags = KVM_S390_RESET_CLEAR; | 89 | vcpu->run->s390_reset_flags = KVM_S390_RESET_CLEAR; |
| 90 | page_table_reset_pgste(current->mm, 0, TASK_SIZE); | ||
| 89 | break; | 91 | break; |
| 90 | case 4: | 92 | case 4: |
| 91 | vcpu->run->s390_reset_flags = 0; | 93 | vcpu->run->s390_reset_flags = 0; |
| 94 | page_table_reset_pgste(current->mm, 0, TASK_SIZE); | ||
| 92 | break; | 95 | break; |
| 93 | default: | 96 | default: |
| 94 | return -EOPNOTSUPP; | 97 | return -EOPNOTSUPP; |
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index e0676f390d57..10b5db3c9bc4 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
| @@ -68,6 +68,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = { | |||
| 68 | { "instruction_storage_key", VCPU_STAT(instruction_storage_key) }, | 68 | { "instruction_storage_key", VCPU_STAT(instruction_storage_key) }, |
| 69 | { "instruction_stsch", VCPU_STAT(instruction_stsch) }, | 69 | { "instruction_stsch", VCPU_STAT(instruction_stsch) }, |
| 70 | { "instruction_chsc", VCPU_STAT(instruction_chsc) }, | 70 | { "instruction_chsc", VCPU_STAT(instruction_chsc) }, |
| 71 | { "instruction_essa", VCPU_STAT(instruction_essa) }, | ||
| 71 | { "instruction_stsi", VCPU_STAT(instruction_stsi) }, | 72 | { "instruction_stsi", VCPU_STAT(instruction_stsi) }, |
| 72 | { "instruction_stfl", VCPU_STAT(instruction_stfl) }, | 73 | { "instruction_stfl", VCPU_STAT(instruction_stfl) }, |
| 73 | { "instruction_tprot", VCPU_STAT(instruction_tprot) }, | 74 | { "instruction_tprot", VCPU_STAT(instruction_tprot) }, |
| @@ -283,7 +284,11 @@ void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu) | |||
| 283 | if (kvm_is_ucontrol(vcpu->kvm)) | 284 | if (kvm_is_ucontrol(vcpu->kvm)) |
| 284 | gmap_free(vcpu->arch.gmap); | 285 | gmap_free(vcpu->arch.gmap); |
| 285 | 286 | ||
| 287 | if (vcpu->arch.sie_block->cbrlo) | ||
| 288 | __free_page(__pfn_to_page( | ||
| 289 | vcpu->arch.sie_block->cbrlo >> PAGE_SHIFT)); | ||
| 286 | free_page((unsigned long)(vcpu->arch.sie_block)); | 290 | free_page((unsigned long)(vcpu->arch.sie_block)); |
| 291 | |||
| 287 | kvm_vcpu_uninit(vcpu); | 292 | kvm_vcpu_uninit(vcpu); |
| 288 | kmem_cache_free(kvm_vcpu_cache, vcpu); | 293 | kmem_cache_free(kvm_vcpu_cache, vcpu); |
| 289 | } | 294 | } |
| @@ -390,6 +395,8 @@ int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu) | |||
| 390 | 395 | ||
| 391 | int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu) | 396 | int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu) |
| 392 | { | 397 | { |
| 398 | struct page *cbrl; | ||
| 399 | |||
| 393 | atomic_set(&vcpu->arch.sie_block->cpuflags, CPUSTAT_ZARCH | | 400 | atomic_set(&vcpu->arch.sie_block->cpuflags, CPUSTAT_ZARCH | |
| 394 | CPUSTAT_SM | | 401 | CPUSTAT_SM | |
| 395 | CPUSTAT_STOPPED | | 402 | CPUSTAT_STOPPED | |
| @@ -401,6 +408,14 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu) | |||
| 401 | vcpu->arch.sie_block->ecb2 = 8; | 408 | vcpu->arch.sie_block->ecb2 = 8; |
| 402 | vcpu->arch.sie_block->eca = 0xC1002001U; | 409 | vcpu->arch.sie_block->eca = 0xC1002001U; |
| 403 | vcpu->arch.sie_block->fac = (int) (long) vfacilities; | 410 | vcpu->arch.sie_block->fac = (int) (long) vfacilities; |
| 411 | if (kvm_enabled_cmma()) { | ||
| 412 | cbrl = alloc_page(GFP_KERNEL | __GFP_ZERO); | ||
| 413 | if (cbrl) { | ||
| 414 | vcpu->arch.sie_block->ecb2 |= 0x80; | ||
| 415 | vcpu->arch.sie_block->ecb2 &= ~0x08; | ||
| 416 | vcpu->arch.sie_block->cbrlo = page_to_phys(cbrl); | ||
| 417 | } | ||
| 418 | } | ||
| 404 | hrtimer_init(&vcpu->arch.ckc_timer, CLOCK_REALTIME, HRTIMER_MODE_ABS); | 419 | hrtimer_init(&vcpu->arch.ckc_timer, CLOCK_REALTIME, HRTIMER_MODE_ABS); |
| 405 | tasklet_init(&vcpu->arch.tasklet, kvm_s390_tasklet, | 420 | tasklet_init(&vcpu->arch.tasklet, kvm_s390_tasklet, |
| 406 | (unsigned long) vcpu); | 421 | (unsigned long) vcpu); |
| @@ -761,6 +776,16 @@ static int vcpu_post_run(struct kvm_vcpu *vcpu, int exit_reason) | |||
| 761 | return rc; | 776 | return rc; |
| 762 | } | 777 | } |
| 763 | 778 | ||
| 779 | bool kvm_enabled_cmma(void) | ||
| 780 | { | ||
| 781 | if (!MACHINE_IS_LPAR) | ||
| 782 | return false; | ||
| 783 | /* only enable for z10 and later */ | ||
| 784 | if (!MACHINE_HAS_EDAT1) | ||
| 785 | return false; | ||
| 786 | return true; | ||
| 787 | } | ||
| 788 | |||
| 764 | static int __vcpu_run(struct kvm_vcpu *vcpu) | 789 | static int __vcpu_run(struct kvm_vcpu *vcpu) |
| 765 | { | 790 | { |
| 766 | int rc, exit_reason; | 791 | int rc, exit_reason; |
diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h index f9559b0bd620..564514f410f4 100644 --- a/arch/s390/kvm/kvm-s390.h +++ b/arch/s390/kvm/kvm-s390.h | |||
| @@ -156,6 +156,8 @@ void s390_vcpu_block(struct kvm_vcpu *vcpu); | |||
| 156 | void s390_vcpu_unblock(struct kvm_vcpu *vcpu); | 156 | void s390_vcpu_unblock(struct kvm_vcpu *vcpu); |
| 157 | void exit_sie(struct kvm_vcpu *vcpu); | 157 | void exit_sie(struct kvm_vcpu *vcpu); |
| 158 | void exit_sie_sync(struct kvm_vcpu *vcpu); | 158 | void exit_sie_sync(struct kvm_vcpu *vcpu); |
| 159 | /* are we going to support cmma? */ | ||
| 160 | bool kvm_enabled_cmma(void); | ||
| 159 | /* implemented in diag.c */ | 161 | /* implemented in diag.c */ |
| 160 | int kvm_s390_handle_diag(struct kvm_vcpu *vcpu); | 162 | int kvm_s390_handle_diag(struct kvm_vcpu *vcpu); |
| 161 | 163 | ||
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c index 75beea632a10..aacb6b129914 100644 --- a/arch/s390/kvm/priv.c +++ b/arch/s390/kvm/priv.c | |||
| @@ -636,8 +636,49 @@ static int handle_pfmf(struct kvm_vcpu *vcpu) | |||
| 636 | return 0; | 636 | return 0; |
| 637 | } | 637 | } |
| 638 | 638 | ||
| 639 | static int handle_essa(struct kvm_vcpu *vcpu) | ||
| 640 | { | ||
| 641 | /* entries expected to be 1FF */ | ||
| 642 | int entries = (vcpu->arch.sie_block->cbrlo & ~PAGE_MASK) >> 3; | ||
| 643 | unsigned long *cbrlo, cbrle; | ||
| 644 | struct gmap *gmap; | ||
| 645 | int i; | ||
| 646 | |||
| 647 | VCPU_EVENT(vcpu, 5, "cmma release %d pages", entries); | ||
| 648 | gmap = vcpu->arch.gmap; | ||
| 649 | vcpu->stat.instruction_essa++; | ||
| 650 | if (!kvm_enabled_cmma() || !vcpu->arch.sie_block->cbrlo) | ||
| 651 | return kvm_s390_inject_program_int(vcpu, PGM_OPERATION); | ||
| 652 | |||
| 653 | if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE) | ||
| 654 | return kvm_s390_inject_program_int(vcpu, PGM_PRIVILEGED_OP); | ||
| 655 | |||
| 656 | if (((vcpu->arch.sie_block->ipb & 0xf0000000) >> 28) > 6) | ||
| 657 | return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION); | ||
| 658 | |||
| 659 | /* Rewind PSW to repeat the ESSA instruction */ | ||
| 660 | vcpu->arch.sie_block->gpsw.addr = | ||
| 661 | __rewind_psw(vcpu->arch.sie_block->gpsw, 4); | ||
| 662 | vcpu->arch.sie_block->cbrlo &= PAGE_MASK; /* reset nceo */ | ||
| 663 | cbrlo = phys_to_virt(vcpu->arch.sie_block->cbrlo); | ||
| 664 | down_read(&gmap->mm->mmap_sem); | ||
| 665 | for (i = 0; i < entries; ++i) { | ||
| 666 | cbrle = cbrlo[i]; | ||
| 667 | if (unlikely(cbrle & ~PAGE_MASK || cbrle < 2 * PAGE_SIZE)) | ||
| 668 | /* invalid entry */ | ||
| 669 | break; | ||
| 670 | /* try to free backing */ | ||
| 671 | __gmap_zap(cbrle, gmap); | ||
| 672 | } | ||
| 673 | up_read(&gmap->mm->mmap_sem); | ||
| 674 | if (i < entries) | ||
| 675 | return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION); | ||
| 676 | return 0; | ||
| 677 | } | ||
| 678 | |||
| 639 | static const intercept_handler_t b9_handlers[256] = { | 679 | static const intercept_handler_t b9_handlers[256] = { |
| 640 | [0x8d] = handle_epsw, | 680 | [0x8d] = handle_epsw, |
| 681 | [0xab] = handle_essa, | ||
| 641 | [0xaf] = handle_pfmf, | 682 | [0xaf] = handle_pfmf, |
| 642 | }; | 683 | }; |
| 643 | 684 | ||
diff --git a/arch/s390/lib/Makefile b/arch/s390/lib/Makefile index b068729e50ac..e3fffe1dff51 100644 --- a/arch/s390/lib/Makefile +++ b/arch/s390/lib/Makefile | |||
| @@ -2,8 +2,7 @@ | |||
| 2 | # Makefile for s390-specific library files.. | 2 | # Makefile for s390-specific library files.. |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | lib-y += delay.o string.o uaccess_pt.o find.o | 5 | lib-y += delay.o string.o uaccess_pt.o uaccess_mvcos.o find.o |
| 6 | obj-$(CONFIG_32BIT) += div64.o qrnnd.o ucmpdi2.o mem32.o | 6 | obj-$(CONFIG_32BIT) += div64.o qrnnd.o ucmpdi2.o mem32.o |
| 7 | obj-$(CONFIG_64BIT) += mem64.o | 7 | obj-$(CONFIG_64BIT) += mem64.o |
| 8 | lib-$(CONFIG_64BIT) += uaccess_mvcos.o | ||
| 9 | lib-$(CONFIG_SMP) += spinlock.o | 8 | lib-$(CONFIG_SMP) += spinlock.o |
diff --git a/arch/s390/lib/find.c b/arch/s390/lib/find.c index 620d34d6487e..922003c1b90d 100644 --- a/arch/s390/lib/find.c +++ b/arch/s390/lib/find.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * On s390x the bits are numbered: | 4 | * On s390x the bits are numbered: |
| 5 | * |0..............63|64............127|128...........191|192...........255| | 5 | * |0..............63|64............127|128...........191|192...........255| |
| 6 | * and on s390: | 6 | * and on s390: |
| 7 | * |0.....31|31....63|64....95|96...127|128..159|160..191|192..223|224..255| | 7 | * |0.....31|32....63|64....95|96...127|128..159|160..191|192..223|224..255| |
| 8 | * | 8 | * |
| 9 | * The reason for this bit numbering is the fact that the hardware sets bits | 9 | * The reason for this bit numbering is the fact that the hardware sets bits |
| 10 | * in a bitmap starting at bit 0 (MSB) and we don't want to scan the bitmap | 10 | * in a bitmap starting at bit 0 (MSB) and we don't want to scan the bitmap |
diff --git a/arch/s390/lib/uaccess.h b/arch/s390/lib/uaccess.h index b1a22173d027..c7e0e81f4b4e 100644 --- a/arch/s390/lib/uaccess.h +++ b/arch/s390/lib/uaccess.h | |||
| @@ -6,7 +6,11 @@ | |||
| 6 | #ifndef __ARCH_S390_LIB_UACCESS_H | 6 | #ifndef __ARCH_S390_LIB_UACCESS_H |
| 7 | #define __ARCH_S390_LIB_UACCESS_H | 7 | #define __ARCH_S390_LIB_UACCESS_H |
| 8 | 8 | ||
| 9 | extern int futex_atomic_op_pt(int, u32 __user *, int, int *); | 9 | unsigned long copy_from_user_pt(void *to, const void __user *from, unsigned long n); |
| 10 | extern int futex_atomic_cmpxchg_pt(u32 *, u32 __user *, u32, u32); | 10 | unsigned long copy_to_user_pt(void __user *to, const void *from, unsigned long n); |
| 11 | unsigned long copy_in_user_pt(void __user *to, const void __user *from, unsigned long n); | ||
| 12 | unsigned long clear_user_pt(void __user *to, unsigned long n); | ||
| 13 | unsigned long strnlen_user_pt(const char __user *src, unsigned long count); | ||
| 14 | long strncpy_from_user_pt(char *dst, const char __user *src, long count); | ||
| 11 | 15 | ||
| 12 | #endif /* __ARCH_S390_LIB_UACCESS_H */ | 16 | #endif /* __ARCH_S390_LIB_UACCESS_H */ |
diff --git a/arch/s390/lib/uaccess_mvcos.c b/arch/s390/lib/uaccess_mvcos.c index 4b7993bf69b9..ae97b8df11aa 100644 --- a/arch/s390/lib/uaccess_mvcos.c +++ b/arch/s390/lib/uaccess_mvcos.c | |||
| @@ -6,8 +6,11 @@ | |||
| 6 | * Gerald Schaefer (gerald.schaefer@de.ibm.com) | 6 | * Gerald Schaefer (gerald.schaefer@de.ibm.com) |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #include <linux/jump_label.h> | ||
| 9 | #include <linux/errno.h> | 10 | #include <linux/errno.h> |
| 11 | #include <linux/init.h> | ||
| 10 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
| 13 | #include <asm/facility.h> | ||
| 11 | #include <asm/uaccess.h> | 14 | #include <asm/uaccess.h> |
| 12 | #include <asm/futex.h> | 15 | #include <asm/futex.h> |
| 13 | #include "uaccess.h" | 16 | #include "uaccess.h" |
| @@ -26,7 +29,10 @@ | |||
| 26 | #define SLR "slgr" | 29 | #define SLR "slgr" |
| 27 | #endif | 30 | #endif |
| 28 | 31 | ||
| 29 | static size_t copy_from_user_mvcos(size_t size, const void __user *ptr, void *x) | 32 | static struct static_key have_mvcos = STATIC_KEY_INIT_TRUE; |
| 33 | |||
| 34 | static inline unsigned long copy_from_user_mvcos(void *x, const void __user *ptr, | ||
| 35 | unsigned long size) | ||
| 30 | { | 36 | { |
| 31 | register unsigned long reg0 asm("0") = 0x81UL; | 37 | register unsigned long reg0 asm("0") = 0x81UL; |
| 32 | unsigned long tmp1, tmp2; | 38 | unsigned long tmp1, tmp2; |
| @@ -65,7 +71,16 @@ static size_t copy_from_user_mvcos(size_t size, const void __user *ptr, void *x) | |||
| 65 | return size; | 71 | return size; |
| 66 | } | 72 | } |
| 67 | 73 | ||
| 68 | static size_t copy_to_user_mvcos(size_t size, void __user *ptr, const void *x) | 74 | unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n) |
| 75 | { | ||
| 76 | if (static_key_true(&have_mvcos)) | ||
| 77 | return copy_from_user_mvcos(to, from, n); | ||
| 78 | return copy_from_user_pt(to, from, n); | ||
| 79 | } | ||
| 80 | EXPORT_SYMBOL(__copy_from_user); | ||
| 81 | |||
| 82 | static inline unsigned long copy_to_user_mvcos(void __user *ptr, const void *x, | ||
| 83 | unsigned long size) | ||
| 69 | { | 84 | { |
| 70 | register unsigned long reg0 asm("0") = 0x810000UL; | 85 | register unsigned long reg0 asm("0") = 0x810000UL; |
| 71 | unsigned long tmp1, tmp2; | 86 | unsigned long tmp1, tmp2; |
| @@ -94,8 +109,16 @@ static size_t copy_to_user_mvcos(size_t size, void __user *ptr, const void *x) | |||
| 94 | return size; | 109 | return size; |
| 95 | } | 110 | } |
| 96 | 111 | ||
| 97 | static size_t copy_in_user_mvcos(size_t size, void __user *to, | 112 | unsigned long __copy_to_user(void __user *to, const void *from, unsigned long n) |
| 98 | const void __user *from) | 113 | { |
| 114 | if (static_key_true(&have_mvcos)) | ||
| 115 | return copy_to_user_mvcos(to, from, n); | ||
| 116 | return copy_to_user_pt(to, from, n); | ||
| 117 | } | ||
| 118 | EXPORT_SYMBOL(__copy_to_user); | ||
| 119 | |||
| 120 | static inline unsigned long copy_in_user_mvcos(void __user *to, const void __user *from, | ||
| 121 | unsigned long size) | ||
| 99 | { | 122 | { |
| 100 | register unsigned long reg0 asm("0") = 0x810081UL; | 123 | register unsigned long reg0 asm("0") = 0x810081UL; |
| 101 | unsigned long tmp1, tmp2; | 124 | unsigned long tmp1, tmp2; |
| @@ -117,7 +140,15 @@ static size_t copy_in_user_mvcos(size_t size, void __user *to, | |||
| 117 | return size; | 140 | return size; |
| 118 | } | 141 | } |
| 119 | 142 | ||
| 120 | static size_t clear_user_mvcos(size_t size, void __user *to) | 143 | unsigned long __copy_in_user(void __user *to, const void __user *from, unsigned long n) |
| 144 | { | ||
| 145 | if (static_key_true(&have_mvcos)) | ||
| 146 | return copy_in_user_mvcos(to, from, n); | ||
| 147 | return copy_in_user_pt(to, from, n); | ||
| 148 | } | ||
| 149 | EXPORT_SYMBOL(__copy_in_user); | ||
| 150 | |||
| 151 | static inline unsigned long clear_user_mvcos(void __user *to, unsigned long size) | ||
| 121 | { | 152 | { |
| 122 | register unsigned long reg0 asm("0") = 0x810000UL; | 153 | register unsigned long reg0 asm("0") = 0x810000UL; |
| 123 | unsigned long tmp1, tmp2; | 154 | unsigned long tmp1, tmp2; |
| @@ -145,17 +176,26 @@ static size_t clear_user_mvcos(size_t size, void __user *to) | |||
| 145 | return size; | 176 | return size; |
| 146 | } | 177 | } |
| 147 | 178 | ||
| 148 | static size_t strnlen_user_mvcos(size_t count, const char __user *src) | 179 | unsigned long __clear_user(void __user *to, unsigned long size) |
| 149 | { | 180 | { |
| 150 | size_t done, len, offset, len_str; | 181 | if (static_key_true(&have_mvcos)) |
| 182 | return clear_user_mvcos(to, size); | ||
| 183 | return clear_user_pt(to, size); | ||
| 184 | } | ||
| 185 | EXPORT_SYMBOL(__clear_user); | ||
| 186 | |||
| 187 | static inline unsigned long strnlen_user_mvcos(const char __user *src, | ||
| 188 | unsigned long count) | ||
| 189 | { | ||
| 190 | unsigned long done, len, offset, len_str; | ||
| 151 | char buf[256]; | 191 | char buf[256]; |
| 152 | 192 | ||
| 153 | done = 0; | 193 | done = 0; |
| 154 | do { | 194 | do { |
| 155 | offset = (size_t)src & ~PAGE_MASK; | 195 | offset = (unsigned long)src & ~PAGE_MASK; |
| 156 | len = min(256UL, PAGE_SIZE - offset); | 196 | len = min(256UL, PAGE_SIZE - offset); |
| 157 | len = min(count - done, len); | 197 | len = min(count - done, len); |
| 158 | if (copy_from_user_mvcos(len, src, buf)) | 198 | if (copy_from_user_mvcos(buf, src, len)) |
| 159 | return 0; | 199 | return 0; |
| 160 | len_str = strnlen(buf, len); | 200 | len_str = strnlen(buf, len); |
| 161 | done += len_str; | 201 | done += len_str; |
| @@ -164,18 +204,26 @@ static size_t strnlen_user_mvcos(size_t count, const char __user *src) | |||
| 164 | return done + 1; | 204 | return done + 1; |
| 165 | } | 205 | } |
| 166 | 206 | ||
| 167 | static size_t strncpy_from_user_mvcos(size_t count, const char __user *src, | 207 | unsigned long __strnlen_user(const char __user *src, unsigned long count) |
| 168 | char *dst) | ||
| 169 | { | 208 | { |
| 170 | size_t done, len, offset, len_str; | 209 | if (static_key_true(&have_mvcos)) |
| 210 | return strnlen_user_mvcos(src, count); | ||
| 211 | return strnlen_user_pt(src, count); | ||
| 212 | } | ||
| 213 | EXPORT_SYMBOL(__strnlen_user); | ||
| 171 | 214 | ||
| 172 | if (unlikely(!count)) | 215 | static inline long strncpy_from_user_mvcos(char *dst, const char __user *src, |
| 216 | long count) | ||
| 217 | { | ||
| 218 | unsigned long done, len, offset, len_str; | ||
| 219 | |||
| 220 | if (unlikely(count <= 0)) | ||
| 173 | return 0; | 221 | return 0; |
| 174 | done = 0; | 222 | done = 0; |
| 175 | do { | 223 | do { |
| 176 | offset = (size_t)src & ~PAGE_MASK; | 224 | offset = (unsigned long)src & ~PAGE_MASK; |
| 177 | len = min(count - done, PAGE_SIZE - offset); | 225 | len = min(count - done, PAGE_SIZE - offset); |
| 178 | if (copy_from_user_mvcos(len, src, dst)) | 226 | if (copy_from_user_mvcos(dst, src, len)) |
| 179 | return -EFAULT; | 227 | return -EFAULT; |
| 180 | len_str = strnlen(dst, len); | 228 | len_str = strnlen(dst, len); |
| 181 | done += len_str; | 229 | done += len_str; |
| @@ -185,13 +233,31 @@ static size_t strncpy_from_user_mvcos(size_t count, const char __user *src, | |||
| 185 | return done; | 233 | return done; |
| 186 | } | 234 | } |
| 187 | 235 | ||
| 188 | struct uaccess_ops uaccess_mvcos = { | 236 | long __strncpy_from_user(char *dst, const char __user *src, long count) |
| 189 | .copy_from_user = copy_from_user_mvcos, | 237 | { |
| 190 | .copy_to_user = copy_to_user_mvcos, | 238 | if (static_key_true(&have_mvcos)) |
| 191 | .copy_in_user = copy_in_user_mvcos, | 239 | return strncpy_from_user_mvcos(dst, src, count); |
| 192 | .clear_user = clear_user_mvcos, | 240 | return strncpy_from_user_pt(dst, src, count); |
| 193 | .strnlen_user = strnlen_user_mvcos, | 241 | } |
| 194 | .strncpy_from_user = strncpy_from_user_mvcos, | 242 | EXPORT_SYMBOL(__strncpy_from_user); |
| 195 | .futex_atomic_op = futex_atomic_op_pt, | 243 | |
| 196 | .futex_atomic_cmpxchg = futex_atomic_cmpxchg_pt, | 244 | /* |
| 197 | }; | 245 | * The uaccess page tabe walk variant can be enforced with the "uaccesspt" |
| 246 | * kernel parameter. This is mainly for debugging purposes. | ||
| 247 | */ | ||
| 248 | static int force_uaccess_pt __initdata; | ||
| 249 | |||
| 250 | static int __init parse_uaccess_pt(char *__unused) | ||
| 251 | { | ||
| 252 | force_uaccess_pt = 1; | ||
| 253 | return 0; | ||
| 254 | } | ||
| 255 | early_param("uaccesspt", parse_uaccess_pt); | ||
| 256 | |||
| 257 | static int __init uaccess_init(void) | ||
| 258 | { | ||
| 259 | if (IS_ENABLED(CONFIG_32BIT) || force_uaccess_pt || !test_facility(27)) | ||
| 260 | static_key_slow_dec(&have_mvcos); | ||
| 261 | return 0; | ||
| 262 | } | ||
| 263 | early_initcall(uaccess_init); | ||
diff --git a/arch/s390/lib/uaccess_pt.c b/arch/s390/lib/uaccess_pt.c index 61ebcc9ccb34..8d39760bae68 100644 --- a/arch/s390/lib/uaccess_pt.c +++ b/arch/s390/lib/uaccess_pt.c | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | #define SLR "slgr" | 22 | #define SLR "slgr" |
| 23 | #endif | 23 | #endif |
| 24 | 24 | ||
| 25 | static size_t strnlen_kernel(size_t count, const char __user *src) | 25 | static unsigned long strnlen_kernel(const char __user *src, unsigned long count) |
| 26 | { | 26 | { |
| 27 | register unsigned long reg0 asm("0") = 0UL; | 27 | register unsigned long reg0 asm("0") = 0UL; |
| 28 | unsigned long tmp1, tmp2; | 28 | unsigned long tmp1, tmp2; |
| @@ -42,8 +42,8 @@ static size_t strnlen_kernel(size_t count, const char __user *src) | |||
| 42 | return count; | 42 | return count; |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | static size_t copy_in_kernel(size_t count, void __user *to, | 45 | static unsigned long copy_in_kernel(void __user *to, const void __user *from, |
| 46 | const void __user *from) | 46 | unsigned long count) |
| 47 | { | 47 | { |
| 48 | unsigned long tmp1; | 48 | unsigned long tmp1; |
| 49 | 49 | ||
| @@ -146,8 +146,8 @@ static unsigned long follow_table(struct mm_struct *mm, | |||
| 146 | 146 | ||
| 147 | #endif /* CONFIG_64BIT */ | 147 | #endif /* CONFIG_64BIT */ |
| 148 | 148 | ||
| 149 | static __always_inline size_t __user_copy_pt(unsigned long uaddr, void *kptr, | 149 | static inline unsigned long __user_copy_pt(unsigned long uaddr, void *kptr, |
| 150 | size_t n, int write_user) | 150 | unsigned long n, int write_user) |
| 151 | { | 151 | { |
| 152 | struct mm_struct *mm = current->mm; | 152 | struct mm_struct *mm = current->mm; |
| 153 | unsigned long offset, done, size, kaddr; | 153 | unsigned long offset, done, size, kaddr; |
| @@ -189,8 +189,7 @@ fault: | |||
| 189 | * Do DAT for user address by page table walk, return kernel address. | 189 | * Do DAT for user address by page table walk, return kernel address. |
| 190 | * This function needs to be called with current->mm->page_table_lock held. | 190 | * This function needs to be called with current->mm->page_table_lock held. |
| 191 | */ | 191 | */ |
| 192 | static __always_inline unsigned long __dat_user_addr(unsigned long uaddr, | 192 | static inline unsigned long __dat_user_addr(unsigned long uaddr, int write) |
| 193 | int write) | ||
| 194 | { | 193 | { |
| 195 | struct mm_struct *mm = current->mm; | 194 | struct mm_struct *mm = current->mm; |
| 196 | unsigned long kaddr; | 195 | unsigned long kaddr; |
| @@ -211,29 +210,29 @@ fault: | |||
| 211 | return 0; | 210 | return 0; |
| 212 | } | 211 | } |
| 213 | 212 | ||
| 214 | static size_t copy_from_user_pt(size_t n, const void __user *from, void *to) | 213 | unsigned long copy_from_user_pt(void *to, const void __user *from, unsigned long n) |
| 215 | { | 214 | { |
| 216 | size_t rc; | 215 | unsigned long rc; |
| 217 | 216 | ||
| 218 | if (segment_eq(get_fs(), KERNEL_DS)) | 217 | if (segment_eq(get_fs(), KERNEL_DS)) |
| 219 | return copy_in_kernel(n, (void __user *) to, from); | 218 | return copy_in_kernel((void __user *) to, from, n); |
| 220 | rc = __user_copy_pt((unsigned long) from, to, n, 0); | 219 | rc = __user_copy_pt((unsigned long) from, to, n, 0); |
| 221 | if (unlikely(rc)) | 220 | if (unlikely(rc)) |
| 222 | memset(to + n - rc, 0, rc); | 221 | memset(to + n - rc, 0, rc); |
| 223 | return rc; | 222 | return rc; |
| 224 | } | 223 | } |
| 225 | 224 | ||
| 226 | static size_t copy_to_user_pt(size_t n, void __user *to, const void *from) | 225 | unsigned long copy_to_user_pt(void __user *to, const void *from, unsigned long n) |
| 227 | { | 226 | { |
| 228 | if (segment_eq(get_fs(), KERNEL_DS)) | 227 | if (segment_eq(get_fs(), KERNEL_DS)) |
| 229 | return copy_in_kernel(n, to, (void __user *) from); | 228 | return copy_in_kernel(to, (void __user *) from, n); |
| 230 | return __user_copy_pt((unsigned long) to, (void *) from, n, 1); | 229 | return __user_copy_pt((unsigned long) to, (void *) from, n, 1); |
| 231 | } | 230 | } |
| 232 | 231 | ||
| 233 | static size_t clear_user_pt(size_t n, void __user *to) | 232 | unsigned long clear_user_pt(void __user *to, unsigned long n) |
| 234 | { | 233 | { |
| 235 | void *zpage = (void *) empty_zero_page; | 234 | void *zpage = (void *) empty_zero_page; |
| 236 | long done, size, ret; | 235 | unsigned long done, size, ret; |
| 237 | 236 | ||
| 238 | done = 0; | 237 | done = 0; |
| 239 | do { | 238 | do { |
| @@ -242,7 +241,7 @@ static size_t clear_user_pt(size_t n, void __user *to) | |||
| 242 | else | 241 | else |
| 243 | size = n - done; | 242 | size = n - done; |
| 244 | if (segment_eq(get_fs(), KERNEL_DS)) | 243 | if (segment_eq(get_fs(), KERNEL_DS)) |
| 245 | ret = copy_in_kernel(n, to, (void __user *) zpage); | 244 | ret = copy_in_kernel(to, (void __user *) zpage, n); |
| 246 | else | 245 | else |
| 247 | ret = __user_copy_pt((unsigned long) to, zpage, size, 1); | 246 | ret = __user_copy_pt((unsigned long) to, zpage, size, 1); |
| 248 | done += size; | 247 | done += size; |
| @@ -253,17 +252,17 @@ static size_t clear_user_pt(size_t n, void __user *to) | |||
| 253 | return 0; | 252 | return 0; |
| 254 | } | 253 | } |
| 255 | 254 | ||
| 256 | static size_t strnlen_user_pt(size_t count, const char __user *src) | 255 | unsigned long strnlen_user_pt(const char __user *src, unsigned long count) |
| 257 | { | 256 | { |
| 258 | unsigned long uaddr = (unsigned long) src; | 257 | unsigned long uaddr = (unsigned long) src; |
| 259 | struct mm_struct *mm = current->mm; | 258 | struct mm_struct *mm = current->mm; |
| 260 | unsigned long offset, done, len, kaddr; | 259 | unsigned long offset, done, len, kaddr; |
| 261 | size_t len_str; | 260 | unsigned long len_str; |
| 262 | 261 | ||
| 263 | if (unlikely(!count)) | 262 | if (unlikely(!count)) |
| 264 | return 0; | 263 | return 0; |
| 265 | if (segment_eq(get_fs(), KERNEL_DS)) | 264 | if (segment_eq(get_fs(), KERNEL_DS)) |
| 266 | return strnlen_kernel(count, src); | 265 | return strnlen_kernel(src, count); |
| 267 | if (!mm) | 266 | if (!mm) |
| 268 | return 0; | 267 | return 0; |
| 269 | done = 0; | 268 | done = 0; |
| @@ -289,19 +288,18 @@ fault: | |||
| 289 | goto retry; | 288 | goto retry; |
| 290 | } | 289 | } |
| 291 | 290 | ||
| 292 | static size_t strncpy_from_user_pt(size_t count, const char __user *src, | 291 | long strncpy_from_user_pt(char *dst, const char __user *src, long count) |
| 293 | char *dst) | ||
| 294 | { | 292 | { |
| 295 | size_t done, len, offset, len_str; | 293 | unsigned long done, len, offset, len_str; |
| 296 | 294 | ||
| 297 | if (unlikely(!count)) | 295 | if (unlikely(count <= 0)) |
| 298 | return 0; | 296 | return 0; |
| 299 | done = 0; | 297 | done = 0; |
| 300 | do { | 298 | do { |
| 301 | offset = (size_t)src & ~PAGE_MASK; | 299 | offset = (unsigned long)src & ~PAGE_MASK; |
| 302 | len = min(count - done, PAGE_SIZE - offset); | 300 | len = min(count - done, PAGE_SIZE - offset); |
| 303 | if (segment_eq(get_fs(), KERNEL_DS)) { | 301 | if (segment_eq(get_fs(), KERNEL_DS)) { |
| 304 | if (copy_in_kernel(len, (void __user *) dst, src)) | 302 | if (copy_in_kernel((void __user *) dst, src, len)) |
| 305 | return -EFAULT; | 303 | return -EFAULT; |
| 306 | } else { | 304 | } else { |
| 307 | if (__user_copy_pt((unsigned long) src, dst, len, 0)) | 305 | if (__user_copy_pt((unsigned long) src, dst, len, 0)) |
| @@ -315,8 +313,8 @@ static size_t strncpy_from_user_pt(size_t count, const char __user *src, | |||
| 315 | return done; | 313 | return done; |
| 316 | } | 314 | } |
| 317 | 315 | ||
| 318 | static size_t copy_in_user_pt(size_t n, void __user *to, | 316 | unsigned long copy_in_user_pt(void __user *to, const void __user *from, |
| 319 | const void __user *from) | 317 | unsigned long n) |
| 320 | { | 318 | { |
| 321 | struct mm_struct *mm = current->mm; | 319 | struct mm_struct *mm = current->mm; |
| 322 | unsigned long offset_max, uaddr, done, size, error_code; | 320 | unsigned long offset_max, uaddr, done, size, error_code; |
| @@ -326,7 +324,7 @@ static size_t copy_in_user_pt(size_t n, void __user *to, | |||
| 326 | int write_user; | 324 | int write_user; |
| 327 | 325 | ||
| 328 | if (segment_eq(get_fs(), KERNEL_DS)) | 326 | if (segment_eq(get_fs(), KERNEL_DS)) |
| 329 | return copy_in_kernel(n, to, from); | 327 | return copy_in_kernel(to, from, n); |
| 330 | if (!mm) | 328 | if (!mm) |
| 331 | return n; | 329 | return n; |
| 332 | done = 0; | 330 | done = 0; |
| @@ -411,7 +409,7 @@ static int __futex_atomic_op_pt(int op, u32 __user *uaddr, int oparg, int *old) | |||
| 411 | return ret; | 409 | return ret; |
| 412 | } | 410 | } |
| 413 | 411 | ||
| 414 | int futex_atomic_op_pt(int op, u32 __user *uaddr, int oparg, int *old) | 412 | int __futex_atomic_op_inuser(int op, u32 __user *uaddr, int oparg, int *old) |
| 415 | { | 413 | { |
| 416 | int ret; | 414 | int ret; |
| 417 | 415 | ||
| @@ -449,8 +447,8 @@ static int __futex_atomic_cmpxchg_pt(u32 *uval, u32 __user *uaddr, | |||
| 449 | return ret; | 447 | return ret; |
| 450 | } | 448 | } |
| 451 | 449 | ||
| 452 | int futex_atomic_cmpxchg_pt(u32 *uval, u32 __user *uaddr, | 450 | int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, |
| 453 | u32 oldval, u32 newval) | 451 | u32 oldval, u32 newval) |
| 454 | { | 452 | { |
| 455 | int ret; | 453 | int ret; |
| 456 | 454 | ||
| @@ -471,14 +469,3 @@ int futex_atomic_cmpxchg_pt(u32 *uval, u32 __user *uaddr, | |||
| 471 | put_page(virt_to_page(uaddr)); | 469 | put_page(virt_to_page(uaddr)); |
| 472 | return ret; | 470 | return ret; |
| 473 | } | 471 | } |
| 474 | |||
| 475 | struct uaccess_ops uaccess_pt = { | ||
| 476 | .copy_from_user = copy_from_user_pt, | ||
| 477 | .copy_to_user = copy_to_user_pt, | ||
| 478 | .copy_in_user = copy_in_user_pt, | ||
| 479 | .clear_user = clear_user_pt, | ||
| 480 | .strnlen_user = strnlen_user_pt, | ||
| 481 | .strncpy_from_user = strncpy_from_user_pt, | ||
| 482 | .futex_atomic_op = futex_atomic_op_pt, | ||
| 483 | .futex_atomic_cmpxchg = futex_atomic_cmpxchg_pt, | ||
| 484 | }; | ||
diff --git a/arch/s390/mm/maccess.c b/arch/s390/mm/maccess.c index d1e0e0c7a7e2..2a2e35416d2f 100644 --- a/arch/s390/mm/maccess.c +++ b/arch/s390/mm/maccess.c | |||
| @@ -128,7 +128,7 @@ void memcpy_absolute(void *dest, void *src, size_t count) | |||
| 128 | /* | 128 | /* |
| 129 | * Copy memory from kernel (real) to user (virtual) | 129 | * Copy memory from kernel (real) to user (virtual) |
| 130 | */ | 130 | */ |
| 131 | int copy_to_user_real(void __user *dest, void *src, size_t count) | 131 | int copy_to_user_real(void __user *dest, void *src, unsigned long count) |
| 132 | { | 132 | { |
| 133 | int offs = 0, size, rc; | 133 | int offs = 0, size, rc; |
| 134 | char *buf; | 134 | char *buf; |
| @@ -152,32 +152,6 @@ out: | |||
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | /* | 154 | /* |
| 155 | * Copy memory from user (virtual) to kernel (real) | ||
| 156 | */ | ||
| 157 | int copy_from_user_real(void *dest, void __user *src, size_t count) | ||
| 158 | { | ||
| 159 | int offs = 0, size, rc; | ||
| 160 | char *buf; | ||
| 161 | |||
| 162 | buf = (char *) __get_free_page(GFP_KERNEL); | ||
| 163 | if (!buf) | ||
| 164 | return -ENOMEM; | ||
| 165 | rc = -EFAULT; | ||
| 166 | while (offs < count) { | ||
| 167 | size = min(PAGE_SIZE, count - offs); | ||
| 168 | if (copy_from_user(buf, src + offs, size)) | ||
| 169 | goto out; | ||
| 170 | if (memcpy_real(dest + offs, buf, size)) | ||
| 171 | goto out; | ||
| 172 | offs += size; | ||
| 173 | } | ||
| 174 | rc = 0; | ||
| 175 | out: | ||
| 176 | free_page((unsigned long) buf); | ||
| 177 | return rc; | ||
| 178 | } | ||
| 179 | |||
| 180 | /* | ||
| 181 | * Check if physical address is within prefix or zero page | 155 | * Check if physical address is within prefix or zero page |
| 182 | */ | 156 | */ |
| 183 | static int is_swapped(unsigned long addr) | 157 | static int is_swapped(unsigned long addr) |
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c index 3584ed9b20a1..796c9320c709 100644 --- a/arch/s390/mm/pgtable.c +++ b/arch/s390/mm/pgtable.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/quicklist.h> | 17 | #include <linux/quicklist.h> |
| 18 | #include <linux/rcupdate.h> | 18 | #include <linux/rcupdate.h> |
| 19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
| 20 | #include <linux/swapops.h> | ||
| 20 | 21 | ||
| 21 | #include <asm/pgtable.h> | 22 | #include <asm/pgtable.h> |
| 22 | #include <asm/pgalloc.h> | 23 | #include <asm/pgalloc.h> |
| @@ -594,6 +595,82 @@ unsigned long gmap_fault(unsigned long address, struct gmap *gmap) | |||
| 594 | } | 595 | } |
| 595 | EXPORT_SYMBOL_GPL(gmap_fault); | 596 | EXPORT_SYMBOL_GPL(gmap_fault); |
| 596 | 597 | ||
| 598 | static void gmap_zap_swap_entry(swp_entry_t entry, struct mm_struct *mm) | ||
| 599 | { | ||
| 600 | if (!non_swap_entry(entry)) | ||
| 601 | dec_mm_counter(mm, MM_SWAPENTS); | ||
| 602 | else if (is_migration_entry(entry)) { | ||
| 603 | struct page *page = migration_entry_to_page(entry); | ||
| 604 | |||
| 605 | if (PageAnon(page)) | ||
| 606 | dec_mm_counter(mm, MM_ANONPAGES); | ||
| 607 | else | ||
| 608 | dec_mm_counter(mm, MM_FILEPAGES); | ||
| 609 | } | ||
| 610 | free_swap_and_cache(entry); | ||
| 611 | } | ||
| 612 | |||
| 613 | /** | ||
| 614 | * The mm->mmap_sem lock must be held | ||
| 615 | */ | ||
| 616 | static void gmap_zap_unused(struct mm_struct *mm, unsigned long address) | ||
| 617 | { | ||
| 618 | unsigned long ptev, pgstev; | ||
| 619 | spinlock_t *ptl; | ||
| 620 | pgste_t pgste; | ||
| 621 | pte_t *ptep, pte; | ||
| 622 | |||
| 623 | ptep = get_locked_pte(mm, address, &ptl); | ||
| 624 | if (unlikely(!ptep)) | ||
| 625 | return; | ||
| 626 | pte = *ptep; | ||
| 627 | if (!pte_swap(pte)) | ||
| 628 | goto out_pte; | ||
| 629 | /* Zap unused and logically-zero pages */ | ||
| 630 | pgste = pgste_get_lock(ptep); | ||
| 631 | pgstev = pgste_val(pgste); | ||
| 632 | ptev = pte_val(pte); | ||
| 633 | if (((pgstev & _PGSTE_GPS_USAGE_MASK) == _PGSTE_GPS_USAGE_UNUSED) || | ||
| 634 | ((pgstev & _PGSTE_GPS_ZERO) && (ptev & _PAGE_INVALID))) { | ||
| 635 | gmap_zap_swap_entry(pte_to_swp_entry(pte), mm); | ||
| 636 | pte_clear(mm, address, ptep); | ||
| 637 | } | ||
| 638 | pgste_set_unlock(ptep, pgste); | ||
| 639 | out_pte: | ||
| 640 | pte_unmap_unlock(*ptep, ptl); | ||
| 641 | } | ||
| 642 | |||
| 643 | /* | ||
| 644 | * this function is assumed to be called with mmap_sem held | ||
| 645 | */ | ||
| 646 | void __gmap_zap(unsigned long address, struct gmap *gmap) | ||
| 647 | { | ||
| 648 | unsigned long *table, *segment_ptr; | ||
| 649 | unsigned long segment, pgstev, ptev; | ||
| 650 | struct gmap_pgtable *mp; | ||
| 651 | struct page *page; | ||
| 652 | |||
| 653 | segment_ptr = gmap_table_walk(address, gmap); | ||
| 654 | if (IS_ERR(segment_ptr)) | ||
| 655 | return; | ||
| 656 | segment = *segment_ptr; | ||
| 657 | if (segment & _SEGMENT_ENTRY_INVALID) | ||
| 658 | return; | ||
| 659 | page = pfn_to_page(segment >> PAGE_SHIFT); | ||
| 660 | mp = (struct gmap_pgtable *) page->index; | ||
| 661 | address = mp->vmaddr | (address & ~PMD_MASK); | ||
| 662 | /* Page table is present */ | ||
| 663 | table = (unsigned long *)(segment & _SEGMENT_ENTRY_ORIGIN); | ||
| 664 | table = table + ((address >> 12) & 0xff); | ||
| 665 | pgstev = table[PTRS_PER_PTE]; | ||
| 666 | ptev = table[0]; | ||
| 667 | /* quick check, checked again with locks held */ | ||
| 668 | if (((pgstev & _PGSTE_GPS_USAGE_MASK) == _PGSTE_GPS_USAGE_UNUSED) || | ||
| 669 | ((pgstev & _PGSTE_GPS_ZERO) && (ptev & _PAGE_INVALID))) | ||
| 670 | gmap_zap_unused(gmap->mm, address); | ||
| 671 | } | ||
| 672 | EXPORT_SYMBOL_GPL(__gmap_zap); | ||
| 673 | |||
| 597 | void gmap_discard(unsigned long from, unsigned long to, struct gmap *gmap) | 674 | void gmap_discard(unsigned long from, unsigned long to, struct gmap *gmap) |
| 598 | { | 675 | { |
| 599 | 676 | ||
| @@ -671,7 +748,7 @@ EXPORT_SYMBOL_GPL(gmap_unregister_ipte_notifier); | |||
| 671 | /** | 748 | /** |
| 672 | * gmap_ipte_notify - mark a range of ptes for invalidation notification | 749 | * gmap_ipte_notify - mark a range of ptes for invalidation notification |
| 673 | * @gmap: pointer to guest mapping meta data structure | 750 | * @gmap: pointer to guest mapping meta data structure |
| 674 | * @address: virtual address in the guest address space | 751 | * @start: virtual address in the guest address space |
| 675 | * @len: size of area | 752 | * @len: size of area |
| 676 | * | 753 | * |
| 677 | * Returns 0 if for each page in the given range a gmap mapping exists and | 754 | * Returns 0 if for each page in the given range a gmap mapping exists and |
| @@ -725,13 +802,12 @@ EXPORT_SYMBOL_GPL(gmap_ipte_notify); | |||
| 725 | /** | 802 | /** |
| 726 | * gmap_do_ipte_notify - call all invalidation callbacks for a specific pte. | 803 | * gmap_do_ipte_notify - call all invalidation callbacks for a specific pte. |
| 727 | * @mm: pointer to the process mm_struct | 804 | * @mm: pointer to the process mm_struct |
| 728 | * @addr: virtual address in the process address space | ||
| 729 | * @pte: pointer to the page table entry | 805 | * @pte: pointer to the page table entry |
| 730 | * | 806 | * |
| 731 | * This function is assumed to be called with the page table lock held | 807 | * This function is assumed to be called with the page table lock held |
| 732 | * for the pte to notify. | 808 | * for the pte to notify. |
| 733 | */ | 809 | */ |
| 734 | void gmap_do_ipte_notify(struct mm_struct *mm, unsigned long addr, pte_t *pte) | 810 | void gmap_do_ipte_notify(struct mm_struct *mm, pte_t *pte) |
| 735 | { | 811 | { |
| 736 | unsigned long segment_offset; | 812 | unsigned long segment_offset; |
| 737 | struct gmap_notifier *nb; | 813 | struct gmap_notifier *nb; |
| @@ -802,6 +878,78 @@ static inline void page_table_free_pgste(unsigned long *table) | |||
| 802 | __free_page(page); | 878 | __free_page(page); |
| 803 | } | 879 | } |
| 804 | 880 | ||
| 881 | static inline unsigned long page_table_reset_pte(struct mm_struct *mm, | ||
| 882 | pmd_t *pmd, unsigned long addr, unsigned long end) | ||
| 883 | { | ||
| 884 | pte_t *start_pte, *pte; | ||
| 885 | spinlock_t *ptl; | ||
| 886 | pgste_t pgste; | ||
| 887 | |||
| 888 | start_pte = pte_offset_map_lock(mm, pmd, addr, &ptl); | ||
| 889 | pte = start_pte; | ||
| 890 | do { | ||
| 891 | pgste = pgste_get_lock(pte); | ||
| 892 | pgste_val(pgste) &= ~_PGSTE_GPS_USAGE_MASK; | ||
| 893 | pgste_set_unlock(pte, pgste); | ||
| 894 | } while (pte++, addr += PAGE_SIZE, addr != end); | ||
| 895 | pte_unmap_unlock(start_pte, ptl); | ||
| 896 | |||
| 897 | return addr; | ||
| 898 | } | ||
| 899 | |||
| 900 | static inline unsigned long page_table_reset_pmd(struct mm_struct *mm, | ||
| 901 | pud_t *pud, unsigned long addr, unsigned long end) | ||
| 902 | { | ||
| 903 | unsigned long next; | ||
| 904 | pmd_t *pmd; | ||
| 905 | |||
| 906 | pmd = pmd_offset(pud, addr); | ||
| 907 | do { | ||
| 908 | next = pmd_addr_end(addr, end); | ||
| 909 | if (pmd_none_or_clear_bad(pmd)) | ||
| 910 | continue; | ||
| 911 | next = page_table_reset_pte(mm, pmd, addr, next); | ||
| 912 | } while (pmd++, addr = next, addr != end); | ||
| 913 | |||
| 914 | return addr; | ||
| 915 | } | ||
| 916 | |||
| 917 | static inline unsigned long page_table_reset_pud(struct mm_struct *mm, | ||
| 918 | pgd_t *pgd, unsigned long addr, unsigned long end) | ||
| 919 | { | ||
| 920 | unsigned long next; | ||
| 921 | pud_t *pud; | ||
| 922 | |||
| 923 | pud = pud_offset(pgd, addr); | ||
| 924 | do { | ||
| 925 | next = pud_addr_end(addr, end); | ||
| 926 | if (pud_none_or_clear_bad(pud)) | ||
| 927 | continue; | ||
| 928 | next = page_table_reset_pmd(mm, pud, addr, next); | ||
| 929 | } while (pud++, addr = next, addr != end); | ||
| 930 | |||
| 931 | return addr; | ||
| 932 | } | ||
| 933 | |||
| 934 | void page_table_reset_pgste(struct mm_struct *mm, | ||
| 935 | unsigned long start, unsigned long end) | ||
| 936 | { | ||
| 937 | unsigned long addr, next; | ||
| 938 | pgd_t *pgd; | ||
| 939 | |||
| 940 | addr = start; | ||
| 941 | down_read(&mm->mmap_sem); | ||
| 942 | pgd = pgd_offset(mm, addr); | ||
| 943 | do { | ||
| 944 | next = pgd_addr_end(addr, end); | ||
| 945 | if (pgd_none_or_clear_bad(pgd)) | ||
| 946 | continue; | ||
| 947 | next = page_table_reset_pud(mm, pgd, addr, next); | ||
| 948 | } while (pgd++, addr = next, addr != end); | ||
| 949 | up_read(&mm->mmap_sem); | ||
| 950 | } | ||
| 951 | EXPORT_SYMBOL(page_table_reset_pgste); | ||
| 952 | |||
| 805 | int set_guest_storage_key(struct mm_struct *mm, unsigned long addr, | 953 | int set_guest_storage_key(struct mm_struct *mm, unsigned long addr, |
| 806 | unsigned long key, bool nq) | 954 | unsigned long key, bool nq) |
| 807 | { | 955 | { |
| @@ -1248,7 +1396,7 @@ void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp, | |||
| 1248 | { | 1396 | { |
| 1249 | struct list_head *lh = (struct list_head *) pgtable; | 1397 | struct list_head *lh = (struct list_head *) pgtable; |
| 1250 | 1398 | ||
| 1251 | assert_spin_locked(&mm->page_table_lock); | 1399 | assert_spin_locked(pmd_lockptr(mm, pmdp)); |
| 1252 | 1400 | ||
| 1253 | /* FIFO */ | 1401 | /* FIFO */ |
| 1254 | if (!pmd_huge_pte(mm, pmdp)) | 1402 | if (!pmd_huge_pte(mm, pmdp)) |
| @@ -1264,7 +1412,7 @@ pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp) | |||
| 1264 | pgtable_t pgtable; | 1412 | pgtable_t pgtable; |
| 1265 | pte_t *ptep; | 1413 | pte_t *ptep; |
| 1266 | 1414 | ||
| 1267 | assert_spin_locked(&mm->page_table_lock); | 1415 | assert_spin_locked(pmd_lockptr(mm, pmdp)); |
| 1268 | 1416 | ||
| 1269 | /* FIFO */ | 1417 | /* FIFO */ |
| 1270 | pgtable = pmd_huge_pte(mm, pmdp); | 1418 | pgtable = pmd_huge_pte(mm, pmdp); |
diff --git a/arch/s390/pci/pci_debug.c b/arch/s390/pci/pci_debug.c index 75c69b402e05..c5c66840ac00 100644 --- a/arch/s390/pci/pci_debug.c +++ b/arch/s390/pci/pci_debug.c | |||
| @@ -139,7 +139,7 @@ void zpci_debug_exit_device(struct zpci_dev *zdev) | |||
| 139 | int __init zpci_debug_init(void) | 139 | int __init zpci_debug_init(void) |
| 140 | { | 140 | { |
| 141 | /* event trace buffer */ | 141 | /* event trace buffer */ |
| 142 | pci_debug_msg_id = debug_register("pci_msg", 16, 1, 16 * sizeof(long)); | 142 | pci_debug_msg_id = debug_register("pci_msg", 8, 1, 8 * sizeof(long)); |
| 143 | if (!pci_debug_msg_id) | 143 | if (!pci_debug_msg_id) |
| 144 | return -EINVAL; | 144 | return -EINVAL; |
| 145 | debug_register_view(pci_debug_msg_id, &debug_sprintf_view); | 145 | debug_register_view(pci_debug_msg_id, &debug_sprintf_view); |
diff --git a/arch/s390/pci/pci_dma.c b/arch/s390/pci/pci_dma.c index 60c11a629d96..f91c03119804 100644 --- a/arch/s390/pci/pci_dma.c +++ b/arch/s390/pci/pci_dma.c | |||
| @@ -206,11 +206,13 @@ static void dma_cleanup_tables(struct zpci_dev *zdev) | |||
| 206 | zdev->dma_table = NULL; | 206 | zdev->dma_table = NULL; |
| 207 | } | 207 | } |
| 208 | 208 | ||
| 209 | static unsigned long __dma_alloc_iommu(struct zpci_dev *zdev, unsigned long start, | 209 | static unsigned long __dma_alloc_iommu(struct zpci_dev *zdev, |
| 210 | int size) | 210 | unsigned long start, int size) |
| 211 | { | 211 | { |
| 212 | unsigned long boundary_size = 0x1000000; | 212 | unsigned long boundary_size; |
| 213 | 213 | ||
| 214 | boundary_size = ALIGN(dma_get_seg_boundary(&zdev->pdev->dev) + 1, | ||
| 215 | PAGE_SIZE) >> PAGE_SHIFT; | ||
| 214 | return iommu_area_alloc(zdev->iommu_bitmap, zdev->iommu_pages, | 216 | return iommu_area_alloc(zdev->iommu_bitmap, zdev->iommu_pages, |
| 215 | start, size, 0, boundary_size, 0); | 217 | start, size, 0, boundary_size, 0); |
| 216 | } | 218 | } |
diff --git a/arch/score/include/asm/Kbuild b/arch/score/include/asm/Kbuild index 146b9d5e89f8..2f947aba4bd4 100644 --- a/arch/score/include/asm/Kbuild +++ b/arch/score/include/asm/Kbuild | |||
| @@ -1,10 +1,12 @@ | |||
| 1 | 1 | ||
| 2 | header-y += | 2 | header-y += |
| 3 | 3 | ||
| 4 | |||
| 4 | generic-y += barrier.h | 5 | generic-y += barrier.h |
| 5 | generic-y += clkdev.h | 6 | generic-y += clkdev.h |
| 7 | generic-y += cputime.h | ||
| 6 | generic-y += hash.h | 8 | generic-y += hash.h |
| 9 | generic-y += mcs_spinlock.h | ||
| 10 | generic-y += preempt.h | ||
| 7 | generic-y += trace_clock.h | 11 | generic-y += trace_clock.h |
| 8 | generic-y += xor.h | 12 | generic-y += xor.h |
| 9 | generic-y += preempt.h | ||
| 10 | |||
diff --git a/arch/score/include/asm/cputime.h b/arch/score/include/asm/cputime.h deleted file mode 100644 index 1fced99f0d67..000000000000 --- a/arch/score/include/asm/cputime.h +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | #ifndef _ASM_SCORE_CPUTIME_H | ||
| 2 | #define _ASM_SCORE_CPUTIME_H | ||
| 3 | |||
| 4 | #include <asm-generic/cputime.h> | ||
| 5 | |||
| 6 | #endif /* _ASM_SCORE_CPUTIME_H */ | ||
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 6357710753d5..364d204298fa 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
| @@ -123,15 +123,6 @@ config SYS_SUPPORTS_NUMA | |||
| 123 | config SYS_SUPPORTS_PCI | 123 | config SYS_SUPPORTS_PCI |
| 124 | bool | 124 | bool |
| 125 | 125 | ||
| 126 | config SYS_SUPPORTS_CMT | ||
| 127 | bool | ||
| 128 | |||
| 129 | config SYS_SUPPORTS_MTU2 | ||
| 130 | bool | ||
| 131 | |||
| 132 | config SYS_SUPPORTS_TMU | ||
| 133 | bool | ||
| 134 | |||
| 135 | config STACKTRACE_SUPPORT | 126 | config STACKTRACE_SUPPORT |
| 136 | def_bool y | 127 | def_bool y |
| 137 | 128 | ||
| @@ -191,14 +182,14 @@ config CPU_SH3 | |||
| 191 | bool | 182 | bool |
| 192 | select CPU_HAS_INTEVT | 183 | select CPU_HAS_INTEVT |
| 193 | select CPU_HAS_SR_RB | 184 | select CPU_HAS_SR_RB |
| 194 | select SYS_SUPPORTS_TMU | 185 | select SYS_SUPPORTS_SH_TMU |
| 195 | 186 | ||
| 196 | config CPU_SH4 | 187 | config CPU_SH4 |
| 197 | bool | 188 | bool |
| 198 | select CPU_HAS_INTEVT | 189 | select CPU_HAS_INTEVT |
| 199 | select CPU_HAS_SR_RB | 190 | select CPU_HAS_SR_RB |
| 200 | select CPU_HAS_FPU if !CPU_SH4AL_DSP | 191 | select CPU_HAS_FPU if !CPU_SH4AL_DSP |
| 201 | select SYS_SUPPORTS_TMU | 192 | select SYS_SUPPORTS_SH_TMU |
| 202 | select SYS_SUPPORTS_HUGETLBFS if MMU | 193 | select SYS_SUPPORTS_HUGETLBFS if MMU |
| 203 | 194 | ||
| 204 | config CPU_SH4A | 195 | config CPU_SH4A |
| @@ -213,7 +204,7 @@ config CPU_SH4AL_DSP | |||
| 213 | config CPU_SH5 | 204 | config CPU_SH5 |
| 214 | bool | 205 | bool |
| 215 | select CPU_HAS_FPU | 206 | select CPU_HAS_FPU |
| 216 | select SYS_SUPPORTS_TMU | 207 | select SYS_SUPPORTS_SH_TMU |
| 217 | select SYS_SUPPORTS_HUGETLBFS if MMU | 208 | select SYS_SUPPORTS_HUGETLBFS if MMU |
| 218 | 209 | ||
| 219 | config CPU_SHX2 | 210 | config CPU_SHX2 |
| @@ -250,7 +241,7 @@ choice | |||
| 250 | config CPU_SUBTYPE_SH7619 | 241 | config CPU_SUBTYPE_SH7619 |
| 251 | bool "Support SH7619 processor" | 242 | bool "Support SH7619 processor" |
| 252 | select CPU_SH2 | 243 | select CPU_SH2 |
| 253 | select SYS_SUPPORTS_CMT | 244 | select SYS_SUPPORTS_SH_CMT |
| 254 | 245 | ||
| 255 | # SH-2A Processor Support | 246 | # SH-2A Processor Support |
| 256 | 247 | ||
| @@ -258,50 +249,50 @@ config CPU_SUBTYPE_SH7201 | |||
| 258 | bool "Support SH7201 processor" | 249 | bool "Support SH7201 processor" |
| 259 | select CPU_SH2A | 250 | select CPU_SH2A |
| 260 | select CPU_HAS_FPU | 251 | select CPU_HAS_FPU |
| 261 | select SYS_SUPPORTS_MTU2 | 252 | select SYS_SUPPORTS_SH_MTU2 |
| 262 | 253 | ||
| 263 | config CPU_SUBTYPE_SH7203 | 254 | config CPU_SUBTYPE_SH7203 |
| 264 | bool "Support SH7203 processor" | 255 | bool "Support SH7203 processor" |
| 265 | select CPU_SH2A | 256 | select CPU_SH2A |
| 266 | select CPU_HAS_FPU | 257 | select CPU_HAS_FPU |
| 267 | select SYS_SUPPORTS_CMT | 258 | select SYS_SUPPORTS_SH_CMT |
| 268 | select SYS_SUPPORTS_MTU2 | 259 | select SYS_SUPPORTS_SH_MTU2 |
| 269 | select ARCH_WANT_OPTIONAL_GPIOLIB | 260 | select ARCH_WANT_OPTIONAL_GPIOLIB |
| 270 | select PINCTRL | 261 | select PINCTRL |
| 271 | 262 | ||
| 272 | config CPU_SUBTYPE_SH7206 | 263 | config CPU_SUBTYPE_SH7206 |
| 273 | bool "Support SH7206 processor" | 264 | bool "Support SH7206 processor" |
| 274 | select CPU_SH2A | 265 | select CPU_SH2A |
| 275 | select SYS_SUPPORTS_CMT | 266 | select SYS_SUPPORTS_SH_CMT |
| 276 | select SYS_SUPPORTS_MTU2 | 267 | select SYS_SUPPORTS_SH_MTU2 |
| 277 | 268 | ||
| 278 | config CPU_SUBTYPE_SH7263 | 269 | config CPU_SUBTYPE_SH7263 |
| 279 | bool "Support SH7263 processor" | 270 | bool "Support SH7263 processor" |
| 280 | select CPU_SH2A | 271 | select CPU_SH2A |
| 281 | select CPU_HAS_FPU | 272 | select CPU_HAS_FPU |
| 282 | select SYS_SUPPORTS_CMT | 273 | select SYS_SUPPORTS_SH_CMT |
| 283 | select SYS_SUPPORTS_MTU2 | 274 | select SYS_SUPPORTS_SH_MTU2 |
| 284 | 275 | ||
| 285 | config CPU_SUBTYPE_SH7264 | 276 | config CPU_SUBTYPE_SH7264 |
| 286 | bool "Support SH7264 processor" | 277 | bool "Support SH7264 processor" |
| 287 | select CPU_SH2A | 278 | select CPU_SH2A |
| 288 | select CPU_HAS_FPU | 279 | select CPU_HAS_FPU |
| 289 | select SYS_SUPPORTS_CMT | 280 | select SYS_SUPPORTS_SH_CMT |
| 290 | select SYS_SUPPORTS_MTU2 | 281 | select SYS_SUPPORTS_SH_MTU2 |
| 291 | select PINCTRL | 282 | select PINCTRL |
| 292 | 283 | ||
| 293 | config CPU_SUBTYPE_SH7269 | 284 | config CPU_SUBTYPE_SH7269 |
| 294 | bool "Support SH7269 processor" | 285 | bool "Support SH7269 processor" |
| 295 | select CPU_SH2A | 286 | select CPU_SH2A |
| 296 | select CPU_HAS_FPU | 287 | select CPU_HAS_FPU |
| 297 | select SYS_SUPPORTS_CMT | 288 | select SYS_SUPPORTS_SH_CMT |
| 298 | select SYS_SUPPORTS_MTU2 | 289 | select SYS_SUPPORTS_SH_MTU2 |
| 299 | select PINCTRL | 290 | select PINCTRL |
| 300 | 291 | ||
| 301 | config CPU_SUBTYPE_MXG | 292 | config CPU_SUBTYPE_MXG |
| 302 | bool "Support MX-G processor" | 293 | bool "Support MX-G processor" |
| 303 | select CPU_SH2A | 294 | select CPU_SH2A |
| 304 | select SYS_SUPPORTS_MTU2 | 295 | select SYS_SUPPORTS_SH_MTU2 |
| 305 | help | 296 | help |
| 306 | Select MX-G if running on an R8A03022BG part. | 297 | Select MX-G if running on an R8A03022BG part. |
| 307 | 298 | ||
| @@ -354,7 +345,7 @@ config CPU_SUBTYPE_SH7720 | |||
| 354 | bool "Support SH7720 processor" | 345 | bool "Support SH7720 processor" |
| 355 | select CPU_SH3 | 346 | select CPU_SH3 |
| 356 | select CPU_HAS_DSP | 347 | select CPU_HAS_DSP |
| 357 | select SYS_SUPPORTS_CMT | 348 | select SYS_SUPPORTS_SH_CMT |
| 358 | select ARCH_WANT_OPTIONAL_GPIOLIB | 349 | select ARCH_WANT_OPTIONAL_GPIOLIB |
| 359 | select USB_ARCH_HAS_OHCI | 350 | select USB_ARCH_HAS_OHCI |
| 360 | select USB_OHCI_SH if USB_OHCI_HCD | 351 | select USB_OHCI_SH if USB_OHCI_HCD |
| @@ -366,7 +357,7 @@ config CPU_SUBTYPE_SH7721 | |||
| 366 | bool "Support SH7721 processor" | 357 | bool "Support SH7721 processor" |
| 367 | select CPU_SH3 | 358 | select CPU_SH3 |
| 368 | select CPU_HAS_DSP | 359 | select CPU_HAS_DSP |
| 369 | select SYS_SUPPORTS_CMT | 360 | select SYS_SUPPORTS_SH_CMT |
| 370 | select USB_ARCH_HAS_OHCI | 361 | select USB_ARCH_HAS_OHCI |
| 371 | select USB_OHCI_SH if USB_OHCI_HCD | 362 | select USB_OHCI_SH if USB_OHCI_HCD |
| 372 | help | 363 | help |
| @@ -422,7 +413,7 @@ config CPU_SUBTYPE_SH7723 | |||
| 422 | select CPU_SHX2 | 413 | select CPU_SHX2 |
| 423 | select ARCH_SHMOBILE | 414 | select ARCH_SHMOBILE |
| 424 | select ARCH_SPARSEMEM_ENABLE | 415 | select ARCH_SPARSEMEM_ENABLE |
| 425 | select SYS_SUPPORTS_CMT | 416 | select SYS_SUPPORTS_SH_CMT |
| 426 | select ARCH_WANT_OPTIONAL_GPIOLIB | 417 | select ARCH_WANT_OPTIONAL_GPIOLIB |
| 427 | select PINCTRL | 418 | select PINCTRL |
| 428 | help | 419 | help |
| @@ -434,7 +425,7 @@ config CPU_SUBTYPE_SH7724 | |||
| 434 | select CPU_SHX2 | 425 | select CPU_SHX2 |
| 435 | select ARCH_SHMOBILE | 426 | select ARCH_SHMOBILE |
| 436 | select ARCH_SPARSEMEM_ENABLE | 427 | select ARCH_SPARSEMEM_ENABLE |
| 437 | select SYS_SUPPORTS_CMT | 428 | select SYS_SUPPORTS_SH_CMT |
| 438 | select ARCH_WANT_OPTIONAL_GPIOLIB | 429 | select ARCH_WANT_OPTIONAL_GPIOLIB |
| 439 | select PINCTRL | 430 | select PINCTRL |
| 440 | help | 431 | help |
| @@ -514,7 +505,7 @@ config CPU_SUBTYPE_SH7343 | |||
| 514 | bool "Support SH7343 processor" | 505 | bool "Support SH7343 processor" |
| 515 | select CPU_SH4AL_DSP | 506 | select CPU_SH4AL_DSP |
| 516 | select ARCH_SHMOBILE | 507 | select ARCH_SHMOBILE |
| 517 | select SYS_SUPPORTS_CMT | 508 | select SYS_SUPPORTS_SH_CMT |
| 518 | 509 | ||
| 519 | config CPU_SUBTYPE_SH7722 | 510 | config CPU_SUBTYPE_SH7722 |
| 520 | bool "Support SH7722 processor" | 511 | bool "Support SH7722 processor" |
| @@ -523,7 +514,7 @@ config CPU_SUBTYPE_SH7722 | |||
| 523 | select ARCH_SHMOBILE | 514 | select ARCH_SHMOBILE |
| 524 | select ARCH_SPARSEMEM_ENABLE | 515 | select ARCH_SPARSEMEM_ENABLE |
| 525 | select SYS_SUPPORTS_NUMA | 516 | select SYS_SUPPORTS_NUMA |
| 526 | select SYS_SUPPORTS_CMT | 517 | select SYS_SUPPORTS_SH_CMT |
| 527 | select ARCH_WANT_OPTIONAL_GPIOLIB | 518 | select ARCH_WANT_OPTIONAL_GPIOLIB |
| 528 | select PINCTRL | 519 | select PINCTRL |
| 529 | 520 | ||
| @@ -534,7 +525,7 @@ config CPU_SUBTYPE_SH7366 | |||
| 534 | select ARCH_SHMOBILE | 525 | select ARCH_SHMOBILE |
| 535 | select ARCH_SPARSEMEM_ENABLE | 526 | select ARCH_SPARSEMEM_ENABLE |
| 536 | select SYS_SUPPORTS_NUMA | 527 | select SYS_SUPPORTS_NUMA |
| 537 | select SYS_SUPPORTS_CMT | 528 | select SYS_SUPPORTS_SH_CMT |
| 538 | 529 | ||
| 539 | endchoice | 530 | endchoice |
| 540 | 531 | ||
| @@ -567,27 +558,6 @@ source "arch/sh/boards/Kconfig" | |||
| 567 | 558 | ||
| 568 | menu "Timer and clock configuration" | 559 | menu "Timer and clock configuration" |
| 569 | 560 | ||
| 570 | config SH_TIMER_TMU | ||
| 571 | bool "TMU timer driver" | ||
| 572 | depends on SYS_SUPPORTS_TMU | ||
| 573 | default y | ||
| 574 | help | ||
| 575 | This enables the build of the TMU timer driver. | ||
| 576 | |||
| 577 | config SH_TIMER_CMT | ||
| 578 | bool "CMT timer driver" | ||
| 579 | depends on SYS_SUPPORTS_CMT | ||
| 580 | default y | ||
| 581 | help | ||
| 582 | This enables build of the CMT timer driver. | ||
| 583 | |||
| 584 | config SH_TIMER_MTU2 | ||
| 585 | bool "MTU2 timer driver" | ||
| 586 | depends on SYS_SUPPORTS_MTU2 | ||
| 587 | default y | ||
| 588 | help | ||
| 589 | This enables build of the MTU2 timer driver. | ||
| 590 | |||
| 591 | config SH_PCLK_FREQ | 561 | config SH_PCLK_FREQ |
| 592 | int "Peripheral clock frequency (in Hz)" | 562 | int "Peripheral clock frequency (in Hz)" |
| 593 | depends on SH_CLK_CPG_LEGACY | 563 | depends on SH_CLK_CPG_LEGACY |
diff --git a/arch/sh/include/asm/Kbuild b/arch/sh/include/asm/Kbuild index 0cd7198a4524..c19e47dacb31 100644 --- a/arch/sh/include/asm/Kbuild +++ b/arch/sh/include/asm/Kbuild | |||
| @@ -8,18 +8,21 @@ generic-y += emergency-restart.h | |||
| 8 | generic-y += errno.h | 8 | generic-y += errno.h |
| 9 | generic-y += exec.h | 9 | generic-y += exec.h |
| 10 | generic-y += fcntl.h | 10 | generic-y += fcntl.h |
| 11 | generic-y += hash.h | ||
| 11 | generic-y += ioctl.h | 12 | generic-y += ioctl.h |
| 12 | generic-y += ipcbuf.h | 13 | generic-y += ipcbuf.h |
| 13 | generic-y += irq_regs.h | 14 | generic-y += irq_regs.h |
| 14 | generic-y += kvm_para.h | 15 | generic-y += kvm_para.h |
| 15 | generic-y += local.h | 16 | generic-y += local.h |
| 16 | generic-y += local64.h | 17 | generic-y += local64.h |
| 18 | generic-y += mcs_spinlock.h | ||
| 19 | generic-y += mman.h | ||
| 20 | generic-y += msgbuf.h | ||
| 17 | generic-y += param.h | 21 | generic-y += param.h |
| 18 | generic-y += parport.h | 22 | generic-y += parport.h |
| 19 | generic-y += percpu.h | 23 | generic-y += percpu.h |
| 20 | generic-y += poll.h | 24 | generic-y += poll.h |
| 21 | generic-y += mman.h | 25 | generic-y += preempt.h |
| 22 | generic-y += msgbuf.h | ||
| 23 | generic-y += resource.h | 26 | generic-y += resource.h |
| 24 | generic-y += scatterlist.h | 27 | generic-y += scatterlist.h |
| 25 | generic-y += sembuf.h | 28 | generic-y += sembuf.h |
| @@ -34,5 +37,3 @@ generic-y += termios.h | |||
| 34 | generic-y += trace_clock.h | 37 | generic-y += trace_clock.h |
| 35 | generic-y += ucontext.h | 38 | generic-y += ucontext.h |
| 36 | generic-y += xor.h | 39 | generic-y += xor.h |
| 37 | generic-y += preempt.h | ||
| 38 | generic-y += hash.h | ||
diff --git a/arch/sh/include/cpu-sh2/cpu/cache.h b/arch/sh/include/cpu-sh2/cpu/cache.h index 673515bc4135..aa1b2b9088a7 100644 --- a/arch/sh/include/cpu-sh2/cpu/cache.h +++ b/arch/sh/include/cpu-sh2/cpu/cache.h | |||
| @@ -18,7 +18,7 @@ | |||
| 18 | #define SH_CACHE_ASSOC 8 | 18 | #define SH_CACHE_ASSOC 8 |
| 19 | 19 | ||
| 20 | #if defined(CONFIG_CPU_SUBTYPE_SH7619) | 20 | #if defined(CONFIG_CPU_SUBTYPE_SH7619) |
| 21 | #define CCR 0xffffffec | 21 | #define SH_CCR 0xffffffec |
| 22 | 22 | ||
| 23 | #define CCR_CACHE_CE 0x01 /* Cache enable */ | 23 | #define CCR_CACHE_CE 0x01 /* Cache enable */ |
| 24 | #define CCR_CACHE_WT 0x02 /* CCR[bit1=1,bit2=1] */ | 24 | #define CCR_CACHE_WT 0x02 /* CCR[bit1=1,bit2=1] */ |
diff --git a/arch/sh/include/cpu-sh2a/cpu/cache.h b/arch/sh/include/cpu-sh2a/cpu/cache.h index defb0baa5a06..b27ce92cb600 100644 --- a/arch/sh/include/cpu-sh2a/cpu/cache.h +++ b/arch/sh/include/cpu-sh2a/cpu/cache.h | |||
| @@ -17,8 +17,8 @@ | |||
| 17 | #define SH_CACHE_COMBINED 4 | 17 | #define SH_CACHE_COMBINED 4 |
| 18 | #define SH_CACHE_ASSOC 8 | 18 | #define SH_CACHE_ASSOC 8 |
| 19 | 19 | ||
| 20 | #define CCR 0xfffc1000 /* CCR1 */ | 20 | #define SH_CCR 0xfffc1000 /* CCR1 */ |
| 21 | #define CCR2 0xfffc1004 | 21 | #define SH_CCR2 0xfffc1004 |
| 22 | 22 | ||
| 23 | /* | 23 | /* |
| 24 | * Most of the SH-2A CCR1 definitions resemble the SH-4 ones. All others not | 24 | * Most of the SH-2A CCR1 definitions resemble the SH-4 ones. All others not |
diff --git a/arch/sh/include/cpu-sh3/cpu/cache.h b/arch/sh/include/cpu-sh3/cpu/cache.h index bee2d81c56bf..29700fd88c75 100644 --- a/arch/sh/include/cpu-sh3/cpu/cache.h +++ b/arch/sh/include/cpu-sh3/cpu/cache.h | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | #define SH_CACHE_COMBINED 4 | 17 | #define SH_CACHE_COMBINED 4 |
| 18 | #define SH_CACHE_ASSOC 8 | 18 | #define SH_CACHE_ASSOC 8 |
| 19 | 19 | ||
| 20 | #define CCR 0xffffffec /* Address of Cache Control Register */ | 20 | #define SH_CCR 0xffffffec /* Address of Cache Control Register */ |
| 21 | 21 | ||
| 22 | #define CCR_CACHE_CE 0x01 /* Cache Enable */ | 22 | #define CCR_CACHE_CE 0x01 /* Cache Enable */ |
| 23 | #define CCR_CACHE_WT 0x02 /* Write-Through (for P0,U0,P3) (else writeback) */ | 23 | #define CCR_CACHE_WT 0x02 /* Write-Through (for P0,U0,P3) (else writeback) */ |
diff --git a/arch/sh/include/cpu-sh4/cpu/cache.h b/arch/sh/include/cpu-sh4/cpu/cache.h index 7bfb9e8b069c..92c4cd119b66 100644 --- a/arch/sh/include/cpu-sh4/cpu/cache.h +++ b/arch/sh/include/cpu-sh4/cpu/cache.h | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | #define SH_CACHE_COMBINED 4 | 17 | #define SH_CACHE_COMBINED 4 |
| 18 | #define SH_CACHE_ASSOC 8 | 18 | #define SH_CACHE_ASSOC 8 |
| 19 | 19 | ||
| 20 | #define CCR 0xff00001c /* Address of Cache Control Register */ | 20 | #define SH_CCR 0xff00001c /* Address of Cache Control Register */ |
| 21 | #define CCR_CACHE_OCE 0x0001 /* Operand Cache Enable */ | 21 | #define CCR_CACHE_OCE 0x0001 /* Operand Cache Enable */ |
| 22 | #define CCR_CACHE_WT 0x0002 /* Write-Through (for P0,U0,P3) (else writeback)*/ | 22 | #define CCR_CACHE_WT 0x0002 /* Write-Through (for P0,U0,P3) (else writeback)*/ |
| 23 | #define CCR_CACHE_CB 0x0004 /* Copy-Back (for P1) (else writethrough) */ | 23 | #define CCR_CACHE_CB 0x0004 /* Copy-Back (for P1) (else writethrough) */ |
diff --git a/arch/sh/kernel/cpu/init.c b/arch/sh/kernel/cpu/init.c index ecf83cd158dc..0d7360d549c1 100644 --- a/arch/sh/kernel/cpu/init.c +++ b/arch/sh/kernel/cpu/init.c | |||
| @@ -112,7 +112,7 @@ static void cache_init(void) | |||
| 112 | unsigned long ccr, flags; | 112 | unsigned long ccr, flags; |
| 113 | 113 | ||
| 114 | jump_to_uncached(); | 114 | jump_to_uncached(); |
| 115 | ccr = __raw_readl(CCR); | 115 | ccr = __raw_readl(SH_CCR); |
| 116 | 116 | ||
| 117 | /* | 117 | /* |
| 118 | * At this point we don't know whether the cache is enabled or not - a | 118 | * At this point we don't know whether the cache is enabled or not - a |
| @@ -189,7 +189,7 @@ static void cache_init(void) | |||
| 189 | 189 | ||
| 190 | l2_cache_init(); | 190 | l2_cache_init(); |
| 191 | 191 | ||
| 192 | __raw_writel(flags, CCR); | 192 | __raw_writel(flags, SH_CCR); |
| 193 | back_to_cached(); | 193 | back_to_cached(); |
| 194 | } | 194 | } |
| 195 | #else | 195 | #else |
diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c index 2ea4483fd722..be616ee0cf87 100644 --- a/arch/sh/kernel/idle.c +++ b/arch/sh/kernel/idle.c | |||
| @@ -16,7 +16,6 @@ | |||
| 16 | #include <linux/thread_info.h> | 16 | #include <linux/thread_info.h> |
| 17 | #include <linux/irqflags.h> | 17 | #include <linux/irqflags.h> |
| 18 | #include <linux/smp.h> | 18 | #include <linux/smp.h> |
| 19 | #include <linux/cpuidle.h> | ||
| 20 | #include <linux/atomic.h> | 19 | #include <linux/atomic.h> |
| 21 | #include <asm/pgalloc.h> | 20 | #include <asm/pgalloc.h> |
| 22 | #include <asm/smp.h> | 21 | #include <asm/smp.h> |
| @@ -40,8 +39,7 @@ void arch_cpu_idle_dead(void) | |||
| 40 | 39 | ||
| 41 | void arch_cpu_idle(void) | 40 | void arch_cpu_idle(void) |
| 42 | { | 41 | { |
| 43 | if (cpuidle_idle_call()) | 42 | sh_idle(); |
| 44 | sh_idle(); | ||
| 45 | } | 43 | } |
| 46 | 44 | ||
| 47 | void __init select_idle_routine(void) | 45 | void __init select_idle_routine(void) |
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c index 0833736afa32..65a1ecd77f96 100644 --- a/arch/sh/kernel/irq.c +++ b/arch/sh/kernel/irq.c | |||
| @@ -217,19 +217,6 @@ void __init init_IRQ(void) | |||
| 217 | } | 217 | } |
| 218 | 218 | ||
| 219 | #ifdef CONFIG_HOTPLUG_CPU | 219 | #ifdef CONFIG_HOTPLUG_CPU |
| 220 | static void route_irq(struct irq_data *data, unsigned int irq, unsigned int cpu) | ||
| 221 | { | ||
| 222 | struct irq_desc *desc = irq_to_desc(irq); | ||
| 223 | struct irq_chip *chip = irq_data_get_irq_chip(data); | ||
| 224 | |||
| 225 | printk(KERN_INFO "IRQ%u: moving from cpu%u to cpu%u\n", | ||
| 226 | irq, data->node, cpu); | ||
| 227 | |||
| 228 | raw_spin_lock_irq(&desc->lock); | ||
| 229 | chip->irq_set_affinity(data, cpumask_of(cpu), false); | ||
| 230 | raw_spin_unlock_irq(&desc->lock); | ||
| 231 | } | ||
| 232 | |||
| 233 | /* | 220 | /* |
| 234 | * The CPU has been marked offline. Migrate IRQs off this CPU. If | 221 | * The CPU has been marked offline. Migrate IRQs off this CPU. If |
| 235 | * the affinity settings do not allow other CPUs, force them onto any | 222 | * the affinity settings do not allow other CPUs, force them onto any |
| @@ -250,11 +237,8 @@ void migrate_irqs(void) | |||
| 250 | irq, cpu); | 237 | irq, cpu); |
| 251 | 238 | ||
| 252 | cpumask_setall(data->affinity); | 239 | cpumask_setall(data->affinity); |
| 253 | newcpu = cpumask_any_and(data->affinity, | ||
| 254 | cpu_online_mask); | ||
| 255 | } | 240 | } |
| 256 | 241 | irq_set_affinity(irq, data->affinity); | |
| 257 | route_irq(data, irq, newcpu); | ||
| 258 | } | 242 | } |
| 259 | } | 243 | } |
| 260 | } | 244 | } |
diff --git a/arch/sh/mm/cache-debugfs.c b/arch/sh/mm/cache-debugfs.c index 115725198038..777e50f33c00 100644 --- a/arch/sh/mm/cache-debugfs.c +++ b/arch/sh/mm/cache-debugfs.c | |||
| @@ -36,7 +36,7 @@ static int cache_seq_show(struct seq_file *file, void *iter) | |||
| 36 | */ | 36 | */ |
| 37 | jump_to_uncached(); | 37 | jump_to_uncached(); |
| 38 | 38 | ||
| 39 | ccr = __raw_readl(CCR); | 39 | ccr = __raw_readl(SH_CCR); |
| 40 | if ((ccr & CCR_CACHE_ENABLE) == 0) { | 40 | if ((ccr & CCR_CACHE_ENABLE) == 0) { |
| 41 | back_to_cached(); | 41 | back_to_cached(); |
| 42 | 42 | ||
diff --git a/arch/sh/mm/cache-sh2.c b/arch/sh/mm/cache-sh2.c index defcf719f2e8..a74259f2f981 100644 --- a/arch/sh/mm/cache-sh2.c +++ b/arch/sh/mm/cache-sh2.c | |||
| @@ -63,9 +63,9 @@ static void sh2__flush_invalidate_region(void *start, int size) | |||
| 63 | local_irq_save(flags); | 63 | local_irq_save(flags); |
| 64 | jump_to_uncached(); | 64 | jump_to_uncached(); |
| 65 | 65 | ||
| 66 | ccr = __raw_readl(CCR); | 66 | ccr = __raw_readl(SH_CCR); |
| 67 | ccr |= CCR_CACHE_INVALIDATE; | 67 | ccr |= CCR_CACHE_INVALIDATE; |
| 68 | __raw_writel(ccr, CCR); | 68 | __raw_writel(ccr, SH_CCR); |
| 69 | 69 | ||
| 70 | back_to_cached(); | 70 | back_to_cached(); |
| 71 | local_irq_restore(flags); | 71 | local_irq_restore(flags); |
diff --git a/arch/sh/mm/cache-sh2a.c b/arch/sh/mm/cache-sh2a.c index 949e2d3138a0..ee87d081259b 100644 --- a/arch/sh/mm/cache-sh2a.c +++ b/arch/sh/mm/cache-sh2a.c | |||
| @@ -134,7 +134,8 @@ static void sh2a__flush_invalidate_region(void *start, int size) | |||
| 134 | 134 | ||
| 135 | /* If there are too many pages then just blow the cache */ | 135 | /* If there are too many pages then just blow the cache */ |
| 136 | if (((end - begin) >> PAGE_SHIFT) >= MAX_OCACHE_PAGES) { | 136 | if (((end - begin) >> PAGE_SHIFT) >= MAX_OCACHE_PAGES) { |
| 137 | __raw_writel(__raw_readl(CCR) | CCR_OCACHE_INVALIDATE, CCR); | 137 | __raw_writel(__raw_readl(SH_CCR) | CCR_OCACHE_INVALIDATE, |
| 138 | SH_CCR); | ||
| 138 | } else { | 139 | } else { |
| 139 | for (v = begin; v < end; v += L1_CACHE_BYTES) | 140 | for (v = begin; v < end; v += L1_CACHE_BYTES) |
| 140 | sh2a_invalidate_line(CACHE_OC_ADDRESS_ARRAY, v); | 141 | sh2a_invalidate_line(CACHE_OC_ADDRESS_ARRAY, v); |
| @@ -167,7 +168,8 @@ static void sh2a_flush_icache_range(void *args) | |||
| 167 | /* I-Cache invalidate */ | 168 | /* I-Cache invalidate */ |
| 168 | /* If there are too many pages then just blow the cache */ | 169 | /* If there are too many pages then just blow the cache */ |
| 169 | if (((end - start) >> PAGE_SHIFT) >= MAX_ICACHE_PAGES) { | 170 | if (((end - start) >> PAGE_SHIFT) >= MAX_ICACHE_PAGES) { |
| 170 | __raw_writel(__raw_readl(CCR) | CCR_ICACHE_INVALIDATE, CCR); | 171 | __raw_writel(__raw_readl(SH_CCR) | CCR_ICACHE_INVALIDATE, |
| 172 | SH_CCR); | ||
| 171 | } else { | 173 | } else { |
| 172 | for (v = start; v < end; v += L1_CACHE_BYTES) | 174 | for (v = start; v < end; v += L1_CACHE_BYTES) |
| 173 | sh2a_invalidate_line(CACHE_IC_ADDRESS_ARRAY, v); | 175 | sh2a_invalidate_line(CACHE_IC_ADDRESS_ARRAY, v); |
diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c index 0e529285b28d..51d8f7f31d1d 100644 --- a/arch/sh/mm/cache-sh4.c +++ b/arch/sh/mm/cache-sh4.c | |||
| @@ -133,9 +133,9 @@ static void flush_icache_all(void) | |||
| 133 | jump_to_uncached(); | 133 | jump_to_uncached(); |
| 134 | 134 | ||
| 135 | /* Flush I-cache */ | 135 | /* Flush I-cache */ |
| 136 | ccr = __raw_readl(CCR); | 136 | ccr = __raw_readl(SH_CCR); |
| 137 | ccr |= CCR_CACHE_ICI; | 137 | ccr |= CCR_CACHE_ICI; |
| 138 | __raw_writel(ccr, CCR); | 138 | __raw_writel(ccr, SH_CCR); |
| 139 | 139 | ||
| 140 | /* | 140 | /* |
| 141 | * back_to_cached() will take care of the barrier for us, don't add | 141 | * back_to_cached() will take care of the barrier for us, don't add |
diff --git a/arch/sh/mm/cache-shx3.c b/arch/sh/mm/cache-shx3.c index c0adbee97b5f..24c58b7dc022 100644 --- a/arch/sh/mm/cache-shx3.c +++ b/arch/sh/mm/cache-shx3.c | |||
| @@ -19,7 +19,7 @@ void __init shx3_cache_init(void) | |||
| 19 | { | 19 | { |
| 20 | unsigned int ccr; | 20 | unsigned int ccr; |
| 21 | 21 | ||
| 22 | ccr = __raw_readl(CCR); | 22 | ccr = __raw_readl(SH_CCR); |
| 23 | 23 | ||
| 24 | /* | 24 | /* |
| 25 | * If we've got cache aliases, resolve them in hardware. | 25 | * If we've got cache aliases, resolve them in hardware. |
| @@ -40,5 +40,5 @@ void __init shx3_cache_init(void) | |||
| 40 | ccr |= CCR_CACHE_IBE; | 40 | ccr |= CCR_CACHE_IBE; |
| 41 | #endif | 41 | #endif |
| 42 | 42 | ||
| 43 | writel_uncached(ccr, CCR); | 43 | writel_uncached(ccr, SH_CCR); |
| 44 | } | 44 | } |
diff --git a/arch/sh/mm/cache.c b/arch/sh/mm/cache.c index 616966a96cba..097c2cdd117f 100644 --- a/arch/sh/mm/cache.c +++ b/arch/sh/mm/cache.c | |||
| @@ -285,8 +285,8 @@ void __init cpu_cache_init(void) | |||
| 285 | { | 285 | { |
| 286 | unsigned int cache_disabled = 0; | 286 | unsigned int cache_disabled = 0; |
| 287 | 287 | ||
| 288 | #ifdef CCR | 288 | #ifdef SH_CCR |
| 289 | cache_disabled = !(__raw_readl(CCR) & CCR_CACHE_ENABLE); | 289 | cache_disabled = !(__raw_readl(SH_CCR) & CCR_CACHE_ENABLE); |
| 290 | #endif | 290 | #endif |
| 291 | 291 | ||
| 292 | compute_alias(&boot_cpu_data.icache); | 292 | compute_alias(&boot_cpu_data.icache); |
diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild index 4b60a0c325ec..a45821818003 100644 --- a/arch/sparc/include/asm/Kbuild +++ b/arch/sparc/include/asm/Kbuild | |||
| @@ -6,15 +6,16 @@ generic-y += cputime.h | |||
| 6 | generic-y += div64.h | 6 | generic-y += div64.h |
| 7 | generic-y += emergency-restart.h | 7 | generic-y += emergency-restart.h |
| 8 | generic-y += exec.h | 8 | generic-y += exec.h |
| 9 | generic-y += linkage.h | 9 | generic-y += hash.h |
| 10 | generic-y += local64.h | ||
| 11 | generic-y += mutex.h | ||
| 12 | generic-y += irq_regs.h | 10 | generic-y += irq_regs.h |
| 11 | generic-y += linkage.h | ||
| 13 | generic-y += local.h | 12 | generic-y += local.h |
| 13 | generic-y += local64.h | ||
| 14 | generic-y += mcs_spinlock.h | ||
| 14 | generic-y += module.h | 15 | generic-y += module.h |
| 16 | generic-y += mutex.h | ||
| 17 | generic-y += preempt.h | ||
| 15 | generic-y += serial.h | 18 | generic-y += serial.h |
| 16 | generic-y += trace_clock.h | 19 | generic-y += trace_clock.h |
| 17 | generic-y += types.h | 20 | generic-y += types.h |
| 18 | generic-y += word-at-a-time.h | 21 | generic-y += word-at-a-time.h |
| 19 | generic-y += preempt.h | ||
| 20 | generic-y += hash.h | ||
diff --git a/arch/sparc/include/asm/smp_64.h b/arch/sparc/include/asm/smp_64.h index dd3bef4b9896..05710393959f 100644 --- a/arch/sparc/include/asm/smp_64.h +++ b/arch/sparc/include/asm/smp_64.h | |||
| @@ -32,7 +32,6 @@ | |||
| 32 | 32 | ||
| 33 | DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); | 33 | DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); |
| 34 | extern cpumask_t cpu_core_map[NR_CPUS]; | 34 | extern cpumask_t cpu_core_map[NR_CPUS]; |
| 35 | extern int sparc64_multi_core; | ||
| 36 | 35 | ||
| 37 | extern void arch_send_call_function_single_ipi(int cpu); | 36 | extern void arch_send_call_function_single_ipi(int cpu); |
| 38 | extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); | 37 | extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); |
diff --git a/arch/sparc/include/asm/topology_64.h b/arch/sparc/include/asm/topology_64.h index 1754390a426f..a2d10fc64faf 100644 --- a/arch/sparc/include/asm/topology_64.h +++ b/arch/sparc/include/asm/topology_64.h | |||
| @@ -42,8 +42,6 @@ static inline int pcibus_to_node(struct pci_bus *pbus) | |||
| 42 | #define topology_core_id(cpu) (cpu_data(cpu).core_id) | 42 | #define topology_core_id(cpu) (cpu_data(cpu).core_id) |
| 43 | #define topology_core_cpumask(cpu) (&cpu_core_map[cpu]) | 43 | #define topology_core_cpumask(cpu) (&cpu_core_map[cpu]) |
| 44 | #define topology_thread_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu)) | 44 | #define topology_thread_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu)) |
| 45 | #define mc_capable() (sparc64_multi_core) | ||
| 46 | #define smt_capable() (sparc64_multi_core) | ||
| 47 | #endif /* CONFIG_SMP */ | 45 | #endif /* CONFIG_SMP */ |
| 48 | 46 | ||
| 49 | extern cpumask_t cpu_core_map[NR_CPUS]; | 47 | extern cpumask_t cpu_core_map[NR_CPUS]; |
diff --git a/arch/sparc/kernel/mdesc.c b/arch/sparc/kernel/mdesc.c index b90bf23e3aab..a1a4400d4025 100644 --- a/arch/sparc/kernel/mdesc.c +++ b/arch/sparc/kernel/mdesc.c | |||
| @@ -896,10 +896,6 @@ void mdesc_fill_in_cpu_data(cpumask_t *mask) | |||
| 896 | 896 | ||
| 897 | mdesc_iterate_over_cpus(fill_in_one_cpu, NULL, mask); | 897 | mdesc_iterate_over_cpus(fill_in_one_cpu, NULL, mask); |
| 898 | 898 | ||
| 899 | #ifdef CONFIG_SMP | ||
| 900 | sparc64_multi_core = 1; | ||
| 901 | #endif | ||
| 902 | |||
| 903 | hp = mdesc_grab(); | 899 | hp = mdesc_grab(); |
| 904 | 900 | ||
| 905 | set_core_ids(hp); | 901 | set_core_ids(hp); |
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c index 32a280ec38c1..d7b4967f8fa6 100644 --- a/arch/sparc/kernel/process_64.c +++ b/arch/sparc/kernel/process_64.c | |||
| @@ -58,9 +58,12 @@ void arch_cpu_idle(void) | |||
| 58 | { | 58 | { |
| 59 | if (tlb_type != hypervisor) { | 59 | if (tlb_type != hypervisor) { |
| 60 | touch_nmi_watchdog(); | 60 | touch_nmi_watchdog(); |
| 61 | local_irq_enable(); | ||
| 61 | } else { | 62 | } else { |
| 62 | unsigned long pstate; | 63 | unsigned long pstate; |
| 63 | 64 | ||
| 65 | local_irq_enable(); | ||
| 66 | |||
| 64 | /* The sun4v sleeping code requires that we have PSTATE.IE cleared over | 67 | /* The sun4v sleeping code requires that we have PSTATE.IE cleared over |
| 65 | * the cpu sleep hypervisor call. | 68 | * the cpu sleep hypervisor call. |
| 66 | */ | 69 | */ |
| @@ -82,7 +85,6 @@ void arch_cpu_idle(void) | |||
| 82 | : "=&r" (pstate) | 85 | : "=&r" (pstate) |
| 83 | : "i" (PSTATE_IE)); | 86 | : "i" (PSTATE_IE)); |
| 84 | } | 87 | } |
| 85 | local_irq_enable(); | ||
| 86 | } | 88 | } |
| 87 | 89 | ||
| 88 | #ifdef CONFIG_HOTPLUG_CPU | 90 | #ifdef CONFIG_HOTPLUG_CPU |
diff --git a/arch/sparc/kernel/prom_64.c b/arch/sparc/kernel/prom_64.c index 6b39125eb927..9a690d39c01b 100644 --- a/arch/sparc/kernel/prom_64.c +++ b/arch/sparc/kernel/prom_64.c | |||
| @@ -555,9 +555,6 @@ static void *fill_in_one_cpu(struct device_node *dp, int cpuid, int arg) | |||
| 555 | 555 | ||
| 556 | cpu_data(cpuid).core_id = portid + 1; | 556 | cpu_data(cpuid).core_id = portid + 1; |
| 557 | cpu_data(cpuid).proc_id = portid; | 557 | cpu_data(cpuid).proc_id = portid; |
| 558 | #ifdef CONFIG_SMP | ||
| 559 | sparc64_multi_core = 1; | ||
| 560 | #endif | ||
| 561 | } else { | 558 | } else { |
| 562 | cpu_data(cpuid).dcache_size = | 559 | cpu_data(cpuid).dcache_size = |
| 563 | of_getintprop_default(dp, "dcache-size", 16 * 1024); | 560 | of_getintprop_default(dp, "dcache-size", 16 * 1024); |
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c index b085311dcd0e..9781048161ab 100644 --- a/arch/sparc/kernel/smp_64.c +++ b/arch/sparc/kernel/smp_64.c | |||
| @@ -53,8 +53,6 @@ | |||
| 53 | 53 | ||
| 54 | #include "cpumap.h" | 54 | #include "cpumap.h" |
| 55 | 55 | ||
| 56 | int sparc64_multi_core __read_mostly; | ||
| 57 | |||
| 58 | DEFINE_PER_CPU(cpumask_t, cpu_sibling_map) = CPU_MASK_NONE; | 56 | DEFINE_PER_CPU(cpumask_t, cpu_sibling_map) = CPU_MASK_NONE; |
| 59 | cpumask_t cpu_core_map[NR_CPUS] __read_mostly = | 57 | cpumask_t cpu_core_map[NR_CPUS] __read_mostly = |
| 60 | { [0 ... NR_CPUS-1] = CPU_MASK_NONE }; | 58 | { [0 ... NR_CPUS-1] = CPU_MASK_NONE }; |
diff --git a/arch/sparc/kernel/syscalls.S b/arch/sparc/kernel/syscalls.S index 87729fff13b9..33a17e7b3ccd 100644 --- a/arch/sparc/kernel/syscalls.S +++ b/arch/sparc/kernel/syscalls.S | |||
| @@ -189,7 +189,8 @@ linux_sparc_syscall32: | |||
| 189 | mov %i0, %l5 ! IEU1 | 189 | mov %i0, %l5 ! IEU1 |
| 190 | 5: call %l7 ! CTI Group brk forced | 190 | 5: call %l7 ! CTI Group brk forced |
| 191 | srl %i5, 0, %o5 ! IEU1 | 191 | srl %i5, 0, %o5 ! IEU1 |
| 192 | ba,a,pt %xcc, 3f | 192 | ba,pt %xcc, 3f |
| 193 | sra %o0, 0, %o0 | ||
| 193 | 194 | ||
| 194 | /* Linux native system calls enter here... */ | 195 | /* Linux native system calls enter here... */ |
| 195 | .align 32 | 196 | .align 32 |
| @@ -217,7 +218,6 @@ linux_sparc_syscall: | |||
| 217 | 3: stx %o0, [%sp + PTREGS_OFF + PT_V9_I0] | 218 | 3: stx %o0, [%sp + PTREGS_OFF + PT_V9_I0] |
| 218 | ret_sys_call: | 219 | ret_sys_call: |
| 219 | ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %g3 | 220 | ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %g3 |
| 220 | sra %o0, 0, %o0 | ||
| 221 | mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2 | 221 | mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2 |
| 222 | sllx %g2, 32, %g2 | 222 | sllx %g2, 32, %g2 |
| 223 | 223 | ||
diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c index c3d82b5f54ca..24e8b8705e7f 100644 --- a/arch/sparc/kernel/time_64.c +++ b/arch/sparc/kernel/time_64.c | |||
| @@ -733,7 +733,7 @@ void __irq_entry timer_interrupt(int irq, struct pt_regs *regs) | |||
| 733 | irq_enter(); | 733 | irq_enter(); |
| 734 | 734 | ||
| 735 | local_cpu_data().irq0_irqs++; | 735 | local_cpu_data().irq0_irqs++; |
| 736 | kstat_incr_irqs_this_cpu(0, irq_to_desc(0)); | 736 | kstat_incr_irq_this_cpu(0); |
| 737 | 737 | ||
| 738 | if (unlikely(!evt->event_handler)) { | 738 | if (unlikely(!evt->event_handler)) { |
| 739 | printk(KERN_WARNING | 739 | printk(KERN_WARNING |
diff --git a/arch/sparc/mm/tsb.c b/arch/sparc/mm/tsb.c index 3b3a360b429a..f5d506fdddad 100644 --- a/arch/sparc/mm/tsb.c +++ b/arch/sparc/mm/tsb.c | |||
| @@ -273,7 +273,7 @@ void __init pgtable_cache_init(void) | |||
| 273 | prom_halt(); | 273 | prom_halt(); |
| 274 | } | 274 | } |
| 275 | 275 | ||
| 276 | for (i = 0; i < 8; i++) { | 276 | for (i = 0; i < ARRAY_SIZE(tsb_cache_names); i++) { |
| 277 | unsigned long size = 8192 << i; | 277 | unsigned long size = 8192 << i; |
| 278 | const char *name = tsb_cache_names[i]; | 278 | const char *name = tsb_cache_names[i]; |
| 279 | 279 | ||
diff --git a/arch/tile/include/asm/Kbuild b/arch/tile/include/asm/Kbuild index 3793c75e45d9..0aa5675e7025 100644 --- a/arch/tile/include/asm/Kbuild +++ b/arch/tile/include/asm/Kbuild | |||
| @@ -11,6 +11,7 @@ generic-y += errno.h | |||
| 11 | generic-y += exec.h | 11 | generic-y += exec.h |
| 12 | generic-y += fb.h | 12 | generic-y += fb.h |
| 13 | generic-y += fcntl.h | 13 | generic-y += fcntl.h |
| 14 | generic-y += hash.h | ||
| 14 | generic-y += hw_irq.h | 15 | generic-y += hw_irq.h |
| 15 | generic-y += ioctl.h | 16 | generic-y += ioctl.h |
| 16 | generic-y += ioctls.h | 17 | generic-y += ioctls.h |
| @@ -18,12 +19,14 @@ generic-y += ipcbuf.h | |||
| 18 | generic-y += irq_regs.h | 19 | generic-y += irq_regs.h |
| 19 | generic-y += local.h | 20 | generic-y += local.h |
| 20 | generic-y += local64.h | 21 | generic-y += local64.h |
| 22 | generic-y += mcs_spinlock.h | ||
| 21 | generic-y += msgbuf.h | 23 | generic-y += msgbuf.h |
| 22 | generic-y += mutex.h | 24 | generic-y += mutex.h |
| 23 | generic-y += param.h | 25 | generic-y += param.h |
| 24 | generic-y += parport.h | 26 | generic-y += parport.h |
| 25 | generic-y += poll.h | 27 | generic-y += poll.h |
| 26 | generic-y += posix_types.h | 28 | generic-y += posix_types.h |
| 29 | generic-y += preempt.h | ||
| 27 | generic-y += resource.h | 30 | generic-y += resource.h |
| 28 | generic-y += scatterlist.h | 31 | generic-y += scatterlist.h |
| 29 | generic-y += sembuf.h | 32 | generic-y += sembuf.h |
| @@ -38,5 +41,3 @@ generic-y += termios.h | |||
| 38 | generic-y += trace_clock.h | 41 | generic-y += trace_clock.h |
| 39 | generic-y += types.h | 42 | generic-y += types.h |
| 40 | generic-y += xor.h | 43 | generic-y += xor.h |
| 41 | generic-y += preempt.h | ||
| 42 | generic-y += hash.h | ||
diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild index 88a330dcdede..a5e4b6068213 100644 --- a/arch/um/include/asm/Kbuild +++ b/arch/um/include/asm/Kbuild | |||
| @@ -1,8 +1,28 @@ | |||
| 1 | generic-y += bug.h cputime.h device.h emergency-restart.h futex.h hardirq.h | ||
| 2 | generic-y += hw_irq.h irq_regs.h kdebug.h percpu.h sections.h topology.h xor.h | ||
| 3 | generic-y += ftrace.h pci.h io.h param.h delay.h mutex.h current.h exec.h | ||
| 4 | generic-y += switch_to.h clkdev.h | ||
| 5 | generic-y += trace_clock.h | ||
| 6 | generic-y += preempt.h | ||
| 7 | generic-y += hash.h | ||
| 8 | generic-y += barrier.h | 1 | generic-y += barrier.h |
| 2 | generic-y += bug.h | ||
| 3 | generic-y += clkdev.h | ||
| 4 | generic-y += cputime.h | ||
| 5 | generic-y += current.h | ||
| 6 | generic-y += delay.h | ||
| 7 | generic-y += device.h | ||
| 8 | generic-y += emergency-restart.h | ||
| 9 | generic-y += exec.h | ||
| 10 | generic-y += ftrace.h | ||
| 11 | generic-y += futex.h | ||
| 12 | generic-y += hardirq.h | ||
| 13 | generic-y += hash.h | ||
| 14 | generic-y += hw_irq.h | ||
| 15 | generic-y += io.h | ||
| 16 | generic-y += irq_regs.h | ||
| 17 | generic-y += kdebug.h | ||
| 18 | generic-y += mcs_spinlock.h | ||
| 19 | generic-y += mutex.h | ||
| 20 | generic-y += param.h | ||
| 21 | generic-y += pci.h | ||
| 22 | generic-y += percpu.h | ||
| 23 | generic-y += preempt.h | ||
| 24 | generic-y += sections.h | ||
| 25 | generic-y += switch_to.h | ||
| 26 | generic-y += topology.h | ||
| 27 | generic-y += trace_clock.h | ||
| 28 | generic-y += xor.h | ||
diff --git a/arch/unicore32/include/asm/Kbuild b/arch/unicore32/include/asm/Kbuild index 3ef4f9d9bf5d..1e5fb872a4aa 100644 --- a/arch/unicore32/include/asm/Kbuild +++ b/arch/unicore32/include/asm/Kbuild | |||
| @@ -16,6 +16,7 @@ generic-y += fcntl.h | |||
| 16 | generic-y += ftrace.h | 16 | generic-y += ftrace.h |
| 17 | generic-y += futex.h | 17 | generic-y += futex.h |
| 18 | generic-y += hardirq.h | 18 | generic-y += hardirq.h |
| 19 | generic-y += hash.h | ||
| 19 | generic-y += hw_irq.h | 20 | generic-y += hw_irq.h |
| 20 | generic-y += ioctl.h | 21 | generic-y += ioctl.h |
| 21 | generic-y += ioctls.h | 22 | generic-y += ioctls.h |
| @@ -24,6 +25,7 @@ generic-y += irq_regs.h | |||
| 24 | generic-y += kdebug.h | 25 | generic-y += kdebug.h |
| 25 | generic-y += kmap_types.h | 26 | generic-y += kmap_types.h |
| 26 | generic-y += local.h | 27 | generic-y += local.h |
| 28 | generic-y += mcs_spinlock.h | ||
| 27 | generic-y += mman.h | 29 | generic-y += mman.h |
| 28 | generic-y += module.h | 30 | generic-y += module.h |
| 29 | generic-y += msgbuf.h | 31 | generic-y += msgbuf.h |
| @@ -32,6 +34,7 @@ generic-y += parport.h | |||
| 32 | generic-y += percpu.h | 34 | generic-y += percpu.h |
| 33 | generic-y += poll.h | 35 | generic-y += poll.h |
| 34 | generic-y += posix_types.h | 36 | generic-y += posix_types.h |
| 37 | generic-y += preempt.h | ||
| 35 | generic-y += resource.h | 38 | generic-y += resource.h |
| 36 | generic-y += scatterlist.h | 39 | generic-y += scatterlist.h |
| 37 | generic-y += sections.h | 40 | generic-y += sections.h |
| @@ -60,5 +63,3 @@ generic-y += unaligned.h | |||
| 60 | generic-y += user.h | 63 | generic-y += user.h |
| 61 | generic-y += vga.h | 64 | generic-y += vga.h |
| 62 | generic-y += xor.h | 65 | generic-y += xor.h |
| 63 | generic-y += preempt.h | ||
| 64 | generic-y += hash.h | ||
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 0af5250d914f..8453fe1342ea 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
| @@ -1585,6 +1585,20 @@ config EFI_STUB | |||
| 1585 | 1585 | ||
| 1586 | See Documentation/efi-stub.txt for more information. | 1586 | See Documentation/efi-stub.txt for more information. |
| 1587 | 1587 | ||
| 1588 | config EFI_MIXED | ||
| 1589 | bool "EFI mixed-mode support" | ||
| 1590 | depends on EFI_STUB && X86_64 | ||
| 1591 | ---help--- | ||
| 1592 | Enabling this feature allows a 64-bit kernel to be booted | ||
| 1593 | on a 32-bit firmware, provided that your CPU supports 64-bit | ||
| 1594 | mode. | ||
| 1595 | |||
| 1596 | Note that it is not possible to boot a mixed-mode enabled | ||
| 1597 | kernel via the EFI boot stub - a bootloader that supports | ||
| 1598 | the EFI handover protocol must be used. | ||
| 1599 | |||
| 1600 | If unsure, say N. | ||
| 1601 | |||
| 1588 | config SECCOMP | 1602 | config SECCOMP |
| 1589 | def_bool y | 1603 | def_bool y |
| 1590 | prompt "Enable seccomp to safely compute untrusted bytecode" | 1604 | prompt "Enable seccomp to safely compute untrusted bytecode" |
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu index c026cca5602c..f3aaf231b4e5 100644 --- a/arch/x86/Kconfig.cpu +++ b/arch/x86/Kconfig.cpu | |||
| @@ -341,10 +341,6 @@ config X86_USE_3DNOW | |||
| 341 | def_bool y | 341 | def_bool y |
| 342 | depends on (MCYRIXIII || MK7 || MGEODE_LX) && !UML | 342 | depends on (MCYRIXIII || MK7 || MGEODE_LX) && !UML |
| 343 | 343 | ||
| 344 | config X86_OOSTORE | ||
| 345 | def_bool y | ||
| 346 | depends on (MWINCHIP3D || MWINCHIPC6) && MTRR | ||
| 347 | |||
| 348 | # | 344 | # |
| 349 | # P6_NOPs are a relatively minor optimization that require a family >= | 345 | # P6_NOPs are a relatively minor optimization that require a family >= |
| 350 | # 6 processor, except that it is broken on certain VIA chips. | 346 | # 6 processor, except that it is broken on certain VIA chips. |
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug index 321a52ccf63a..61bd2ad94281 100644 --- a/arch/x86/Kconfig.debug +++ b/arch/x86/Kconfig.debug | |||
| @@ -81,6 +81,15 @@ config X86_PTDUMP | |||
| 81 | kernel. | 81 | kernel. |
| 82 | If in doubt, say "N" | 82 | If in doubt, say "N" |
| 83 | 83 | ||
| 84 | config EFI_PGT_DUMP | ||
| 85 | bool "Dump the EFI pagetable" | ||
| 86 | depends on EFI && X86_PTDUMP | ||
| 87 | ---help--- | ||
| 88 | Enable this if you want to dump the EFI page table before | ||
| 89 | enabling virtual mode. This can be used to debug miscellaneous | ||
| 90 | issues with the mapping of the EFI runtime regions into that | ||
| 91 | table. | ||
| 92 | |||
| 84 | config DEBUG_RODATA | 93 | config DEBUG_RODATA |
| 85 | bool "Write protect kernel read-only data structures" | 94 | bool "Write protect kernel read-only data structures" |
| 86 | default y | 95 | default y |
diff --git a/arch/x86/Makefile b/arch/x86/Makefile index eeda43abed6e..3b9348a0c1a4 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile | |||
| @@ -82,8 +82,8 @@ else | |||
| 82 | KBUILD_AFLAGS += -m64 | 82 | KBUILD_AFLAGS += -m64 |
| 83 | KBUILD_CFLAGS += -m64 | 83 | KBUILD_CFLAGS += -m64 |
| 84 | 84 | ||
| 85 | # Don't autogenerate MMX or SSE instructions | 85 | # Don't autogenerate traditional x87, MMX or SSE instructions |
| 86 | KBUILD_CFLAGS += -mno-mmx -mno-sse | 86 | KBUILD_CFLAGS += -mno-mmx -mno-sse -mno-80387 -mno-fp-ret-in-387 |
| 87 | 87 | ||
| 88 | # Use -mpreferred-stack-boundary=3 if supported. | 88 | # Use -mpreferred-stack-boundary=3 if supported. |
| 89 | KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3) | 89 | KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3) |
| @@ -152,6 +152,7 @@ cfi-sections := $(call as-instr,.cfi_sections .debug_frame,-DCONFIG_AS_CFI_SECTI | |||
| 152 | 152 | ||
| 153 | # does binutils support specific instructions? | 153 | # does binutils support specific instructions? |
| 154 | asinstr := $(call as-instr,fxsaveq (%rax),-DCONFIG_AS_FXSAVEQ=1) | 154 | asinstr := $(call as-instr,fxsaveq (%rax),-DCONFIG_AS_FXSAVEQ=1) |
| 155 | asinstr += $(call as-instr,crc32l %eax$(comma)%eax,-DCONFIG_AS_CRC32=1) | ||
| 155 | avx_instr := $(call as-instr,vxorps %ymm0$(comma)%ymm1$(comma)%ymm2,-DCONFIG_AS_AVX=1) | 156 | avx_instr := $(call as-instr,vxorps %ymm0$(comma)%ymm1$(comma)%ymm2,-DCONFIG_AS_AVX=1) |
| 156 | avx2_instr :=$(call as-instr,vpbroadcastb %xmm0$(comma)%ymm1,-DCONFIG_AS_AVX2=1) | 157 | avx2_instr :=$(call as-instr,vpbroadcastb %xmm0$(comma)%ymm1,-DCONFIG_AS_AVX2=1) |
| 157 | 158 | ||
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile index 878df7e88cd4..abb9eba61b50 100644 --- a/arch/x86/boot/Makefile +++ b/arch/x86/boot/Makefile | |||
| @@ -80,7 +80,7 @@ targets += voffset.h | |||
| 80 | $(obj)/voffset.h: vmlinux FORCE | 80 | $(obj)/voffset.h: vmlinux FORCE |
| 81 | $(call if_changed,voffset) | 81 | $(call if_changed,voffset) |
| 82 | 82 | ||
| 83 | sed-zoffset := -e 's/^\([0-9a-fA-F]*\) . \(startup_32\|startup_64\|efi_pe_entry\|efi_stub_entry\|input_data\|_end\|z_.*\)$$/\#define ZO_\2 0x\1/p' | 83 | sed-zoffset := -e 's/^\([0-9a-fA-F]*\) . \(startup_32\|startup_64\|efi32_stub_entry\|efi64_stub_entry\|efi_pe_entry\|input_data\|_end\|z_.*\)$$/\#define ZO_\2 0x\1/p' |
| 84 | 84 | ||
| 85 | quiet_cmd_zoffset = ZOFFSET $@ | 85 | quiet_cmd_zoffset = ZOFFSET $@ |
| 86 | cmd_zoffset = $(NM) $< | sed -n $(sed-zoffset) > $@ | 86 | cmd_zoffset = $(NM) $< | sed -n $(sed-zoffset) > $@ |
diff --git a/arch/x86/boot/compressed/aslr.c b/arch/x86/boot/compressed/aslr.c index 90a21f430117..4dbf967da50d 100644 --- a/arch/x86/boot/compressed/aslr.c +++ b/arch/x86/boot/compressed/aslr.c | |||
| @@ -111,7 +111,7 @@ struct mem_vector { | |||
| 111 | }; | 111 | }; |
| 112 | 112 | ||
| 113 | #define MEM_AVOID_MAX 5 | 113 | #define MEM_AVOID_MAX 5 |
| 114 | struct mem_vector mem_avoid[MEM_AVOID_MAX]; | 114 | static struct mem_vector mem_avoid[MEM_AVOID_MAX]; |
| 115 | 115 | ||
| 116 | static bool mem_contains(struct mem_vector *region, struct mem_vector *item) | 116 | static bool mem_contains(struct mem_vector *region, struct mem_vector *item) |
| 117 | { | 117 | { |
| @@ -180,7 +180,7 @@ static void mem_avoid_init(unsigned long input, unsigned long input_size, | |||
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | /* Does this memory vector overlap a known avoided area? */ | 182 | /* Does this memory vector overlap a known avoided area? */ |
| 183 | bool mem_avoid_overlap(struct mem_vector *img) | 183 | static bool mem_avoid_overlap(struct mem_vector *img) |
| 184 | { | 184 | { |
| 185 | int i; | 185 | int i; |
| 186 | 186 | ||
| @@ -192,8 +192,9 @@ bool mem_avoid_overlap(struct mem_vector *img) | |||
| 192 | return false; | 192 | return false; |
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | unsigned long slots[CONFIG_RANDOMIZE_BASE_MAX_OFFSET / CONFIG_PHYSICAL_ALIGN]; | 195 | static unsigned long slots[CONFIG_RANDOMIZE_BASE_MAX_OFFSET / |
| 196 | unsigned long slot_max = 0; | 196 | CONFIG_PHYSICAL_ALIGN]; |
| 197 | static unsigned long slot_max; | ||
| 197 | 198 | ||
| 198 | static void slots_append(unsigned long addr) | 199 | static void slots_append(unsigned long addr) |
| 199 | { | 200 | { |
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c index a7677babf946..1e6146137f8e 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c | |||
| @@ -19,10 +19,272 @@ | |||
| 19 | 19 | ||
| 20 | static efi_system_table_t *sys_table; | 20 | static efi_system_table_t *sys_table; |
| 21 | 21 | ||
| 22 | static struct efi_config *efi_early; | ||
| 23 | |||
| 24 | #define efi_call_early(f, ...) \ | ||
| 25 | efi_early->call(efi_early->f, __VA_ARGS__); | ||
| 26 | |||
| 27 | #define BOOT_SERVICES(bits) \ | ||
| 28 | static void setup_boot_services##bits(struct efi_config *c) \ | ||
| 29 | { \ | ||
| 30 | efi_system_table_##bits##_t *table; \ | ||
| 31 | efi_boot_services_##bits##_t *bt; \ | ||
| 32 | \ | ||
| 33 | table = (typeof(table))sys_table; \ | ||
| 34 | \ | ||
| 35 | c->text_output = table->con_out; \ | ||
| 36 | \ | ||
| 37 | bt = (typeof(bt))(unsigned long)(table->boottime); \ | ||
| 38 | \ | ||
| 39 | c->allocate_pool = bt->allocate_pool; \ | ||
| 40 | c->allocate_pages = bt->allocate_pages; \ | ||
| 41 | c->get_memory_map = bt->get_memory_map; \ | ||
| 42 | c->free_pool = bt->free_pool; \ | ||
| 43 | c->free_pages = bt->free_pages; \ | ||
| 44 | c->locate_handle = bt->locate_handle; \ | ||
| 45 | c->handle_protocol = bt->handle_protocol; \ | ||
| 46 | c->exit_boot_services = bt->exit_boot_services; \ | ||
| 47 | } | ||
| 48 | BOOT_SERVICES(32); | ||
| 49 | BOOT_SERVICES(64); | ||
| 22 | 50 | ||
| 23 | #include "../../../../drivers/firmware/efi/efi-stub-helper.c" | 51 | static void efi_printk(efi_system_table_t *, char *); |
| 52 | static void efi_char16_printk(efi_system_table_t *, efi_char16_t *); | ||
| 53 | |||
| 54 | static efi_status_t | ||
| 55 | __file_size32(void *__fh, efi_char16_t *filename_16, | ||
| 56 | void **handle, u64 *file_sz) | ||
| 57 | { | ||
| 58 | efi_file_handle_32_t *h, *fh = __fh; | ||
| 59 | efi_file_info_t *info; | ||
| 60 | efi_status_t status; | ||
| 61 | efi_guid_t info_guid = EFI_FILE_INFO_ID; | ||
| 62 | u32 info_sz; | ||
| 63 | |||
| 64 | status = efi_early->call((unsigned long)fh->open, fh, &h, filename_16, | ||
| 65 | EFI_FILE_MODE_READ, (u64)0); | ||
| 66 | if (status != EFI_SUCCESS) { | ||
| 67 | efi_printk(sys_table, "Failed to open file: "); | ||
| 68 | efi_char16_printk(sys_table, filename_16); | ||
| 69 | efi_printk(sys_table, "\n"); | ||
| 70 | return status; | ||
| 71 | } | ||
| 72 | |||
| 73 | *handle = h; | ||
| 74 | |||
| 75 | info_sz = 0; | ||
| 76 | status = efi_early->call((unsigned long)h->get_info, h, &info_guid, | ||
| 77 | &info_sz, NULL); | ||
| 78 | if (status != EFI_BUFFER_TOO_SMALL) { | ||
| 79 | efi_printk(sys_table, "Failed to get file info size\n"); | ||
| 80 | return status; | ||
| 81 | } | ||
| 82 | |||
| 83 | grow: | ||
| 84 | status = efi_call_early(allocate_pool, EFI_LOADER_DATA, | ||
| 85 | info_sz, (void **)&info); | ||
| 86 | if (status != EFI_SUCCESS) { | ||
| 87 | efi_printk(sys_table, "Failed to alloc mem for file info\n"); | ||
| 88 | return status; | ||
| 89 | } | ||
| 90 | |||
| 91 | status = efi_early->call((unsigned long)h->get_info, h, &info_guid, | ||
| 92 | &info_sz, info); | ||
| 93 | if (status == EFI_BUFFER_TOO_SMALL) { | ||
| 94 | efi_call_early(free_pool, info); | ||
| 95 | goto grow; | ||
| 96 | } | ||
| 97 | |||
| 98 | *file_sz = info->file_size; | ||
| 99 | efi_call_early(free_pool, info); | ||
| 100 | |||
| 101 | if (status != EFI_SUCCESS) | ||
| 102 | efi_printk(sys_table, "Failed to get initrd info\n"); | ||
| 103 | |||
| 104 | return status; | ||
| 105 | } | ||
| 106 | |||
| 107 | static efi_status_t | ||
| 108 | __file_size64(void *__fh, efi_char16_t *filename_16, | ||
| 109 | void **handle, u64 *file_sz) | ||
| 110 | { | ||
| 111 | efi_file_handle_64_t *h, *fh = __fh; | ||
| 112 | efi_file_info_t *info; | ||
| 113 | efi_status_t status; | ||
| 114 | efi_guid_t info_guid = EFI_FILE_INFO_ID; | ||
| 115 | u32 info_sz; | ||
| 24 | 116 | ||
| 117 | status = efi_early->call((unsigned long)fh->open, fh, &h, filename_16, | ||
| 118 | EFI_FILE_MODE_READ, (u64)0); | ||
| 119 | if (status != EFI_SUCCESS) { | ||
| 120 | efi_printk(sys_table, "Failed to open file: "); | ||
| 121 | efi_char16_printk(sys_table, filename_16); | ||
| 122 | efi_printk(sys_table, "\n"); | ||
| 123 | return status; | ||
| 124 | } | ||
| 25 | 125 | ||
| 126 | *handle = h; | ||
| 127 | |||
| 128 | info_sz = 0; | ||
| 129 | status = efi_early->call((unsigned long)h->get_info, h, &info_guid, | ||
| 130 | &info_sz, NULL); | ||
| 131 | if (status != EFI_BUFFER_TOO_SMALL) { | ||
| 132 | efi_printk(sys_table, "Failed to get file info size\n"); | ||
| 133 | return status; | ||
| 134 | } | ||
| 135 | |||
| 136 | grow: | ||
| 137 | status = efi_call_early(allocate_pool, EFI_LOADER_DATA, | ||
| 138 | info_sz, (void **)&info); | ||
| 139 | if (status != EFI_SUCCESS) { | ||
| 140 | efi_printk(sys_table, "Failed to alloc mem for file info\n"); | ||
| 141 | return status; | ||
| 142 | } | ||
| 143 | |||
| 144 | status = efi_early->call((unsigned long)h->get_info, h, &info_guid, | ||
| 145 | &info_sz, info); | ||
| 146 | if (status == EFI_BUFFER_TOO_SMALL) { | ||
| 147 | efi_call_early(free_pool, info); | ||
| 148 | goto grow; | ||
| 149 | } | ||
| 150 | |||
| 151 | *file_sz = info->file_size; | ||
| 152 | efi_call_early(free_pool, info); | ||
| 153 | |||
| 154 | if (status != EFI_SUCCESS) | ||
| 155 | efi_printk(sys_table, "Failed to get initrd info\n"); | ||
| 156 | |||
| 157 | return status; | ||
| 158 | } | ||
| 159 | static efi_status_t | ||
| 160 | efi_file_size(efi_system_table_t *sys_table, void *__fh, | ||
| 161 | efi_char16_t *filename_16, void **handle, u64 *file_sz) | ||
| 162 | { | ||
| 163 | if (efi_early->is64) | ||
| 164 | return __file_size64(__fh, filename_16, handle, file_sz); | ||
| 165 | |||
| 166 | return __file_size32(__fh, filename_16, handle, file_sz); | ||
| 167 | } | ||
| 168 | |||
| 169 | static inline efi_status_t | ||
| 170 | efi_file_read(void *__fh, void *handle, unsigned long *size, void *addr) | ||
| 171 | { | ||
| 172 | unsigned long func; | ||
| 173 | |||
| 174 | if (efi_early->is64) { | ||
| 175 | efi_file_handle_64_t *fh = __fh; | ||
| 176 | |||
| 177 | func = (unsigned long)fh->read; | ||
| 178 | return efi_early->call(func, handle, size, addr); | ||
| 179 | } else { | ||
| 180 | efi_file_handle_32_t *fh = __fh; | ||
| 181 | |||
| 182 | func = (unsigned long)fh->read; | ||
| 183 | return efi_early->call(func, handle, size, addr); | ||
| 184 | } | ||
| 185 | } | ||
| 186 | |||
| 187 | static inline efi_status_t efi_file_close(void *__fh, void *handle) | ||
| 188 | { | ||
| 189 | if (efi_early->is64) { | ||
| 190 | efi_file_handle_64_t *fh = __fh; | ||
| 191 | |||
| 192 | return efi_early->call((unsigned long)fh->close, handle); | ||
| 193 | } else { | ||
| 194 | efi_file_handle_32_t *fh = __fh; | ||
| 195 | |||
| 196 | return efi_early->call((unsigned long)fh->close, handle); | ||
| 197 | } | ||
| 198 | } | ||
| 199 | |||
| 200 | static inline efi_status_t __open_volume32(void *__image, void **__fh) | ||
| 201 | { | ||
| 202 | efi_file_io_interface_t *io; | ||
| 203 | efi_loaded_image_32_t *image = __image; | ||
| 204 | efi_file_handle_32_t *fh; | ||
| 205 | efi_guid_t fs_proto = EFI_FILE_SYSTEM_GUID; | ||
| 206 | efi_status_t status; | ||
| 207 | void *handle = (void *)(unsigned long)image->device_handle; | ||
| 208 | unsigned long func; | ||
| 209 | |||
| 210 | status = efi_call_early(handle_protocol, handle, | ||
| 211 | &fs_proto, (void **)&io); | ||
| 212 | if (status != EFI_SUCCESS) { | ||
| 213 | efi_printk(sys_table, "Failed to handle fs_proto\n"); | ||
| 214 | return status; | ||
| 215 | } | ||
| 216 | |||
| 217 | func = (unsigned long)io->open_volume; | ||
| 218 | status = efi_early->call(func, io, &fh); | ||
| 219 | if (status != EFI_SUCCESS) | ||
| 220 | efi_printk(sys_table, "Failed to open volume\n"); | ||
| 221 | |||
| 222 | *__fh = fh; | ||
| 223 | return status; | ||
| 224 | } | ||
| 225 | |||
| 226 | static inline efi_status_t __open_volume64(void *__image, void **__fh) | ||
| 227 | { | ||
| 228 | efi_file_io_interface_t *io; | ||
| 229 | efi_loaded_image_64_t *image = __image; | ||
| 230 | efi_file_handle_64_t *fh; | ||
| 231 | efi_guid_t fs_proto = EFI_FILE_SYSTEM_GUID; | ||
| 232 | efi_status_t status; | ||
| 233 | void *handle = (void *)(unsigned long)image->device_handle; | ||
| 234 | unsigned long func; | ||
| 235 | |||
| 236 | status = efi_call_early(handle_protocol, handle, | ||
| 237 | &fs_proto, (void **)&io); | ||
| 238 | if (status != EFI_SUCCESS) { | ||
| 239 | efi_printk(sys_table, "Failed to handle fs_proto\n"); | ||
| 240 | return status; | ||
| 241 | } | ||
| 242 | |||
| 243 | func = (unsigned long)io->open_volume; | ||
| 244 | status = efi_early->call(func, io, &fh); | ||
| 245 | if (status != EFI_SUCCESS) | ||
| 246 | efi_printk(sys_table, "Failed to open volume\n"); | ||
| 247 | |||
| 248 | *__fh = fh; | ||
| 249 | return status; | ||
| 250 | } | ||
| 251 | |||
| 252 | static inline efi_status_t | ||
| 253 | efi_open_volume(efi_system_table_t *sys_table, void *__image, void **__fh) | ||
| 254 | { | ||
| 255 | if (efi_early->is64) | ||
| 256 | return __open_volume64(__image, __fh); | ||
| 257 | |||
| 258 | return __open_volume32(__image, __fh); | ||
| 259 | } | ||
| 260 | |||
| 261 | static void efi_char16_printk(efi_system_table_t *table, efi_char16_t *str) | ||
| 262 | { | ||
| 263 | unsigned long output_string; | ||
| 264 | size_t offset; | ||
| 265 | |||
| 266 | if (efi_early->is64) { | ||
| 267 | struct efi_simple_text_output_protocol_64 *out; | ||
| 268 | u64 *func; | ||
| 269 | |||
| 270 | offset = offsetof(typeof(*out), output_string); | ||
| 271 | output_string = efi_early->text_output + offset; | ||
| 272 | func = (u64 *)output_string; | ||
| 273 | |||
| 274 | efi_early->call(*func, efi_early->text_output, str); | ||
| 275 | } else { | ||
| 276 | struct efi_simple_text_output_protocol_32 *out; | ||
| 277 | u32 *func; | ||
| 278 | |||
| 279 | offset = offsetof(typeof(*out), output_string); | ||
| 280 | output_string = efi_early->text_output + offset; | ||
| 281 | func = (u32 *)output_string; | ||
| 282 | |||
| 283 | efi_early->call(*func, efi_early->text_output, str); | ||
| 284 | } | ||
| 285 | } | ||
| 286 | |||
| 287 | #include "../../../../drivers/firmware/efi/efi-stub-helper.c" | ||
| 26 | 288 | ||
| 27 | static void find_bits(unsigned long mask, u8 *pos, u8 *size) | 289 | static void find_bits(unsigned long mask, u8 *pos, u8 *size) |
| 28 | { | 290 | { |
| @@ -47,105 +309,97 @@ static void find_bits(unsigned long mask, u8 *pos, u8 *size) | |||
| 47 | *size = len; | 309 | *size = len; |
| 48 | } | 310 | } |
| 49 | 311 | ||
| 50 | static efi_status_t setup_efi_pci(struct boot_params *params) | 312 | static efi_status_t |
| 313 | __setup_efi_pci32(efi_pci_io_protocol_32 *pci, struct pci_setup_rom **__rom) | ||
| 51 | { | 314 | { |
| 52 | efi_pci_io_protocol *pci; | 315 | struct pci_setup_rom *rom = NULL; |
| 53 | efi_status_t status; | 316 | efi_status_t status; |
| 54 | void **pci_handle; | 317 | unsigned long size; |
| 55 | efi_guid_t pci_proto = EFI_PCI_IO_PROTOCOL_GUID; | 318 | uint64_t attributes; |
| 56 | unsigned long nr_pci, size = 0; | ||
| 57 | int i; | ||
| 58 | struct setup_data *data; | ||
| 59 | 319 | ||
| 60 | data = (struct setup_data *)(unsigned long)params->hdr.setup_data; | 320 | status = efi_early->call(pci->attributes, pci, |
| 321 | EfiPciIoAttributeOperationGet, 0, 0, | ||
| 322 | &attributes); | ||
| 323 | if (status != EFI_SUCCESS) | ||
| 324 | return status; | ||
| 61 | 325 | ||
| 62 | while (data && data->next) | 326 | if (!pci->romimage || !pci->romsize) |
| 63 | data = (struct setup_data *)(unsigned long)data->next; | 327 | return EFI_INVALID_PARAMETER; |
| 64 | 328 | ||
| 65 | status = efi_call_phys5(sys_table->boottime->locate_handle, | 329 | size = pci->romsize + sizeof(*rom); |
| 66 | EFI_LOCATE_BY_PROTOCOL, &pci_proto, | ||
| 67 | NULL, &size, pci_handle); | ||
| 68 | 330 | ||
| 69 | if (status == EFI_BUFFER_TOO_SMALL) { | 331 | status = efi_call_early(allocate_pool, EFI_LOADER_DATA, size, &rom); |
| 70 | status = efi_call_phys3(sys_table->boottime->allocate_pool, | 332 | if (status != EFI_SUCCESS) |
| 71 | EFI_LOADER_DATA, size, &pci_handle); | 333 | return status; |
| 72 | 334 | ||
| 73 | if (status != EFI_SUCCESS) | 335 | memset(rom, 0, sizeof(*rom)); |
| 74 | return status; | ||
| 75 | 336 | ||
| 76 | status = efi_call_phys5(sys_table->boottime->locate_handle, | 337 | rom->data.type = SETUP_PCI; |
| 77 | EFI_LOCATE_BY_PROTOCOL, &pci_proto, | 338 | rom->data.len = size - sizeof(struct setup_data); |
| 78 | NULL, &size, pci_handle); | 339 | rom->data.next = 0; |
| 79 | } | 340 | rom->pcilen = pci->romsize; |
| 341 | *__rom = rom; | ||
| 80 | 342 | ||
| 81 | if (status != EFI_SUCCESS) | 343 | status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, |
| 82 | goto free_handle; | 344 | PCI_VENDOR_ID, 1, &(rom->vendor)); |
| 83 | |||
| 84 | nr_pci = size / sizeof(void *); | ||
| 85 | for (i = 0; i < nr_pci; i++) { | ||
| 86 | void *h = pci_handle[i]; | ||
| 87 | uint64_t attributes; | ||
| 88 | struct pci_setup_rom *rom; | ||
| 89 | 345 | ||
| 90 | status = efi_call_phys3(sys_table->boottime->handle_protocol, | 346 | if (status != EFI_SUCCESS) |
| 91 | h, &pci_proto, &pci); | 347 | goto free_struct; |
| 92 | 348 | ||
| 93 | if (status != EFI_SUCCESS) | 349 | status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, |
| 94 | continue; | 350 | PCI_DEVICE_ID, 1, &(rom->devid)); |
| 95 | 351 | ||
| 96 | if (!pci) | 352 | if (status != EFI_SUCCESS) |
| 97 | continue; | 353 | goto free_struct; |
| 98 | 354 | ||
| 99 | #ifdef CONFIG_X86_64 | 355 | status = efi_early->call(pci->get_location, pci, &(rom->segment), |
| 100 | status = efi_call_phys4(pci->attributes, pci, | 356 | &(rom->bus), &(rom->device), &(rom->function)); |
| 101 | EfiPciIoAttributeOperationGet, 0, | ||
| 102 | &attributes); | ||
| 103 | #else | ||
| 104 | status = efi_call_phys5(pci->attributes, pci, | ||
| 105 | EfiPciIoAttributeOperationGet, 0, 0, | ||
| 106 | &attributes); | ||
| 107 | #endif | ||
| 108 | if (status != EFI_SUCCESS) | ||
| 109 | continue; | ||
| 110 | 357 | ||
| 111 | if (!pci->romimage || !pci->romsize) | 358 | if (status != EFI_SUCCESS) |
| 112 | continue; | 359 | goto free_struct; |
| 113 | 360 | ||
| 114 | size = pci->romsize + sizeof(*rom); | 361 | memcpy(rom->romdata, pci->romimage, pci->romsize); |
| 362 | return status; | ||
| 115 | 363 | ||
| 116 | status = efi_call_phys3(sys_table->boottime->allocate_pool, | 364 | free_struct: |
| 117 | EFI_LOADER_DATA, size, &rom); | 365 | efi_call_early(free_pool, rom); |
| 366 | return status; | ||
| 367 | } | ||
| 118 | 368 | ||
| 119 | if (status != EFI_SUCCESS) | 369 | static efi_status_t |
| 120 | continue; | 370 | setup_efi_pci32(struct boot_params *params, void **pci_handle, |
| 371 | unsigned long size) | ||
| 372 | { | ||
| 373 | efi_pci_io_protocol_32 *pci = NULL; | ||
| 374 | efi_guid_t pci_proto = EFI_PCI_IO_PROTOCOL_GUID; | ||
| 375 | u32 *handles = (u32 *)(unsigned long)pci_handle; | ||
| 376 | efi_status_t status; | ||
| 377 | unsigned long nr_pci; | ||
| 378 | struct setup_data *data; | ||
| 379 | int i; | ||
| 121 | 380 | ||
| 122 | rom->data.type = SETUP_PCI; | 381 | data = (struct setup_data *)(unsigned long)params->hdr.setup_data; |
| 123 | rom->data.len = size - sizeof(struct setup_data); | ||
| 124 | rom->data.next = 0; | ||
| 125 | rom->pcilen = pci->romsize; | ||
| 126 | 382 | ||
| 127 | status = efi_call_phys5(pci->pci.read, pci, | 383 | while (data && data->next) |
| 128 | EfiPciIoWidthUint16, PCI_VENDOR_ID, | 384 | data = (struct setup_data *)(unsigned long)data->next; |
| 129 | 1, &(rom->vendor)); | ||
| 130 | 385 | ||
| 131 | if (status != EFI_SUCCESS) | 386 | nr_pci = size / sizeof(u32); |
| 132 | goto free_struct; | 387 | for (i = 0; i < nr_pci; i++) { |
| 388 | struct pci_setup_rom *rom = NULL; | ||
| 389 | u32 h = handles[i]; | ||
| 133 | 390 | ||
| 134 | status = efi_call_phys5(pci->pci.read, pci, | 391 | status = efi_call_early(handle_protocol, h, |
| 135 | EfiPciIoWidthUint16, PCI_DEVICE_ID, | 392 | &pci_proto, (void **)&pci); |
| 136 | 1, &(rom->devid)); | ||
| 137 | 393 | ||
| 138 | if (status != EFI_SUCCESS) | 394 | if (status != EFI_SUCCESS) |
| 139 | goto free_struct; | 395 | continue; |
| 140 | 396 | ||
| 141 | status = efi_call_phys5(pci->get_location, pci, | 397 | if (!pci) |
| 142 | &(rom->segment), &(rom->bus), | 398 | continue; |
| 143 | &(rom->device), &(rom->function)); | ||
| 144 | 399 | ||
| 400 | status = __setup_efi_pci32(pci, &rom); | ||
| 145 | if (status != EFI_SUCCESS) | 401 | if (status != EFI_SUCCESS) |
| 146 | goto free_struct; | 402 | continue; |
| 147 | |||
| 148 | memcpy(rom->romdata, pci->romimage, pci->romsize); | ||
| 149 | 403 | ||
| 150 | if (data) | 404 | if (data) |
| 151 | data->next = (unsigned long)rom; | 405 | data->next = (unsigned long)rom; |
| @@ -154,105 +408,155 @@ static efi_status_t setup_efi_pci(struct boot_params *params) | |||
| 154 | 408 | ||
| 155 | data = (struct setup_data *)rom; | 409 | data = (struct setup_data *)rom; |
| 156 | 410 | ||
| 157 | continue; | ||
| 158 | free_struct: | ||
| 159 | efi_call_phys1(sys_table->boottime->free_pool, rom); | ||
| 160 | } | 411 | } |
| 161 | 412 | ||
| 162 | free_handle: | ||
| 163 | efi_call_phys1(sys_table->boottime->free_pool, pci_handle); | ||
| 164 | return status; | 413 | return status; |
| 165 | } | 414 | } |
| 166 | 415 | ||
| 167 | /* | 416 | static efi_status_t |
| 168 | * See if we have Graphics Output Protocol | 417 | __setup_efi_pci64(efi_pci_io_protocol_64 *pci, struct pci_setup_rom **__rom) |
| 169 | */ | ||
| 170 | static efi_status_t setup_gop(struct screen_info *si, efi_guid_t *proto, | ||
| 171 | unsigned long size) | ||
| 172 | { | 418 | { |
| 173 | struct efi_graphics_output_protocol *gop, *first_gop; | 419 | struct pci_setup_rom *rom; |
| 174 | struct efi_pixel_bitmask pixel_info; | ||
| 175 | unsigned long nr_gops; | ||
| 176 | efi_status_t status; | 420 | efi_status_t status; |
| 177 | void **gop_handle; | 421 | unsigned long size; |
| 178 | u16 width, height; | 422 | uint64_t attributes; |
| 179 | u32 fb_base, fb_size; | ||
| 180 | u32 pixels_per_scan_line; | ||
| 181 | int pixel_format; | ||
| 182 | int i; | ||
| 183 | 423 | ||
| 184 | status = efi_call_phys3(sys_table->boottime->allocate_pool, | 424 | status = efi_early->call(pci->attributes, pci, |
| 185 | EFI_LOADER_DATA, size, &gop_handle); | 425 | EfiPciIoAttributeOperationGet, 0, |
| 426 | &attributes); | ||
| 186 | if (status != EFI_SUCCESS) | 427 | if (status != EFI_SUCCESS) |
| 187 | return status; | 428 | return status; |
| 188 | 429 | ||
| 189 | status = efi_call_phys5(sys_table->boottime->locate_handle, | 430 | if (!pci->romimage || !pci->romsize) |
| 190 | EFI_LOCATE_BY_PROTOCOL, proto, | 431 | return EFI_INVALID_PARAMETER; |
| 191 | NULL, &size, gop_handle); | 432 | |
| 433 | size = pci->romsize + sizeof(*rom); | ||
| 434 | |||
| 435 | status = efi_call_early(allocate_pool, EFI_LOADER_DATA, size, &rom); | ||
| 192 | if (status != EFI_SUCCESS) | 436 | if (status != EFI_SUCCESS) |
| 193 | goto free_handle; | 437 | return status; |
| 194 | 438 | ||
| 195 | first_gop = NULL; | 439 | rom->data.type = SETUP_PCI; |
| 440 | rom->data.len = size - sizeof(struct setup_data); | ||
| 441 | rom->data.next = 0; | ||
| 442 | rom->pcilen = pci->romsize; | ||
| 443 | *__rom = rom; | ||
| 196 | 444 | ||
| 197 | nr_gops = size / sizeof(void *); | 445 | status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, |
| 198 | for (i = 0; i < nr_gops; i++) { | 446 | PCI_VENDOR_ID, 1, &(rom->vendor)); |
| 199 | struct efi_graphics_output_mode_info *info; | 447 | |
| 200 | efi_guid_t conout_proto = EFI_CONSOLE_OUT_DEVICE_GUID; | 448 | if (status != EFI_SUCCESS) |
| 201 | bool conout_found = false; | 449 | goto free_struct; |
| 202 | void *dummy; | 450 | |
| 203 | void *h = gop_handle[i]; | 451 | status = efi_early->call(pci->pci.read, pci, EfiPciIoWidthUint16, |
| 452 | PCI_DEVICE_ID, 1, &(rom->devid)); | ||
| 453 | |||
| 454 | if (status != EFI_SUCCESS) | ||
| 455 | goto free_struct; | ||
| 456 | |||
| 457 | status = efi_early->call(pci->get_location, pci, &(rom->segment), | ||
| 458 | &(rom->bus), &(rom->device), &(rom->function)); | ||
| 459 | |||
| 460 | if (status != EFI_SUCCESS) | ||
| 461 | goto free_struct; | ||
| 462 | |||
| 463 | memcpy(rom->romdata, pci->romimage, pci->romsize); | ||
| 464 | return status; | ||
| 465 | |||
| 466 | free_struct: | ||
| 467 | efi_call_early(free_pool, rom); | ||
| 468 | return status; | ||
| 469 | |||
| 470 | } | ||
| 471 | |||
| 472 | static efi_status_t | ||
| 473 | setup_efi_pci64(struct boot_params *params, void **pci_handle, | ||
| 474 | unsigned long size) | ||
| 475 | { | ||
| 476 | efi_pci_io_protocol_64 *pci = NULL; | ||
| 477 | efi_guid_t pci_proto = EFI_PCI_IO_PROTOCOL_GUID; | ||
| 478 | u64 *handles = (u64 *)(unsigned long)pci_handle; | ||
| 479 | efi_status_t status; | ||
| 480 | unsigned long nr_pci; | ||
| 481 | struct setup_data *data; | ||
| 482 | int i; | ||
| 483 | |||
| 484 | data = (struct setup_data *)(unsigned long)params->hdr.setup_data; | ||
| 485 | |||
| 486 | while (data && data->next) | ||
| 487 | data = (struct setup_data *)(unsigned long)data->next; | ||
| 488 | |||
| 489 | nr_pci = size / sizeof(u64); | ||
| 490 | for (i = 0; i < nr_pci; i++) { | ||
| 491 | struct pci_setup_rom *rom = NULL; | ||
| 492 | u64 h = handles[i]; | ||
| 493 | |||
| 494 | status = efi_call_early(handle_protocol, h, | ||
| 495 | &pci_proto, (void **)&pci); | ||
| 204 | 496 | ||
| 205 | status = efi_call_phys3(sys_table->boottime->handle_protocol, | ||
| 206 | h, proto, &gop); | ||
| 207 | if (status != EFI_SUCCESS) | 497 | if (status != EFI_SUCCESS) |
| 208 | continue; | 498 | continue; |
| 209 | 499 | ||
| 210 | status = efi_call_phys3(sys_table->boottime->handle_protocol, | 500 | if (!pci) |
| 211 | h, &conout_proto, &dummy); | 501 | continue; |
| 212 | 502 | ||
| 213 | if (status == EFI_SUCCESS) | 503 | status = __setup_efi_pci64(pci, &rom); |
| 214 | conout_found = true; | 504 | if (status != EFI_SUCCESS) |
| 505 | continue; | ||
| 215 | 506 | ||
| 216 | status = efi_call_phys4(gop->query_mode, gop, | 507 | if (data) |
| 217 | gop->mode->mode, &size, &info); | 508 | data->next = (unsigned long)rom; |
| 218 | if (status == EFI_SUCCESS && (!first_gop || conout_found)) { | 509 | else |
| 219 | /* | 510 | params->hdr.setup_data = (unsigned long)rom; |
| 220 | * Systems that use the UEFI Console Splitter may | 511 | |
| 221 | * provide multiple GOP devices, not all of which are | 512 | data = (struct setup_data *)rom; |
| 222 | * backed by real hardware. The workaround is to search | ||
| 223 | * for a GOP implementing the ConOut protocol, and if | ||
| 224 | * one isn't found, to just fall back to the first GOP. | ||
| 225 | */ | ||
| 226 | width = info->horizontal_resolution; | ||
| 227 | height = info->vertical_resolution; | ||
| 228 | fb_base = gop->mode->frame_buffer_base; | ||
| 229 | fb_size = gop->mode->frame_buffer_size; | ||
| 230 | pixel_format = info->pixel_format; | ||
| 231 | pixel_info = info->pixel_information; | ||
| 232 | pixels_per_scan_line = info->pixels_per_scan_line; | ||
| 233 | 513 | ||
| 234 | /* | ||
| 235 | * Once we've found a GOP supporting ConOut, | ||
| 236 | * don't bother looking any further. | ||
| 237 | */ | ||
| 238 | first_gop = gop; | ||
| 239 | if (conout_found) | ||
| 240 | break; | ||
| 241 | } | ||
| 242 | } | 514 | } |
| 243 | 515 | ||
| 244 | /* Did we find any GOPs? */ | 516 | return status; |
| 245 | if (!first_gop) | 517 | } |
| 518 | |||
| 519 | static efi_status_t setup_efi_pci(struct boot_params *params) | ||
| 520 | { | ||
| 521 | efi_status_t status; | ||
| 522 | void **pci_handle = NULL; | ||
| 523 | efi_guid_t pci_proto = EFI_PCI_IO_PROTOCOL_GUID; | ||
| 524 | unsigned long size = 0; | ||
| 525 | |||
| 526 | status = efi_call_early(locate_handle, | ||
| 527 | EFI_LOCATE_BY_PROTOCOL, | ||
| 528 | &pci_proto, NULL, &size, pci_handle); | ||
| 529 | |||
| 530 | if (status == EFI_BUFFER_TOO_SMALL) { | ||
| 531 | status = efi_call_early(allocate_pool, | ||
| 532 | EFI_LOADER_DATA, | ||
| 533 | size, (void **)&pci_handle); | ||
| 534 | |||
| 535 | if (status != EFI_SUCCESS) | ||
| 536 | return status; | ||
| 537 | |||
| 538 | status = efi_call_early(locate_handle, | ||
| 539 | EFI_LOCATE_BY_PROTOCOL, &pci_proto, | ||
| 540 | NULL, &size, pci_handle); | ||
| 541 | } | ||
| 542 | |||
| 543 | if (status != EFI_SUCCESS) | ||
| 246 | goto free_handle; | 544 | goto free_handle; |
| 247 | 545 | ||
| 248 | /* EFI framebuffer */ | 546 | if (efi_early->is64) |
| 249 | si->orig_video_isVGA = VIDEO_TYPE_EFI; | 547 | status = setup_efi_pci64(params, pci_handle, size); |
| 548 | else | ||
| 549 | status = setup_efi_pci32(params, pci_handle, size); | ||
| 250 | 550 | ||
| 251 | si->lfb_width = width; | 551 | free_handle: |
| 252 | si->lfb_height = height; | 552 | efi_call_early(free_pool, pci_handle); |
| 253 | si->lfb_base = fb_base; | 553 | return status; |
| 254 | si->pages = 1; | 554 | } |
| 255 | 555 | ||
| 556 | static void | ||
| 557 | setup_pixel_info(struct screen_info *si, u32 pixels_per_scan_line, | ||
| 558 | struct efi_pixel_bitmask pixel_info, int pixel_format) | ||
| 559 | { | ||
| 256 | if (pixel_format == PIXEL_RGB_RESERVED_8BIT_PER_COLOR) { | 560 | if (pixel_format == PIXEL_RGB_RESERVED_8BIT_PER_COLOR) { |
| 257 | si->lfb_depth = 32; | 561 | si->lfb_depth = 32; |
| 258 | si->lfb_linelength = pixels_per_scan_line * 4; | 562 | si->lfb_linelength = pixels_per_scan_line * 4; |
| @@ -297,62 +601,319 @@ static efi_status_t setup_gop(struct screen_info *si, efi_guid_t *proto, | |||
| 297 | si->rsvd_size = 0; | 601 | si->rsvd_size = 0; |
| 298 | si->rsvd_pos = 0; | 602 | si->rsvd_pos = 0; |
| 299 | } | 603 | } |
| 604 | } | ||
| 605 | |||
| 606 | static efi_status_t | ||
| 607 | __gop_query32(struct efi_graphics_output_protocol_32 *gop32, | ||
| 608 | struct efi_graphics_output_mode_info **info, | ||
| 609 | unsigned long *size, u32 *fb_base) | ||
| 610 | { | ||
| 611 | struct efi_graphics_output_protocol_mode_32 *mode; | ||
| 612 | efi_status_t status; | ||
| 613 | unsigned long m; | ||
| 614 | |||
| 615 | m = gop32->mode; | ||
| 616 | mode = (struct efi_graphics_output_protocol_mode_32 *)m; | ||
| 617 | |||
| 618 | status = efi_early->call(gop32->query_mode, gop32, | ||
| 619 | mode->mode, size, info); | ||
| 620 | if (status != EFI_SUCCESS) | ||
| 621 | return status; | ||
| 622 | |||
| 623 | *fb_base = mode->frame_buffer_base; | ||
| 624 | return status; | ||
| 625 | } | ||
| 626 | |||
| 627 | static efi_status_t | ||
| 628 | setup_gop32(struct screen_info *si, efi_guid_t *proto, | ||
| 629 | unsigned long size, void **gop_handle) | ||
| 630 | { | ||
| 631 | struct efi_graphics_output_protocol_32 *gop32, *first_gop; | ||
| 632 | unsigned long nr_gops; | ||
| 633 | u16 width, height; | ||
| 634 | u32 pixels_per_scan_line; | ||
| 635 | u32 fb_base; | ||
| 636 | struct efi_pixel_bitmask pixel_info; | ||
| 637 | int pixel_format; | ||
| 638 | efi_status_t status; | ||
| 639 | u32 *handles = (u32 *)(unsigned long)gop_handle; | ||
| 640 | int i; | ||
| 641 | |||
| 642 | first_gop = NULL; | ||
| 643 | gop32 = NULL; | ||
| 644 | |||
| 645 | nr_gops = size / sizeof(u32); | ||
| 646 | for (i = 0; i < nr_gops; i++) { | ||
| 647 | struct efi_graphics_output_mode_info *info = NULL; | ||
| 648 | efi_guid_t conout_proto = EFI_CONSOLE_OUT_DEVICE_GUID; | ||
| 649 | bool conout_found = false; | ||
| 650 | void *dummy = NULL; | ||
| 651 | u32 h = handles[i]; | ||
| 652 | |||
| 653 | status = efi_call_early(handle_protocol, h, | ||
| 654 | proto, (void **)&gop32); | ||
| 655 | if (status != EFI_SUCCESS) | ||
| 656 | continue; | ||
| 657 | |||
| 658 | status = efi_call_early(handle_protocol, h, | ||
| 659 | &conout_proto, &dummy); | ||
| 660 | if (status == EFI_SUCCESS) | ||
| 661 | conout_found = true; | ||
| 662 | |||
| 663 | status = __gop_query32(gop32, &info, &size, &fb_base); | ||
| 664 | if (status == EFI_SUCCESS && (!first_gop || conout_found)) { | ||
| 665 | /* | ||
| 666 | * Systems that use the UEFI Console Splitter may | ||
| 667 | * provide multiple GOP devices, not all of which are | ||
| 668 | * backed by real hardware. The workaround is to search | ||
| 669 | * for a GOP implementing the ConOut protocol, and if | ||
| 670 | * one isn't found, to just fall back to the first GOP. | ||
| 671 | */ | ||
| 672 | width = info->horizontal_resolution; | ||
| 673 | height = info->vertical_resolution; | ||
| 674 | pixel_format = info->pixel_format; | ||
| 675 | pixel_info = info->pixel_information; | ||
| 676 | pixels_per_scan_line = info->pixels_per_scan_line; | ||
| 677 | |||
| 678 | /* | ||
| 679 | * Once we've found a GOP supporting ConOut, | ||
| 680 | * don't bother looking any further. | ||
| 681 | */ | ||
| 682 | first_gop = gop32; | ||
| 683 | if (conout_found) | ||
| 684 | break; | ||
| 685 | } | ||
| 686 | } | ||
| 687 | |||
| 688 | /* Did we find any GOPs? */ | ||
| 689 | if (!first_gop) | ||
| 690 | goto out; | ||
| 691 | |||
| 692 | /* EFI framebuffer */ | ||
| 693 | si->orig_video_isVGA = VIDEO_TYPE_EFI; | ||
| 694 | |||
| 695 | si->lfb_width = width; | ||
| 696 | si->lfb_height = height; | ||
| 697 | si->lfb_base = fb_base; | ||
| 698 | si->pages = 1; | ||
| 699 | |||
| 700 | setup_pixel_info(si, pixels_per_scan_line, pixel_info, pixel_format); | ||
| 300 | 701 | ||
| 301 | si->lfb_size = si->lfb_linelength * si->lfb_height; | 702 | si->lfb_size = si->lfb_linelength * si->lfb_height; |
| 302 | 703 | ||
| 303 | si->capabilities |= VIDEO_CAPABILITY_SKIP_QUIRKS; | 704 | si->capabilities |= VIDEO_CAPABILITY_SKIP_QUIRKS; |
| 705 | out: | ||
| 706 | return status; | ||
| 707 | } | ||
| 304 | 708 | ||
| 305 | free_handle: | 709 | static efi_status_t |
| 306 | efi_call_phys1(sys_table->boottime->free_pool, gop_handle); | 710 | __gop_query64(struct efi_graphics_output_protocol_64 *gop64, |
| 711 | struct efi_graphics_output_mode_info **info, | ||
| 712 | unsigned long *size, u32 *fb_base) | ||
| 713 | { | ||
| 714 | struct efi_graphics_output_protocol_mode_64 *mode; | ||
| 715 | efi_status_t status; | ||
| 716 | unsigned long m; | ||
| 717 | |||
| 718 | m = gop64->mode; | ||
| 719 | mode = (struct efi_graphics_output_protocol_mode_64 *)m; | ||
| 720 | |||
| 721 | status = efi_early->call(gop64->query_mode, gop64, | ||
| 722 | mode->mode, size, info); | ||
| 723 | if (status != EFI_SUCCESS) | ||
| 724 | return status; | ||
| 725 | |||
| 726 | *fb_base = mode->frame_buffer_base; | ||
| 727 | return status; | ||
| 728 | } | ||
| 729 | |||
| 730 | static efi_status_t | ||
| 731 | setup_gop64(struct screen_info *si, efi_guid_t *proto, | ||
| 732 | unsigned long size, void **gop_handle) | ||
| 733 | { | ||
| 734 | struct efi_graphics_output_protocol_64 *gop64, *first_gop; | ||
| 735 | unsigned long nr_gops; | ||
| 736 | u16 width, height; | ||
| 737 | u32 pixels_per_scan_line; | ||
| 738 | u32 fb_base; | ||
| 739 | struct efi_pixel_bitmask pixel_info; | ||
| 740 | int pixel_format; | ||
| 741 | efi_status_t status; | ||
| 742 | u64 *handles = (u64 *)(unsigned long)gop_handle; | ||
| 743 | int i; | ||
| 744 | |||
| 745 | first_gop = NULL; | ||
| 746 | gop64 = NULL; | ||
| 747 | |||
| 748 | nr_gops = size / sizeof(u64); | ||
| 749 | for (i = 0; i < nr_gops; i++) { | ||
| 750 | struct efi_graphics_output_mode_info *info = NULL; | ||
| 751 | efi_guid_t conout_proto = EFI_CONSOLE_OUT_DEVICE_GUID; | ||
| 752 | bool conout_found = false; | ||
| 753 | void *dummy = NULL; | ||
| 754 | u64 h = handles[i]; | ||
| 755 | |||
| 756 | status = efi_call_early(handle_protocol, h, | ||
| 757 | proto, (void **)&gop64); | ||
| 758 | if (status != EFI_SUCCESS) | ||
| 759 | continue; | ||
| 760 | |||
| 761 | status = efi_call_early(handle_protocol, h, | ||
| 762 | &conout_proto, &dummy); | ||
| 763 | if (status == EFI_SUCCESS) | ||
| 764 | conout_found = true; | ||
| 765 | |||
| 766 | status = __gop_query64(gop64, &info, &size, &fb_base); | ||
| 767 | if (status == EFI_SUCCESS && (!first_gop || conout_found)) { | ||
| 768 | /* | ||
| 769 | * Systems that use the UEFI Console Splitter may | ||
| 770 | * provide multiple GOP devices, not all of which are | ||
| 771 | * backed by real hardware. The workaround is to search | ||
| 772 | * for a GOP implementing the ConOut protocol, and if | ||
| 773 | * one isn't found, to just fall back to the first GOP. | ||
| 774 | */ | ||
| 775 | width = info->horizontal_resolution; | ||
| 776 | height = info->vertical_resolution; | ||
| 777 | pixel_format = info->pixel_format; | ||
| 778 | pixel_info = info->pixel_information; | ||
| 779 | pixels_per_scan_line = info->pixels_per_scan_line; | ||
| 780 | |||
| 781 | /* | ||
| 782 | * Once we've found a GOP supporting ConOut, | ||
| 783 | * don't bother looking any further. | ||
| 784 | */ | ||
| 785 | first_gop = gop64; | ||
| 786 | if (conout_found) | ||
| 787 | break; | ||
| 788 | } | ||
| 789 | } | ||
| 790 | |||
| 791 | /* Did we find any GOPs? */ | ||
| 792 | if (!first_gop) | ||
| 793 | goto out; | ||
| 794 | |||
| 795 | /* EFI framebuffer */ | ||
| 796 | si->orig_video_isVGA = VIDEO_TYPE_EFI; | ||
| 797 | |||
| 798 | si->lfb_width = width; | ||
| 799 | si->lfb_height = height; | ||
| 800 | si->lfb_base = fb_base; | ||
| 801 | si->pages = 1; | ||
| 802 | |||
| 803 | setup_pixel_info(si, pixels_per_scan_line, pixel_info, pixel_format); | ||
| 804 | |||
| 805 | si->lfb_size = si->lfb_linelength * si->lfb_height; | ||
| 806 | |||
| 807 | si->capabilities |= VIDEO_CAPABILITY_SKIP_QUIRKS; | ||
| 808 | out: | ||
| 307 | return status; | 809 | return status; |
| 308 | } | 810 | } |
| 309 | 811 | ||
| 310 | /* | 812 | /* |
| 311 | * See if we have Universal Graphics Adapter (UGA) protocol | 813 | * See if we have Graphics Output Protocol |
| 312 | */ | 814 | */ |
| 313 | static efi_status_t setup_uga(struct screen_info *si, efi_guid_t *uga_proto, | 815 | static efi_status_t setup_gop(struct screen_info *si, efi_guid_t *proto, |
| 314 | unsigned long size) | 816 | unsigned long size) |
| 315 | { | 817 | { |
| 316 | struct efi_uga_draw_protocol *uga, *first_uga; | ||
| 317 | unsigned long nr_ugas; | ||
| 318 | efi_status_t status; | 818 | efi_status_t status; |
| 319 | u32 width, height; | 819 | void **gop_handle = NULL; |
| 320 | void **uga_handle = NULL; | ||
| 321 | int i; | ||
| 322 | 820 | ||
| 323 | status = efi_call_phys3(sys_table->boottime->allocate_pool, | 821 | status = efi_call_early(allocate_pool, EFI_LOADER_DATA, |
| 324 | EFI_LOADER_DATA, size, &uga_handle); | 822 | size, (void **)&gop_handle); |
| 325 | if (status != EFI_SUCCESS) | 823 | if (status != EFI_SUCCESS) |
| 326 | return status; | 824 | return status; |
| 327 | 825 | ||
| 328 | status = efi_call_phys5(sys_table->boottime->locate_handle, | 826 | status = efi_call_early(locate_handle, |
| 329 | EFI_LOCATE_BY_PROTOCOL, uga_proto, | 827 | EFI_LOCATE_BY_PROTOCOL, |
| 330 | NULL, &size, uga_handle); | 828 | proto, NULL, &size, gop_handle); |
| 331 | if (status != EFI_SUCCESS) | 829 | if (status != EFI_SUCCESS) |
| 332 | goto free_handle; | 830 | goto free_handle; |
| 333 | 831 | ||
| 832 | if (efi_early->is64) | ||
| 833 | status = setup_gop64(si, proto, size, gop_handle); | ||
| 834 | else | ||
| 835 | status = setup_gop32(si, proto, size, gop_handle); | ||
| 836 | |||
| 837 | free_handle: | ||
| 838 | efi_call_early(free_pool, gop_handle); | ||
| 839 | return status; | ||
| 840 | } | ||
| 841 | |||
| 842 | static efi_status_t | ||
| 843 | setup_uga32(void **uga_handle, unsigned long size, u32 *width, u32 *height) | ||
| 844 | { | ||
| 845 | struct efi_uga_draw_protocol *uga = NULL, *first_uga; | ||
| 846 | efi_guid_t uga_proto = EFI_UGA_PROTOCOL_GUID; | ||
| 847 | unsigned long nr_ugas; | ||
| 848 | u32 *handles = (u32 *)uga_handle;; | ||
| 849 | efi_status_t status; | ||
| 850 | int i; | ||
| 851 | |||
| 334 | first_uga = NULL; | 852 | first_uga = NULL; |
| 853 | nr_ugas = size / sizeof(u32); | ||
| 854 | for (i = 0; i < nr_ugas; i++) { | ||
| 855 | efi_guid_t pciio_proto = EFI_PCI_IO_PROTOCOL_GUID; | ||
| 856 | u32 w, h, depth, refresh; | ||
| 857 | void *pciio; | ||
| 858 | u32 handle = handles[i]; | ||
| 859 | |||
| 860 | status = efi_call_early(handle_protocol, handle, | ||
| 861 | &uga_proto, (void **)&uga); | ||
| 862 | if (status != EFI_SUCCESS) | ||
| 863 | continue; | ||
| 864 | |||
| 865 | efi_call_early(handle_protocol, handle, &pciio_proto, &pciio); | ||
| 866 | |||
| 867 | status = efi_early->call((unsigned long)uga->get_mode, uga, | ||
| 868 | &w, &h, &depth, &refresh); | ||
| 869 | if (status == EFI_SUCCESS && (!first_uga || pciio)) { | ||
| 870 | *width = w; | ||
| 871 | *height = h; | ||
| 872 | |||
| 873 | /* | ||
| 874 | * Once we've found a UGA supporting PCIIO, | ||
| 875 | * don't bother looking any further. | ||
| 876 | */ | ||
| 877 | if (pciio) | ||
| 878 | break; | ||
| 335 | 879 | ||
| 336 | nr_ugas = size / sizeof(void *); | 880 | first_uga = uga; |
| 881 | } | ||
| 882 | } | ||
| 883 | |||
| 884 | return status; | ||
| 885 | } | ||
| 886 | |||
| 887 | static efi_status_t | ||
| 888 | setup_uga64(void **uga_handle, unsigned long size, u32 *width, u32 *height) | ||
| 889 | { | ||
| 890 | struct efi_uga_draw_protocol *uga = NULL, *first_uga; | ||
| 891 | efi_guid_t uga_proto = EFI_UGA_PROTOCOL_GUID; | ||
| 892 | unsigned long nr_ugas; | ||
| 893 | u64 *handles = (u64 *)uga_handle;; | ||
| 894 | efi_status_t status; | ||
| 895 | int i; | ||
| 896 | |||
| 897 | first_uga = NULL; | ||
| 898 | nr_ugas = size / sizeof(u64); | ||
| 337 | for (i = 0; i < nr_ugas; i++) { | 899 | for (i = 0; i < nr_ugas; i++) { |
| 338 | efi_guid_t pciio_proto = EFI_PCI_IO_PROTOCOL_GUID; | 900 | efi_guid_t pciio_proto = EFI_PCI_IO_PROTOCOL_GUID; |
| 339 | void *handle = uga_handle[i]; | ||
| 340 | u32 w, h, depth, refresh; | 901 | u32 w, h, depth, refresh; |
| 341 | void *pciio; | 902 | void *pciio; |
| 903 | u64 handle = handles[i]; | ||
| 342 | 904 | ||
| 343 | status = efi_call_phys3(sys_table->boottime->handle_protocol, | 905 | status = efi_call_early(handle_protocol, handle, |
| 344 | handle, uga_proto, &uga); | 906 | &uga_proto, (void **)&uga); |
| 345 | if (status != EFI_SUCCESS) | 907 | if (status != EFI_SUCCESS) |
| 346 | continue; | 908 | continue; |
| 347 | 909 | ||
| 348 | efi_call_phys3(sys_table->boottime->handle_protocol, | 910 | efi_call_early(handle_protocol, handle, &pciio_proto, &pciio); |
| 349 | handle, &pciio_proto, &pciio); | ||
| 350 | 911 | ||
| 351 | status = efi_call_phys5(uga->get_mode, uga, &w, &h, | 912 | status = efi_early->call((unsigned long)uga->get_mode, uga, |
| 352 | &depth, &refresh); | 913 | &w, &h, &depth, &refresh); |
| 353 | if (status == EFI_SUCCESS && (!first_uga || pciio)) { | 914 | if (status == EFI_SUCCESS && (!first_uga || pciio)) { |
| 354 | width = w; | 915 | *width = w; |
| 355 | height = h; | 916 | *height = h; |
| 356 | 917 | ||
| 357 | /* | 918 | /* |
| 358 | * Once we've found a UGA supporting PCIIO, | 919 | * Once we've found a UGA supporting PCIIO, |
| @@ -365,7 +926,39 @@ static efi_status_t setup_uga(struct screen_info *si, efi_guid_t *uga_proto, | |||
| 365 | } | 926 | } |
| 366 | } | 927 | } |
| 367 | 928 | ||
| 368 | if (!first_uga) | 929 | return status; |
| 930 | } | ||
| 931 | |||
| 932 | /* | ||
| 933 | * See if we have Universal Graphics Adapter (UGA) protocol | ||
| 934 | */ | ||
| 935 | static efi_status_t setup_uga(struct screen_info *si, efi_guid_t *uga_proto, | ||
| 936 | unsigned long size) | ||
| 937 | { | ||
| 938 | efi_status_t status; | ||
| 939 | u32 width, height; | ||
| 940 | void **uga_handle = NULL; | ||
| 941 | |||
| 942 | status = efi_call_early(allocate_pool, EFI_LOADER_DATA, | ||
| 943 | size, (void **)&uga_handle); | ||
| 944 | if (status != EFI_SUCCESS) | ||
| 945 | return status; | ||
| 946 | |||
| 947 | status = efi_call_early(locate_handle, | ||
| 948 | EFI_LOCATE_BY_PROTOCOL, | ||
| 949 | uga_proto, NULL, &size, uga_handle); | ||
| 950 | if (status != EFI_SUCCESS) | ||
| 951 | goto free_handle; | ||
| 952 | |||
| 953 | height = 0; | ||
| 954 | width = 0; | ||
| 955 | |||
| 956 | if (efi_early->is64) | ||
| 957 | status = setup_uga64(uga_handle, size, &width, &height); | ||
| 958 | else | ||
| 959 | status = setup_uga32(uga_handle, size, &width, &height); | ||
| 960 | |||
| 961 | if (!width && !height) | ||
| 369 | goto free_handle; | 962 | goto free_handle; |
| 370 | 963 | ||
| 371 | /* EFI framebuffer */ | 964 | /* EFI framebuffer */ |
| @@ -384,9 +977,8 @@ static efi_status_t setup_uga(struct screen_info *si, efi_guid_t *uga_proto, | |||
| 384 | si->rsvd_size = 8; | 977 | si->rsvd_size = 8; |
| 385 | si->rsvd_pos = 24; | 978 | si->rsvd_pos = 24; |
| 386 | 979 | ||
| 387 | |||
| 388 | free_handle: | 980 | free_handle: |
| 389 | efi_call_phys1(sys_table->boottime->free_pool, uga_handle); | 981 | efi_call_early(free_pool, uga_handle); |
| 390 | return status; | 982 | return status; |
| 391 | } | 983 | } |
| 392 | 984 | ||
| @@ -404,29 +996,28 @@ void setup_graphics(struct boot_params *boot_params) | |||
| 404 | memset(si, 0, sizeof(*si)); | 996 | memset(si, 0, sizeof(*si)); |
| 405 | 997 | ||
| 406 | size = 0; | 998 | size = 0; |
| 407 | status = efi_call_phys5(sys_table->boottime->locate_handle, | 999 | status = efi_call_early(locate_handle, |
| 408 | EFI_LOCATE_BY_PROTOCOL, &graphics_proto, | 1000 | EFI_LOCATE_BY_PROTOCOL, |
| 409 | NULL, &size, gop_handle); | 1001 | &graphics_proto, NULL, &size, gop_handle); |
| 410 | if (status == EFI_BUFFER_TOO_SMALL) | 1002 | if (status == EFI_BUFFER_TOO_SMALL) |
| 411 | status = setup_gop(si, &graphics_proto, size); | 1003 | status = setup_gop(si, &graphics_proto, size); |
| 412 | 1004 | ||
| 413 | if (status != EFI_SUCCESS) { | 1005 | if (status != EFI_SUCCESS) { |
| 414 | size = 0; | 1006 | size = 0; |
| 415 | status = efi_call_phys5(sys_table->boottime->locate_handle, | 1007 | status = efi_call_early(locate_handle, |
| 416 | EFI_LOCATE_BY_PROTOCOL, &uga_proto, | 1008 | EFI_LOCATE_BY_PROTOCOL, |
| 417 | NULL, &size, uga_handle); | 1009 | &uga_proto, NULL, &size, uga_handle); |
| 418 | if (status == EFI_BUFFER_TOO_SMALL) | 1010 | if (status == EFI_BUFFER_TOO_SMALL) |
| 419 | setup_uga(si, &uga_proto, size); | 1011 | setup_uga(si, &uga_proto, size); |
| 420 | } | 1012 | } |
| 421 | } | 1013 | } |
| 422 | 1014 | ||
| 423 | |||
| 424 | /* | 1015 | /* |
| 425 | * Because the x86 boot code expects to be passed a boot_params we | 1016 | * Because the x86 boot code expects to be passed a boot_params we |
| 426 | * need to create one ourselves (usually the bootloader would create | 1017 | * need to create one ourselves (usually the bootloader would create |
| 427 | * one for us). | 1018 | * one for us). |
| 428 | */ | 1019 | */ |
| 429 | struct boot_params *make_boot_params(void *handle, efi_system_table_t *_table) | 1020 | struct boot_params *make_boot_params(struct efi_config *c) |
| 430 | { | 1021 | { |
| 431 | struct boot_params *boot_params; | 1022 | struct boot_params *boot_params; |
| 432 | struct sys_desc_table *sdt; | 1023 | struct sys_desc_table *sdt; |
| @@ -434,7 +1025,7 @@ struct boot_params *make_boot_params(void *handle, efi_system_table_t *_table) | |||
| 434 | struct setup_header *hdr; | 1025 | struct setup_header *hdr; |
| 435 | struct efi_info *efi; | 1026 | struct efi_info *efi; |
| 436 | efi_loaded_image_t *image; | 1027 | efi_loaded_image_t *image; |
| 437 | void *options; | 1028 | void *options, *handle; |
| 438 | efi_guid_t proto = LOADED_IMAGE_PROTOCOL_GUID; | 1029 | efi_guid_t proto = LOADED_IMAGE_PROTOCOL_GUID; |
| 439 | int options_size = 0; | 1030 | int options_size = 0; |
| 440 | efi_status_t status; | 1031 | efi_status_t status; |
| @@ -445,14 +1036,21 @@ struct boot_params *make_boot_params(void *handle, efi_system_table_t *_table) | |||
| 445 | unsigned long ramdisk_addr; | 1036 | unsigned long ramdisk_addr; |
| 446 | unsigned long ramdisk_size; | 1037 | unsigned long ramdisk_size; |
| 447 | 1038 | ||
| 448 | sys_table = _table; | 1039 | efi_early = c; |
| 1040 | sys_table = (efi_system_table_t *)(unsigned long)efi_early->table; | ||
| 1041 | handle = (void *)(unsigned long)efi_early->image_handle; | ||
| 449 | 1042 | ||
| 450 | /* Check if we were booted by the EFI firmware */ | 1043 | /* Check if we were booted by the EFI firmware */ |
| 451 | if (sys_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) | 1044 | if (sys_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) |
| 452 | return NULL; | 1045 | return NULL; |
| 453 | 1046 | ||
| 454 | status = efi_call_phys3(sys_table->boottime->handle_protocol, | 1047 | if (efi_early->is64) |
| 455 | handle, &proto, (void *)&image); | 1048 | setup_boot_services64(efi_early); |
| 1049 | else | ||
| 1050 | setup_boot_services32(efi_early); | ||
| 1051 | |||
| 1052 | status = efi_call_early(handle_protocol, handle, | ||
| 1053 | &proto, (void *)&image); | ||
| 456 | if (status != EFI_SUCCESS) { | 1054 | if (status != EFI_SUCCESS) { |
| 457 | efi_printk(sys_table, "Failed to get handle for LOADED_IMAGE_PROTOCOL\n"); | 1055 | efi_printk(sys_table, "Failed to get handle for LOADED_IMAGE_PROTOCOL\n"); |
| 458 | return NULL; | 1056 | return NULL; |
| @@ -641,14 +1239,13 @@ static efi_status_t alloc_e820ext(u32 nr_desc, struct setup_data **e820ext, | |||
| 641 | sizeof(struct e820entry) * nr_desc; | 1239 | sizeof(struct e820entry) * nr_desc; |
| 642 | 1240 | ||
| 643 | if (*e820ext) { | 1241 | if (*e820ext) { |
| 644 | efi_call_phys1(sys_table->boottime->free_pool, *e820ext); | 1242 | efi_call_early(free_pool, *e820ext); |
| 645 | *e820ext = NULL; | 1243 | *e820ext = NULL; |
| 646 | *e820ext_size = 0; | 1244 | *e820ext_size = 0; |
| 647 | } | 1245 | } |
| 648 | 1246 | ||
| 649 | status = efi_call_phys3(sys_table->boottime->allocate_pool, | 1247 | status = efi_call_early(allocate_pool, EFI_LOADER_DATA, |
| 650 | EFI_LOADER_DATA, size, e820ext); | 1248 | size, (void **)e820ext); |
| 651 | |||
| 652 | if (status == EFI_SUCCESS) | 1249 | if (status == EFI_SUCCESS) |
| 653 | *e820ext_size = size; | 1250 | *e820ext_size = size; |
| 654 | 1251 | ||
| @@ -656,12 +1253,13 @@ static efi_status_t alloc_e820ext(u32 nr_desc, struct setup_data **e820ext, | |||
| 656 | } | 1253 | } |
| 657 | 1254 | ||
| 658 | static efi_status_t exit_boot(struct boot_params *boot_params, | 1255 | static efi_status_t exit_boot(struct boot_params *boot_params, |
| 659 | void *handle) | 1256 | void *handle, bool is64) |
| 660 | { | 1257 | { |
| 661 | struct efi_info *efi = &boot_params->efi_info; | 1258 | struct efi_info *efi = &boot_params->efi_info; |
| 662 | unsigned long map_sz, key, desc_size; | 1259 | unsigned long map_sz, key, desc_size; |
| 663 | efi_memory_desc_t *mem_map; | 1260 | efi_memory_desc_t *mem_map; |
| 664 | struct setup_data *e820ext; | 1261 | struct setup_data *e820ext; |
| 1262 | const char *signature; | ||
| 665 | __u32 e820ext_size; | 1263 | __u32 e820ext_size; |
| 666 | __u32 nr_desc, prev_nr_desc; | 1264 | __u32 nr_desc, prev_nr_desc; |
| 667 | efi_status_t status; | 1265 | efi_status_t status; |
| @@ -691,11 +1289,13 @@ get_map: | |||
| 691 | if (status != EFI_SUCCESS) | 1289 | if (status != EFI_SUCCESS) |
| 692 | goto free_mem_map; | 1290 | goto free_mem_map; |
| 693 | 1291 | ||
| 694 | efi_call_phys1(sys_table->boottime->free_pool, mem_map); | 1292 | efi_call_early(free_pool, mem_map); |
| 695 | goto get_map; /* Allocated memory, get map again */ | 1293 | goto get_map; /* Allocated memory, get map again */ |
| 696 | } | 1294 | } |
| 697 | 1295 | ||
| 698 | memcpy(&efi->efi_loader_signature, EFI_LOADER_SIGNATURE, sizeof(__u32)); | 1296 | signature = is64 ? EFI64_LOADER_SIGNATURE : EFI32_LOADER_SIGNATURE; |
| 1297 | memcpy(&efi->efi_loader_signature, signature, sizeof(__u32)); | ||
| 1298 | |||
| 699 | efi->efi_systab = (unsigned long)sys_table; | 1299 | efi->efi_systab = (unsigned long)sys_table; |
| 700 | efi->efi_memdesc_size = desc_size; | 1300 | efi->efi_memdesc_size = desc_size; |
| 701 | efi->efi_memdesc_version = desc_version; | 1301 | efi->efi_memdesc_version = desc_version; |
| @@ -708,8 +1308,7 @@ get_map: | |||
| 708 | #endif | 1308 | #endif |
| 709 | 1309 | ||
| 710 | /* Might as well exit boot services now */ | 1310 | /* Might as well exit boot services now */ |
| 711 | status = efi_call_phys2(sys_table->boottime->exit_boot_services, | 1311 | status = efi_call_early(exit_boot_services, handle, key); |
| 712 | handle, key); | ||
| 713 | if (status != EFI_SUCCESS) { | 1312 | if (status != EFI_SUCCESS) { |
| 714 | /* | 1313 | /* |
| 715 | * ExitBootServices() will fail if any of the event | 1314 | * ExitBootServices() will fail if any of the event |
| @@ -722,7 +1321,7 @@ get_map: | |||
| 722 | goto free_mem_map; | 1321 | goto free_mem_map; |
| 723 | 1322 | ||
| 724 | called_exit = true; | 1323 | called_exit = true; |
| 725 | efi_call_phys1(sys_table->boottime->free_pool, mem_map); | 1324 | efi_call_early(free_pool, mem_map); |
| 726 | goto get_map; | 1325 | goto get_map; |
| 727 | } | 1326 | } |
| 728 | 1327 | ||
| @@ -736,23 +1335,31 @@ get_map: | |||
| 736 | return EFI_SUCCESS; | 1335 | return EFI_SUCCESS; |
| 737 | 1336 | ||
| 738 | free_mem_map: | 1337 | free_mem_map: |
| 739 | efi_call_phys1(sys_table->boottime->free_pool, mem_map); | 1338 | efi_call_early(free_pool, mem_map); |
| 740 | return status; | 1339 | return status; |
| 741 | } | 1340 | } |
| 742 | 1341 | ||
| 743 | |||
| 744 | /* | 1342 | /* |
| 745 | * On success we return a pointer to a boot_params structure, and NULL | 1343 | * On success we return a pointer to a boot_params structure, and NULL |
| 746 | * on failure. | 1344 | * on failure. |
| 747 | */ | 1345 | */ |
| 748 | struct boot_params *efi_main(void *handle, efi_system_table_t *_table, | 1346 | struct boot_params *efi_main(struct efi_config *c, |
| 749 | struct boot_params *boot_params) | 1347 | struct boot_params *boot_params) |
| 750 | { | 1348 | { |
| 751 | struct desc_ptr *gdt; | 1349 | struct desc_ptr *gdt = NULL; |
| 752 | efi_loaded_image_t *image; | 1350 | efi_loaded_image_t *image; |
| 753 | struct setup_header *hdr = &boot_params->hdr; | 1351 | struct setup_header *hdr = &boot_params->hdr; |
| 754 | efi_status_t status; | 1352 | efi_status_t status; |
| 755 | struct desc_struct *desc; | 1353 | struct desc_struct *desc; |
| 1354 | void *handle; | ||
| 1355 | efi_system_table_t *_table; | ||
| 1356 | bool is64; | ||
| 1357 | |||
| 1358 | efi_early = c; | ||
| 1359 | |||
| 1360 | _table = (efi_system_table_t *)(unsigned long)efi_early->table; | ||
| 1361 | handle = (void *)(unsigned long)efi_early->image_handle; | ||
| 1362 | is64 = efi_early->is64; | ||
| 756 | 1363 | ||
| 757 | sys_table = _table; | 1364 | sys_table = _table; |
| 758 | 1365 | ||
| @@ -760,13 +1367,17 @@ struct boot_params *efi_main(void *handle, efi_system_table_t *_table, | |||
| 760 | if (sys_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) | 1367 | if (sys_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) |
| 761 | goto fail; | 1368 | goto fail; |
| 762 | 1369 | ||
| 1370 | if (is64) | ||
| 1371 | setup_boot_services64(efi_early); | ||
| 1372 | else | ||
| 1373 | setup_boot_services32(efi_early); | ||
| 1374 | |||
| 763 | setup_graphics(boot_params); | 1375 | setup_graphics(boot_params); |
| 764 | 1376 | ||
| 765 | setup_efi_pci(boot_params); | 1377 | setup_efi_pci(boot_params); |
| 766 | 1378 | ||
| 767 | status = efi_call_phys3(sys_table->boottime->allocate_pool, | 1379 | status = efi_call_early(allocate_pool, EFI_LOADER_DATA, |
| 768 | EFI_LOADER_DATA, sizeof(*gdt), | 1380 | sizeof(*gdt), (void **)&gdt); |
| 769 | (void **)&gdt); | ||
| 770 | if (status != EFI_SUCCESS) { | 1381 | if (status != EFI_SUCCESS) { |
| 771 | efi_printk(sys_table, "Failed to alloc mem for gdt structure\n"); | 1382 | efi_printk(sys_table, "Failed to alloc mem for gdt structure\n"); |
| 772 | goto fail; | 1383 | goto fail; |
| @@ -797,7 +1408,7 @@ struct boot_params *efi_main(void *handle, efi_system_table_t *_table, | |||
| 797 | hdr->code32_start = bzimage_addr; | 1408 | hdr->code32_start = bzimage_addr; |
| 798 | } | 1409 | } |
| 799 | 1410 | ||
| 800 | status = exit_boot(boot_params, handle); | 1411 | status = exit_boot(boot_params, handle, is64); |
| 801 | if (status != EFI_SUCCESS) | 1412 | if (status != EFI_SUCCESS) |
| 802 | goto fail; | 1413 | goto fail; |
| 803 | 1414 | ||
diff --git a/arch/x86/boot/compressed/eboot.h b/arch/x86/boot/compressed/eboot.h index 81b6b652b46a..c88c31ecad12 100644 --- a/arch/x86/boot/compressed/eboot.h +++ b/arch/x86/boot/compressed/eboot.h | |||
| @@ -37,6 +37,24 @@ struct efi_graphics_output_mode_info { | |||
| 37 | u32 pixels_per_scan_line; | 37 | u32 pixels_per_scan_line; |
| 38 | } __packed; | 38 | } __packed; |
| 39 | 39 | ||
| 40 | struct efi_graphics_output_protocol_mode_32 { | ||
| 41 | u32 max_mode; | ||
| 42 | u32 mode; | ||
| 43 | u32 info; | ||
| 44 | u32 size_of_info; | ||
| 45 | u64 frame_buffer_base; | ||
| 46 | u32 frame_buffer_size; | ||
| 47 | } __packed; | ||
| 48 | |||
| 49 | struct efi_graphics_output_protocol_mode_64 { | ||
| 50 | u32 max_mode; | ||
| 51 | u32 mode; | ||
| 52 | u64 info; | ||
| 53 | u64 size_of_info; | ||
| 54 | u64 frame_buffer_base; | ||
| 55 | u64 frame_buffer_size; | ||
| 56 | } __packed; | ||
| 57 | |||
| 40 | struct efi_graphics_output_protocol_mode { | 58 | struct efi_graphics_output_protocol_mode { |
| 41 | u32 max_mode; | 59 | u32 max_mode; |
| 42 | u32 mode; | 60 | u32 mode; |
| @@ -46,6 +64,20 @@ struct efi_graphics_output_protocol_mode { | |||
| 46 | unsigned long frame_buffer_size; | 64 | unsigned long frame_buffer_size; |
| 47 | } __packed; | 65 | } __packed; |
| 48 | 66 | ||
| 67 | struct efi_graphics_output_protocol_32 { | ||
| 68 | u32 query_mode; | ||
| 69 | u32 set_mode; | ||
| 70 | u32 blt; | ||
| 71 | u32 mode; | ||
| 72 | }; | ||
| 73 | |||
| 74 | struct efi_graphics_output_protocol_64 { | ||
| 75 | u64 query_mode; | ||
| 76 | u64 set_mode; | ||
| 77 | u64 blt; | ||
| 78 | u64 mode; | ||
| 79 | }; | ||
| 80 | |||
| 49 | struct efi_graphics_output_protocol { | 81 | struct efi_graphics_output_protocol { |
| 50 | void *query_mode; | 82 | void *query_mode; |
| 51 | unsigned long set_mode; | 83 | unsigned long set_mode; |
| @@ -53,10 +85,38 @@ struct efi_graphics_output_protocol { | |||
| 53 | struct efi_graphics_output_protocol_mode *mode; | 85 | struct efi_graphics_output_protocol_mode *mode; |
| 54 | }; | 86 | }; |
| 55 | 87 | ||
| 88 | struct efi_uga_draw_protocol_32 { | ||
| 89 | u32 get_mode; | ||
| 90 | u32 set_mode; | ||
| 91 | u32 blt; | ||
| 92 | }; | ||
| 93 | |||
| 94 | struct efi_uga_draw_protocol_64 { | ||
| 95 | u64 get_mode; | ||
| 96 | u64 set_mode; | ||
| 97 | u64 blt; | ||
| 98 | }; | ||
| 99 | |||
| 56 | struct efi_uga_draw_protocol { | 100 | struct efi_uga_draw_protocol { |
| 57 | void *get_mode; | 101 | void *get_mode; |
| 58 | void *set_mode; | 102 | void *set_mode; |
| 59 | void *blt; | 103 | void *blt; |
| 60 | }; | 104 | }; |
| 61 | 105 | ||
| 106 | struct efi_config { | ||
| 107 | u64 image_handle; | ||
| 108 | u64 table; | ||
| 109 | u64 allocate_pool; | ||
| 110 | u64 allocate_pages; | ||
| 111 | u64 get_memory_map; | ||
| 112 | u64 free_pool; | ||
| 113 | u64 free_pages; | ||
| 114 | u64 locate_handle; | ||
| 115 | u64 handle_protocol; | ||
| 116 | u64 exit_boot_services; | ||
| 117 | u64 text_output; | ||
| 118 | efi_status_t (*call)(unsigned long, ...); | ||
| 119 | bool is64; | ||
| 120 | } __packed; | ||
| 121 | |||
| 62 | #endif /* BOOT_COMPRESSED_EBOOT_H */ | 122 | #endif /* BOOT_COMPRESSED_EBOOT_H */ |
diff --git a/arch/x86/boot/compressed/efi_stub_64.S b/arch/x86/boot/compressed/efi_stub_64.S index cedc60de86eb..7ff3632806b1 100644 --- a/arch/x86/boot/compressed/efi_stub_64.S +++ b/arch/x86/boot/compressed/efi_stub_64.S | |||
| @@ -1 +1,30 @@ | |||
| 1 | #include <asm/segment.h> | ||
| 2 | #include <asm/msr.h> | ||
| 3 | #include <asm/processor-flags.h> | ||
| 4 | |||
| 1 | #include "../../platform/efi/efi_stub_64.S" | 5 | #include "../../platform/efi/efi_stub_64.S" |
| 6 | |||
| 7 | #ifdef CONFIG_EFI_MIXED | ||
| 8 | .code64 | ||
| 9 | .text | ||
| 10 | ENTRY(efi64_thunk) | ||
| 11 | push %rbp | ||
| 12 | push %rbx | ||
| 13 | |||
| 14 | subq $16, %rsp | ||
| 15 | leaq efi_exit32(%rip), %rax | ||
| 16 | movl %eax, 8(%rsp) | ||
| 17 | leaq efi_gdt64(%rip), %rax | ||
| 18 | movl %eax, 4(%rsp) | ||
| 19 | movl %eax, 2(%rax) /* Fixup the gdt base address */ | ||
| 20 | leaq efi32_boot_gdt(%rip), %rax | ||
| 21 | movl %eax, (%rsp) | ||
| 22 | |||
| 23 | call __efi64_thunk | ||
| 24 | |||
| 25 | addq $16, %rsp | ||
| 26 | pop %rbx | ||
| 27 | pop %rbp | ||
| 28 | ret | ||
| 29 | ENDPROC(efi64_thunk) | ||
| 30 | #endif /* CONFIG_EFI_MIXED */ | ||
diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S index 9116aac232c7..de9d4200d305 100644 --- a/arch/x86/boot/compressed/head_32.S +++ b/arch/x86/boot/compressed/head_32.S | |||
| @@ -42,26 +42,53 @@ ENTRY(startup_32) | |||
| 42 | ENTRY(efi_pe_entry) | 42 | ENTRY(efi_pe_entry) |
| 43 | add $0x4, %esp | 43 | add $0x4, %esp |
| 44 | 44 | ||
| 45 | call 1f | ||
| 46 | 1: popl %esi | ||
| 47 | subl $1b, %esi | ||
| 48 | |||
| 49 | popl %ecx | ||
| 50 | movl %ecx, efi32_config(%esi) /* Handle */ | ||
| 51 | popl %ecx | ||
| 52 | movl %ecx, efi32_config+8(%esi) /* EFI System table pointer */ | ||
| 53 | |||
| 54 | /* Relocate efi_config->call() */ | ||
| 55 | leal efi32_config(%esi), %eax | ||
| 56 | add %esi, 88(%eax) | ||
| 57 | pushl %eax | ||
| 58 | |||
| 45 | call make_boot_params | 59 | call make_boot_params |
| 46 | cmpl $0, %eax | 60 | cmpl $0, %eax |
| 47 | je 1f | 61 | je fail |
| 48 | movl 0x4(%esp), %esi | 62 | popl %ecx |
| 49 | movl (%esp), %ecx | ||
| 50 | pushl %eax | 63 | pushl %eax |
| 51 | pushl %esi | ||
| 52 | pushl %ecx | 64 | pushl %ecx |
| 53 | sub $0x4, %esp | 65 | jmp 2f /* Skip efi_config initialization */ |
| 54 | 66 | ||
| 55 | ENTRY(efi_stub_entry) | 67 | ENTRY(efi32_stub_entry) |
| 56 | add $0x4, %esp | 68 | add $0x4, %esp |
| 69 | popl %ecx | ||
| 70 | popl %edx | ||
| 71 | |||
| 72 | call 1f | ||
| 73 | 1: popl %esi | ||
| 74 | subl $1b, %esi | ||
| 75 | |||
| 76 | movl %ecx, efi32_config(%esi) /* Handle */ | ||
| 77 | movl %edx, efi32_config+8(%esi) /* EFI System table pointer */ | ||
| 78 | |||
| 79 | /* Relocate efi_config->call() */ | ||
| 80 | leal efi32_config(%esi), %eax | ||
| 81 | add %esi, 88(%eax) | ||
| 82 | pushl %eax | ||
| 83 | 2: | ||
| 57 | call efi_main | 84 | call efi_main |
| 58 | cmpl $0, %eax | 85 | cmpl $0, %eax |
| 59 | movl %eax, %esi | 86 | movl %eax, %esi |
| 60 | jne 2f | 87 | jne 2f |
| 61 | 1: | 88 | fail: |
| 62 | /* EFI init failed, so hang. */ | 89 | /* EFI init failed, so hang. */ |
| 63 | hlt | 90 | hlt |
| 64 | jmp 1b | 91 | jmp fail |
| 65 | 2: | 92 | 2: |
| 66 | call 3f | 93 | call 3f |
| 67 | 3: | 94 | 3: |
| @@ -202,6 +229,15 @@ relocated: | |||
| 202 | xorl %ebx, %ebx | 229 | xorl %ebx, %ebx |
| 203 | jmp *%eax | 230 | jmp *%eax |
| 204 | 231 | ||
| 232 | #ifdef CONFIG_EFI_STUB | ||
| 233 | .data | ||
| 234 | efi32_config: | ||
| 235 | .fill 11,8,0 | ||
| 236 | .long efi_call_phys | ||
| 237 | .long 0 | ||
| 238 | .byte 0 | ||
| 239 | #endif | ||
| 240 | |||
| 205 | /* | 241 | /* |
| 206 | * Stack and heap for uncompression | 242 | * Stack and heap for uncompression |
| 207 | */ | 243 | */ |
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S index c5c1ae0997e7..57e58a5fa210 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S | |||
| @@ -113,7 +113,8 @@ ENTRY(startup_32) | |||
| 113 | lgdt gdt(%ebp) | 113 | lgdt gdt(%ebp) |
| 114 | 114 | ||
| 115 | /* Enable PAE mode */ | 115 | /* Enable PAE mode */ |
| 116 | movl $(X86_CR4_PAE), %eax | 116 | movl %cr4, %eax |
| 117 | orl $X86_CR4_PAE, %eax | ||
| 117 | movl %eax, %cr4 | 118 | movl %eax, %cr4 |
| 118 | 119 | ||
| 119 | /* | 120 | /* |
| @@ -178,6 +179,13 @@ ENTRY(startup_32) | |||
| 178 | */ | 179 | */ |
| 179 | pushl $__KERNEL_CS | 180 | pushl $__KERNEL_CS |
| 180 | leal startup_64(%ebp), %eax | 181 | leal startup_64(%ebp), %eax |
| 182 | #ifdef CONFIG_EFI_MIXED | ||
| 183 | movl efi32_config(%ebp), %ebx | ||
| 184 | cmp $0, %ebx | ||
| 185 | jz 1f | ||
| 186 | leal handover_entry(%ebp), %eax | ||
| 187 | 1: | ||
| 188 | #endif | ||
| 181 | pushl %eax | 189 | pushl %eax |
| 182 | 190 | ||
| 183 | /* Enter paged protected Mode, activating Long Mode */ | 191 | /* Enter paged protected Mode, activating Long Mode */ |
| @@ -188,6 +196,30 @@ ENTRY(startup_32) | |||
| 188 | lret | 196 | lret |
| 189 | ENDPROC(startup_32) | 197 | ENDPROC(startup_32) |
| 190 | 198 | ||
| 199 | #ifdef CONFIG_EFI_MIXED | ||
| 200 | .org 0x190 | ||
| 201 | ENTRY(efi32_stub_entry) | ||
| 202 | add $0x4, %esp /* Discard return address */ | ||
| 203 | popl %ecx | ||
| 204 | popl %edx | ||
| 205 | popl %esi | ||
| 206 | |||
| 207 | leal (BP_scratch+4)(%esi), %esp | ||
| 208 | call 1f | ||
| 209 | 1: pop %ebp | ||
| 210 | subl $1b, %ebp | ||
| 211 | |||
| 212 | movl %ecx, efi32_config(%ebp) | ||
| 213 | movl %edx, efi32_config+8(%ebp) | ||
| 214 | sgdtl efi32_boot_gdt(%ebp) | ||
| 215 | |||
| 216 | leal efi32_config(%ebp), %eax | ||
| 217 | movl %eax, efi_config(%ebp) | ||
| 218 | |||
| 219 | jmp startup_32 | ||
| 220 | ENDPROC(efi32_stub_entry) | ||
| 221 | #endif | ||
| 222 | |||
| 191 | .code64 | 223 | .code64 |
| 192 | .org 0x200 | 224 | .org 0x200 |
| 193 | ENTRY(startup_64) | 225 | ENTRY(startup_64) |
| @@ -209,26 +241,48 @@ ENTRY(startup_64) | |||
| 209 | jmp preferred_addr | 241 | jmp preferred_addr |
| 210 | 242 | ||
| 211 | ENTRY(efi_pe_entry) | 243 | ENTRY(efi_pe_entry) |
| 212 | mov %rcx, %rdi | 244 | movq %rcx, efi64_config(%rip) /* Handle */ |
| 213 | mov %rdx, %rsi | 245 | movq %rdx, efi64_config+8(%rip) /* EFI System table pointer */ |
| 214 | pushq %rdi | 246 | |
| 215 | pushq %rsi | 247 | leaq efi64_config(%rip), %rax |
| 248 | movq %rax, efi_config(%rip) | ||
| 249 | |||
| 250 | call 1f | ||
| 251 | 1: popq %rbp | ||
| 252 | subq $1b, %rbp | ||
| 253 | |||
| 254 | /* | ||
| 255 | * Relocate efi_config->call(). | ||
| 256 | */ | ||
| 257 | addq %rbp, efi64_config+88(%rip) | ||
| 258 | |||
| 259 | movq %rax, %rdi | ||
| 216 | call make_boot_params | 260 | call make_boot_params |
| 217 | cmpq $0,%rax | 261 | cmpq $0,%rax |
| 218 | je 1f | 262 | je fail |
| 219 | mov %rax, %rdx | 263 | mov %rax, %rsi |
| 220 | popq %rsi | 264 | jmp 2f /* Skip the relocation */ |
| 221 | popq %rdi | ||
| 222 | 265 | ||
| 223 | ENTRY(efi_stub_entry) | 266 | handover_entry: |
| 267 | call 1f | ||
| 268 | 1: popq %rbp | ||
| 269 | subq $1b, %rbp | ||
| 270 | |||
| 271 | /* | ||
| 272 | * Relocate efi_config->call(). | ||
| 273 | */ | ||
| 274 | movq efi_config(%rip), %rax | ||
| 275 | addq %rbp, 88(%rax) | ||
| 276 | 2: | ||
| 277 | movq efi_config(%rip), %rdi | ||
| 224 | call efi_main | 278 | call efi_main |
| 225 | movq %rax,%rsi | 279 | movq %rax,%rsi |
| 226 | cmpq $0,%rax | 280 | cmpq $0,%rax |
| 227 | jne 2f | 281 | jne 2f |
| 228 | 1: | 282 | fail: |
| 229 | /* EFI init failed, so hang. */ | 283 | /* EFI init failed, so hang. */ |
| 230 | hlt | 284 | hlt |
| 231 | jmp 1b | 285 | jmp fail |
| 232 | 2: | 286 | 2: |
| 233 | call 3f | 287 | call 3f |
| 234 | 3: | 288 | 3: |
| @@ -307,6 +361,20 @@ preferred_addr: | |||
| 307 | leaq relocated(%rbx), %rax | 361 | leaq relocated(%rbx), %rax |
| 308 | jmp *%rax | 362 | jmp *%rax |
| 309 | 363 | ||
| 364 | #ifdef CONFIG_EFI_STUB | ||
| 365 | .org 0x390 | ||
| 366 | ENTRY(efi64_stub_entry) | ||
| 367 | movq %rdi, efi64_config(%rip) /* Handle */ | ||
| 368 | movq %rsi, efi64_config+8(%rip) /* EFI System table pointer */ | ||
| 369 | |||
| 370 | leaq efi64_config(%rip), %rax | ||
| 371 | movq %rax, efi_config(%rip) | ||
| 372 | |||
| 373 | movq %rdx, %rsi | ||
| 374 | jmp handover_entry | ||
| 375 | ENDPROC(efi64_stub_entry) | ||
| 376 | #endif | ||
| 377 | |||
| 310 | .text | 378 | .text |
| 311 | relocated: | 379 | relocated: |
| 312 | 380 | ||
| @@ -372,6 +440,25 @@ gdt: | |||
| 372 | .quad 0x0000000000000000 /* TS continued */ | 440 | .quad 0x0000000000000000 /* TS continued */ |
| 373 | gdt_end: | 441 | gdt_end: |
| 374 | 442 | ||
| 443 | #ifdef CONFIG_EFI_STUB | ||
| 444 | efi_config: | ||
| 445 | .quad 0 | ||
| 446 | |||
| 447 | #ifdef CONFIG_EFI_MIXED | ||
| 448 | .global efi32_config | ||
| 449 | efi32_config: | ||
| 450 | .fill 11,8,0 | ||
| 451 | .quad efi64_thunk | ||
| 452 | .byte 0 | ||
| 453 | #endif | ||
| 454 | |||
| 455 | .global efi64_config | ||
| 456 | efi64_config: | ||
| 457 | .fill 11,8,0 | ||
| 458 | .quad efi_call6 | ||
| 459 | .byte 1 | ||
| 460 | #endif /* CONFIG_EFI_STUB */ | ||
| 461 | |||
| 375 | /* | 462 | /* |
| 376 | * Stack and heap for uncompression | 463 | * Stack and heap for uncompression |
| 377 | */ | 464 | */ |
diff --git a/arch/x86/boot/cpucheck.c b/arch/x86/boot/cpucheck.c index 100a9a10076a..f0d0b20fe149 100644 --- a/arch/x86/boot/cpucheck.c +++ b/arch/x86/boot/cpucheck.c | |||
| @@ -67,6 +67,13 @@ static int is_transmeta(void) | |||
| 67 | cpu_vendor[2] == A32('M', 'x', '8', '6'); | 67 | cpu_vendor[2] == A32('M', 'x', '8', '6'); |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | static int is_intel(void) | ||
| 71 | { | ||
| 72 | return cpu_vendor[0] == A32('G', 'e', 'n', 'u') && | ||
| 73 | cpu_vendor[1] == A32('i', 'n', 'e', 'I') && | ||
| 74 | cpu_vendor[2] == A32('n', 't', 'e', 'l'); | ||
| 75 | } | ||
| 76 | |||
| 70 | /* Returns a bitmask of which words we have error bits in */ | 77 | /* Returns a bitmask of which words we have error bits in */ |
| 71 | static int check_cpuflags(void) | 78 | static int check_cpuflags(void) |
| 72 | { | 79 | { |
| @@ -153,6 +160,19 @@ int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr) | |||
| 153 | asm("wrmsr" : : "a" (eax), "d" (edx), "c" (ecx)); | 160 | asm("wrmsr" : : "a" (eax), "d" (edx), "c" (ecx)); |
| 154 | 161 | ||
| 155 | err = check_cpuflags(); | 162 | err = check_cpuflags(); |
| 163 | } else if (err == 0x01 && | ||
| 164 | !(err_flags[0] & ~(1 << X86_FEATURE_PAE)) && | ||
| 165 | is_intel() && cpu.level == 6 && | ||
| 166 | (cpu.model == 9 || cpu.model == 13)) { | ||
| 167 | /* PAE is disabled on this Pentium M but can be forced */ | ||
| 168 | if (cmdline_find_option_bool("forcepae")) { | ||
| 169 | puts("WARNING: Forcing PAE in CPU flags\n"); | ||
| 170 | set_bit(X86_FEATURE_PAE, cpu.flags); | ||
| 171 | err = check_cpuflags(); | ||
| 172 | } | ||
| 173 | else { | ||
| 174 | puts("WARNING: PAE disabled. Use parameter 'forcepae' to enable at your own risk!\n"); | ||
| 175 | } | ||
| 156 | } | 176 | } |
| 157 | 177 | ||
| 158 | if (err_flags_ptr) | 178 | if (err_flags_ptr) |
diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S index ec3b8ba68096..0ca9a5c362bc 100644 --- a/arch/x86/boot/header.S +++ b/arch/x86/boot/header.S | |||
| @@ -283,7 +283,7 @@ _start: | |||
| 283 | # Part 2 of the header, from the old setup.S | 283 | # Part 2 of the header, from the old setup.S |
| 284 | 284 | ||
| 285 | .ascii "HdrS" # header signature | 285 | .ascii "HdrS" # header signature |
| 286 | .word 0x020c # header version number (>= 0x0105) | 286 | .word 0x020d # header version number (>= 0x0105) |
| 287 | # or else old loadlin-1.5 will fail) | 287 | # or else old loadlin-1.5 will fail) |
| 288 | .globl realmode_swtch | 288 | .globl realmode_swtch |
| 289 | realmode_swtch: .word 0, 0 # default_switch, SETUPSEG | 289 | realmode_swtch: .word 0, 0 # default_switch, SETUPSEG |
| @@ -350,7 +350,7 @@ cmd_line_ptr: .long 0 # (Header version 0x0202 or later) | |||
| 350 | # can be located anywhere in | 350 | # can be located anywhere in |
| 351 | # low memory 0x10000 or higher. | 351 | # low memory 0x10000 or higher. |
| 352 | 352 | ||
| 353 | ramdisk_max: .long 0x7fffffff | 353 | initrd_addr_max: .long 0x7fffffff |
| 354 | # (Header version 0x0203 or later) | 354 | # (Header version 0x0203 or later) |
| 355 | # The highest safe address for | 355 | # The highest safe address for |
| 356 | # the contents of an initrd | 356 | # the contents of an initrd |
| @@ -375,7 +375,8 @@ xloadflags: | |||
| 375 | # define XLF0 0 | 375 | # define XLF0 0 |
| 376 | #endif | 376 | #endif |
| 377 | 377 | ||
| 378 | #if defined(CONFIG_RELOCATABLE) && defined(CONFIG_X86_64) | 378 | #if defined(CONFIG_RELOCATABLE) && defined(CONFIG_X86_64) && \ |
| 379 | !defined(CONFIG_EFI_MIXED) | ||
| 379 | /* kernel/boot_param/ramdisk could be loaded above 4g */ | 380 | /* kernel/boot_param/ramdisk could be loaded above 4g */ |
| 380 | # define XLF1 XLF_CAN_BE_LOADED_ABOVE_4G | 381 | # define XLF1 XLF_CAN_BE_LOADED_ABOVE_4G |
| 381 | #else | 382 | #else |
| @@ -383,10 +384,14 @@ xloadflags: | |||
| 383 | #endif | 384 | #endif |
| 384 | 385 | ||
| 385 | #ifdef CONFIG_EFI_STUB | 386 | #ifdef CONFIG_EFI_STUB |
| 386 | # ifdef CONFIG_X86_64 | 387 | # ifdef CONFIG_EFI_MIXED |
| 387 | # define XLF23 XLF_EFI_HANDOVER_64 /* 64-bit EFI handover ok */ | 388 | # define XLF23 (XLF_EFI_HANDOVER_32|XLF_EFI_HANDOVER_64) |
| 388 | # else | 389 | # else |
| 389 | # define XLF23 XLF_EFI_HANDOVER_32 /* 32-bit EFI handover ok */ | 390 | # ifdef CONFIG_X86_64 |
| 391 | # define XLF23 XLF_EFI_HANDOVER_64 /* 64-bit EFI handover ok */ | ||
| 392 | # else | ||
| 393 | # define XLF23 XLF_EFI_HANDOVER_32 /* 32-bit EFI handover ok */ | ||
| 394 | # endif | ||
| 390 | # endif | 395 | # endif |
| 391 | #else | 396 | #else |
| 392 | # define XLF23 0 | 397 | # define XLF23 0 |
| @@ -426,13 +431,7 @@ pref_address: .quad LOAD_PHYSICAL_ADDR # preferred load addr | |||
| 426 | #define INIT_SIZE VO_INIT_SIZE | 431 | #define INIT_SIZE VO_INIT_SIZE |
| 427 | #endif | 432 | #endif |
| 428 | init_size: .long INIT_SIZE # kernel initialization size | 433 | init_size: .long INIT_SIZE # kernel initialization size |
| 429 | handover_offset: | 434 | handover_offset: .long 0 # Filled in by build.c |
| 430 | #ifdef CONFIG_EFI_STUB | ||
| 431 | .long 0x30 # offset to the handover | ||
| 432 | # protocol entry point | ||
| 433 | #else | ||
| 434 | .long 0 | ||
| 435 | #endif | ||
| 436 | 435 | ||
| 437 | # End of setup header ##################################################### | 436 | # End of setup header ##################################################### |
| 438 | 437 | ||
diff --git a/arch/x86/boot/tools/build.c b/arch/x86/boot/tools/build.c index 8e15b22391fc..1a2f2121cada 100644 --- a/arch/x86/boot/tools/build.c +++ b/arch/x86/boot/tools/build.c | |||
| @@ -53,7 +53,8 @@ int is_big_kernel; | |||
| 53 | 53 | ||
| 54 | #define PECOFF_RELOC_RESERVE 0x20 | 54 | #define PECOFF_RELOC_RESERVE 0x20 |
| 55 | 55 | ||
| 56 | unsigned long efi_stub_entry; | 56 | unsigned long efi32_stub_entry; |
| 57 | unsigned long efi64_stub_entry; | ||
| 57 | unsigned long efi_pe_entry; | 58 | unsigned long efi_pe_entry; |
| 58 | unsigned long startup_64; | 59 | unsigned long startup_64; |
| 59 | 60 | ||
| @@ -219,6 +220,52 @@ static void update_pecoff_text(unsigned int text_start, unsigned int file_sz) | |||
| 219 | update_pecoff_section_header(".text", text_start, text_sz); | 220 | update_pecoff_section_header(".text", text_start, text_sz); |
| 220 | } | 221 | } |
| 221 | 222 | ||
| 223 | static int reserve_pecoff_reloc_section(int c) | ||
| 224 | { | ||
| 225 | /* Reserve 0x20 bytes for .reloc section */ | ||
| 226 | memset(buf+c, 0, PECOFF_RELOC_RESERVE); | ||
| 227 | return PECOFF_RELOC_RESERVE; | ||
| 228 | } | ||
| 229 | |||
| 230 | static void efi_stub_defaults(void) | ||
| 231 | { | ||
| 232 | /* Defaults for old kernel */ | ||
| 233 | #ifdef CONFIG_X86_32 | ||
| 234 | efi_pe_entry = 0x10; | ||
| 235 | #else | ||
| 236 | efi_pe_entry = 0x210; | ||
| 237 | startup_64 = 0x200; | ||
| 238 | #endif | ||
| 239 | } | ||
| 240 | |||
| 241 | static void efi_stub_entry_update(void) | ||
| 242 | { | ||
| 243 | unsigned long addr = efi32_stub_entry; | ||
| 244 | |||
| 245 | #ifdef CONFIG_X86_64 | ||
| 246 | /* Yes, this is really how we defined it :( */ | ||
| 247 | addr = efi64_stub_entry - 0x200; | ||
| 248 | #endif | ||
| 249 | |||
| 250 | #ifdef CONFIG_EFI_MIXED | ||
| 251 | if (efi32_stub_entry != addr) | ||
| 252 | die("32-bit and 64-bit EFI entry points do not match\n"); | ||
| 253 | #endif | ||
| 254 | put_unaligned_le32(addr, &buf[0x264]); | ||
| 255 | } | ||
| 256 | |||
| 257 | #else | ||
| 258 | |||
| 259 | static inline void update_pecoff_setup_and_reloc(unsigned int size) {} | ||
| 260 | static inline void update_pecoff_text(unsigned int text_start, | ||
| 261 | unsigned int file_sz) {} | ||
| 262 | static inline void efi_stub_defaults(void) {} | ||
| 263 | static inline void efi_stub_entry_update(void) {} | ||
| 264 | |||
| 265 | static inline int reserve_pecoff_reloc_section(int c) | ||
| 266 | { | ||
| 267 | return 0; | ||
| 268 | } | ||
| 222 | #endif /* CONFIG_EFI_STUB */ | 269 | #endif /* CONFIG_EFI_STUB */ |
| 223 | 270 | ||
| 224 | 271 | ||
| @@ -250,7 +297,8 @@ static void parse_zoffset(char *fname) | |||
| 250 | p = (char *)buf; | 297 | p = (char *)buf; |
| 251 | 298 | ||
| 252 | while (p && *p) { | 299 | while (p && *p) { |
| 253 | PARSE_ZOFS(p, efi_stub_entry); | 300 | PARSE_ZOFS(p, efi32_stub_entry); |
| 301 | PARSE_ZOFS(p, efi64_stub_entry); | ||
| 254 | PARSE_ZOFS(p, efi_pe_entry); | 302 | PARSE_ZOFS(p, efi_pe_entry); |
| 255 | PARSE_ZOFS(p, startup_64); | 303 | PARSE_ZOFS(p, startup_64); |
| 256 | 304 | ||
| @@ -271,15 +319,7 @@ int main(int argc, char ** argv) | |||
| 271 | void *kernel; | 319 | void *kernel; |
| 272 | u32 crc = 0xffffffffUL; | 320 | u32 crc = 0xffffffffUL; |
| 273 | 321 | ||
| 274 | /* Defaults for old kernel */ | 322 | efi_stub_defaults(); |
| 275 | #ifdef CONFIG_X86_32 | ||
| 276 | efi_pe_entry = 0x10; | ||
| 277 | efi_stub_entry = 0x30; | ||
| 278 | #else | ||
| 279 | efi_pe_entry = 0x210; | ||
| 280 | efi_stub_entry = 0x230; | ||
| 281 | startup_64 = 0x200; | ||
| 282 | #endif | ||
| 283 | 323 | ||
| 284 | if (argc != 5) | 324 | if (argc != 5) |
| 285 | usage(); | 325 | usage(); |
| @@ -302,11 +342,7 @@ int main(int argc, char ** argv) | |||
| 302 | die("Boot block hasn't got boot flag (0xAA55)"); | 342 | die("Boot block hasn't got boot flag (0xAA55)"); |
| 303 | fclose(file); | 343 | fclose(file); |
| 304 | 344 | ||
| 305 | #ifdef CONFIG_EFI_STUB | 345 | c += reserve_pecoff_reloc_section(c); |
| 306 | /* Reserve 0x20 bytes for .reloc section */ | ||
| 307 | memset(buf+c, 0, PECOFF_RELOC_RESERVE); | ||
| 308 | c += PECOFF_RELOC_RESERVE; | ||
| 309 | #endif | ||
| 310 | 346 | ||
| 311 | /* Pad unused space with zeros */ | 347 | /* Pad unused space with zeros */ |
| 312 | setup_sectors = (c + 511) / 512; | 348 | setup_sectors = (c + 511) / 512; |
| @@ -315,9 +351,7 @@ int main(int argc, char ** argv) | |||
| 315 | i = setup_sectors*512; | 351 | i = setup_sectors*512; |
| 316 | memset(buf+c, 0, i-c); | 352 | memset(buf+c, 0, i-c); |
| 317 | 353 | ||
| 318 | #ifdef CONFIG_EFI_STUB | ||
| 319 | update_pecoff_setup_and_reloc(i); | 354 | update_pecoff_setup_and_reloc(i); |
| 320 | #endif | ||
| 321 | 355 | ||
| 322 | /* Set the default root device */ | 356 | /* Set the default root device */ |
| 323 | put_unaligned_le16(DEFAULT_ROOT_DEV, &buf[508]); | 357 | put_unaligned_le16(DEFAULT_ROOT_DEV, &buf[508]); |
| @@ -342,14 +376,9 @@ int main(int argc, char ** argv) | |||
| 342 | buf[0x1f1] = setup_sectors-1; | 376 | buf[0x1f1] = setup_sectors-1; |
| 343 | put_unaligned_le32(sys_size, &buf[0x1f4]); | 377 | put_unaligned_le32(sys_size, &buf[0x1f4]); |
| 344 | 378 | ||
| 345 | #ifdef CONFIG_EFI_STUB | ||
| 346 | update_pecoff_text(setup_sectors * 512, sz + i + ((sys_size * 16) - sz)); | 379 | update_pecoff_text(setup_sectors * 512, sz + i + ((sys_size * 16) - sz)); |
| 347 | 380 | ||
| 348 | #ifdef CONFIG_X86_64 /* Yes, this is really how we defined it :( */ | 381 | efi_stub_entry_update(); |
| 349 | efi_stub_entry -= 0x200; | ||
| 350 | #endif | ||
| 351 | put_unaligned_le32(efi_stub_entry, &buf[0x264]); | ||
| 352 | #endif | ||
| 353 | 382 | ||
| 354 | crc = partial_crc32(buf, i, crc); | 383 | crc = partial_crc32(buf, i, crc); |
| 355 | if (fwrite(buf, 1, i, dest) != i) | 384 | if (fwrite(buf, 1, i, dest) != i) |
diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild index 7f669853317a..4acddc43ee0c 100644 --- a/arch/x86/include/asm/Kbuild +++ b/arch/x86/include/asm/Kbuild | |||
| @@ -5,3 +5,5 @@ genhdr-y += unistd_64.h | |||
| 5 | genhdr-y += unistd_x32.h | 5 | genhdr-y += unistd_x32.h |
| 6 | 6 | ||
| 7 | generic-y += clkdev.h | 7 | generic-y += clkdev.h |
| 8 | generic-y += cputime.h | ||
| 9 | generic-y += mcs_spinlock.h | ||
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index 1d2091a226bc..19b0ebafcd3e 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h | |||
| @@ -93,9 +93,6 @@ static inline int is_vsmp_box(void) | |||
| 93 | return 0; | 93 | return 0; |
| 94 | } | 94 | } |
| 95 | #endif | 95 | #endif |
| 96 | extern void xapic_wait_icr_idle(void); | ||
| 97 | extern u32 safe_xapic_wait_icr_idle(void); | ||
| 98 | extern void xapic_icr_write(u32, u32); | ||
| 99 | extern int setup_profiling_timer(unsigned int); | 96 | extern int setup_profiling_timer(unsigned int); |
| 100 | 97 | ||
| 101 | static inline void native_apic_mem_write(u32 reg, u32 v) | 98 | static inline void native_apic_mem_write(u32 reg, u32 v) |
| @@ -184,7 +181,6 @@ extern int x2apic_phys; | |||
| 184 | extern int x2apic_preenabled; | 181 | extern int x2apic_preenabled; |
| 185 | extern void check_x2apic(void); | 182 | extern void check_x2apic(void); |
| 186 | extern void enable_x2apic(void); | 183 | extern void enable_x2apic(void); |
| 187 | extern void x2apic_icr_write(u32 low, u32 id); | ||
| 188 | static inline int x2apic_enabled(void) | 184 | static inline int x2apic_enabled(void) |
| 189 | { | 185 | { |
| 190 | u64 msr; | 186 | u64 msr; |
| @@ -221,7 +217,6 @@ static inline void x2apic_force_phys(void) | |||
| 221 | { | 217 | { |
| 222 | } | 218 | } |
| 223 | 219 | ||
| 224 | #define nox2apic 0 | ||
| 225 | #define x2apic_preenabled 0 | 220 | #define x2apic_preenabled 0 |
| 226 | #define x2apic_supported() 0 | 221 | #define x2apic_supported() 0 |
| 227 | #endif | 222 | #endif |
| @@ -351,7 +346,7 @@ struct apic { | |||
| 351 | int trampoline_phys_low; | 346 | int trampoline_phys_low; |
| 352 | int trampoline_phys_high; | 347 | int trampoline_phys_high; |
| 353 | 348 | ||
| 354 | void (*wait_for_init_deassert)(atomic_t *deassert); | 349 | bool wait_for_init_deassert; |
| 355 | void (*smp_callin_clear_local_apic)(void); | 350 | void (*smp_callin_clear_local_apic)(void); |
| 356 | void (*inquire_remote_apic)(int apicid); | 351 | void (*inquire_remote_apic)(int apicid); |
| 357 | 352 | ||
| @@ -517,13 +512,6 @@ extern int default_cpu_present_to_apicid(int mps_cpu); | |||
| 517 | extern int default_check_phys_apicid_present(int phys_apicid); | 512 | extern int default_check_phys_apicid_present(int phys_apicid); |
| 518 | #endif | 513 | #endif |
| 519 | 514 | ||
| 520 | static inline void default_wait_for_init_deassert(atomic_t *deassert) | ||
| 521 | { | ||
| 522 | while (!atomic_read(deassert)) | ||
| 523 | cpu_relax(); | ||
| 524 | return; | ||
| 525 | } | ||
| 526 | |||
| 527 | extern void generic_bigsmp_probe(void); | 515 | extern void generic_bigsmp_probe(void); |
| 528 | 516 | ||
| 529 | 517 | ||
diff --git a/arch/x86/include/asm/barrier.h b/arch/x86/include/asm/barrier.h index 04a48903b2eb..69bbb4845020 100644 --- a/arch/x86/include/asm/barrier.h +++ b/arch/x86/include/asm/barrier.h | |||
| @@ -85,11 +85,7 @@ | |||
| 85 | #else | 85 | #else |
| 86 | # define smp_rmb() barrier() | 86 | # define smp_rmb() barrier() |
| 87 | #endif | 87 | #endif |
| 88 | #ifdef CONFIG_X86_OOSTORE | 88 | #define smp_wmb() barrier() |
| 89 | # define smp_wmb() wmb() | ||
| 90 | #else | ||
| 91 | # define smp_wmb() barrier() | ||
| 92 | #endif | ||
| 93 | #define smp_read_barrier_depends() read_barrier_depends() | 89 | #define smp_read_barrier_depends() read_barrier_depends() |
| 94 | #define set_mb(var, value) do { (void)xchg(&var, value); } while (0) | 90 | #define set_mb(var, value) do { (void)xchg(&var, value); } while (0) |
| 95 | #else /* !SMP */ | 91 | #else /* !SMP */ |
| @@ -100,7 +96,7 @@ | |||
| 100 | #define set_mb(var, value) do { var = value; barrier(); } while (0) | 96 | #define set_mb(var, value) do { var = value; barrier(); } while (0) |
| 101 | #endif /* SMP */ | 97 | #endif /* SMP */ |
| 102 | 98 | ||
| 103 | #if defined(CONFIG_X86_OOSTORE) || defined(CONFIG_X86_PPRO_FENCE) | 99 | #if defined(CONFIG_X86_PPRO_FENCE) |
| 104 | 100 | ||
| 105 | /* | 101 | /* |
| 106 | * For either of these options x86 doesn't have a strong TSO memory | 102 | * For either of these options x86 doesn't have a strong TSO memory |
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index e099f9502ace..63211ef5046a 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h | |||
| @@ -37,7 +37,7 @@ | |||
| 37 | #define X86_FEATURE_PAT (0*32+16) /* Page Attribute Table */ | 37 | #define X86_FEATURE_PAT (0*32+16) /* Page Attribute Table */ |
| 38 | #define X86_FEATURE_PSE36 (0*32+17) /* 36-bit PSEs */ | 38 | #define X86_FEATURE_PSE36 (0*32+17) /* 36-bit PSEs */ |
| 39 | #define X86_FEATURE_PN (0*32+18) /* Processor serial number */ | 39 | #define X86_FEATURE_PN (0*32+18) /* Processor serial number */ |
| 40 | #define X86_FEATURE_CLFLSH (0*32+19) /* "clflush" CLFLUSH instruction */ | 40 | #define X86_FEATURE_CLFLUSH (0*32+19) /* CLFLUSH instruction */ |
| 41 | #define X86_FEATURE_DS (0*32+21) /* "dts" Debug Store */ | 41 | #define X86_FEATURE_DS (0*32+21) /* "dts" Debug Store */ |
| 42 | #define X86_FEATURE_ACPI (0*32+22) /* ACPI via MSR */ | 42 | #define X86_FEATURE_ACPI (0*32+22) /* ACPI via MSR */ |
| 43 | #define X86_FEATURE_MMX (0*32+23) /* Multimedia Extensions */ | 43 | #define X86_FEATURE_MMX (0*32+23) /* Multimedia Extensions */ |
| @@ -217,9 +217,14 @@ | |||
| 217 | #define X86_FEATURE_INVPCID (9*32+10) /* Invalidate Processor Context ID */ | 217 | #define X86_FEATURE_INVPCID (9*32+10) /* Invalidate Processor Context ID */ |
| 218 | #define X86_FEATURE_RTM (9*32+11) /* Restricted Transactional Memory */ | 218 | #define X86_FEATURE_RTM (9*32+11) /* Restricted Transactional Memory */ |
| 219 | #define X86_FEATURE_MPX (9*32+14) /* Memory Protection Extension */ | 219 | #define X86_FEATURE_MPX (9*32+14) /* Memory Protection Extension */ |
| 220 | #define X86_FEATURE_AVX512F (9*32+16) /* AVX-512 Foundation */ | ||
| 220 | #define X86_FEATURE_RDSEED (9*32+18) /* The RDSEED instruction */ | 221 | #define X86_FEATURE_RDSEED (9*32+18) /* The RDSEED instruction */ |
| 221 | #define X86_FEATURE_ADX (9*32+19) /* The ADCX and ADOX instructions */ | 222 | #define X86_FEATURE_ADX (9*32+19) /* The ADCX and ADOX instructions */ |
| 222 | #define X86_FEATURE_SMAP (9*32+20) /* Supervisor Mode Access Prevention */ | 223 | #define X86_FEATURE_SMAP (9*32+20) /* Supervisor Mode Access Prevention */ |
| 224 | #define X86_FEATURE_CLFLUSHOPT (9*32+23) /* CLFLUSHOPT instruction */ | ||
| 225 | #define X86_FEATURE_AVX512PF (9*32+26) /* AVX-512 Prefetch */ | ||
| 226 | #define X86_FEATURE_AVX512ER (9*32+27) /* AVX-512 Exponential and Reciprocal */ | ||
| 227 | #define X86_FEATURE_AVX512CD (9*32+28) /* AVX-512 Conflict Detection */ | ||
| 223 | 228 | ||
| 224 | /* | 229 | /* |
| 225 | * BUG word(s) | 230 | * BUG word(s) |
| @@ -313,7 +318,7 @@ extern const char * const x86_power_flags[32]; | |||
| 313 | #define cpu_has_pmm_enabled boot_cpu_has(X86_FEATURE_PMM_EN) | 318 | #define cpu_has_pmm_enabled boot_cpu_has(X86_FEATURE_PMM_EN) |
| 314 | #define cpu_has_ds boot_cpu_has(X86_FEATURE_DS) | 319 | #define cpu_has_ds boot_cpu_has(X86_FEATURE_DS) |
| 315 | #define cpu_has_pebs boot_cpu_has(X86_FEATURE_PEBS) | 320 | #define cpu_has_pebs boot_cpu_has(X86_FEATURE_PEBS) |
| 316 | #define cpu_has_clflush boot_cpu_has(X86_FEATURE_CLFLSH) | 321 | #define cpu_has_clflush boot_cpu_has(X86_FEATURE_CLFLUSH) |
| 317 | #define cpu_has_bts boot_cpu_has(X86_FEATURE_BTS) | 322 | #define cpu_has_bts boot_cpu_has(X86_FEATURE_BTS) |
| 318 | #define cpu_has_gbpages boot_cpu_has(X86_FEATURE_GBPAGES) | 323 | #define cpu_has_gbpages boot_cpu_has(X86_FEATURE_GBPAGES) |
| 319 | #define cpu_has_arch_perfmon boot_cpu_has(X86_FEATURE_ARCH_PERFMON) | 324 | #define cpu_has_arch_perfmon boot_cpu_has(X86_FEATURE_ARCH_PERFMON) |
diff --git a/arch/x86/include/asm/cputime.h b/arch/x86/include/asm/cputime.h deleted file mode 100644 index 6d68ad7e0ea3..000000000000 --- a/arch/x86/include/asm/cputime.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #include <asm-generic/cputime.h> | ||
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index 3d6b9f81cc68..0869434eaf72 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h | |||
| @@ -19,9 +19,11 @@ | |||
| 19 | */ | 19 | */ |
| 20 | #define EFI_OLD_MEMMAP EFI_ARCH_1 | 20 | #define EFI_OLD_MEMMAP EFI_ARCH_1 |
| 21 | 21 | ||
| 22 | #define EFI32_LOADER_SIGNATURE "EL32" | ||
| 23 | #define EFI64_LOADER_SIGNATURE "EL64" | ||
| 24 | |||
| 22 | #ifdef CONFIG_X86_32 | 25 | #ifdef CONFIG_X86_32 |
| 23 | 26 | ||
| 24 | #define EFI_LOADER_SIGNATURE "EL32" | ||
| 25 | 27 | ||
| 26 | extern unsigned long asmlinkage efi_call_phys(void *, ...); | 28 | extern unsigned long asmlinkage efi_call_phys(void *, ...); |
| 27 | 29 | ||
| @@ -57,8 +59,6 @@ extern unsigned long asmlinkage efi_call_phys(void *, ...); | |||
| 57 | 59 | ||
| 58 | #else /* !CONFIG_X86_32 */ | 60 | #else /* !CONFIG_X86_32 */ |
| 59 | 61 | ||
| 60 | #define EFI_LOADER_SIGNATURE "EL64" | ||
| 61 | |||
| 62 | extern u64 efi_call0(void *fp); | 62 | extern u64 efi_call0(void *fp); |
| 63 | extern u64 efi_call1(void *fp, u64 arg1); | 63 | extern u64 efi_call1(void *fp, u64 arg1); |
| 64 | extern u64 efi_call2(void *fp, u64 arg1, u64 arg2); | 64 | extern u64 efi_call2(void *fp, u64 arg1, u64 arg2); |
| @@ -119,7 +119,6 @@ extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size, | |||
| 119 | #endif /* CONFIG_X86_32 */ | 119 | #endif /* CONFIG_X86_32 */ |
| 120 | 120 | ||
| 121 | extern int add_efi_memmap; | 121 | extern int add_efi_memmap; |
| 122 | extern unsigned long x86_efi_facility; | ||
| 123 | extern struct efi_scratch efi_scratch; | 122 | extern struct efi_scratch efi_scratch; |
| 124 | extern void efi_set_executable(efi_memory_desc_t *md, bool executable); | 123 | extern void efi_set_executable(efi_memory_desc_t *md, bool executable); |
| 125 | extern int efi_memblock_x86_reserve_range(void); | 124 | extern int efi_memblock_x86_reserve_range(void); |
| @@ -130,10 +129,13 @@ extern void efi_memory_uc(u64 addr, unsigned long size); | |||
| 130 | extern void __init efi_map_region(efi_memory_desc_t *md); | 129 | extern void __init efi_map_region(efi_memory_desc_t *md); |
| 131 | extern void __init efi_map_region_fixed(efi_memory_desc_t *md); | 130 | extern void __init efi_map_region_fixed(efi_memory_desc_t *md); |
| 132 | extern void efi_sync_low_kernel_mappings(void); | 131 | extern void efi_sync_low_kernel_mappings(void); |
| 133 | extern void efi_setup_page_tables(void); | 132 | extern int efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages); |
| 133 | extern void efi_cleanup_page_tables(unsigned long pa_memmap, unsigned num_pages); | ||
| 134 | extern void __init old_map_region(efi_memory_desc_t *md); | 134 | extern void __init old_map_region(efi_memory_desc_t *md); |
| 135 | extern void __init runtime_code_page_mkexec(void); | 135 | extern void __init runtime_code_page_mkexec(void); |
| 136 | extern void __init efi_runtime_mkexec(void); | 136 | extern void __init efi_runtime_mkexec(void); |
| 137 | extern void __init efi_dump_pagetable(void); | ||
| 138 | extern void __init efi_apply_memmap_quirks(void); | ||
| 137 | 139 | ||
| 138 | struct efi_setup_data { | 140 | struct efi_setup_data { |
| 139 | u64 fw_vendor; | 141 | u64 fw_vendor; |
| @@ -152,8 +154,40 @@ static inline bool efi_is_native(void) | |||
| 152 | return IS_ENABLED(CONFIG_X86_64) == efi_enabled(EFI_64BIT); | 154 | return IS_ENABLED(CONFIG_X86_64) == efi_enabled(EFI_64BIT); |
| 153 | } | 155 | } |
| 154 | 156 | ||
| 157 | static inline bool efi_runtime_supported(void) | ||
| 158 | { | ||
| 159 | if (efi_is_native()) | ||
| 160 | return true; | ||
| 161 | |||
| 162 | if (IS_ENABLED(CONFIG_EFI_MIXED) && !efi_enabled(EFI_OLD_MEMMAP)) | ||
| 163 | return true; | ||
| 164 | |||
| 165 | return false; | ||
| 166 | } | ||
| 167 | |||
| 155 | extern struct console early_efi_console; | 168 | extern struct console early_efi_console; |
| 156 | extern void parse_efi_setup(u64 phys_addr, u32 data_len); | 169 | extern void parse_efi_setup(u64 phys_addr, u32 data_len); |
| 170 | |||
| 171 | #ifdef CONFIG_EFI_MIXED | ||
| 172 | extern void efi_thunk_runtime_setup(void); | ||
| 173 | extern efi_status_t efi_thunk_set_virtual_address_map( | ||
| 174 | void *phys_set_virtual_address_map, | ||
| 175 | unsigned long memory_map_size, | ||
| 176 | unsigned long descriptor_size, | ||
| 177 | u32 descriptor_version, | ||
| 178 | efi_memory_desc_t *virtual_map); | ||
| 179 | #else | ||
| 180 | static inline void efi_thunk_runtime_setup(void) {} | ||
| 181 | static inline efi_status_t efi_thunk_set_virtual_address_map( | ||
| 182 | void *phys_set_virtual_address_map, | ||
| 183 | unsigned long memory_map_size, | ||
| 184 | unsigned long descriptor_size, | ||
| 185 | u32 descriptor_version, | ||
| 186 | efi_memory_desc_t *virtual_map) | ||
| 187 | { | ||
| 188 | return EFI_SUCCESS; | ||
| 189 | } | ||
| 190 | #endif /* CONFIG_EFI_MIXED */ | ||
| 157 | #else | 191 | #else |
| 158 | /* | 192 | /* |
| 159 | * IF EFI is not configured, have the EFI calls return -ENOSYS. | 193 | * IF EFI is not configured, have the EFI calls return -ENOSYS. |
diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h index d3d74698dce9..1c7eefe32502 100644 --- a/arch/x86/include/asm/floppy.h +++ b/arch/x86/include/asm/floppy.h | |||
| @@ -145,10 +145,10 @@ static int fd_request_irq(void) | |||
| 145 | { | 145 | { |
| 146 | if (can_use_virtual_dma) | 146 | if (can_use_virtual_dma) |
| 147 | return request_irq(FLOPPY_IRQ, floppy_hardint, | 147 | return request_irq(FLOPPY_IRQ, floppy_hardint, |
| 148 | IRQF_DISABLED, "floppy", NULL); | 148 | 0, "floppy", NULL); |
| 149 | else | 149 | else |
| 150 | return request_irq(FLOPPY_IRQ, floppy_interrupt, | 150 | return request_irq(FLOPPY_IRQ, floppy_interrupt, |
| 151 | IRQF_DISABLED, "floppy", NULL); | 151 | 0, "floppy", NULL); |
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | static unsigned long dma_mem_alloc(unsigned long size) | 154 | static unsigned long dma_mem_alloc(unsigned long size) |
diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h index ab0ae1aa6d0a..230853da4ec0 100644 --- a/arch/x86/include/asm/hardirq.h +++ b/arch/x86/include/asm/hardirq.h | |||
| @@ -33,6 +33,9 @@ typedef struct { | |||
| 33 | #ifdef CONFIG_X86_MCE_THRESHOLD | 33 | #ifdef CONFIG_X86_MCE_THRESHOLD |
| 34 | unsigned int irq_threshold_count; | 34 | unsigned int irq_threshold_count; |
| 35 | #endif | 35 | #endif |
| 36 | #if IS_ENABLED(CONFIG_HYPERV) || defined(CONFIG_XEN) | ||
| 37 | unsigned int irq_hv_callback_count; | ||
| 38 | #endif | ||
| 36 | } ____cacheline_aligned irq_cpustat_t; | 39 | } ____cacheline_aligned irq_cpustat_t; |
| 37 | 40 | ||
| 38 | DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat); | 41 | DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat); |
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index 34f69cb9350a..91d9c69a629e 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h | |||
| @@ -237,7 +237,7 @@ memcpy_toio(volatile void __iomem *dst, const void *src, size_t count) | |||
| 237 | 237 | ||
| 238 | static inline void flush_write_buffers(void) | 238 | static inline void flush_write_buffers(void) |
| 239 | { | 239 | { |
| 240 | #if defined(CONFIG_X86_OOSTORE) || defined(CONFIG_X86_PPRO_FENCE) | 240 | #if defined(CONFIG_X86_PPRO_FENCE) |
| 241 | asm volatile("lock; addl $0,0(%%esp)": : :"memory"); | 241 | asm volatile("lock; addl $0,0(%%esp)": : :"memory"); |
| 242 | #endif | 242 | #endif |
| 243 | } | 243 | } |
diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h index cd9c41938b8a..c163215abb9a 100644 --- a/arch/x86/include/asm/mshyperv.h +++ b/arch/x86/include/asm/mshyperv.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define _ASM_X86_MSHYPER_H | 2 | #define _ASM_X86_MSHYPER_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/interrupt.h> | ||
| 5 | #include <asm/hyperv.h> | 6 | #include <asm/hyperv.h> |
| 6 | 7 | ||
| 7 | struct ms_hyperv_info { | 8 | struct ms_hyperv_info { |
| @@ -16,6 +17,7 @@ void hyperv_callback_vector(void); | |||
| 16 | #define trace_hyperv_callback_vector hyperv_callback_vector | 17 | #define trace_hyperv_callback_vector hyperv_callback_vector |
| 17 | #endif | 18 | #endif |
| 18 | void hyperv_vector_handler(struct pt_regs *regs); | 19 | void hyperv_vector_handler(struct pt_regs *regs); |
| 19 | void hv_register_vmbus_handler(int irq, irq_handler_t handler); | 20 | void hv_setup_vmbus_irq(void (*handler)(void)); |
| 21 | void hv_remove_vmbus_irq(void); | ||
| 20 | 22 | ||
| 21 | #endif | 23 | #endif |
diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h index e139b13f2a33..de36f22eb0b9 100644 --- a/arch/x86/include/asm/msr.h +++ b/arch/x86/include/asm/msr.h | |||
| @@ -214,6 +214,8 @@ do { \ | |||
| 214 | 214 | ||
| 215 | struct msr *msrs_alloc(void); | 215 | struct msr *msrs_alloc(void); |
| 216 | void msrs_free(struct msr *msrs); | 216 | void msrs_free(struct msr *msrs); |
| 217 | int msr_set_bit(u32 msr, u8 bit); | ||
| 218 | int msr_clear_bit(u32 msr, u8 bit); | ||
| 217 | 219 | ||
| 218 | #ifdef CONFIG_SMP | 220 | #ifdef CONFIG_SMP |
| 219 | int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); | 221 | int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); |
diff --git a/arch/x86/include/asm/nmi.h b/arch/x86/include/asm/nmi.h index 86f9301903c8..5f2fc4441b11 100644 --- a/arch/x86/include/asm/nmi.h +++ b/arch/x86/include/asm/nmi.h | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #ifndef _ASM_X86_NMI_H | 1 | #ifndef _ASM_X86_NMI_H |
| 2 | #define _ASM_X86_NMI_H | 2 | #define _ASM_X86_NMI_H |
| 3 | 3 | ||
| 4 | #include <linux/irq_work.h> | ||
| 4 | #include <linux/pm.h> | 5 | #include <linux/pm.h> |
| 5 | #include <asm/irq.h> | 6 | #include <asm/irq.h> |
| 6 | #include <asm/io.h> | 7 | #include <asm/io.h> |
| @@ -38,6 +39,8 @@ typedef int (*nmi_handler_t)(unsigned int, struct pt_regs *); | |||
| 38 | struct nmiaction { | 39 | struct nmiaction { |
| 39 | struct list_head list; | 40 | struct list_head list; |
| 40 | nmi_handler_t handler; | 41 | nmi_handler_t handler; |
| 42 | u64 max_duration; | ||
| 43 | struct irq_work irq_work; | ||
| 41 | unsigned long flags; | 44 | unsigned long flags; |
| 42 | const char *name; | 45 | const char *name; |
| 43 | }; | 46 | }; |
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 5ad38ad07890..b459ddf27d64 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h | |||
| @@ -15,9 +15,10 @@ | |||
| 15 | : (prot)) | 15 | : (prot)) |
| 16 | 16 | ||
| 17 | #ifndef __ASSEMBLY__ | 17 | #ifndef __ASSEMBLY__ |
| 18 | |||
| 19 | #include <asm/x86_init.h> | 18 | #include <asm/x86_init.h> |
| 20 | 19 | ||
| 20 | void ptdump_walk_pgd_level(struct seq_file *m, pgd_t *pgd); | ||
| 21 | |||
| 21 | /* | 22 | /* |
| 22 | * ZERO_PAGE is a global shared page that is always zero: used | 23 | * ZERO_PAGE is a global shared page that is always zero: used |
| 23 | * for zero-mapped memory areas etc.. | 24 | * for zero-mapped memory areas etc.. |
| @@ -445,20 +446,10 @@ static inline int pte_same(pte_t a, pte_t b) | |||
| 445 | return a.pte == b.pte; | 446 | return a.pte == b.pte; |
| 446 | } | 447 | } |
| 447 | 448 | ||
| 448 | static inline int pteval_present(pteval_t pteval) | ||
| 449 | { | ||
| 450 | /* | ||
| 451 | * Yes Linus, _PAGE_PROTNONE == _PAGE_NUMA. Expressing it this | ||
| 452 | * way clearly states that the intent is that protnone and numa | ||
| 453 | * hinting ptes are considered present for the purposes of | ||
| 454 | * pagetable operations like zapping, protection changes, gup etc. | ||
| 455 | */ | ||
| 456 | return pteval & (_PAGE_PRESENT | _PAGE_PROTNONE | _PAGE_NUMA); | ||
| 457 | } | ||
| 458 | |||
| 459 | static inline int pte_present(pte_t a) | 449 | static inline int pte_present(pte_t a) |
| 460 | { | 450 | { |
| 461 | return pteval_present(pte_flags(a)); | 451 | return pte_flags(a) & (_PAGE_PRESENT | _PAGE_PROTNONE | |
| 452 | _PAGE_NUMA); | ||
| 462 | } | 453 | } |
| 463 | 454 | ||
| 464 | #define pte_accessible pte_accessible | 455 | #define pte_accessible pte_accessible |
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h index 1aa9ccd43223..708f19fb4fc7 100644 --- a/arch/x86/include/asm/pgtable_types.h +++ b/arch/x86/include/asm/pgtable_types.h | |||
| @@ -382,9 +382,13 @@ static inline void update_page_count(int level, unsigned long pages) { } | |||
| 382 | * as a pte too. | 382 | * as a pte too. |
| 383 | */ | 383 | */ |
| 384 | extern pte_t *lookup_address(unsigned long address, unsigned int *level); | 384 | extern pte_t *lookup_address(unsigned long address, unsigned int *level); |
| 385 | extern pte_t *lookup_address_in_pgd(pgd_t *pgd, unsigned long address, | ||
| 386 | unsigned int *level); | ||
| 385 | extern phys_addr_t slow_virt_to_phys(void *__address); | 387 | extern phys_addr_t slow_virt_to_phys(void *__address); |
| 386 | extern int kernel_map_pages_in_pgd(pgd_t *pgd, u64 pfn, unsigned long address, | 388 | extern int kernel_map_pages_in_pgd(pgd_t *pgd, u64 pfn, unsigned long address, |
| 387 | unsigned numpages, unsigned long page_flags); | 389 | unsigned numpages, unsigned long page_flags); |
| 390 | void kernel_unmap_pages_in_pgd(pgd_t *root, unsigned long address, | ||
| 391 | unsigned numpages); | ||
| 388 | #endif /* !__ASSEMBLY__ */ | 392 | #endif /* !__ASSEMBLY__ */ |
| 389 | 393 | ||
| 390 | #endif /* _ASM_X86_PGTABLE_DEFS_H */ | 394 | #endif /* _ASM_X86_PGTABLE_DEFS_H */ |
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index fdedd38fd0fc..a4ea02351f4d 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
| @@ -449,6 +449,15 @@ struct stack_canary { | |||
| 449 | }; | 449 | }; |
| 450 | DECLARE_PER_CPU_ALIGNED(struct stack_canary, stack_canary); | 450 | DECLARE_PER_CPU_ALIGNED(struct stack_canary, stack_canary); |
| 451 | #endif | 451 | #endif |
| 452 | /* | ||
| 453 | * per-CPU IRQ handling stacks | ||
| 454 | */ | ||
| 455 | struct irq_stack { | ||
| 456 | u32 stack[THREAD_SIZE/sizeof(u32)]; | ||
| 457 | } __aligned(THREAD_SIZE); | ||
| 458 | |||
| 459 | DECLARE_PER_CPU(struct irq_stack *, hardirq_stack); | ||
| 460 | DECLARE_PER_CPU(struct irq_stack *, softirq_stack); | ||
| 452 | #endif /* X86_64 */ | 461 | #endif /* X86_64 */ |
| 453 | 462 | ||
| 454 | extern unsigned int xstate_size; | 463 | extern unsigned int xstate_size; |
diff --git a/arch/x86/include/asm/special_insns.h b/arch/x86/include/asm/special_insns.h index 645cad2c95ff..e820c080a4e9 100644 --- a/arch/x86/include/asm/special_insns.h +++ b/arch/x86/include/asm/special_insns.h | |||
| @@ -191,6 +191,14 @@ static inline void clflush(volatile void *__p) | |||
| 191 | asm volatile("clflush %0" : "+m" (*(volatile char __force *)__p)); | 191 | asm volatile("clflush %0" : "+m" (*(volatile char __force *)__p)); |
| 192 | } | 192 | } |
| 193 | 193 | ||
| 194 | static inline void clflushopt(volatile void *__p) | ||
| 195 | { | ||
| 196 | alternative_io(".byte " __stringify(NOP_DS_PREFIX) "; clflush %P0", | ||
| 197 | ".byte 0x66; clflush %P0", | ||
| 198 | X86_FEATURE_CLFLUSHOPT, | ||
| 199 | "+m" (*(volatile char __force *)__p)); | ||
| 200 | } | ||
| 201 | |||
| 194 | #define nop() asm volatile ("nop") | 202 | #define nop() asm volatile ("nop") |
| 195 | 203 | ||
| 196 | 204 | ||
diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h index bf156ded74b5..0f62f5482d91 100644 --- a/arch/x86/include/asm/spinlock.h +++ b/arch/x86/include/asm/spinlock.h | |||
| @@ -26,10 +26,9 @@ | |||
| 26 | # define LOCK_PTR_REG "D" | 26 | # define LOCK_PTR_REG "D" |
| 27 | #endif | 27 | #endif |
| 28 | 28 | ||
| 29 | #if defined(CONFIG_X86_32) && \ | 29 | #if defined(CONFIG_X86_32) && (defined(CONFIG_X86_PPRO_FENCE)) |
| 30 | (defined(CONFIG_X86_OOSTORE) || defined(CONFIG_X86_PPRO_FENCE)) | ||
| 31 | /* | 30 | /* |
| 32 | * On PPro SMP or if we are using OOSTORE, we use a locked operation to unlock | 31 | * On PPro SMP, we use a locked operation to unlock |
| 33 | * (PPro errata 66, 92) | 32 | * (PPro errata 66, 92) |
| 34 | */ | 33 | */ |
| 35 | # define UNLOCK_LOCK_PREFIX LOCK_PREFIX | 34 | # define UNLOCK_LOCK_PREFIX LOCK_PREFIX |
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index e1940c06ed02..47e5de25ba79 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | 9 | ||
| 10 | #include <linux/compiler.h> | 10 | #include <linux/compiler.h> |
| 11 | #include <asm/page.h> | 11 | #include <asm/page.h> |
| 12 | #include <asm/percpu.h> | ||
| 12 | #include <asm/types.h> | 13 | #include <asm/types.h> |
| 13 | 14 | ||
| 14 | /* | 15 | /* |
| @@ -32,12 +33,6 @@ struct thread_info { | |||
| 32 | mm_segment_t addr_limit; | 33 | mm_segment_t addr_limit; |
| 33 | struct restart_block restart_block; | 34 | struct restart_block restart_block; |
| 34 | void __user *sysenter_return; | 35 | void __user *sysenter_return; |
| 35 | #ifdef CONFIG_X86_32 | ||
| 36 | unsigned long previous_esp; /* ESP of the previous stack in | ||
| 37 | case of nested (IRQ) stacks | ||
| 38 | */ | ||
| 39 | __u8 supervisor_stack[0]; | ||
| 40 | #endif | ||
| 41 | unsigned int sig_on_uaccess_error:1; | 36 | unsigned int sig_on_uaccess_error:1; |
| 42 | unsigned int uaccess_err:1; /* uaccess failed */ | 37 | unsigned int uaccess_err:1; /* uaccess failed */ |
| 43 | }; | 38 | }; |
| @@ -153,9 +148,9 @@ struct thread_info { | |||
| 153 | #define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY) | 148 | #define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY) |
| 154 | #define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW) | 149 | #define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW) |
| 155 | 150 | ||
| 156 | #ifdef CONFIG_X86_32 | 151 | #define STACK_WARN (THREAD_SIZE/8) |
| 152 | #define KERNEL_STACK_OFFSET (5*(BITS_PER_LONG/8)) | ||
| 157 | 153 | ||
| 158 | #define STACK_WARN (THREAD_SIZE/8) | ||
| 159 | /* | 154 | /* |
| 160 | * macros/functions for gaining access to the thread information structure | 155 | * macros/functions for gaining access to the thread information structure |
| 161 | * | 156 | * |
| @@ -163,42 +158,6 @@ struct thread_info { | |||
| 163 | */ | 158 | */ |
| 164 | #ifndef __ASSEMBLY__ | 159 | #ifndef __ASSEMBLY__ |
| 165 | 160 | ||
| 166 | #define current_stack_pointer ({ \ | ||
| 167 | unsigned long sp; \ | ||
| 168 | asm("mov %%esp,%0" : "=g" (sp)); \ | ||
| 169 | sp; \ | ||
| 170 | }) | ||
| 171 | |||
| 172 | /* how to get the thread information struct from C */ | ||
| 173 | static inline struct thread_info *current_thread_info(void) | ||
| 174 | { | ||
| 175 | return (struct thread_info *) | ||
| 176 | (current_stack_pointer & ~(THREAD_SIZE - 1)); | ||
| 177 | } | ||
| 178 | |||
| 179 | #else /* !__ASSEMBLY__ */ | ||
| 180 | |||
| 181 | /* how to get the thread information struct from ASM */ | ||
| 182 | #define GET_THREAD_INFO(reg) \ | ||
| 183 | movl $-THREAD_SIZE, reg; \ | ||
| 184 | andl %esp, reg | ||
| 185 | |||
| 186 | /* use this one if reg already contains %esp */ | ||
| 187 | #define GET_THREAD_INFO_WITH_ESP(reg) \ | ||
| 188 | andl $-THREAD_SIZE, reg | ||
| 189 | |||
| 190 | #endif | ||
| 191 | |||
| 192 | #else /* X86_32 */ | ||
| 193 | |||
| 194 | #include <asm/percpu.h> | ||
| 195 | #define KERNEL_STACK_OFFSET (5*8) | ||
| 196 | |||
| 197 | /* | ||
| 198 | * macros/functions for gaining access to the thread information structure | ||
| 199 | * preempt_count needs to be 1 initially, until the scheduler is functional. | ||
| 200 | */ | ||
| 201 | #ifndef __ASSEMBLY__ | ||
| 202 | DECLARE_PER_CPU(unsigned long, kernel_stack); | 161 | DECLARE_PER_CPU(unsigned long, kernel_stack); |
| 203 | 162 | ||
| 204 | static inline struct thread_info *current_thread_info(void) | 163 | static inline struct thread_info *current_thread_info(void) |
| @@ -213,8 +172,8 @@ static inline struct thread_info *current_thread_info(void) | |||
| 213 | 172 | ||
| 214 | /* how to get the thread information struct from ASM */ | 173 | /* how to get the thread information struct from ASM */ |
| 215 | #define GET_THREAD_INFO(reg) \ | 174 | #define GET_THREAD_INFO(reg) \ |
| 216 | movq PER_CPU_VAR(kernel_stack),reg ; \ | 175 | _ASM_MOV PER_CPU_VAR(kernel_stack),reg ; \ |
| 217 | subq $(THREAD_SIZE-KERNEL_STACK_OFFSET),reg | 176 | _ASM_SUB $(THREAD_SIZE-KERNEL_STACK_OFFSET),reg ; |
| 218 | 177 | ||
| 219 | /* | 178 | /* |
| 220 | * Same if PER_CPU_VAR(kernel_stack) is, perhaps with some offset, already in | 179 | * Same if PER_CPU_VAR(kernel_stack) is, perhaps with some offset, already in |
| @@ -224,8 +183,6 @@ static inline struct thread_info *current_thread_info(void) | |||
| 224 | 183 | ||
| 225 | #endif | 184 | #endif |
| 226 | 185 | ||
| 227 | #endif /* !X86_32 */ | ||
| 228 | |||
| 229 | /* | 186 | /* |
| 230 | * Thread-synchronous status. | 187 | * Thread-synchronous status. |
| 231 | * | 188 | * |
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h index d35f24e231cd..b28097e4c8c3 100644 --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h | |||
| @@ -119,9 +119,10 @@ static inline void setup_node_to_cpumask_map(void) { } | |||
| 119 | 119 | ||
| 120 | extern const struct cpumask *cpu_coregroup_mask(int cpu); | 120 | extern const struct cpumask *cpu_coregroup_mask(int cpu); |
| 121 | 121 | ||
| 122 | #ifdef ENABLE_TOPO_DEFINES | ||
| 123 | #define topology_physical_package_id(cpu) (cpu_data(cpu).phys_proc_id) | 122 | #define topology_physical_package_id(cpu) (cpu_data(cpu).phys_proc_id) |
| 124 | #define topology_core_id(cpu) (cpu_data(cpu).cpu_core_id) | 123 | #define topology_core_id(cpu) (cpu_data(cpu).cpu_core_id) |
| 124 | |||
| 125 | #ifdef ENABLE_TOPO_DEFINES | ||
| 125 | #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu)) | 126 | #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu)) |
| 126 | #define topology_thread_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu)) | 127 | #define topology_thread_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu)) |
| 127 | #endif | 128 | #endif |
| @@ -133,12 +134,6 @@ static inline void arch_fix_phys_package_id(int num, u32 slot) | |||
| 133 | struct pci_bus; | 134 | struct pci_bus; |
| 134 | void x86_pci_root_bus_resources(int bus, struct list_head *resources); | 135 | void x86_pci_root_bus_resources(int bus, struct list_head *resources); |
| 135 | 136 | ||
| 136 | #ifdef CONFIG_SMP | ||
| 137 | #define mc_capable() ((boot_cpu_data.x86_max_cores > 1) && \ | ||
| 138 | (cpumask_weight(cpu_core_mask(0)) != nr_cpu_ids)) | ||
| 139 | #define smt_capable() (smp_num_siblings > 1) | ||
| 140 | #endif | ||
| 141 | |||
| 142 | #ifdef CONFIG_NUMA | 137 | #ifdef CONFIG_NUMA |
| 143 | extern int get_mp_bus_to_node(int busnum); | 138 | extern int get_mp_bus_to_node(int busnum); |
| 144 | extern void set_mp_bus_to_node(int busnum, int node); | 139 | extern void set_mp_bus_to_node(int busnum, int node); |
diff --git a/arch/x86/include/asm/unistd.h b/arch/x86/include/asm/unistd.h index c2a48139c340..3f556c6a0157 100644 --- a/arch/x86/include/asm/unistd.h +++ b/arch/x86/include/asm/unistd.h | |||
| @@ -23,6 +23,9 @@ | |||
| 23 | # include <asm/unistd_64.h> | 23 | # include <asm/unistd_64.h> |
| 24 | # include <asm/unistd_64_x32.h> | 24 | # include <asm/unistd_64_x32.h> |
| 25 | # define __ARCH_WANT_COMPAT_SYS_TIME | 25 | # define __ARCH_WANT_COMPAT_SYS_TIME |
| 26 | # define __ARCH_WANT_COMPAT_SYS_GETDENTS64 | ||
| 27 | # define __ARCH_WANT_COMPAT_SYS_PREADV64 | ||
| 28 | # define __ARCH_WANT_COMPAT_SYS_PWRITEV64 | ||
| 26 | 29 | ||
| 27 | # endif | 30 | # endif |
| 28 | 31 | ||
diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h index 554738963b28..6c1d7411eb00 100644 --- a/arch/x86/include/asm/xsave.h +++ b/arch/x86/include/asm/xsave.h | |||
| @@ -6,11 +6,14 @@ | |||
| 6 | 6 | ||
| 7 | #define XSTATE_CPUID 0x0000000d | 7 | #define XSTATE_CPUID 0x0000000d |
| 8 | 8 | ||
| 9 | #define XSTATE_FP 0x1 | 9 | #define XSTATE_FP 0x1 |
| 10 | #define XSTATE_SSE 0x2 | 10 | #define XSTATE_SSE 0x2 |
| 11 | #define XSTATE_YMM 0x4 | 11 | #define XSTATE_YMM 0x4 |
| 12 | #define XSTATE_BNDREGS 0x8 | 12 | #define XSTATE_BNDREGS 0x8 |
| 13 | #define XSTATE_BNDCSR 0x10 | 13 | #define XSTATE_BNDCSR 0x10 |
| 14 | #define XSTATE_OPMASK 0x20 | ||
| 15 | #define XSTATE_ZMM_Hi256 0x40 | ||
| 16 | #define XSTATE_Hi16_ZMM 0x80 | ||
| 14 | 17 | ||
| 15 | #define XSTATE_FPSSE (XSTATE_FP | XSTATE_SSE) | 18 | #define XSTATE_FPSSE (XSTATE_FP | XSTATE_SSE) |
| 16 | 19 | ||
| @@ -23,7 +26,8 @@ | |||
| 23 | #define XSAVE_YMM_OFFSET (XSAVE_HDR_SIZE + XSAVE_HDR_OFFSET) | 26 | #define XSAVE_YMM_OFFSET (XSAVE_HDR_SIZE + XSAVE_HDR_OFFSET) |
| 24 | 27 | ||
| 25 | /* Supported features which support lazy state saving */ | 28 | /* Supported features which support lazy state saving */ |
| 26 | #define XSTATE_LAZY (XSTATE_FP | XSTATE_SSE | XSTATE_YMM) | 29 | #define XSTATE_LAZY (XSTATE_FP | XSTATE_SSE | XSTATE_YMM \ |
| 30 | | XSTATE_OPMASK | XSTATE_ZMM_Hi256 | XSTATE_Hi16_ZMM) | ||
| 27 | 31 | ||
| 28 | /* Supported features which require eager state saving */ | 32 | /* Supported features which require eager state saving */ |
| 29 | #define XSTATE_EAGER (XSTATE_BNDREGS | XSTATE_BNDCSR) | 33 | #define XSTATE_EAGER (XSTATE_BNDREGS | XSTATE_BNDCSR) |
diff --git a/arch/x86/include/uapi/asm/msr-index.h b/arch/x86/include/uapi/asm/msr-index.h index c19fc60ff062..4924f4be2b99 100644 --- a/arch/x86/include/uapi/asm/msr-index.h +++ b/arch/x86/include/uapi/asm/msr-index.h | |||
| @@ -368,33 +368,58 @@ | |||
| 368 | #define THERM_LOG_THRESHOLD1 (1 << 9) | 368 | #define THERM_LOG_THRESHOLD1 (1 << 9) |
| 369 | 369 | ||
| 370 | /* MISC_ENABLE bits: architectural */ | 370 | /* MISC_ENABLE bits: architectural */ |
| 371 | #define MSR_IA32_MISC_ENABLE_FAST_STRING (1ULL << 0) | 371 | #define MSR_IA32_MISC_ENABLE_FAST_STRING_BIT 0 |
| 372 | #define MSR_IA32_MISC_ENABLE_TCC (1ULL << 1) | 372 | #define MSR_IA32_MISC_ENABLE_FAST_STRING (1ULL << MSR_IA32_MISC_ENABLE_FAST_STRING_BIT) |
| 373 | #define MSR_IA32_MISC_ENABLE_EMON (1ULL << 7) | 373 | #define MSR_IA32_MISC_ENABLE_TCC_BIT 1 |
| 374 | #define MSR_IA32_MISC_ENABLE_BTS_UNAVAIL (1ULL << 11) | 374 | #define MSR_IA32_MISC_ENABLE_TCC (1ULL << MSR_IA32_MISC_ENABLE_TCC_BIT) |
| 375 | #define MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL (1ULL << 12) | 375 | #define MSR_IA32_MISC_ENABLE_EMON_BIT 7 |
| 376 | #define MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP (1ULL << 16) | 376 | #define MSR_IA32_MISC_ENABLE_EMON (1ULL << MSR_IA32_MISC_ENABLE_EMON_BIT) |
| 377 | #define MSR_IA32_MISC_ENABLE_MWAIT (1ULL << 18) | 377 | #define MSR_IA32_MISC_ENABLE_BTS_UNAVAIL_BIT 11 |
| 378 | #define MSR_IA32_MISC_ENABLE_LIMIT_CPUID (1ULL << 22) | 378 | #define MSR_IA32_MISC_ENABLE_BTS_UNAVAIL (1ULL << MSR_IA32_MISC_ENABLE_BTS_UNAVAIL_BIT) |
| 379 | #define MSR_IA32_MISC_ENABLE_XTPR_DISABLE (1ULL << 23) | 379 | #define MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL_BIT 12 |
| 380 | #define MSR_IA32_MISC_ENABLE_XD_DISABLE (1ULL << 34) | 380 | #define MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL (1ULL << MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL_BIT) |
| 381 | #define MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP_BIT 16 | ||
| 382 | #define MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP (1ULL << MSR_IA32_MISC_ENABLE_ENHANCED_SPEEDSTEP_BIT) | ||
| 383 | #define MSR_IA32_MISC_ENABLE_MWAIT_BIT 18 | ||
| 384 | #define MSR_IA32_MISC_ENABLE_MWAIT (1ULL << MSR_IA32_MISC_ENABLE_MWAIT_BIT) | ||
| 385 | #define MSR_IA32_MISC_ENABLE_LIMIT_CPUID_BIT 22 | ||
| 386 | #define MSR_IA32_MISC_ENABLE_LIMIT_CPUID (1ULL << MSR_IA32_MISC_ENABLE_LIMIT_CPUID_BIT); | ||
| 387 | #define MSR_IA32_MISC_ENABLE_XTPR_DISABLE_BIT 23 | ||
| 388 | #define MSR_IA32_MISC_ENABLE_XTPR_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_XTPR_DISABLE_BIT) | ||
| 389 | #define MSR_IA32_MISC_ENABLE_XD_DISABLE_BIT 34 | ||
| 390 | #define MSR_IA32_MISC_ENABLE_XD_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_XD_DISABLE_BIT) | ||
| 381 | 391 | ||
| 382 | /* MISC_ENABLE bits: model-specific, meaning may vary from core to core */ | 392 | /* MISC_ENABLE bits: model-specific, meaning may vary from core to core */ |
| 383 | #define MSR_IA32_MISC_ENABLE_X87_COMPAT (1ULL << 2) | 393 | #define MSR_IA32_MISC_ENABLE_X87_COMPAT_BIT 2 |
| 384 | #define MSR_IA32_MISC_ENABLE_TM1 (1ULL << 3) | 394 | #define MSR_IA32_MISC_ENABLE_X87_COMPAT (1ULL << MSR_IA32_MISC_ENABLE_X87_COMPAT_BIT) |
| 385 | #define MSR_IA32_MISC_ENABLE_SPLIT_LOCK_DISABLE (1ULL << 4) | 395 | #define MSR_IA32_MISC_ENABLE_TM1_BIT 3 |
| 386 | #define MSR_IA32_MISC_ENABLE_L3CACHE_DISABLE (1ULL << 6) | 396 | #define MSR_IA32_MISC_ENABLE_TM1 (1ULL << MSR_IA32_MISC_ENABLE_TM1_BIT) |
| 387 | #define MSR_IA32_MISC_ENABLE_SUPPRESS_LOCK (1ULL << 8) | 397 | #define MSR_IA32_MISC_ENABLE_SPLIT_LOCK_DISABLE_BIT 4 |
| 388 | #define MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE (1ULL << 9) | 398 | #define MSR_IA32_MISC_ENABLE_SPLIT_LOCK_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_SPLIT_LOCK_DISABLE_BIT) |
| 389 | #define MSR_IA32_MISC_ENABLE_FERR (1ULL << 10) | 399 | #define MSR_IA32_MISC_ENABLE_L3CACHE_DISABLE_BIT 6 |
| 390 | #define MSR_IA32_MISC_ENABLE_FERR_MULTIPLEX (1ULL << 10) | 400 | #define MSR_IA32_MISC_ENABLE_L3CACHE_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_L3CACHE_DISABLE_BIT) |
| 391 | #define MSR_IA32_MISC_ENABLE_TM2 (1ULL << 13) | 401 | #define MSR_IA32_MISC_ENABLE_SUPPRESS_LOCK_BIT 8 |
| 392 | #define MSR_IA32_MISC_ENABLE_ADJ_PREF_DISABLE (1ULL << 19) | 402 | #define MSR_IA32_MISC_ENABLE_SUPPRESS_LOCK (1ULL << MSR_IA32_MISC_ENABLE_SUPPRESS_LOCK_BIT) |
| 393 | #define MSR_IA32_MISC_ENABLE_SPEEDSTEP_LOCK (1ULL << 20) | 403 | #define MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE_BIT 9 |
| 394 | #define MSR_IA32_MISC_ENABLE_L1D_CONTEXT (1ULL << 24) | 404 | #define MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE_BIT) |
| 395 | #define MSR_IA32_MISC_ENABLE_DCU_PREF_DISABLE (1ULL << 37) | 405 | #define MSR_IA32_MISC_ENABLE_FERR_BIT 10 |
| 396 | #define MSR_IA32_MISC_ENABLE_TURBO_DISABLE (1ULL << 38) | 406 | #define MSR_IA32_MISC_ENABLE_FERR (1ULL << MSR_IA32_MISC_ENABLE_FERR_BIT) |
| 397 | #define MSR_IA32_MISC_ENABLE_IP_PREF_DISABLE (1ULL << 39) | 407 | #define MSR_IA32_MISC_ENABLE_FERR_MULTIPLEX_BIT 10 |
| 408 | #define MSR_IA32_MISC_ENABLE_FERR_MULTIPLEX (1ULL << MSR_IA32_MISC_ENABLE_FERR_MULTIPLEX_BIT) | ||
| 409 | #define MSR_IA32_MISC_ENABLE_TM2_BIT 13 | ||
| 410 | #define MSR_IA32_MISC_ENABLE_TM2 (1ULL << MSR_IA32_MISC_ENABLE_TM2_BIT) | ||
| 411 | #define MSR_IA32_MISC_ENABLE_ADJ_PREF_DISABLE_BIT 19 | ||
| 412 | #define MSR_IA32_MISC_ENABLE_ADJ_PREF_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_ADJ_PREF_DISABLE_BIT) | ||
| 413 | #define MSR_IA32_MISC_ENABLE_SPEEDSTEP_LOCK_BIT 20 | ||
| 414 | #define MSR_IA32_MISC_ENABLE_SPEEDSTEP_LOCK (1ULL << MSR_IA32_MISC_ENABLE_SPEEDSTEP_LOCK_BIT) | ||
| 415 | #define MSR_IA32_MISC_ENABLE_L1D_CONTEXT_BIT 24 | ||
| 416 | #define MSR_IA32_MISC_ENABLE_L1D_CONTEXT (1ULL << MSR_IA32_MISC_ENABLE_L1D_CONTEXT_BIT) | ||
| 417 | #define MSR_IA32_MISC_ENABLE_DCU_PREF_DISABLE_BIT 37 | ||
| 418 | #define MSR_IA32_MISC_ENABLE_DCU_PREF_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_DCU_PREF_DISABLE_BIT) | ||
| 419 | #define MSR_IA32_MISC_ENABLE_TURBO_DISABLE_BIT 38 | ||
| 420 | #define MSR_IA32_MISC_ENABLE_TURBO_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_TURBO_DISABLE_BIT) | ||
| 421 | #define MSR_IA32_MISC_ENABLE_IP_PREF_DISABLE_BIT 39 | ||
| 422 | #define MSR_IA32_MISC_ENABLE_IP_PREF_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_IP_PREF_DISABLE_BIT) | ||
| 398 | 423 | ||
| 399 | #define MSR_IA32_TSC_DEADLINE 0x000006E0 | 424 | #define MSR_IA32_TSC_DEADLINE 0x000006E0 |
| 400 | 425 | ||
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 1dac94265b59..9f46f2b1cfc2 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
| @@ -613,10 +613,10 @@ static void acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) | |||
| 613 | int nid; | 613 | int nid; |
| 614 | 614 | ||
| 615 | nid = acpi_get_node(handle); | 615 | nid = acpi_get_node(handle); |
| 616 | if (nid == -1 || !node_online(nid)) | 616 | if (nid != -1) { |
| 617 | return; | 617 | set_apicid_to_node(physid, nid); |
| 618 | set_apicid_to_node(physid, nid); | 618 | numa_set_node(cpu, nid); |
| 619 | numa_set_node(cpu, nid); | 619 | } |
| 620 | #endif | 620 | #endif |
| 621 | } | 621 | } |
| 622 | 622 | ||
diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c index fd972a3e4cbb..9fa8aa051f54 100644 --- a/arch/x86/kernel/aperture_64.c +++ b/arch/x86/kernel/aperture_64.c | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | #include <linux/pci_ids.h> | 18 | #include <linux/pci_ids.h> |
| 19 | #include <linux/pci.h> | 19 | #include <linux/pci.h> |
| 20 | #include <linux/bitops.h> | 20 | #include <linux/bitops.h> |
| 21 | #include <linux/ioport.h> | ||
| 22 | #include <linux/suspend.h> | 21 | #include <linux/suspend.h> |
| 23 | #include <asm/e820.h> | 22 | #include <asm/e820.h> |
| 24 | #include <asm/io.h> | 23 | #include <asm/io.h> |
| @@ -54,18 +53,6 @@ int fallback_aper_force __initdata; | |||
| 54 | 53 | ||
| 55 | int fix_aperture __initdata = 1; | 54 | int fix_aperture __initdata = 1; |
| 56 | 55 | ||
| 57 | static struct resource gart_resource = { | ||
| 58 | .name = "GART", | ||
| 59 | .flags = IORESOURCE_MEM, | ||
| 60 | }; | ||
| 61 | |||
| 62 | static void __init insert_aperture_resource(u32 aper_base, u32 aper_size) | ||
| 63 | { | ||
| 64 | gart_resource.start = aper_base; | ||
| 65 | gart_resource.end = aper_base + aper_size - 1; | ||
| 66 | insert_resource(&iomem_resource, &gart_resource); | ||
| 67 | } | ||
| 68 | |||
| 69 | /* This code runs before the PCI subsystem is initialized, so just | 56 | /* This code runs before the PCI subsystem is initialized, so just |
| 70 | access the northbridge directly. */ | 57 | access the northbridge directly. */ |
| 71 | 58 | ||
| @@ -96,7 +83,6 @@ static u32 __init allocate_aperture(void) | |||
| 96 | memblock_reserve(addr, aper_size); | 83 | memblock_reserve(addr, aper_size); |
| 97 | printk(KERN_INFO "Mapping aperture over %d KB of RAM @ %lx\n", | 84 | printk(KERN_INFO "Mapping aperture over %d KB of RAM @ %lx\n", |
| 98 | aper_size >> 10, addr); | 85 | aper_size >> 10, addr); |
| 99 | insert_aperture_resource((u32)addr, aper_size); | ||
| 100 | register_nosave_region(addr >> PAGE_SHIFT, | 86 | register_nosave_region(addr >> PAGE_SHIFT, |
| 101 | (addr+aper_size) >> PAGE_SHIFT); | 87 | (addr+aper_size) >> PAGE_SHIFT); |
| 102 | 88 | ||
| @@ -444,12 +430,8 @@ int __init gart_iommu_hole_init(void) | |||
| 444 | 430 | ||
| 445 | out: | 431 | out: |
| 446 | if (!fix && !fallback_aper_force) { | 432 | if (!fix && !fallback_aper_force) { |
| 447 | if (last_aper_base) { | 433 | if (last_aper_base) |
| 448 | unsigned long n = (32 * 1024 * 1024) << last_aper_order; | ||
| 449 | |||
| 450 | insert_aperture_resource((u32)last_aper_base, n); | ||
| 451 | return 1; | 434 | return 1; |
| 452 | } | ||
| 453 | return 0; | 435 | return 0; |
| 454 | } | 436 | } |
| 455 | 437 | ||
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 7f26c9a70a9e..53e20531470e 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
| @@ -133,6 +133,10 @@ static inline void imcr_apic_to_pic(void) | |||
| 133 | * +1=force-enable | 133 | * +1=force-enable |
| 134 | */ | 134 | */ |
| 135 | static int force_enable_local_apic __initdata; | 135 | static int force_enable_local_apic __initdata; |
| 136 | |||
| 137 | /* Control whether x2APIC mode is enabled or not */ | ||
| 138 | static bool nox2apic __initdata; | ||
| 139 | |||
| 136 | /* | 140 | /* |
| 137 | * APIC command line parameters | 141 | * APIC command line parameters |
| 138 | */ | 142 | */ |
| @@ -162,8 +166,7 @@ int x2apic_mode; | |||
| 162 | /* x2apic enabled before OS handover */ | 166 | /* x2apic enabled before OS handover */ |
| 163 | int x2apic_preenabled; | 167 | int x2apic_preenabled; |
| 164 | static int x2apic_disabled; | 168 | static int x2apic_disabled; |
| 165 | static int nox2apic; | 169 | static int __init setup_nox2apic(char *str) |
| 166 | static __init int setup_nox2apic(char *str) | ||
| 167 | { | 170 | { |
| 168 | if (x2apic_enabled()) { | 171 | if (x2apic_enabled()) { |
| 169 | int apicid = native_apic_msr_read(APIC_ID); | 172 | int apicid = native_apic_msr_read(APIC_ID); |
| @@ -178,7 +181,7 @@ static __init int setup_nox2apic(char *str) | |||
| 178 | } else | 181 | } else |
| 179 | setup_clear_cpu_cap(X86_FEATURE_X2APIC); | 182 | setup_clear_cpu_cap(X86_FEATURE_X2APIC); |
| 180 | 183 | ||
| 181 | nox2apic = 1; | 184 | nox2apic = true; |
| 182 | 185 | ||
| 183 | return 0; | 186 | return 0; |
| 184 | } | 187 | } |
| @@ -283,8 +286,12 @@ u32 native_safe_apic_wait_icr_idle(void) | |||
| 283 | 286 | ||
| 284 | void native_apic_icr_write(u32 low, u32 id) | 287 | void native_apic_icr_write(u32 low, u32 id) |
| 285 | { | 288 | { |
| 289 | unsigned long flags; | ||
| 290 | |||
| 291 | local_irq_save(flags); | ||
| 286 | apic_write(APIC_ICR2, SET_APIC_DEST_FIELD(id)); | 292 | apic_write(APIC_ICR2, SET_APIC_DEST_FIELD(id)); |
| 287 | apic_write(APIC_ICR, low); | 293 | apic_write(APIC_ICR, low); |
| 294 | local_irq_restore(flags); | ||
| 288 | } | 295 | } |
| 289 | 296 | ||
| 290 | u64 native_apic_icr_read(void) | 297 | u64 native_apic_icr_read(void) |
diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c index 2c621a6b901a..7c1b29479513 100644 --- a/arch/x86/kernel/apic/apic_flat_64.c +++ b/arch/x86/kernel/apic/apic_flat_64.c | |||
| @@ -198,7 +198,7 @@ static struct apic apic_flat = { | |||
| 198 | 198 | ||
| 199 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, | 199 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, |
| 200 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 200 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
| 201 | .wait_for_init_deassert = NULL, | 201 | .wait_for_init_deassert = false, |
| 202 | .smp_callin_clear_local_apic = NULL, | 202 | .smp_callin_clear_local_apic = NULL, |
| 203 | .inquire_remote_apic = default_inquire_remote_apic, | 203 | .inquire_remote_apic = default_inquire_remote_apic, |
| 204 | 204 | ||
| @@ -314,7 +314,7 @@ static struct apic apic_physflat = { | |||
| 314 | 314 | ||
| 315 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, | 315 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, |
| 316 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 316 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
| 317 | .wait_for_init_deassert = NULL, | 317 | .wait_for_init_deassert = false, |
| 318 | .smp_callin_clear_local_apic = NULL, | 318 | .smp_callin_clear_local_apic = NULL, |
| 319 | .inquire_remote_apic = default_inquire_remote_apic, | 319 | .inquire_remote_apic = default_inquire_remote_apic, |
| 320 | 320 | ||
diff --git a/arch/x86/kernel/apic/apic_noop.c b/arch/x86/kernel/apic/apic_noop.c index 191ce75c0e54..8c7c98249c20 100644 --- a/arch/x86/kernel/apic/apic_noop.c +++ b/arch/x86/kernel/apic/apic_noop.c | |||
| @@ -172,8 +172,7 @@ struct apic apic_noop = { | |||
| 172 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, | 172 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, |
| 173 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 173 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
| 174 | 174 | ||
| 175 | .wait_for_init_deassert = NULL, | 175 | .wait_for_init_deassert = false, |
| 176 | |||
| 177 | .smp_callin_clear_local_apic = NULL, | 176 | .smp_callin_clear_local_apic = NULL, |
| 178 | .inquire_remote_apic = NULL, | 177 | .inquire_remote_apic = NULL, |
| 179 | 178 | ||
diff --git a/arch/x86/kernel/apic/apic_numachip.c b/arch/x86/kernel/apic/apic_numachip.c index 3e67f9e3d7ef..a5b45df8bc88 100644 --- a/arch/x86/kernel/apic/apic_numachip.c +++ b/arch/x86/kernel/apic/apic_numachip.c | |||
| @@ -248,7 +248,7 @@ static const struct apic apic_numachip __refconst = { | |||
| 248 | .wakeup_secondary_cpu = numachip_wakeup_secondary, | 248 | .wakeup_secondary_cpu = numachip_wakeup_secondary, |
| 249 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, | 249 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, |
| 250 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 250 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
| 251 | .wait_for_init_deassert = NULL, | 251 | .wait_for_init_deassert = false, |
| 252 | .smp_callin_clear_local_apic = NULL, | 252 | .smp_callin_clear_local_apic = NULL, |
| 253 | .inquire_remote_apic = NULL, /* REMRD not supported */ | 253 | .inquire_remote_apic = NULL, /* REMRD not supported */ |
| 254 | 254 | ||
diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c index d50e3640d5ae..e4840aa7a255 100644 --- a/arch/x86/kernel/apic/bigsmp_32.c +++ b/arch/x86/kernel/apic/bigsmp_32.c | |||
| @@ -199,8 +199,7 @@ static struct apic apic_bigsmp = { | |||
| 199 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, | 199 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, |
| 200 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 200 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
| 201 | 201 | ||
| 202 | .wait_for_init_deassert = default_wait_for_init_deassert, | 202 | .wait_for_init_deassert = true, |
| 203 | |||
| 204 | .smp_callin_clear_local_apic = NULL, | 203 | .smp_callin_clear_local_apic = NULL, |
| 205 | .inquire_remote_apic = default_inquire_remote_apic, | 204 | .inquire_remote_apic = default_inquire_remote_apic, |
| 206 | 205 | ||
diff --git a/arch/x86/kernel/apic/es7000_32.c b/arch/x86/kernel/apic/es7000_32.c index c55224731b2d..6f8f8b348a39 100644 --- a/arch/x86/kernel/apic/es7000_32.c +++ b/arch/x86/kernel/apic/es7000_32.c | |||
| @@ -394,12 +394,6 @@ static void es7000_enable_apic_mode(void) | |||
| 394 | WARN(1, "Command failed, status = %x\n", mip_status); | 394 | WARN(1, "Command failed, status = %x\n", mip_status); |
| 395 | } | 395 | } |
| 396 | 396 | ||
| 397 | static void es7000_wait_for_init_deassert(atomic_t *deassert) | ||
| 398 | { | ||
| 399 | while (!atomic_read(deassert)) | ||
| 400 | cpu_relax(); | ||
| 401 | } | ||
| 402 | |||
| 403 | static unsigned int es7000_get_apic_id(unsigned long x) | 397 | static unsigned int es7000_get_apic_id(unsigned long x) |
| 404 | { | 398 | { |
| 405 | return (x >> 24) & 0xFF; | 399 | return (x >> 24) & 0xFF; |
| @@ -658,8 +652,7 @@ static struct apic __refdata apic_es7000_cluster = { | |||
| 658 | .trampoline_phys_low = 0x467, | 652 | .trampoline_phys_low = 0x467, |
| 659 | .trampoline_phys_high = 0x469, | 653 | .trampoline_phys_high = 0x469, |
| 660 | 654 | ||
| 661 | .wait_for_init_deassert = NULL, | 655 | .wait_for_init_deassert = false, |
| 662 | |||
| 663 | /* Nothing to do for most platforms, since cleared by the INIT cycle: */ | 656 | /* Nothing to do for most platforms, since cleared by the INIT cycle: */ |
| 664 | .smp_callin_clear_local_apic = NULL, | 657 | .smp_callin_clear_local_apic = NULL, |
| 665 | .inquire_remote_apic = default_inquire_remote_apic, | 658 | .inquire_remote_apic = default_inquire_remote_apic, |
| @@ -722,8 +715,7 @@ static struct apic __refdata apic_es7000 = { | |||
| 722 | .trampoline_phys_low = 0x467, | 715 | .trampoline_phys_low = 0x467, |
| 723 | .trampoline_phys_high = 0x469, | 716 | .trampoline_phys_high = 0x469, |
| 724 | 717 | ||
| 725 | .wait_for_init_deassert = es7000_wait_for_init_deassert, | 718 | .wait_for_init_deassert = true, |
| 726 | |||
| 727 | /* Nothing to do for most platforms, since cleared by the INIT cycle: */ | 719 | /* Nothing to do for most platforms, since cleared by the INIT cycle: */ |
| 728 | .smp_callin_clear_local_apic = NULL, | 720 | .smp_callin_clear_local_apic = NULL, |
| 729 | .inquire_remote_apic = default_inquire_remote_apic, | 721 | .inquire_remote_apic = default_inquire_remote_apic, |
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c index 1e42e8f305ee..030ea1c04f72 100644 --- a/arch/x86/kernel/apic/numaq_32.c +++ b/arch/x86/kernel/apic/numaq_32.c | |||
| @@ -505,8 +505,7 @@ static struct apic __refdata apic_numaq = { | |||
| 505 | .trampoline_phys_high = NUMAQ_TRAMPOLINE_PHYS_HIGH, | 505 | .trampoline_phys_high = NUMAQ_TRAMPOLINE_PHYS_HIGH, |
| 506 | 506 | ||
| 507 | /* We don't do anything here because we use NMI's to boot instead */ | 507 | /* We don't do anything here because we use NMI's to boot instead */ |
| 508 | .wait_for_init_deassert = NULL, | 508 | .wait_for_init_deassert = false, |
| 509 | |||
| 510 | .smp_callin_clear_local_apic = numaq_smp_callin_clear_local_apic, | 509 | .smp_callin_clear_local_apic = numaq_smp_callin_clear_local_apic, |
| 511 | .inquire_remote_apic = NULL, | 510 | .inquire_remote_apic = NULL, |
| 512 | 511 | ||
diff --git a/arch/x86/kernel/apic/probe_32.c b/arch/x86/kernel/apic/probe_32.c index eb35ef9ee63f..cceb352c968c 100644 --- a/arch/x86/kernel/apic/probe_32.c +++ b/arch/x86/kernel/apic/probe_32.c | |||
| @@ -119,8 +119,7 @@ static struct apic apic_default = { | |||
| 119 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, | 119 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, |
| 120 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 120 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
| 121 | 121 | ||
| 122 | .wait_for_init_deassert = default_wait_for_init_deassert, | 122 | .wait_for_init_deassert = true, |
| 123 | |||
| 124 | .smp_callin_clear_local_apic = NULL, | 123 | .smp_callin_clear_local_apic = NULL, |
| 125 | .inquire_remote_apic = default_inquire_remote_apic, | 124 | .inquire_remote_apic = default_inquire_remote_apic, |
| 126 | 125 | ||
diff --git a/arch/x86/kernel/apic/summit_32.c b/arch/x86/kernel/apic/summit_32.c index 00146f9b0254..b656128611cd 100644 --- a/arch/x86/kernel/apic/summit_32.c +++ b/arch/x86/kernel/apic/summit_32.c | |||
| @@ -532,8 +532,7 @@ static struct apic apic_summit = { | |||
| 532 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, | 532 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, |
| 533 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 533 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
| 534 | 534 | ||
| 535 | .wait_for_init_deassert = default_wait_for_init_deassert, | 535 | .wait_for_init_deassert = true, |
| 536 | |||
| 537 | .smp_callin_clear_local_apic = NULL, | 536 | .smp_callin_clear_local_apic = NULL, |
| 538 | .inquire_remote_apic = default_inquire_remote_apic, | 537 | .inquire_remote_apic = default_inquire_remote_apic, |
| 539 | 538 | ||
diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c index cac85ee6913f..e66766bf1641 100644 --- a/arch/x86/kernel/apic/x2apic_cluster.c +++ b/arch/x86/kernel/apic/x2apic_cluster.c | |||
| @@ -279,7 +279,7 @@ static struct apic apic_x2apic_cluster = { | |||
| 279 | 279 | ||
| 280 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, | 280 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, |
| 281 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 281 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
| 282 | .wait_for_init_deassert = NULL, | 282 | .wait_for_init_deassert = false, |
| 283 | .smp_callin_clear_local_apic = NULL, | 283 | .smp_callin_clear_local_apic = NULL, |
| 284 | .inquire_remote_apic = NULL, | 284 | .inquire_remote_apic = NULL, |
| 285 | 285 | ||
diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c index de231e328cae..6d600ebf6c12 100644 --- a/arch/x86/kernel/apic/x2apic_phys.c +++ b/arch/x86/kernel/apic/x2apic_phys.c | |||
| @@ -133,7 +133,7 @@ static struct apic apic_x2apic_phys = { | |||
| 133 | 133 | ||
| 134 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, | 134 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, |
| 135 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 135 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
| 136 | .wait_for_init_deassert = NULL, | 136 | .wait_for_init_deassert = false, |
| 137 | .smp_callin_clear_local_apic = NULL, | 137 | .smp_callin_clear_local_apic = NULL, |
| 138 | .inquire_remote_apic = NULL, | 138 | .inquire_remote_apic = NULL, |
| 139 | 139 | ||
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index d263b1307de1..7834389ba5be 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
| @@ -396,7 +396,7 @@ static struct apic __refdata apic_x2apic_uv_x = { | |||
| 396 | .wakeup_secondary_cpu = uv_wakeup_secondary, | 396 | .wakeup_secondary_cpu = uv_wakeup_secondary, |
| 397 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, | 397 | .trampoline_phys_low = DEFAULT_TRAMPOLINE_PHYS_LOW, |
| 398 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 398 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
| 399 | .wait_for_init_deassert = NULL, | 399 | .wait_for_init_deassert = false, |
| 400 | .smp_callin_clear_local_apic = NULL, | 400 | .smp_callin_clear_local_apic = NULL, |
| 401 | .inquire_remote_apic = NULL, | 401 | .inquire_remote_apic = NULL, |
| 402 | 402 | ||
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index c67ffa686064..ce8b8ff0e0ef 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c | |||
| @@ -218,7 +218,7 @@ static void amd_k7_smp_check(struct cpuinfo_x86 *c) | |||
| 218 | */ | 218 | */ |
| 219 | WARN_ONCE(1, "WARNING: This combination of AMD" | 219 | WARN_ONCE(1, "WARNING: This combination of AMD" |
| 220 | " processors is not suitable for SMP.\n"); | 220 | " processors is not suitable for SMP.\n"); |
| 221 | add_taint(TAINT_UNSAFE_SMP, LOCKDEP_NOW_UNRELIABLE); | 221 | add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_NOW_UNRELIABLE); |
| 222 | } | 222 | } |
| 223 | 223 | ||
| 224 | static void init_amd_k7(struct cpuinfo_x86 *c) | 224 | static void init_amd_k7(struct cpuinfo_x86 *c) |
| @@ -233,9 +233,7 @@ static void init_amd_k7(struct cpuinfo_x86 *c) | |||
| 233 | if (c->x86_model >= 6 && c->x86_model <= 10) { | 233 | if (c->x86_model >= 6 && c->x86_model <= 10) { |
| 234 | if (!cpu_has(c, X86_FEATURE_XMM)) { | 234 | if (!cpu_has(c, X86_FEATURE_XMM)) { |
| 235 | printk(KERN_INFO "Enabling disabled K7/SSE Support.\n"); | 235 | printk(KERN_INFO "Enabling disabled K7/SSE Support.\n"); |
| 236 | rdmsr(MSR_K7_HWCR, l, h); | 236 | msr_clear_bit(MSR_K7_HWCR, 15); |
| 237 | l &= ~0x00008000; | ||
| 238 | wrmsr(MSR_K7_HWCR, l, h); | ||
| 239 | set_cpu_cap(c, X86_FEATURE_XMM); | 237 | set_cpu_cap(c, X86_FEATURE_XMM); |
| 240 | } | 238 | } |
| 241 | } | 239 | } |
| @@ -509,14 +507,8 @@ static void early_init_amd(struct cpuinfo_x86 *c) | |||
| 509 | #endif | 507 | #endif |
| 510 | 508 | ||
| 511 | /* F16h erratum 793, CVE-2013-6885 */ | 509 | /* F16h erratum 793, CVE-2013-6885 */ |
| 512 | if (c->x86 == 0x16 && c->x86_model <= 0xf) { | 510 | if (c->x86 == 0x16 && c->x86_model <= 0xf) |
| 513 | u64 val; | 511 | msr_set_bit(MSR_AMD64_LS_CFG, 15); |
| 514 | |||
| 515 | rdmsrl(MSR_AMD64_LS_CFG, val); | ||
| 516 | if (!(val & BIT(15))) | ||
| 517 | wrmsrl(MSR_AMD64_LS_CFG, val | BIT(15)); | ||
| 518 | } | ||
| 519 | |||
| 520 | } | 512 | } |
| 521 | 513 | ||
| 522 | static const int amd_erratum_383[]; | 514 | static const int amd_erratum_383[]; |
| @@ -536,11 +528,8 @@ static void init_amd(struct cpuinfo_x86 *c) | |||
| 536 | * Errata 63 for SH-B3 steppings | 528 | * Errata 63 for SH-B3 steppings |
| 537 | * Errata 122 for all steppings (F+ have it disabled by default) | 529 | * Errata 122 for all steppings (F+ have it disabled by default) |
| 538 | */ | 530 | */ |
| 539 | if (c->x86 == 0xf) { | 531 | if (c->x86 == 0xf) |
| 540 | rdmsrl(MSR_K7_HWCR, value); | 532 | msr_set_bit(MSR_K7_HWCR, 6); |
| 541 | value |= 1 << 6; | ||
| 542 | wrmsrl(MSR_K7_HWCR, value); | ||
| 543 | } | ||
| 544 | #endif | 533 | #endif |
| 545 | 534 | ||
| 546 | early_init_amd(c); | 535 | early_init_amd(c); |
| @@ -623,14 +612,11 @@ static void init_amd(struct cpuinfo_x86 *c) | |||
| 623 | (c->x86_model >= 0x10) && (c->x86_model <= 0x1f) && | 612 | (c->x86_model >= 0x10) && (c->x86_model <= 0x1f) && |
| 624 | !cpu_has(c, X86_FEATURE_TOPOEXT)) { | 613 | !cpu_has(c, X86_FEATURE_TOPOEXT)) { |
| 625 | 614 | ||
| 626 | if (!rdmsrl_safe(0xc0011005, &value)) { | 615 | if (msr_set_bit(0xc0011005, 54) > 0) { |
| 627 | value |= 1ULL << 54; | ||
| 628 | wrmsrl_safe(0xc0011005, value); | ||
| 629 | rdmsrl(0xc0011005, value); | 616 | rdmsrl(0xc0011005, value); |
| 630 | if (value & (1ULL << 54)) { | 617 | if (value & BIT_64(54)) { |
| 631 | set_cpu_cap(c, X86_FEATURE_TOPOEXT); | 618 | set_cpu_cap(c, X86_FEATURE_TOPOEXT); |
| 632 | printk(KERN_INFO FW_INFO "CPU: Re-enabling " | 619 | pr_info(FW_INFO "CPU: Re-enabling disabled Topology Extensions Support.\n"); |
| 633 | "disabled Topology Extensions Support\n"); | ||
| 634 | } | 620 | } |
| 635 | } | 621 | } |
| 636 | } | 622 | } |
| @@ -709,19 +695,12 @@ static void init_amd(struct cpuinfo_x86 *c) | |||
| 709 | * Disable GART TLB Walk Errors on Fam10h. We do this here | 695 | * Disable GART TLB Walk Errors on Fam10h. We do this here |
| 710 | * because this is always needed when GART is enabled, even in a | 696 | * because this is always needed when GART is enabled, even in a |
| 711 | * kernel which has no MCE support built in. | 697 | * kernel which has no MCE support built in. |
| 712 | * BIOS should disable GartTlbWlk Errors themself. If | 698 | * BIOS should disable GartTlbWlk Errors already. If |
| 713 | * it doesn't do it here as suggested by the BKDG. | 699 | * it doesn't, do it here as suggested by the BKDG. |
| 714 | * | 700 | * |
| 715 | * Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=33012 | 701 | * Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=33012 |
| 716 | */ | 702 | */ |
| 717 | u64 mask; | 703 | msr_set_bit(MSR_AMD64_MCx_MASK(4), 10); |
| 718 | int err; | ||
| 719 | |||
| 720 | err = rdmsrl_safe(MSR_AMD64_MCx_MASK(4), &mask); | ||
| 721 | if (err == 0) { | ||
| 722 | mask |= (1 << 10); | ||
| 723 | wrmsrl_safe(MSR_AMD64_MCx_MASK(4), mask); | ||
| 724 | } | ||
| 725 | 704 | ||
| 726 | /* | 705 | /* |
| 727 | * On family 10h BIOS may not have properly enabled WC+ support, | 706 | * On family 10h BIOS may not have properly enabled WC+ support, |
| @@ -733,10 +712,7 @@ static void init_amd(struct cpuinfo_x86 *c) | |||
| 733 | * NOTE: we want to use the _safe accessors so as not to #GP kvm | 712 | * NOTE: we want to use the _safe accessors so as not to #GP kvm |
| 734 | * guests on older kvm hosts. | 713 | * guests on older kvm hosts. |
| 735 | */ | 714 | */ |
| 736 | 715 | msr_clear_bit(MSR_AMD64_BU_CFG2, 24); | |
| 737 | rdmsrl_safe(MSR_AMD64_BU_CFG2, &value); | ||
| 738 | value &= ~(1ULL << 24); | ||
| 739 | wrmsrl_safe(MSR_AMD64_BU_CFG2, value); | ||
| 740 | 716 | ||
| 741 | if (cpu_has_amd_erratum(c, amd_erratum_383)) | 717 | if (cpu_has_amd_erratum(c, amd_erratum_383)) |
| 742 | set_cpu_bug(c, X86_BUG_AMD_TLB_MMATCH); | 718 | set_cpu_bug(c, X86_BUG_AMD_TLB_MMATCH); |
diff --git a/arch/x86/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c index 8779edab684e..d8fba5c15fbd 100644 --- a/arch/x86/kernel/cpu/centaur.c +++ b/arch/x86/kernel/cpu/centaur.c | |||
| @@ -8,236 +8,6 @@ | |||
| 8 | 8 | ||
| 9 | #include "cpu.h" | 9 | #include "cpu.h" |
| 10 | 10 | ||
| 11 | #ifdef CONFIG_X86_OOSTORE | ||
| 12 | |||
| 13 | static u32 power2(u32 x) | ||
| 14 | { | ||
| 15 | u32 s = 1; | ||
| 16 | |||
| 17 | while (s <= x) | ||
| 18 | s <<= 1; | ||
| 19 | |||
| 20 | return s >>= 1; | ||
| 21 | } | ||
| 22 | |||
| 23 | |||
| 24 | /* | ||
| 25 | * Set up an actual MCR | ||
| 26 | */ | ||
| 27 | static void centaur_mcr_insert(int reg, u32 base, u32 size, int key) | ||
| 28 | { | ||
| 29 | u32 lo, hi; | ||
| 30 | |||
| 31 | hi = base & ~0xFFF; | ||
| 32 | lo = ~(size-1); /* Size is a power of 2 so this makes a mask */ | ||
| 33 | lo &= ~0xFFF; /* Remove the ctrl value bits */ | ||
| 34 | lo |= key; /* Attribute we wish to set */ | ||
| 35 | wrmsr(reg+MSR_IDT_MCR0, lo, hi); | ||
| 36 | mtrr_centaur_report_mcr(reg, lo, hi); /* Tell the mtrr driver */ | ||
| 37 | } | ||
| 38 | |||
| 39 | /* | ||
| 40 | * Figure what we can cover with MCR's | ||
| 41 | * | ||
| 42 | * Shortcut: We know you can't put 4Gig of RAM on a winchip | ||
| 43 | */ | ||
| 44 | static u32 ramtop(void) | ||
| 45 | { | ||
| 46 | u32 clip = 0xFFFFFFFFUL; | ||
| 47 | u32 top = 0; | ||
| 48 | int i; | ||
| 49 | |||
| 50 | for (i = 0; i < e820.nr_map; i++) { | ||
| 51 | unsigned long start, end; | ||
| 52 | |||
| 53 | if (e820.map[i].addr > 0xFFFFFFFFUL) | ||
| 54 | continue; | ||
| 55 | /* | ||
| 56 | * Don't MCR over reserved space. Ignore the ISA hole | ||
| 57 | * we frob around that catastrophe already | ||
| 58 | */ | ||
| 59 | if (e820.map[i].type == E820_RESERVED) { | ||
| 60 | if (e820.map[i].addr >= 0x100000UL && | ||
| 61 | e820.map[i].addr < clip) | ||
| 62 | clip = e820.map[i].addr; | ||
| 63 | continue; | ||
| 64 | } | ||
| 65 | start = e820.map[i].addr; | ||
| 66 | end = e820.map[i].addr + e820.map[i].size; | ||
| 67 | if (start >= end) | ||
| 68 | continue; | ||
| 69 | if (end > top) | ||
| 70 | top = end; | ||
| 71 | } | ||
| 72 | /* | ||
| 73 | * Everything below 'top' should be RAM except for the ISA hole. | ||
| 74 | * Because of the limited MCR's we want to map NV/ACPI into our | ||
| 75 | * MCR range for gunk in RAM | ||
| 76 | * | ||
| 77 | * Clip might cause us to MCR insufficient RAM but that is an | ||
| 78 | * acceptable failure mode and should only bite obscure boxes with | ||
| 79 | * a VESA hole at 15Mb | ||
| 80 | * | ||
| 81 | * The second case Clip sometimes kicks in is when the EBDA is marked | ||
| 82 | * as reserved. Again we fail safe with reasonable results | ||
| 83 | */ | ||
| 84 | if (top > clip) | ||
| 85 | top = clip; | ||
| 86 | |||
| 87 | return top; | ||
| 88 | } | ||
| 89 | |||
| 90 | /* | ||
| 91 | * Compute a set of MCR's to give maximum coverage | ||
| 92 | */ | ||
| 93 | static int centaur_mcr_compute(int nr, int key) | ||
| 94 | { | ||
| 95 | u32 mem = ramtop(); | ||
| 96 | u32 root = power2(mem); | ||
| 97 | u32 base = root; | ||
| 98 | u32 top = root; | ||
| 99 | u32 floor = 0; | ||
| 100 | int ct = 0; | ||
| 101 | |||
| 102 | while (ct < nr) { | ||
| 103 | u32 fspace = 0; | ||
| 104 | u32 high; | ||
| 105 | u32 low; | ||
| 106 | |||
| 107 | /* | ||
| 108 | * Find the largest block we will fill going upwards | ||
| 109 | */ | ||
| 110 | high = power2(mem-top); | ||
| 111 | |||
| 112 | /* | ||
| 113 | * Find the largest block we will fill going downwards | ||
| 114 | */ | ||
| 115 | low = base/2; | ||
| 116 | |||
| 117 | /* | ||
| 118 | * Don't fill below 1Mb going downwards as there | ||
| 119 | * is an ISA hole in the way. | ||
| 120 | */ | ||
| 121 | if (base <= 1024*1024) | ||
| 122 | low = 0; | ||
| 123 | |||
| 124 | /* | ||
| 125 | * See how much space we could cover by filling below | ||
| 126 | * the ISA hole | ||
| 127 | */ | ||
| 128 | |||
| 129 | if (floor == 0) | ||
| 130 | fspace = 512*1024; | ||
| 131 | else if (floor == 512*1024) | ||
| 132 | fspace = 128*1024; | ||
| 133 | |||
| 134 | /* And forget ROM space */ | ||
| 135 | |||
| 136 | /* | ||
| 137 | * Now install the largest coverage we get | ||
| 138 | */ | ||
| 139 | if (fspace > high && fspace > low) { | ||
| 140 | centaur_mcr_insert(ct, floor, fspace, key); | ||
| 141 | floor += fspace; | ||
| 142 | } else if (high > low) { | ||
| 143 | centaur_mcr_insert(ct, top, high, key); | ||
| 144 | top += high; | ||
| 145 | } else if (low > 0) { | ||
| 146 | base -= low; | ||
| 147 | centaur_mcr_insert(ct, base, low, key); | ||
| 148 | } else | ||
| 149 | break; | ||
| 150 | ct++; | ||
| 151 | } | ||
| 152 | /* | ||
| 153 | * We loaded ct values. We now need to set the mask. The caller | ||
| 154 | * must do this bit. | ||
| 155 | */ | ||
| 156 | return ct; | ||
| 157 | } | ||
| 158 | |||
| 159 | static void centaur_create_optimal_mcr(void) | ||
| 160 | { | ||
| 161 | int used; | ||
| 162 | int i; | ||
| 163 | |||
| 164 | /* | ||
| 165 | * Allocate up to 6 mcrs to mark as much of ram as possible | ||
| 166 | * as write combining and weak write ordered. | ||
| 167 | * | ||
| 168 | * To experiment with: Linux never uses stack operations for | ||
| 169 | * mmio spaces so we could globally enable stack operation wc | ||
| 170 | * | ||
| 171 | * Load the registers with type 31 - full write combining, all | ||
| 172 | * writes weakly ordered. | ||
| 173 | */ | ||
| 174 | used = centaur_mcr_compute(6, 31); | ||
| 175 | |||
| 176 | /* | ||
| 177 | * Wipe unused MCRs | ||
| 178 | */ | ||
| 179 | for (i = used; i < 8; i++) | ||
| 180 | wrmsr(MSR_IDT_MCR0+i, 0, 0); | ||
| 181 | } | ||
| 182 | |||
| 183 | static void winchip2_create_optimal_mcr(void) | ||
| 184 | { | ||
| 185 | u32 lo, hi; | ||
| 186 | int used; | ||
| 187 | int i; | ||
| 188 | |||
| 189 | /* | ||
| 190 | * Allocate up to 6 mcrs to mark as much of ram as possible | ||
| 191 | * as write combining, weak store ordered. | ||
| 192 | * | ||
| 193 | * Load the registers with type 25 | ||
| 194 | * 8 - weak write ordering | ||
| 195 | * 16 - weak read ordering | ||
| 196 | * 1 - write combining | ||
| 197 | */ | ||
| 198 | used = centaur_mcr_compute(6, 25); | ||
| 199 | |||
| 200 | /* | ||
| 201 | * Mark the registers we are using. | ||
| 202 | */ | ||
| 203 | rdmsr(MSR_IDT_MCR_CTRL, lo, hi); | ||
| 204 | for (i = 0; i < used; i++) | ||
| 205 | lo |= 1<<(9+i); | ||
| 206 | wrmsr(MSR_IDT_MCR_CTRL, lo, hi); | ||
| 207 | |||
| 208 | /* | ||
| 209 | * Wipe unused MCRs | ||
| 210 | */ | ||
| 211 | |||
| 212 | for (i = used; i < 8; i++) | ||
| 213 | wrmsr(MSR_IDT_MCR0+i, 0, 0); | ||
| 214 | } | ||
| 215 | |||
| 216 | /* | ||
| 217 | * Handle the MCR key on the Winchip 2. | ||
| 218 | */ | ||
| 219 | static void winchip2_unprotect_mcr(void) | ||
| 220 | { | ||
| 221 | u32 lo, hi; | ||
| 222 | u32 key; | ||
| 223 | |||
| 224 | rdmsr(MSR_IDT_MCR_CTRL, lo, hi); | ||
| 225 | lo &= ~0x1C0; /* blank bits 8-6 */ | ||
| 226 | key = (lo>>17) & 7; | ||
| 227 | lo |= key<<6; /* replace with unlock key */ | ||
| 228 | wrmsr(MSR_IDT_MCR_CTRL, lo, hi); | ||
| 229 | } | ||
| 230 | |||
| 231 | static void winchip2_protect_mcr(void) | ||
| 232 | { | ||
| 233 | u32 lo, hi; | ||
| 234 | |||
| 235 | rdmsr(MSR_IDT_MCR_CTRL, lo, hi); | ||
| 236 | lo &= ~0x1C0; /* blank bits 8-6 */ | ||
| 237 | wrmsr(MSR_IDT_MCR_CTRL, lo, hi); | ||
| 238 | } | ||
| 239 | #endif /* CONFIG_X86_OOSTORE */ | ||
| 240 | |||
| 241 | #define ACE_PRESENT (1 << 6) | 11 | #define ACE_PRESENT (1 << 6) |
| 242 | #define ACE_ENABLED (1 << 7) | 12 | #define ACE_ENABLED (1 << 7) |
| 243 | #define ACE_FCR (1 << 28) /* MSR_VIA_FCR */ | 13 | #define ACE_FCR (1 << 28) /* MSR_VIA_FCR */ |
| @@ -362,20 +132,6 @@ static void init_centaur(struct cpuinfo_x86 *c) | |||
| 362 | fcr_clr = DPDC; | 132 | fcr_clr = DPDC; |
| 363 | printk(KERN_NOTICE "Disabling bugged TSC.\n"); | 133 | printk(KERN_NOTICE "Disabling bugged TSC.\n"); |
| 364 | clear_cpu_cap(c, X86_FEATURE_TSC); | 134 | clear_cpu_cap(c, X86_FEATURE_TSC); |
| 365 | #ifdef CONFIG_X86_OOSTORE | ||
| 366 | centaur_create_optimal_mcr(); | ||
| 367 | /* | ||
| 368 | * Enable: | ||
| 369 | * write combining on non-stack, non-string | ||
| 370 | * write combining on string, all types | ||
| 371 | * weak write ordering | ||
| 372 | * | ||
| 373 | * The C6 original lacks weak read order | ||
| 374 | * | ||
| 375 | * Note 0x120 is write only on Winchip 1 | ||
| 376 | */ | ||
| 377 | wrmsr(MSR_IDT_MCR_CTRL, 0x01F0001F, 0); | ||
| 378 | #endif | ||
| 379 | break; | 135 | break; |
| 380 | case 8: | 136 | case 8: |
| 381 | switch (c->x86_mask) { | 137 | switch (c->x86_mask) { |
| @@ -392,40 +148,12 @@ static void init_centaur(struct cpuinfo_x86 *c) | |||
| 392 | fcr_set = ECX8|DSMC|DTLOCK|EMMX|EBRPRED|ERETSTK| | 148 | fcr_set = ECX8|DSMC|DTLOCK|EMMX|EBRPRED|ERETSTK| |
| 393 | E2MMX|EAMD3D; | 149 | E2MMX|EAMD3D; |
| 394 | fcr_clr = DPDC; | 150 | fcr_clr = DPDC; |
| 395 | #ifdef CONFIG_X86_OOSTORE | ||
| 396 | winchip2_unprotect_mcr(); | ||
| 397 | winchip2_create_optimal_mcr(); | ||
| 398 | rdmsr(MSR_IDT_MCR_CTRL, lo, hi); | ||
| 399 | /* | ||
| 400 | * Enable: | ||
| 401 | * write combining on non-stack, non-string | ||
| 402 | * write combining on string, all types | ||
| 403 | * weak write ordering | ||
| 404 | */ | ||
| 405 | lo |= 31; | ||
| 406 | wrmsr(MSR_IDT_MCR_CTRL, lo, hi); | ||
| 407 | winchip2_protect_mcr(); | ||
| 408 | #endif | ||
| 409 | break; | 151 | break; |
| 410 | case 9: | 152 | case 9: |
| 411 | name = "3"; | 153 | name = "3"; |
| 412 | fcr_set = ECX8|DSMC|DTLOCK|EMMX|EBRPRED|ERETSTK| | 154 | fcr_set = ECX8|DSMC|DTLOCK|EMMX|EBRPRED|ERETSTK| |
| 413 | E2MMX|EAMD3D; | 155 | E2MMX|EAMD3D; |
| 414 | fcr_clr = DPDC; | 156 | fcr_clr = DPDC; |
| 415 | #ifdef CONFIG_X86_OOSTORE | ||
| 416 | winchip2_unprotect_mcr(); | ||
| 417 | winchip2_create_optimal_mcr(); | ||
| 418 | rdmsr(MSR_IDT_MCR_CTRL, lo, hi); | ||
| 419 | /* | ||
| 420 | * Enable: | ||
| 421 | * write combining on non-stack, non-string | ||
| 422 | * write combining on string, all types | ||
| 423 | * weak write ordering | ||
| 424 | */ | ||
| 425 | lo |= 31; | ||
| 426 | wrmsr(MSR_IDT_MCR_CTRL, lo, hi); | ||
| 427 | winchip2_protect_mcr(); | ||
| 428 | #endif | ||
| 429 | break; | 157 | break; |
| 430 | default: | 158 | default: |
| 431 | name = "??"; | 159 | name = "??"; |
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 8e28bf2fc3ef..a135239badb7 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
| @@ -1025,7 +1025,8 @@ __setup("show_msr=", setup_show_msr); | |||
| 1025 | 1025 | ||
| 1026 | static __init int setup_noclflush(char *arg) | 1026 | static __init int setup_noclflush(char *arg) |
| 1027 | { | 1027 | { |
| 1028 | setup_clear_cpu_cap(X86_FEATURE_CLFLSH); | 1028 | setup_clear_cpu_cap(X86_FEATURE_CLFLUSH); |
| 1029 | setup_clear_cpu_cap(X86_FEATURE_CLFLUSHOPT); | ||
| 1029 | return 1; | 1030 | return 1; |
| 1030 | } | 1031 | } |
| 1031 | __setup("noclflush", setup_noclflush); | 1032 | __setup("noclflush", setup_noclflush); |
| @@ -1078,6 +1079,10 @@ static __init int setup_disablecpuid(char *arg) | |||
| 1078 | } | 1079 | } |
| 1079 | __setup("clearcpuid=", setup_disablecpuid); | 1080 | __setup("clearcpuid=", setup_disablecpuid); |
| 1080 | 1081 | ||
| 1082 | DEFINE_PER_CPU(unsigned long, kernel_stack) = | ||
| 1083 | (unsigned long)&init_thread_union - KERNEL_STACK_OFFSET + THREAD_SIZE; | ||
| 1084 | EXPORT_PER_CPU_SYMBOL(kernel_stack); | ||
| 1085 | |||
| 1081 | #ifdef CONFIG_X86_64 | 1086 | #ifdef CONFIG_X86_64 |
| 1082 | struct desc_ptr idt_descr = { NR_VECTORS * 16 - 1, (unsigned long) idt_table }; | 1087 | struct desc_ptr idt_descr = { NR_VECTORS * 16 - 1, (unsigned long) idt_table }; |
| 1083 | struct desc_ptr debug_idt_descr = { NR_VECTORS * 16 - 1, | 1088 | struct desc_ptr debug_idt_descr = { NR_VECTORS * 16 - 1, |
| @@ -1094,10 +1099,6 @@ DEFINE_PER_CPU(struct task_struct *, current_task) ____cacheline_aligned = | |||
| 1094 | &init_task; | 1099 | &init_task; |
| 1095 | EXPORT_PER_CPU_SYMBOL(current_task); | 1100 | EXPORT_PER_CPU_SYMBOL(current_task); |
| 1096 | 1101 | ||
| 1097 | DEFINE_PER_CPU(unsigned long, kernel_stack) = | ||
| 1098 | (unsigned long)&init_thread_union - KERNEL_STACK_OFFSET + THREAD_SIZE; | ||
| 1099 | EXPORT_PER_CPU_SYMBOL(kernel_stack); | ||
| 1100 | |||
| 1101 | DEFINE_PER_CPU(char *, irq_stack_ptr) = | 1102 | DEFINE_PER_CPU(char *, irq_stack_ptr) = |
| 1102 | init_per_cpu_var(irq_stack_union.irq_stack) + IRQ_STACK_SIZE - 64; | 1103 | init_per_cpu_var(irq_stack_union.irq_stack) + IRQ_STACK_SIZE - 64; |
| 1103 | 1104 | ||
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 5cd9bfabd645..897d6201ef10 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c | |||
| @@ -31,11 +31,8 @@ static void early_init_intel(struct cpuinfo_x86 *c) | |||
| 31 | 31 | ||
| 32 | /* Unmask CPUID levels if masked: */ | 32 | /* Unmask CPUID levels if masked: */ |
| 33 | if (c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xd)) { | 33 | if (c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xd)) { |
| 34 | rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable); | 34 | if (msr_clear_bit(MSR_IA32_MISC_ENABLE, |
| 35 | 35 | MSR_IA32_MISC_ENABLE_LIMIT_CPUID_BIT) > 0) { | |
| 36 | if (misc_enable & MSR_IA32_MISC_ENABLE_LIMIT_CPUID) { | ||
| 37 | misc_enable &= ~MSR_IA32_MISC_ENABLE_LIMIT_CPUID; | ||
| 38 | wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable); | ||
| 39 | c->cpuid_level = cpuid_eax(0); | 36 | c->cpuid_level = cpuid_eax(0); |
| 40 | get_cpu_cap(c); | 37 | get_cpu_cap(c); |
| 41 | } | 38 | } |
| @@ -129,16 +126,10 @@ static void early_init_intel(struct cpuinfo_x86 *c) | |||
| 129 | * Ingo Molnar reported a Pentium D (model 6) and a Xeon | 126 | * Ingo Molnar reported a Pentium D (model 6) and a Xeon |
| 130 | * (model 2) with the same problem. | 127 | * (model 2) with the same problem. |
| 131 | */ | 128 | */ |
| 132 | if (c->x86 == 15) { | 129 | if (c->x86 == 15) |
| 133 | rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable); | 130 | if (msr_clear_bit(MSR_IA32_MISC_ENABLE, |
| 134 | 131 | MSR_IA32_MISC_ENABLE_FAST_STRING_BIT) > 0) | |
| 135 | if (misc_enable & MSR_IA32_MISC_ENABLE_FAST_STRING) { | 132 | pr_info("kmemcheck: Disabling fast string operations\n"); |
| 136 | printk(KERN_INFO "kmemcheck: Disabling fast string operations\n"); | ||
| 137 | |||
| 138 | misc_enable &= ~MSR_IA32_MISC_ENABLE_FAST_STRING; | ||
| 139 | wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable); | ||
| 140 | } | ||
| 141 | } | ||
| 142 | #endif | 133 | #endif |
| 143 | 134 | ||
| 144 | /* | 135 | /* |
| @@ -195,10 +186,16 @@ static void intel_smp_check(struct cpuinfo_x86 *c) | |||
| 195 | } | 186 | } |
| 196 | } | 187 | } |
| 197 | 188 | ||
| 198 | static void intel_workarounds(struct cpuinfo_x86 *c) | 189 | static int forcepae; |
| 190 | static int __init forcepae_setup(char *__unused) | ||
| 199 | { | 191 | { |
| 200 | unsigned long lo, hi; | 192 | forcepae = 1; |
| 193 | return 1; | ||
| 194 | } | ||
| 195 | __setup("forcepae", forcepae_setup); | ||
| 201 | 196 | ||
| 197 | static void intel_workarounds(struct cpuinfo_x86 *c) | ||
| 198 | { | ||
| 202 | #ifdef CONFIG_X86_F00F_BUG | 199 | #ifdef CONFIG_X86_F00F_BUG |
| 203 | /* | 200 | /* |
| 204 | * All current models of Pentium and Pentium with MMX technology CPUs | 201 | * All current models of Pentium and Pentium with MMX technology CPUs |
| @@ -225,16 +222,26 @@ static void intel_workarounds(struct cpuinfo_x86 *c) | |||
| 225 | clear_cpu_cap(c, X86_FEATURE_SEP); | 222 | clear_cpu_cap(c, X86_FEATURE_SEP); |
| 226 | 223 | ||
| 227 | /* | 224 | /* |
| 225 | * PAE CPUID issue: many Pentium M report no PAE but may have a | ||
| 226 | * functionally usable PAE implementation. | ||
| 227 | * Forcefully enable PAE if kernel parameter "forcepae" is present. | ||
| 228 | */ | ||
| 229 | if (forcepae) { | ||
| 230 | printk(KERN_WARNING "PAE forced!\n"); | ||
| 231 | set_cpu_cap(c, X86_FEATURE_PAE); | ||
| 232 | add_taint(TAINT_CPU_OUT_OF_SPEC, LOCKDEP_NOW_UNRELIABLE); | ||
| 233 | } | ||
| 234 | |||
| 235 | /* | ||
| 228 | * P4 Xeon errata 037 workaround. | 236 | * P4 Xeon errata 037 workaround. |
| 229 | * Hardware prefetcher may cause stale data to be loaded into the cache. | 237 | * Hardware prefetcher may cause stale data to be loaded into the cache. |
| 230 | */ | 238 | */ |
| 231 | if ((c->x86 == 15) && (c->x86_model == 1) && (c->x86_mask == 1)) { | 239 | if ((c->x86 == 15) && (c->x86_model == 1) && (c->x86_mask == 1)) { |
| 232 | rdmsr(MSR_IA32_MISC_ENABLE, lo, hi); | 240 | if (msr_set_bit(MSR_IA32_MISC_ENABLE, |
| 233 | if ((lo & MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE) == 0) { | 241 | MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE_BIT) |
| 234 | printk (KERN_INFO "CPU: C0 stepping P4 Xeon detected.\n"); | 242 | > 0) { |
| 235 | printk (KERN_INFO "CPU: Disabling hardware prefetching (Errata 037)\n"); | 243 | pr_info("CPU: C0 stepping P4 Xeon detected.\n"); |
| 236 | lo |= MSR_IA32_MISC_ENABLE_PREFETCH_DISABLE; | 244 | pr_info("CPU: Disabling hardware prefetching (Errata 037)\n"); |
| 237 | wrmsr(MSR_IA32_MISC_ENABLE, lo, hi); | ||
| 238 | } | 245 | } |
| 239 | } | 246 | } |
| 240 | 247 | ||
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index 9f7ca266864a..76f98fe5b35c 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/hardirq.h> | 17 | #include <linux/hardirq.h> |
| 18 | #include <linux/efi.h> | 18 | #include <linux/efi.h> |
| 19 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
| 20 | #include <linux/irq.h> | ||
| 20 | #include <asm/processor.h> | 21 | #include <asm/processor.h> |
| 21 | #include <asm/hypervisor.h> | 22 | #include <asm/hypervisor.h> |
| 22 | #include <asm/hyperv.h> | 23 | #include <asm/hyperv.h> |
| @@ -26,10 +27,50 @@ | |||
| 26 | #include <asm/irq_regs.h> | 27 | #include <asm/irq_regs.h> |
| 27 | #include <asm/i8259.h> | 28 | #include <asm/i8259.h> |
| 28 | #include <asm/apic.h> | 29 | #include <asm/apic.h> |
| 30 | #include <asm/timer.h> | ||
| 29 | 31 | ||
| 30 | struct ms_hyperv_info ms_hyperv; | 32 | struct ms_hyperv_info ms_hyperv; |
| 31 | EXPORT_SYMBOL_GPL(ms_hyperv); | 33 | EXPORT_SYMBOL_GPL(ms_hyperv); |
| 32 | 34 | ||
| 35 | #if IS_ENABLED(CONFIG_HYPERV) | ||
| 36 | static void (*vmbus_handler)(void); | ||
| 37 | |||
| 38 | void hyperv_vector_handler(struct pt_regs *regs) | ||
| 39 | { | ||
| 40 | struct pt_regs *old_regs = set_irq_regs(regs); | ||
| 41 | |||
| 42 | irq_enter(); | ||
| 43 | exit_idle(); | ||
| 44 | |||
| 45 | inc_irq_stat(irq_hv_callback_count); | ||
| 46 | if (vmbus_handler) | ||
| 47 | vmbus_handler(); | ||
| 48 | |||
| 49 | irq_exit(); | ||
| 50 | set_irq_regs(old_regs); | ||
| 51 | } | ||
| 52 | |||
| 53 | void hv_setup_vmbus_irq(void (*handler)(void)) | ||
| 54 | { | ||
| 55 | vmbus_handler = handler; | ||
| 56 | /* | ||
| 57 | * Setup the IDT for hypervisor callback. Prevent reallocation | ||
| 58 | * at module reload. | ||
| 59 | */ | ||
| 60 | if (!test_bit(HYPERVISOR_CALLBACK_VECTOR, used_vectors)) | ||
| 61 | alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, | ||
| 62 | hyperv_callback_vector); | ||
| 63 | } | ||
| 64 | |||
| 65 | void hv_remove_vmbus_irq(void) | ||
| 66 | { | ||
| 67 | /* We have no way to deallocate the interrupt gate */ | ||
| 68 | vmbus_handler = NULL; | ||
| 69 | } | ||
| 70 | EXPORT_SYMBOL_GPL(hv_setup_vmbus_irq); | ||
| 71 | EXPORT_SYMBOL_GPL(hv_remove_vmbus_irq); | ||
| 72 | #endif | ||
| 73 | |||
| 33 | static uint32_t __init ms_hyperv_platform(void) | 74 | static uint32_t __init ms_hyperv_platform(void) |
| 34 | { | 75 | { |
| 35 | u32 eax; | 76 | u32 eax; |
| @@ -105,6 +146,11 @@ static void __init ms_hyperv_init_platform(void) | |||
| 105 | 146 | ||
| 106 | if (ms_hyperv.features & HV_X64_MSR_TIME_REF_COUNT_AVAILABLE) | 147 | if (ms_hyperv.features & HV_X64_MSR_TIME_REF_COUNT_AVAILABLE) |
| 107 | clocksource_register_hz(&hyperv_cs, NSEC_PER_SEC/100); | 148 | clocksource_register_hz(&hyperv_cs, NSEC_PER_SEC/100); |
| 149 | |||
| 150 | #ifdef CONFIG_X86_IO_APIC | ||
| 151 | no_timer_check = 1; | ||
| 152 | #endif | ||
| 153 | |||
| 108 | } | 154 | } |
| 109 | 155 | ||
| 110 | const __refconst struct hypervisor_x86 x86_hyper_ms_hyperv = { | 156 | const __refconst struct hypervisor_x86 x86_hyper_ms_hyperv = { |
| @@ -113,41 +159,3 @@ const __refconst struct hypervisor_x86 x86_hyper_ms_hyperv = { | |||
| 113 | .init_platform = ms_hyperv_init_platform, | 159 | .init_platform = ms_hyperv_init_platform, |
| 114 | }; | 160 | }; |
| 115 | EXPORT_SYMBOL(x86_hyper_ms_hyperv); | 161 | EXPORT_SYMBOL(x86_hyper_ms_hyperv); |
| 116 | |||
| 117 | #if IS_ENABLED(CONFIG_HYPERV) | ||
| 118 | static int vmbus_irq = -1; | ||
| 119 | static irq_handler_t vmbus_isr; | ||
| 120 | |||
| 121 | void hv_register_vmbus_handler(int irq, irq_handler_t handler) | ||
| 122 | { | ||
| 123 | /* | ||
| 124 | * Setup the IDT for hypervisor callback. | ||
| 125 | */ | ||
| 126 | alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, hyperv_callback_vector); | ||
| 127 | |||
| 128 | vmbus_irq = irq; | ||
| 129 | vmbus_isr = handler; | ||
| 130 | } | ||
| 131 | |||
| 132 | void hyperv_vector_handler(struct pt_regs *regs) | ||
| 133 | { | ||
| 134 | struct pt_regs *old_regs = set_irq_regs(regs); | ||
| 135 | struct irq_desc *desc; | ||
| 136 | |||
| 137 | irq_enter(); | ||
| 138 | exit_idle(); | ||
| 139 | |||
| 140 | desc = irq_to_desc(vmbus_irq); | ||
| 141 | |||
| 142 | if (desc) | ||
| 143 | generic_handle_irq_desc(vmbus_irq, desc); | ||
| 144 | |||
| 145 | irq_exit(); | ||
| 146 | set_irq_regs(old_regs); | ||
| 147 | } | ||
| 148 | #else | ||
| 149 | void hv_register_vmbus_handler(int irq, irq_handler_t handler) | ||
| 150 | { | ||
| 151 | } | ||
| 152 | #endif | ||
| 153 | EXPORT_SYMBOL_GPL(hv_register_vmbus_handler); | ||
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 895604f2e916..ae407f7226c8 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
| @@ -892,7 +892,6 @@ static void x86_pmu_enable(struct pmu *pmu) | |||
| 892 | * hw_perf_group_sched_in() or x86_pmu_enable() | 892 | * hw_perf_group_sched_in() or x86_pmu_enable() |
| 893 | * | 893 | * |
| 894 | * step1: save events moving to new counters | 894 | * step1: save events moving to new counters |
| 895 | * step2: reprogram moved events into new counters | ||
| 896 | */ | 895 | */ |
| 897 | for (i = 0; i < n_running; i++) { | 896 | for (i = 0; i < n_running; i++) { |
| 898 | event = cpuc->event_list[i]; | 897 | event = cpuc->event_list[i]; |
| @@ -918,6 +917,9 @@ static void x86_pmu_enable(struct pmu *pmu) | |||
| 918 | x86_pmu_stop(event, PERF_EF_UPDATE); | 917 | x86_pmu_stop(event, PERF_EF_UPDATE); |
| 919 | } | 918 | } |
| 920 | 919 | ||
| 920 | /* | ||
| 921 | * step2: reprogram moved events into new counters | ||
| 922 | */ | ||
| 921 | for (i = 0; i < cpuc->n_events; i++) { | 923 | for (i = 0; i < cpuc->n_events; i++) { |
| 922 | event = cpuc->event_list[i]; | 924 | event = cpuc->event_list[i]; |
| 923 | hwc = &event->hw; | 925 | hwc = &event->hw; |
| @@ -1043,7 +1045,7 @@ static int x86_pmu_add(struct perf_event *event, int flags) | |||
| 1043 | /* | 1045 | /* |
| 1044 | * If group events scheduling transaction was started, | 1046 | * If group events scheduling transaction was started, |
| 1045 | * skip the schedulability test here, it will be performed | 1047 | * skip the schedulability test here, it will be performed |
| 1046 | * at commit time (->commit_txn) as a whole | 1048 | * at commit time (->commit_txn) as a whole. |
| 1047 | */ | 1049 | */ |
| 1048 | if (cpuc->group_flag & PERF_EVENT_TXN) | 1050 | if (cpuc->group_flag & PERF_EVENT_TXN) |
| 1049 | goto done_collect; | 1051 | goto done_collect; |
| @@ -1058,6 +1060,10 @@ static int x86_pmu_add(struct perf_event *event, int flags) | |||
| 1058 | memcpy(cpuc->assign, assign, n*sizeof(int)); | 1060 | memcpy(cpuc->assign, assign, n*sizeof(int)); |
| 1059 | 1061 | ||
| 1060 | done_collect: | 1062 | done_collect: |
| 1063 | /* | ||
| 1064 | * Commit the collect_events() state. See x86_pmu_del() and | ||
| 1065 | * x86_pmu_*_txn(). | ||
| 1066 | */ | ||
| 1061 | cpuc->n_events = n; | 1067 | cpuc->n_events = n; |
| 1062 | cpuc->n_added += n - n0; | 1068 | cpuc->n_added += n - n0; |
| 1063 | cpuc->n_txn += n - n0; | 1069 | cpuc->n_txn += n - n0; |
| @@ -1183,25 +1189,38 @@ static void x86_pmu_del(struct perf_event *event, int flags) | |||
| 1183 | * If we're called during a txn, we don't need to do anything. | 1189 | * If we're called during a txn, we don't need to do anything. |
| 1184 | * The events never got scheduled and ->cancel_txn will truncate | 1190 | * The events never got scheduled and ->cancel_txn will truncate |
| 1185 | * the event_list. | 1191 | * the event_list. |
| 1192 | * | ||
| 1193 | * XXX assumes any ->del() called during a TXN will only be on | ||
| 1194 | * an event added during that same TXN. | ||
| 1186 | */ | 1195 | */ |
| 1187 | if (cpuc->group_flag & PERF_EVENT_TXN) | 1196 | if (cpuc->group_flag & PERF_EVENT_TXN) |
| 1188 | return; | 1197 | return; |
| 1189 | 1198 | ||
| 1199 | /* | ||
| 1200 | * Not a TXN, therefore cleanup properly. | ||
| 1201 | */ | ||
| 1190 | x86_pmu_stop(event, PERF_EF_UPDATE); | 1202 | x86_pmu_stop(event, PERF_EF_UPDATE); |
| 1191 | 1203 | ||
| 1192 | for (i = 0; i < cpuc->n_events; i++) { | 1204 | for (i = 0; i < cpuc->n_events; i++) { |
| 1193 | if (event == cpuc->event_list[i]) { | 1205 | if (event == cpuc->event_list[i]) |
| 1206 | break; | ||
| 1207 | } | ||
| 1194 | 1208 | ||
| 1195 | if (x86_pmu.put_event_constraints) | 1209 | if (WARN_ON_ONCE(i == cpuc->n_events)) /* called ->del() without ->add() ? */ |
| 1196 | x86_pmu.put_event_constraints(cpuc, event); | 1210 | return; |
| 1197 | 1211 | ||
| 1198 | while (++i < cpuc->n_events) | 1212 | /* If we have a newly added event; make sure to decrease n_added. */ |
| 1199 | cpuc->event_list[i-1] = cpuc->event_list[i]; | 1213 | if (i >= cpuc->n_events - cpuc->n_added) |
| 1214 | --cpuc->n_added; | ||
| 1215 | |||
| 1216 | if (x86_pmu.put_event_constraints) | ||
| 1217 | x86_pmu.put_event_constraints(cpuc, event); | ||
| 1218 | |||
| 1219 | /* Delete the array entry. */ | ||
| 1220 | while (++i < cpuc->n_events) | ||
| 1221 | cpuc->event_list[i-1] = cpuc->event_list[i]; | ||
| 1222 | --cpuc->n_events; | ||
| 1200 | 1223 | ||
| 1201 | --cpuc->n_events; | ||
| 1202 | break; | ||
| 1203 | } | ||
| 1204 | } | ||
| 1205 | perf_event_update_userpage(event); | 1224 | perf_event_update_userpage(event); |
| 1206 | } | 1225 | } |
| 1207 | 1226 | ||
| @@ -1595,7 +1614,8 @@ static void x86_pmu_cancel_txn(struct pmu *pmu) | |||
| 1595 | { | 1614 | { |
| 1596 | __this_cpu_and(cpu_hw_events.group_flag, ~PERF_EVENT_TXN); | 1615 | __this_cpu_and(cpu_hw_events.group_flag, ~PERF_EVENT_TXN); |
| 1597 | /* | 1616 | /* |
| 1598 | * Truncate the collected events. | 1617 | * Truncate collected array by the number of events added in this |
| 1618 | * transaction. See x86_pmu_add() and x86_pmu_*_txn(). | ||
| 1599 | */ | 1619 | */ |
| 1600 | __this_cpu_sub(cpu_hw_events.n_added, __this_cpu_read(cpu_hw_events.n_txn)); | 1620 | __this_cpu_sub(cpu_hw_events.n_added, __this_cpu_read(cpu_hw_events.n_txn)); |
| 1601 | __this_cpu_sub(cpu_hw_events.n_events, __this_cpu_read(cpu_hw_events.n_txn)); | 1621 | __this_cpu_sub(cpu_hw_events.n_events, __this_cpu_read(cpu_hw_events.n_txn)); |
| @@ -1606,6 +1626,8 @@ static void x86_pmu_cancel_txn(struct pmu *pmu) | |||
| 1606 | * Commit group events scheduling transaction | 1626 | * Commit group events scheduling transaction |
| 1607 | * Perform the group schedulability test as a whole | 1627 | * Perform the group schedulability test as a whole |
| 1608 | * Return 0 if success | 1628 | * Return 0 if success |
| 1629 | * | ||
| 1630 | * Does not cancel the transaction on failure; expects the caller to do this. | ||
| 1609 | */ | 1631 | */ |
| 1610 | static int x86_pmu_commit_txn(struct pmu *pmu) | 1632 | static int x86_pmu_commit_txn(struct pmu *pmu) |
| 1611 | { | 1633 | { |
diff --git a/arch/x86/kernel/cpu/perf_event.h b/arch/x86/kernel/cpu/perf_event.h index 4972c244d0bc..3b2f9bdd974b 100644 --- a/arch/x86/kernel/cpu/perf_event.h +++ b/arch/x86/kernel/cpu/perf_event.h | |||
| @@ -130,9 +130,11 @@ struct cpu_hw_events { | |||
| 130 | unsigned long running[BITS_TO_LONGS(X86_PMC_IDX_MAX)]; | 130 | unsigned long running[BITS_TO_LONGS(X86_PMC_IDX_MAX)]; |
| 131 | int enabled; | 131 | int enabled; |
| 132 | 132 | ||
| 133 | int n_events; | 133 | int n_events; /* the # of events in the below arrays */ |
| 134 | int n_added; | 134 | int n_added; /* the # last events in the below arrays; |
| 135 | int n_txn; | 135 | they've never been enabled yet */ |
| 136 | int n_txn; /* the # last events in the below arrays; | ||
| 137 | added in the current transaction */ | ||
| 136 | int assign[X86_PMC_IDX_MAX]; /* event to counter assignment */ | 138 | int assign[X86_PMC_IDX_MAX]; /* event to counter assignment */ |
| 137 | u64 tags[X86_PMC_IDX_MAX]; | 139 | u64 tags[X86_PMC_IDX_MAX]; |
| 138 | struct perf_event *event_list[X86_PMC_IDX_MAX]; /* in enabled order */ | 140 | struct perf_event *event_list[X86_PMC_IDX_MAX]; /* in enabled order */ |
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c index c88f7f4b03ee..bd2253d40cff 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c | |||
| @@ -66,6 +66,47 @@ DEFINE_UNCORE_FORMAT_ATTR(mask_vnw, mask_vnw, "config2:3-4"); | |||
| 66 | DEFINE_UNCORE_FORMAT_ATTR(mask0, mask0, "config2:0-31"); | 66 | DEFINE_UNCORE_FORMAT_ATTR(mask0, mask0, "config2:0-31"); |
| 67 | DEFINE_UNCORE_FORMAT_ATTR(mask1, mask1, "config2:32-63"); | 67 | DEFINE_UNCORE_FORMAT_ATTR(mask1, mask1, "config2:32-63"); |
| 68 | 68 | ||
| 69 | static void uncore_pmu_start_hrtimer(struct intel_uncore_box *box); | ||
| 70 | static void uncore_pmu_cancel_hrtimer(struct intel_uncore_box *box); | ||
| 71 | static void uncore_perf_event_update(struct intel_uncore_box *box, struct perf_event *event); | ||
| 72 | static void uncore_pmu_event_read(struct perf_event *event); | ||
| 73 | |||
| 74 | static struct intel_uncore_pmu *uncore_event_to_pmu(struct perf_event *event) | ||
| 75 | { | ||
| 76 | return container_of(event->pmu, struct intel_uncore_pmu, pmu); | ||
| 77 | } | ||
| 78 | |||
| 79 | static struct intel_uncore_box * | ||
| 80 | uncore_pmu_to_box(struct intel_uncore_pmu *pmu, int cpu) | ||
| 81 | { | ||
| 82 | struct intel_uncore_box *box; | ||
| 83 | |||
| 84 | box = *per_cpu_ptr(pmu->box, cpu); | ||
| 85 | if (box) | ||
| 86 | return box; | ||
| 87 | |||
| 88 | raw_spin_lock(&uncore_box_lock); | ||
| 89 | list_for_each_entry(box, &pmu->box_list, list) { | ||
| 90 | if (box->phys_id == topology_physical_package_id(cpu)) { | ||
| 91 | atomic_inc(&box->refcnt); | ||
| 92 | *per_cpu_ptr(pmu->box, cpu) = box; | ||
| 93 | break; | ||
| 94 | } | ||
| 95 | } | ||
| 96 | raw_spin_unlock(&uncore_box_lock); | ||
| 97 | |||
| 98 | return *per_cpu_ptr(pmu->box, cpu); | ||
| 99 | } | ||
| 100 | |||
| 101 | static struct intel_uncore_box *uncore_event_to_box(struct perf_event *event) | ||
| 102 | { | ||
| 103 | /* | ||
| 104 | * perf core schedules event on the basis of cpu, uncore events are | ||
| 105 | * collected by one of the cpus inside a physical package. | ||
| 106 | */ | ||
| 107 | return uncore_pmu_to_box(uncore_event_to_pmu(event), smp_processor_id()); | ||
| 108 | } | ||
| 109 | |||
| 69 | static u64 uncore_msr_read_counter(struct intel_uncore_box *box, struct perf_event *event) | 110 | static u64 uncore_msr_read_counter(struct intel_uncore_box *box, struct perf_event *event) |
| 70 | { | 111 | { |
| 71 | u64 count; | 112 | u64 count; |
| @@ -1639,6 +1680,349 @@ static struct intel_uncore_type *snb_msr_uncores[] = { | |||
| 1639 | &snb_uncore_cbox, | 1680 | &snb_uncore_cbox, |
| 1640 | NULL, | 1681 | NULL, |
| 1641 | }; | 1682 | }; |
| 1683 | |||
| 1684 | enum { | ||
| 1685 | SNB_PCI_UNCORE_IMC, | ||
| 1686 | }; | ||
| 1687 | |||
| 1688 | static struct uncore_event_desc snb_uncore_imc_events[] = { | ||
| 1689 | INTEL_UNCORE_EVENT_DESC(data_reads, "event=0x01"), | ||
| 1690 | INTEL_UNCORE_EVENT_DESC(data_reads.scale, "6.103515625e-5"), | ||
| 1691 | INTEL_UNCORE_EVENT_DESC(data_reads.unit, "MiB"), | ||
| 1692 | |||
| 1693 | INTEL_UNCORE_EVENT_DESC(data_writes, "event=0x02"), | ||
| 1694 | INTEL_UNCORE_EVENT_DESC(data_writes.scale, "6.103515625e-5"), | ||
| 1695 | INTEL_UNCORE_EVENT_DESC(data_writes.unit, "MiB"), | ||
| 1696 | |||
| 1697 | { /* end: all zeroes */ }, | ||
| 1698 | }; | ||
| 1699 | |||
| 1700 | #define SNB_UNCORE_PCI_IMC_EVENT_MASK 0xff | ||
| 1701 | #define SNB_UNCORE_PCI_IMC_BAR_OFFSET 0x48 | ||
| 1702 | |||
| 1703 | /* page size multiple covering all config regs */ | ||
| 1704 | #define SNB_UNCORE_PCI_IMC_MAP_SIZE 0x6000 | ||
| 1705 | |||
| 1706 | #define SNB_UNCORE_PCI_IMC_DATA_READS 0x1 | ||
| 1707 | #define SNB_UNCORE_PCI_IMC_DATA_READS_BASE 0x5050 | ||
| 1708 | #define SNB_UNCORE_PCI_IMC_DATA_WRITES 0x2 | ||
| 1709 | #define SNB_UNCORE_PCI_IMC_DATA_WRITES_BASE 0x5054 | ||
| 1710 | #define SNB_UNCORE_PCI_IMC_CTR_BASE SNB_UNCORE_PCI_IMC_DATA_READS_BASE | ||
| 1711 | |||
| 1712 | static struct attribute *snb_uncore_imc_formats_attr[] = { | ||
| 1713 | &format_attr_event.attr, | ||
| 1714 | NULL, | ||
| 1715 | }; | ||
| 1716 | |||
| 1717 | static struct attribute_group snb_uncore_imc_format_group = { | ||
| 1718 | .name = "format", | ||
| 1719 | .attrs = snb_uncore_imc_formats_attr, | ||
| 1720 | }; | ||
| 1721 | |||
| 1722 | static void snb_uncore_imc_init_box(struct intel_uncore_box *box) | ||
| 1723 | { | ||
| 1724 | struct pci_dev *pdev = box->pci_dev; | ||
| 1725 | int where = SNB_UNCORE_PCI_IMC_BAR_OFFSET; | ||
| 1726 | resource_size_t addr; | ||
| 1727 | u32 pci_dword; | ||
| 1728 | |||
| 1729 | pci_read_config_dword(pdev, where, &pci_dword); | ||
| 1730 | addr = pci_dword; | ||
| 1731 | |||
| 1732 | #ifdef CONFIG_PHYS_ADDR_T_64BIT | ||
| 1733 | pci_read_config_dword(pdev, where + 4, &pci_dword); | ||
| 1734 | addr |= ((resource_size_t)pci_dword << 32); | ||
| 1735 | #endif | ||
| 1736 | |||
| 1737 | addr &= ~(PAGE_SIZE - 1); | ||
| 1738 | |||
| 1739 | box->io_addr = ioremap(addr, SNB_UNCORE_PCI_IMC_MAP_SIZE); | ||
| 1740 | box->hrtimer_duration = UNCORE_SNB_IMC_HRTIMER_INTERVAL; | ||
| 1741 | } | ||
| 1742 | |||
| 1743 | static void snb_uncore_imc_enable_box(struct intel_uncore_box *box) | ||
| 1744 | {} | ||
| 1745 | |||
| 1746 | static void snb_uncore_imc_disable_box(struct intel_uncore_box *box) | ||
| 1747 | {} | ||
| 1748 | |||
| 1749 | static void snb_uncore_imc_enable_event(struct intel_uncore_box *box, struct perf_event *event) | ||
| 1750 | {} | ||
| 1751 | |||
| 1752 | static void snb_uncore_imc_disable_event(struct intel_uncore_box *box, struct perf_event *event) | ||
| 1753 | {} | ||
| 1754 | |||
| 1755 | static u64 snb_uncore_imc_read_counter(struct intel_uncore_box *box, struct perf_event *event) | ||
| 1756 | { | ||
| 1757 | struct hw_perf_event *hwc = &event->hw; | ||
| 1758 | |||
| 1759 | return (u64)*(unsigned int *)(box->io_addr + hwc->event_base); | ||
| 1760 | } | ||
| 1761 | |||
| 1762 | /* | ||
| 1763 | * custom event_init() function because we define our own fixed, free | ||
| 1764 | * running counters, so we do not want to conflict with generic uncore | ||
| 1765 | * logic. Also simplifies processing | ||
| 1766 | */ | ||
| 1767 | static int snb_uncore_imc_event_init(struct perf_event *event) | ||
| 1768 | { | ||
| 1769 | struct intel_uncore_pmu *pmu; | ||
| 1770 | struct intel_uncore_box *box; | ||
| 1771 | struct hw_perf_event *hwc = &event->hw; | ||
| 1772 | u64 cfg = event->attr.config & SNB_UNCORE_PCI_IMC_EVENT_MASK; | ||
| 1773 | int idx, base; | ||
| 1774 | |||
| 1775 | if (event->attr.type != event->pmu->type) | ||
| 1776 | return -ENOENT; | ||
| 1777 | |||
| 1778 | pmu = uncore_event_to_pmu(event); | ||
| 1779 | /* no device found for this pmu */ | ||
| 1780 | if (pmu->func_id < 0) | ||
| 1781 | return -ENOENT; | ||
| 1782 | |||
| 1783 | /* Sampling not supported yet */ | ||
| 1784 | if (hwc->sample_period) | ||
| 1785 | return -EINVAL; | ||
| 1786 | |||
| 1787 | /* unsupported modes and filters */ | ||
| 1788 | if (event->attr.exclude_user || | ||
| 1789 | event->attr.exclude_kernel || | ||
| 1790 | event->attr.exclude_hv || | ||
| 1791 | event->attr.exclude_idle || | ||
| 1792 | event->attr.exclude_host || | ||
| 1793 | event->attr.exclude_guest || | ||
| 1794 | event->attr.sample_period) /* no sampling */ | ||
| 1795 | return -EINVAL; | ||
| 1796 | |||
| 1797 | /* | ||
| 1798 | * Place all uncore events for a particular physical package | ||
| 1799 | * onto a single cpu | ||
| 1800 | */ | ||
| 1801 | if (event->cpu < 0) | ||
| 1802 | return -EINVAL; | ||
| 1803 | |||
| 1804 | /* check only supported bits are set */ | ||
| 1805 | if (event->attr.config & ~SNB_UNCORE_PCI_IMC_EVENT_MASK) | ||
| 1806 | return -EINVAL; | ||
| 1807 | |||
| 1808 | box = uncore_pmu_to_box(pmu, event->cpu); | ||
| 1809 | if (!box || box->cpu < 0) | ||
| 1810 | return -EINVAL; | ||
| 1811 | |||
| 1812 | event->cpu = box->cpu; | ||
| 1813 | |||
| 1814 | event->hw.idx = -1; | ||
| 1815 | event->hw.last_tag = ~0ULL; | ||
| 1816 | event->hw.extra_reg.idx = EXTRA_REG_NONE; | ||
| 1817 | event->hw.branch_reg.idx = EXTRA_REG_NONE; | ||
| 1818 | /* | ||
| 1819 | * check event is known (whitelist, determines counter) | ||
| 1820 | */ | ||
| 1821 | switch (cfg) { | ||
| 1822 | case SNB_UNCORE_PCI_IMC_DATA_READS: | ||
| 1823 | base = SNB_UNCORE_PCI_IMC_DATA_READS_BASE; | ||
| 1824 | idx = UNCORE_PMC_IDX_FIXED; | ||
| 1825 | break; | ||
| 1826 | case SNB_UNCORE_PCI_IMC_DATA_WRITES: | ||
| 1827 | base = SNB_UNCORE_PCI_IMC_DATA_WRITES_BASE; | ||
| 1828 | idx = UNCORE_PMC_IDX_FIXED + 1; | ||
| 1829 | break; | ||
| 1830 | default: | ||
| 1831 | return -EINVAL; | ||
| 1832 | } | ||
| 1833 | |||
| 1834 | /* must be done before validate_group */ | ||
| 1835 | event->hw.event_base = base; | ||
| 1836 | event->hw.config = cfg; | ||
| 1837 | event->hw.idx = idx; | ||
| 1838 | |||
| 1839 | /* no group validation needed, we have free running counters */ | ||
| 1840 | |||
| 1841 | return 0; | ||
| 1842 | } | ||
| 1843 | |||
| 1844 | static int snb_uncore_imc_hw_config(struct intel_uncore_box *box, struct perf_event *event) | ||
| 1845 | { | ||
| 1846 | return 0; | ||
| 1847 | } | ||
| 1848 | |||
| 1849 | static void snb_uncore_imc_event_start(struct perf_event *event, int flags) | ||
| 1850 | { | ||
| 1851 | struct intel_uncore_box *box = uncore_event_to_box(event); | ||
| 1852 | u64 count; | ||
| 1853 | |||
| 1854 | if (WARN_ON_ONCE(!(event->hw.state & PERF_HES_STOPPED))) | ||
| 1855 | return; | ||
| 1856 | |||
| 1857 | event->hw.state = 0; | ||
| 1858 | box->n_active++; | ||
| 1859 | |||
| 1860 | list_add_tail(&event->active_entry, &box->active_list); | ||
| 1861 | |||
| 1862 | count = snb_uncore_imc_read_counter(box, event); | ||
| 1863 | local64_set(&event->hw.prev_count, count); | ||
| 1864 | |||
| 1865 | if (box->n_active == 1) | ||
| 1866 | uncore_pmu_start_hrtimer(box); | ||
| 1867 | } | ||
| 1868 | |||
| 1869 | static void snb_uncore_imc_event_stop(struct perf_event *event, int flags) | ||
| 1870 | { | ||
| 1871 | struct intel_uncore_box *box = uncore_event_to_box(event); | ||
| 1872 | struct hw_perf_event *hwc = &event->hw; | ||
| 1873 | |||
| 1874 | if (!(hwc->state & PERF_HES_STOPPED)) { | ||
| 1875 | box->n_active--; | ||
| 1876 | |||
| 1877 | WARN_ON_ONCE(hwc->state & PERF_HES_STOPPED); | ||
| 1878 | hwc->state |= PERF_HES_STOPPED; | ||
| 1879 | |||
| 1880 | list_del(&event->active_entry); | ||
| 1881 | |||
| 1882 | if (box->n_active == 0) | ||
| 1883 | uncore_pmu_cancel_hrtimer(box); | ||
| 1884 | } | ||
| 1885 | |||
| 1886 | if ((flags & PERF_EF_UPDATE) && !(hwc->state & PERF_HES_UPTODATE)) { | ||
| 1887 | /* | ||
| 1888 | * Drain the remaining delta count out of a event | ||
| 1889 | * that we are disabling: | ||
| 1890 | */ | ||
| 1891 | uncore_perf_event_update(box, event); | ||
| 1892 | hwc->state |= PERF_HES_UPTODATE; | ||
| 1893 | } | ||
| 1894 | } | ||
| 1895 | |||
| 1896 | static int snb_uncore_imc_event_add(struct perf_event *event, int flags) | ||
| 1897 | { | ||
| 1898 | struct intel_uncore_box *box = uncore_event_to_box(event); | ||
| 1899 | struct hw_perf_event *hwc = &event->hw; | ||
| 1900 | |||
| 1901 | if (!box) | ||
| 1902 | return -ENODEV; | ||
| 1903 | |||
| 1904 | hwc->state = PERF_HES_UPTODATE | PERF_HES_STOPPED; | ||
| 1905 | if (!(flags & PERF_EF_START)) | ||
| 1906 | hwc->state |= PERF_HES_ARCH; | ||
| 1907 | |||
| 1908 | snb_uncore_imc_event_start(event, 0); | ||
| 1909 | |||
| 1910 | box->n_events++; | ||
| 1911 | |||
| 1912 | return 0; | ||
| 1913 | } | ||
| 1914 | |||
| 1915 | static void snb_uncore_imc_event_del(struct perf_event *event, int flags) | ||
| 1916 | { | ||
| 1917 | struct intel_uncore_box *box = uncore_event_to_box(event); | ||
| 1918 | int i; | ||
| 1919 | |||
| 1920 | snb_uncore_imc_event_stop(event, PERF_EF_UPDATE); | ||
| 1921 | |||
| 1922 | for (i = 0; i < box->n_events; i++) { | ||
| 1923 | if (event == box->event_list[i]) { | ||
| 1924 | --box->n_events; | ||
| 1925 | break; | ||
| 1926 | } | ||
| 1927 | } | ||
| 1928 | } | ||
| 1929 | |||
| 1930 | static int snb_pci2phy_map_init(int devid) | ||
| 1931 | { | ||
| 1932 | struct pci_dev *dev = NULL; | ||
| 1933 | int bus; | ||
| 1934 | |||
| 1935 | dev = pci_get_device(PCI_VENDOR_ID_INTEL, devid, dev); | ||
| 1936 | if (!dev) | ||
| 1937 | return -ENOTTY; | ||
| 1938 | |||
| 1939 | bus = dev->bus->number; | ||
| 1940 | |||
| 1941 | pcibus_to_physid[bus] = 0; | ||
| 1942 | |||
| 1943 | pci_dev_put(dev); | ||
| 1944 | |||
| 1945 | return 0; | ||
| 1946 | } | ||
| 1947 | |||
| 1948 | static struct pmu snb_uncore_imc_pmu = { | ||
| 1949 | .task_ctx_nr = perf_invalid_context, | ||
| 1950 | .event_init = snb_uncore_imc_event_init, | ||
| 1951 | .add = snb_uncore_imc_event_add, | ||
| 1952 | .del = snb_uncore_imc_event_del, | ||
| 1953 | .start = snb_uncore_imc_event_start, | ||
| 1954 | .stop = snb_uncore_imc_event_stop, | ||
| 1955 | .read = uncore_pmu_event_read, | ||
| 1956 | }; | ||
| 1957 | |||
| 1958 | static struct intel_uncore_ops snb_uncore_imc_ops = { | ||
| 1959 | .init_box = snb_uncore_imc_init_box, | ||
| 1960 | .enable_box = snb_uncore_imc_enable_box, | ||
| 1961 | .disable_box = snb_uncore_imc_disable_box, | ||
| 1962 | .disable_event = snb_uncore_imc_disable_event, | ||
| 1963 | .enable_event = snb_uncore_imc_enable_event, | ||
| 1964 | .hw_config = snb_uncore_imc_hw_config, | ||
| 1965 | .read_counter = snb_uncore_imc_read_counter, | ||
| 1966 | }; | ||
| 1967 | |||
| 1968 | static struct intel_uncore_type snb_uncore_imc = { | ||
| 1969 | .name = "imc", | ||
| 1970 | .num_counters = 2, | ||
| 1971 | .num_boxes = 1, | ||
| 1972 | .fixed_ctr_bits = 32, | ||
| 1973 | .fixed_ctr = SNB_UNCORE_PCI_IMC_CTR_BASE, | ||
| 1974 | .event_descs = snb_uncore_imc_events, | ||
| 1975 | .format_group = &snb_uncore_imc_format_group, | ||
| 1976 | .perf_ctr = SNB_UNCORE_PCI_IMC_DATA_READS_BASE, | ||
| 1977 | .event_mask = SNB_UNCORE_PCI_IMC_EVENT_MASK, | ||
| 1978 | .ops = &snb_uncore_imc_ops, | ||
| 1979 | .pmu = &snb_uncore_imc_pmu, | ||
| 1980 | }; | ||
| 1981 | |||
| 1982 | static struct intel_uncore_type *snb_pci_uncores[] = { | ||
| 1983 | [SNB_PCI_UNCORE_IMC] = &snb_uncore_imc, | ||
| 1984 | NULL, | ||
| 1985 | }; | ||
| 1986 | |||
| 1987 | static DEFINE_PCI_DEVICE_TABLE(snb_uncore_pci_ids) = { | ||
| 1988 | { /* IMC */ | ||
| 1989 | PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SNB_IMC), | ||
| 1990 | .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), | ||
| 1991 | }, | ||
| 1992 | { /* end: all zeroes */ }, | ||
| 1993 | }; | ||
| 1994 | |||
| 1995 | static DEFINE_PCI_DEVICE_TABLE(ivb_uncore_pci_ids) = { | ||
| 1996 | { /* IMC */ | ||
| 1997 | PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IVB_IMC), | ||
| 1998 | .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), | ||
| 1999 | }, | ||
| 2000 | { /* end: all zeroes */ }, | ||
| 2001 | }; | ||
| 2002 | |||
| 2003 | static DEFINE_PCI_DEVICE_TABLE(hsw_uncore_pci_ids) = { | ||
| 2004 | { /* IMC */ | ||
| 2005 | PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_HSW_IMC), | ||
| 2006 | .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0), | ||
| 2007 | }, | ||
| 2008 | { /* end: all zeroes */ }, | ||
| 2009 | }; | ||
| 2010 | |||
| 2011 | static struct pci_driver snb_uncore_pci_driver = { | ||
| 2012 | .name = "snb_uncore", | ||
| 2013 | .id_table = snb_uncore_pci_ids, | ||
| 2014 | }; | ||
| 2015 | |||
| 2016 | static struct pci_driver ivb_uncore_pci_driver = { | ||
| 2017 | .name = "ivb_uncore", | ||
| 2018 | .id_table = ivb_uncore_pci_ids, | ||
| 2019 | }; | ||
| 2020 | |||
| 2021 | static struct pci_driver hsw_uncore_pci_driver = { | ||
| 2022 | .name = "hsw_uncore", | ||
| 2023 | .id_table = hsw_uncore_pci_ids, | ||
| 2024 | }; | ||
| 2025 | |||
| 1642 | /* end of Sandy Bridge uncore support */ | 2026 | /* end of Sandy Bridge uncore support */ |
| 1643 | 2027 | ||
| 1644 | /* Nehalem uncore support */ | 2028 | /* Nehalem uncore support */ |
| @@ -2789,6 +3173,7 @@ again: | |||
| 2789 | static enum hrtimer_restart uncore_pmu_hrtimer(struct hrtimer *hrtimer) | 3173 | static enum hrtimer_restart uncore_pmu_hrtimer(struct hrtimer *hrtimer) |
| 2790 | { | 3174 | { |
| 2791 | struct intel_uncore_box *box; | 3175 | struct intel_uncore_box *box; |
| 3176 | struct perf_event *event; | ||
| 2792 | unsigned long flags; | 3177 | unsigned long flags; |
| 2793 | int bit; | 3178 | int bit; |
| 2794 | 3179 | ||
| @@ -2801,19 +3186,27 @@ static enum hrtimer_restart uncore_pmu_hrtimer(struct hrtimer *hrtimer) | |||
| 2801 | */ | 3186 | */ |
| 2802 | local_irq_save(flags); | 3187 | local_irq_save(flags); |
| 2803 | 3188 | ||
| 3189 | /* | ||
| 3190 | * handle boxes with an active event list as opposed to active | ||
| 3191 | * counters | ||
| 3192 | */ | ||
| 3193 | list_for_each_entry(event, &box->active_list, active_entry) { | ||
| 3194 | uncore_perf_event_update(box, event); | ||
| 3195 | } | ||
| 3196 | |||
| 2804 | for_each_set_bit(bit, box->active_mask, UNCORE_PMC_IDX_MAX) | 3197 | for_each_set_bit(bit, box->active_mask, UNCORE_PMC_IDX_MAX) |
| 2805 | uncore_perf_event_update(box, box->events[bit]); | 3198 | uncore_perf_event_update(box, box->events[bit]); |
| 2806 | 3199 | ||
| 2807 | local_irq_restore(flags); | 3200 | local_irq_restore(flags); |
| 2808 | 3201 | ||
| 2809 | hrtimer_forward_now(hrtimer, ns_to_ktime(UNCORE_PMU_HRTIMER_INTERVAL)); | 3202 | hrtimer_forward_now(hrtimer, ns_to_ktime(box->hrtimer_duration)); |
| 2810 | return HRTIMER_RESTART; | 3203 | return HRTIMER_RESTART; |
| 2811 | } | 3204 | } |
| 2812 | 3205 | ||
| 2813 | static void uncore_pmu_start_hrtimer(struct intel_uncore_box *box) | 3206 | static void uncore_pmu_start_hrtimer(struct intel_uncore_box *box) |
| 2814 | { | 3207 | { |
| 2815 | __hrtimer_start_range_ns(&box->hrtimer, | 3208 | __hrtimer_start_range_ns(&box->hrtimer, |
| 2816 | ns_to_ktime(UNCORE_PMU_HRTIMER_INTERVAL), 0, | 3209 | ns_to_ktime(box->hrtimer_duration), 0, |
| 2817 | HRTIMER_MODE_REL_PINNED, 0); | 3210 | HRTIMER_MODE_REL_PINNED, 0); |
| 2818 | } | 3211 | } |
| 2819 | 3212 | ||
| @@ -2847,43 +3240,12 @@ static struct intel_uncore_box *uncore_alloc_box(struct intel_uncore_type *type, | |||
| 2847 | box->cpu = -1; | 3240 | box->cpu = -1; |
| 2848 | box->phys_id = -1; | 3241 | box->phys_id = -1; |
| 2849 | 3242 | ||
| 2850 | return box; | 3243 | /* set default hrtimer timeout */ |
| 2851 | } | 3244 | box->hrtimer_duration = UNCORE_PMU_HRTIMER_INTERVAL; |
| 2852 | |||
| 2853 | static struct intel_uncore_box * | ||
| 2854 | uncore_pmu_to_box(struct intel_uncore_pmu *pmu, int cpu) | ||
| 2855 | { | ||
| 2856 | struct intel_uncore_box *box; | ||
| 2857 | |||
| 2858 | box = *per_cpu_ptr(pmu->box, cpu); | ||
| 2859 | if (box) | ||
| 2860 | return box; | ||
| 2861 | |||
| 2862 | raw_spin_lock(&uncore_box_lock); | ||
| 2863 | list_for_each_entry(box, &pmu->box_list, list) { | ||
| 2864 | if (box->phys_id == topology_physical_package_id(cpu)) { | ||
| 2865 | atomic_inc(&box->refcnt); | ||
| 2866 | *per_cpu_ptr(pmu->box, cpu) = box; | ||
| 2867 | break; | ||
| 2868 | } | ||
| 2869 | } | ||
| 2870 | raw_spin_unlock(&uncore_box_lock); | ||
| 2871 | |||
| 2872 | return *per_cpu_ptr(pmu->box, cpu); | ||
| 2873 | } | ||
| 2874 | 3245 | ||
| 2875 | static struct intel_uncore_pmu *uncore_event_to_pmu(struct perf_event *event) | 3246 | INIT_LIST_HEAD(&box->active_list); |
| 2876 | { | ||
| 2877 | return container_of(event->pmu, struct intel_uncore_pmu, pmu); | ||
| 2878 | } | ||
| 2879 | 3247 | ||
| 2880 | static struct intel_uncore_box *uncore_event_to_box(struct perf_event *event) | 3248 | return box; |
| 2881 | { | ||
| 2882 | /* | ||
| 2883 | * perf core schedules event on the basis of cpu, uncore events are | ||
| 2884 | * collected by one of the cpus inside a physical package. | ||
| 2885 | */ | ||
| 2886 | return uncore_pmu_to_box(uncore_event_to_pmu(event), smp_processor_id()); | ||
| 2887 | } | 3249 | } |
| 2888 | 3250 | ||
| 2889 | static int | 3251 | static int |
| @@ -3279,16 +3641,21 @@ static int __init uncore_pmu_register(struct intel_uncore_pmu *pmu) | |||
| 3279 | { | 3641 | { |
| 3280 | int ret; | 3642 | int ret; |
| 3281 | 3643 | ||
| 3282 | pmu->pmu = (struct pmu) { | 3644 | if (!pmu->type->pmu) { |
| 3283 | .attr_groups = pmu->type->attr_groups, | 3645 | pmu->pmu = (struct pmu) { |
| 3284 | .task_ctx_nr = perf_invalid_context, | 3646 | .attr_groups = pmu->type->attr_groups, |
| 3285 | .event_init = uncore_pmu_event_init, | 3647 | .task_ctx_nr = perf_invalid_context, |
| 3286 | .add = uncore_pmu_event_add, | 3648 | .event_init = uncore_pmu_event_init, |
| 3287 | .del = uncore_pmu_event_del, | 3649 | .add = uncore_pmu_event_add, |
| 3288 | .start = uncore_pmu_event_start, | 3650 | .del = uncore_pmu_event_del, |
| 3289 | .stop = uncore_pmu_event_stop, | 3651 | .start = uncore_pmu_event_start, |
| 3290 | .read = uncore_pmu_event_read, | 3652 | .stop = uncore_pmu_event_stop, |
| 3291 | }; | 3653 | .read = uncore_pmu_event_read, |
| 3654 | }; | ||
| 3655 | } else { | ||
| 3656 | pmu->pmu = *pmu->type->pmu; | ||
| 3657 | pmu->pmu.attr_groups = pmu->type->attr_groups; | ||
| 3658 | } | ||
| 3292 | 3659 | ||
| 3293 | if (pmu->type->num_boxes == 1) { | 3660 | if (pmu->type->num_boxes == 1) { |
| 3294 | if (strlen(pmu->type->name) > 0) | 3661 | if (strlen(pmu->type->name) > 0) |
| @@ -3334,6 +3701,8 @@ static int __init uncore_type_init(struct intel_uncore_type *type) | |||
| 3334 | if (!pmus) | 3701 | if (!pmus) |
| 3335 | return -ENOMEM; | 3702 | return -ENOMEM; |
| 3336 | 3703 | ||
| 3704 | type->pmus = pmus; | ||
| 3705 | |||
| 3337 | type->unconstrainted = (struct event_constraint) | 3706 | type->unconstrainted = (struct event_constraint) |
| 3338 | __EVENT_CONSTRAINT(0, (1ULL << type->num_counters) - 1, | 3707 | __EVENT_CONSTRAINT(0, (1ULL << type->num_counters) - 1, |
| 3339 | 0, type->num_counters, 0, 0); | 3708 | 0, type->num_counters, 0, 0); |
| @@ -3369,7 +3738,6 @@ static int __init uncore_type_init(struct intel_uncore_type *type) | |||
| 3369 | } | 3738 | } |
| 3370 | 3739 | ||
| 3371 | type->pmu_group = &uncore_pmu_attr_group; | 3740 | type->pmu_group = &uncore_pmu_attr_group; |
| 3372 | type->pmus = pmus; | ||
| 3373 | return 0; | 3741 | return 0; |
| 3374 | fail: | 3742 | fail: |
| 3375 | uncore_type_exit(type); | 3743 | uncore_type_exit(type); |
| @@ -3501,6 +3869,28 @@ static int __init uncore_pci_init(void) | |||
| 3501 | pci_uncores = ivt_pci_uncores; | 3869 | pci_uncores = ivt_pci_uncores; |
| 3502 | uncore_pci_driver = &ivt_uncore_pci_driver; | 3870 | uncore_pci_driver = &ivt_uncore_pci_driver; |
| 3503 | break; | 3871 | break; |
| 3872 | case 42: /* Sandy Bridge */ | ||
| 3873 | ret = snb_pci2phy_map_init(PCI_DEVICE_ID_INTEL_SNB_IMC); | ||
| 3874 | if (ret) | ||
| 3875 | return ret; | ||
| 3876 | pci_uncores = snb_pci_uncores; | ||
| 3877 | uncore_pci_driver = &snb_uncore_pci_driver; | ||
| 3878 | break; | ||
| 3879 | case 58: /* Ivy Bridge */ | ||
| 3880 | ret = snb_pci2phy_map_init(PCI_DEVICE_ID_INTEL_IVB_IMC); | ||
| 3881 | if (ret) | ||
| 3882 | return ret; | ||
| 3883 | pci_uncores = snb_pci_uncores; | ||
| 3884 | uncore_pci_driver = &ivb_uncore_pci_driver; | ||
| 3885 | break; | ||
| 3886 | case 60: /* Haswell */ | ||
| 3887 | case 69: /* Haswell Celeron */ | ||
| 3888 | ret = snb_pci2phy_map_init(PCI_DEVICE_ID_INTEL_HSW_IMC); | ||
| 3889 | if (ret) | ||
| 3890 | return ret; | ||
| 3891 | pci_uncores = snb_pci_uncores; | ||
| 3892 | uncore_pci_driver = &hsw_uncore_pci_driver; | ||
| 3893 | break; | ||
| 3504 | default: | 3894 | default: |
| 3505 | return 0; | 3895 | return 0; |
| 3506 | } | 3896 | } |
| @@ -3772,7 +4162,7 @@ static void __init uncore_cpu_setup(void *dummy) | |||
| 3772 | 4162 | ||
| 3773 | static int __init uncore_cpu_init(void) | 4163 | static int __init uncore_cpu_init(void) |
| 3774 | { | 4164 | { |
| 3775 | int ret, cpu, max_cores; | 4165 | int ret, max_cores; |
| 3776 | 4166 | ||
| 3777 | max_cores = boot_cpu_data.x86_max_cores; | 4167 | max_cores = boot_cpu_data.x86_max_cores; |
| 3778 | switch (boot_cpu_data.x86_model) { | 4168 | switch (boot_cpu_data.x86_model) { |
| @@ -3816,29 +4206,6 @@ static int __init uncore_cpu_init(void) | |||
| 3816 | if (ret) | 4206 | if (ret) |
| 3817 | return ret; | 4207 | return ret; |
| 3818 | 4208 | ||
| 3819 | get_online_cpus(); | ||
| 3820 | |||
| 3821 | for_each_online_cpu(cpu) { | ||
| 3822 | int i, phys_id = topology_physical_package_id(cpu); | ||
| 3823 | |||
| 3824 | for_each_cpu(i, &uncore_cpu_mask) { | ||
| 3825 | if (phys_id == topology_physical_package_id(i)) { | ||
| 3826 | phys_id = -1; | ||
| 3827 | break; | ||
| 3828 | } | ||
| 3829 | } | ||
| 3830 | if (phys_id < 0) | ||
| 3831 | continue; | ||
| 3832 | |||
| 3833 | uncore_cpu_prepare(cpu, phys_id); | ||
| 3834 | uncore_event_init_cpu(cpu); | ||
| 3835 | } | ||
| 3836 | on_each_cpu(uncore_cpu_setup, NULL, 1); | ||
| 3837 | |||
| 3838 | register_cpu_notifier(&uncore_cpu_nb); | ||
| 3839 | |||
| 3840 | put_online_cpus(); | ||
| 3841 | |||
| 3842 | return 0; | 4209 | return 0; |
| 3843 | } | 4210 | } |
| 3844 | 4211 | ||
| @@ -3867,6 +4234,41 @@ static int __init uncore_pmus_register(void) | |||
| 3867 | return 0; | 4234 | return 0; |
| 3868 | } | 4235 | } |
| 3869 | 4236 | ||
| 4237 | static void __init uncore_cpumask_init(void) | ||
| 4238 | { | ||
| 4239 | int cpu; | ||
| 4240 | |||
| 4241 | /* | ||
| 4242 | * ony invoke once from msr or pci init code | ||
| 4243 | */ | ||
| 4244 | if (!cpumask_empty(&uncore_cpu_mask)) | ||
| 4245 | return; | ||
| 4246 | |||
| 4247 | get_online_cpus(); | ||
| 4248 | |||
| 4249 | for_each_online_cpu(cpu) { | ||
| 4250 | int i, phys_id = topology_physical_package_id(cpu); | ||
| 4251 | |||
| 4252 | for_each_cpu(i, &uncore_cpu_mask) { | ||
| 4253 | if (phys_id == topology_physical_package_id(i)) { | ||
| 4254 | phys_id = -1; | ||
| 4255 | break; | ||
| 4256 | } | ||
| 4257 | } | ||
| 4258 | if (phys_id < 0) | ||
| 4259 | continue; | ||
| 4260 | |||
| 4261 | uncore_cpu_prepare(cpu, phys_id); | ||
| 4262 | uncore_event_init_cpu(cpu); | ||
| 4263 | } | ||
| 4264 | on_each_cpu(uncore_cpu_setup, NULL, 1); | ||
| 4265 | |||
| 4266 | register_cpu_notifier(&uncore_cpu_nb); | ||
| 4267 | |||
| 4268 | put_online_cpus(); | ||
| 4269 | } | ||
| 4270 | |||
| 4271 | |||
| 3870 | static int __init intel_uncore_init(void) | 4272 | static int __init intel_uncore_init(void) |
| 3871 | { | 4273 | { |
| 3872 | int ret; | 4274 | int ret; |
| @@ -3885,6 +4287,7 @@ static int __init intel_uncore_init(void) | |||
| 3885 | uncore_pci_exit(); | 4287 | uncore_pci_exit(); |
| 3886 | goto fail; | 4288 | goto fail; |
| 3887 | } | 4289 | } |
| 4290 | uncore_cpumask_init(); | ||
| 3888 | 4291 | ||
| 3889 | uncore_pmus_register(); | 4292 | uncore_pmus_register(); |
| 3890 | return 0; | 4293 | return 0; |
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.h b/arch/x86/kernel/cpu/perf_event_intel_uncore.h index a80ab71a883d..90236f0c94a9 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.h +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #define UNCORE_PMU_NAME_LEN 32 | 7 | #define UNCORE_PMU_NAME_LEN 32 |
| 8 | #define UNCORE_PMU_HRTIMER_INTERVAL (60LL * NSEC_PER_SEC) | 8 | #define UNCORE_PMU_HRTIMER_INTERVAL (60LL * NSEC_PER_SEC) |
| 9 | #define UNCORE_SNB_IMC_HRTIMER_INTERVAL (5ULL * NSEC_PER_SEC) | ||
| 9 | 10 | ||
| 10 | #define UNCORE_FIXED_EVENT 0xff | 11 | #define UNCORE_FIXED_EVENT 0xff |
| 11 | #define UNCORE_PMC_IDX_MAX_GENERIC 8 | 12 | #define UNCORE_PMC_IDX_MAX_GENERIC 8 |
| @@ -440,6 +441,7 @@ struct intel_uncore_type { | |||
| 440 | struct intel_uncore_ops *ops; | 441 | struct intel_uncore_ops *ops; |
| 441 | struct uncore_event_desc *event_descs; | 442 | struct uncore_event_desc *event_descs; |
| 442 | const struct attribute_group *attr_groups[4]; | 443 | const struct attribute_group *attr_groups[4]; |
| 444 | struct pmu *pmu; /* for custom pmu ops */ | ||
| 443 | }; | 445 | }; |
| 444 | 446 | ||
| 445 | #define pmu_group attr_groups[0] | 447 | #define pmu_group attr_groups[0] |
| @@ -488,8 +490,11 @@ struct intel_uncore_box { | |||
| 488 | u64 tags[UNCORE_PMC_IDX_MAX]; | 490 | u64 tags[UNCORE_PMC_IDX_MAX]; |
| 489 | struct pci_dev *pci_dev; | 491 | struct pci_dev *pci_dev; |
| 490 | struct intel_uncore_pmu *pmu; | 492 | struct intel_uncore_pmu *pmu; |
| 493 | u64 hrtimer_duration; /* hrtimer timeout for this box */ | ||
| 491 | struct hrtimer hrtimer; | 494 | struct hrtimer hrtimer; |
| 492 | struct list_head list; | 495 | struct list_head list; |
| 496 | struct list_head active_list; | ||
| 497 | void *io_addr; | ||
| 493 | struct intel_uncore_extra_reg shared_regs[0]; | 498 | struct intel_uncore_extra_reg shared_regs[0]; |
| 494 | }; | 499 | }; |
| 495 | 500 | ||
diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c index 3486e6660357..5d466b7d8609 100644 --- a/arch/x86/kernel/cpu/perf_event_p4.c +++ b/arch/x86/kernel/cpu/perf_event_p4.c | |||
| @@ -1257,7 +1257,24 @@ again: | |||
| 1257 | pass++; | 1257 | pass++; |
| 1258 | goto again; | 1258 | goto again; |
| 1259 | } | 1259 | } |
| 1260 | 1260 | /* | |
| 1261 | * Perf does test runs to see if a whole group can be assigned | ||
| 1262 | * together succesfully. There can be multiple rounds of this. | ||
| 1263 | * Unfortunately, p4_pmu_swap_config_ts touches the hwc->config | ||
| 1264 | * bits, such that the next round of group assignments will | ||
| 1265 | * cause the above p4_should_swap_ts to pass instead of fail. | ||
| 1266 | * This leads to counters exclusive to thread0 being used by | ||
| 1267 | * thread1. | ||
| 1268 | * | ||
| 1269 | * Solve this with a cheap hack, reset the idx back to -1 to | ||
| 1270 | * force a new lookup (p4_next_cntr) to get the right counter | ||
| 1271 | * for the right thread. | ||
| 1272 | * | ||
| 1273 | * This probably doesn't comply with the general spirit of how | ||
| 1274 | * perf wants to work, but P4 is special. :-( | ||
| 1275 | */ | ||
| 1276 | if (p4_should_swap_ts(hwc->config, cpu)) | ||
| 1277 | hwc->idx = -1; | ||
| 1261 | p4_pmu_swap_config_ts(hwc, cpu); | 1278 | p4_pmu_swap_config_ts(hwc, cpu); |
| 1262 | if (assign) | 1279 | if (assign) |
| 1263 | assign[i] = cntr_idx; | 1280 | assign[i] = cntr_idx; |
| @@ -1322,6 +1339,7 @@ static __initconst const struct x86_pmu p4_pmu = { | |||
| 1322 | __init int p4_pmu_init(void) | 1339 | __init int p4_pmu_init(void) |
| 1323 | { | 1340 | { |
| 1324 | unsigned int low, high; | 1341 | unsigned int low, high; |
| 1342 | int i, reg; | ||
| 1325 | 1343 | ||
| 1326 | /* If we get stripped -- indexing fails */ | 1344 | /* If we get stripped -- indexing fails */ |
| 1327 | BUILD_BUG_ON(ARCH_P4_MAX_CCCR > INTEL_PMC_MAX_GENERIC); | 1345 | BUILD_BUG_ON(ARCH_P4_MAX_CCCR > INTEL_PMC_MAX_GENERIC); |
| @@ -1340,5 +1358,19 @@ __init int p4_pmu_init(void) | |||
| 1340 | 1358 | ||
| 1341 | x86_pmu = p4_pmu; | 1359 | x86_pmu = p4_pmu; |
| 1342 | 1360 | ||
| 1361 | /* | ||
| 1362 | * Even though the counters are configured to interrupt a particular | ||
| 1363 | * logical processor when an overflow happens, testing has shown that | ||
| 1364 | * on kdump kernels (which uses a single cpu), thread1's counter | ||
| 1365 | * continues to run and will report an NMI on thread0. Due to the | ||
| 1366 | * overflow bug, this leads to a stream of unknown NMIs. | ||
| 1367 | * | ||
| 1368 | * Solve this by zero'ing out the registers to mimic a reset. | ||
| 1369 | */ | ||
| 1370 | for (i = 0; i < x86_pmu.num_counters; i++) { | ||
| 1371 | reg = x86_pmu_config_addr(i); | ||
| 1372 | wrmsrl_safe(reg, 0ULL); | ||
| 1373 | } | ||
| 1374 | |||
| 1343 | return 0; | 1375 | return 0; |
| 1344 | } | 1376 | } |
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c index a57902efe2d5..507de8066594 100644 --- a/arch/x86/kernel/crash.c +++ b/arch/x86/kernel/crash.c | |||
| @@ -57,9 +57,7 @@ static void kdump_nmi_callback(int cpu, struct pt_regs *regs) | |||
| 57 | { | 57 | { |
| 58 | #ifdef CONFIG_X86_32 | 58 | #ifdef CONFIG_X86_32 |
| 59 | struct pt_regs fixed_regs; | 59 | struct pt_regs fixed_regs; |
| 60 | #endif | ||
| 61 | 60 | ||
| 62 | #ifdef CONFIG_X86_32 | ||
| 63 | if (!user_mode_vm(regs)) { | 61 | if (!user_mode_vm(regs)) { |
| 64 | crash_fixup_ss_esp(&fixed_regs, regs); | 62 | crash_fixup_ss_esp(&fixed_regs, regs); |
| 65 | regs = &fixed_regs; | 63 | regs = &fixed_regs; |
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c index f2a1770ca176..5abd4cd4230c 100644 --- a/arch/x86/kernel/dumpstack_32.c +++ b/arch/x86/kernel/dumpstack_32.c | |||
| @@ -16,12 +16,35 @@ | |||
| 16 | 16 | ||
| 17 | #include <asm/stacktrace.h> | 17 | #include <asm/stacktrace.h> |
| 18 | 18 | ||
| 19 | static void *is_irq_stack(void *p, void *irq) | ||
| 20 | { | ||
| 21 | if (p < irq || p >= (irq + THREAD_SIZE)) | ||
| 22 | return NULL; | ||
| 23 | return irq + THREAD_SIZE; | ||
| 24 | } | ||
| 25 | |||
| 26 | |||
| 27 | static void *is_hardirq_stack(unsigned long *stack, int cpu) | ||
| 28 | { | ||
| 29 | void *irq = per_cpu(hardirq_stack, cpu); | ||
| 30 | |||
| 31 | return is_irq_stack(stack, irq); | ||
| 32 | } | ||
| 33 | |||
| 34 | static void *is_softirq_stack(unsigned long *stack, int cpu) | ||
| 35 | { | ||
| 36 | void *irq = per_cpu(softirq_stack, cpu); | ||
| 37 | |||
| 38 | return is_irq_stack(stack, irq); | ||
| 39 | } | ||
| 19 | 40 | ||
| 20 | void dump_trace(struct task_struct *task, struct pt_regs *regs, | 41 | void dump_trace(struct task_struct *task, struct pt_regs *regs, |
| 21 | unsigned long *stack, unsigned long bp, | 42 | unsigned long *stack, unsigned long bp, |
| 22 | const struct stacktrace_ops *ops, void *data) | 43 | const struct stacktrace_ops *ops, void *data) |
| 23 | { | 44 | { |
| 45 | const unsigned cpu = get_cpu(); | ||
| 24 | int graph = 0; | 46 | int graph = 0; |
| 47 | u32 *prev_esp; | ||
| 25 | 48 | ||
| 26 | if (!task) | 49 | if (!task) |
| 27 | task = current; | 50 | task = current; |
| @@ -30,7 +53,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, | |||
| 30 | unsigned long dummy; | 53 | unsigned long dummy; |
| 31 | 54 | ||
| 32 | stack = &dummy; | 55 | stack = &dummy; |
| 33 | if (task && task != current) | 56 | if (task != current) |
| 34 | stack = (unsigned long *)task->thread.sp; | 57 | stack = (unsigned long *)task->thread.sp; |
| 35 | } | 58 | } |
| 36 | 59 | ||
| @@ -39,18 +62,31 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, | |||
| 39 | 62 | ||
| 40 | for (;;) { | 63 | for (;;) { |
| 41 | struct thread_info *context; | 64 | struct thread_info *context; |
| 65 | void *end_stack; | ||
| 66 | |||
| 67 | end_stack = is_hardirq_stack(stack, cpu); | ||
| 68 | if (!end_stack) | ||
| 69 | end_stack = is_softirq_stack(stack, cpu); | ||
| 42 | 70 | ||
| 43 | context = (struct thread_info *) | 71 | context = task_thread_info(task); |
| 44 | ((unsigned long)stack & (~(THREAD_SIZE - 1))); | 72 | bp = ops->walk_stack(context, stack, bp, ops, data, |
| 45 | bp = ops->walk_stack(context, stack, bp, ops, data, NULL, &graph); | 73 | end_stack, &graph); |
| 46 | 74 | ||
| 47 | stack = (unsigned long *)context->previous_esp; | 75 | /* Stop if not on irq stack */ |
| 76 | if (!end_stack) | ||
| 77 | break; | ||
| 78 | |||
| 79 | /* The previous esp is saved on the bottom of the stack */ | ||
| 80 | prev_esp = (u32 *)(end_stack - THREAD_SIZE); | ||
| 81 | stack = (unsigned long *)*prev_esp; | ||
| 48 | if (!stack) | 82 | if (!stack) |
| 49 | break; | 83 | break; |
| 84 | |||
| 50 | if (ops->stack(data, "IRQ") < 0) | 85 | if (ops->stack(data, "IRQ") < 0) |
| 51 | break; | 86 | break; |
| 52 | touch_nmi_watchdog(); | 87 | touch_nmi_watchdog(); |
| 53 | } | 88 | } |
| 89 | put_cpu(); | ||
| 54 | } | 90 | } |
| 55 | EXPORT_SYMBOL(dump_trace); | 91 | EXPORT_SYMBOL(dump_trace); |
| 56 | 92 | ||
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c index addb207dab92..346b1df2412e 100644 --- a/arch/x86/kernel/dumpstack_64.c +++ b/arch/x86/kernel/dumpstack_64.c | |||
| @@ -104,6 +104,45 @@ in_irq_stack(unsigned long *stack, unsigned long *irq_stack, | |||
| 104 | return (stack >= irq_stack && stack < irq_stack_end); | 104 | return (stack >= irq_stack && stack < irq_stack_end); |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | static const unsigned long irq_stack_size = | ||
| 108 | (IRQ_STACK_SIZE - 64) / sizeof(unsigned long); | ||
| 109 | |||
| 110 | enum stack_type { | ||
| 111 | STACK_IS_UNKNOWN, | ||
| 112 | STACK_IS_NORMAL, | ||
| 113 | STACK_IS_EXCEPTION, | ||
| 114 | STACK_IS_IRQ, | ||
| 115 | }; | ||
| 116 | |||
| 117 | static enum stack_type | ||
| 118 | analyze_stack(int cpu, struct task_struct *task, | ||
| 119 | unsigned long *stack, unsigned long **stack_end, char **id) | ||
| 120 | { | ||
| 121 | unsigned long *irq_stack; | ||
| 122 | unsigned long addr; | ||
| 123 | unsigned used = 0; | ||
| 124 | |||
| 125 | addr = ((unsigned long)stack & (~(THREAD_SIZE - 1))); | ||
| 126 | if ((unsigned long)task_stack_page(task) == addr) | ||
| 127 | return STACK_IS_NORMAL; | ||
| 128 | |||
| 129 | *stack_end = in_exception_stack(cpu, (unsigned long)stack, | ||
| 130 | &used, id); | ||
| 131 | if (*stack_end) | ||
| 132 | return STACK_IS_EXCEPTION; | ||
| 133 | |||
| 134 | *stack_end = (unsigned long *)per_cpu(irq_stack_ptr, cpu); | ||
| 135 | if (!*stack_end) | ||
| 136 | return STACK_IS_UNKNOWN; | ||
| 137 | |||
| 138 | irq_stack = *stack_end - irq_stack_size; | ||
| 139 | |||
| 140 | if (in_irq_stack(stack, irq_stack, *stack_end)) | ||
| 141 | return STACK_IS_IRQ; | ||
| 142 | |||
| 143 | return STACK_IS_UNKNOWN; | ||
| 144 | } | ||
| 145 | |||
| 107 | /* | 146 | /* |
| 108 | * x86-64 can have up to three kernel stacks: | 147 | * x86-64 can have up to three kernel stacks: |
| 109 | * process stack | 148 | * process stack |
| @@ -116,12 +155,11 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, | |||
| 116 | const struct stacktrace_ops *ops, void *data) | 155 | const struct stacktrace_ops *ops, void *data) |
| 117 | { | 156 | { |
| 118 | const unsigned cpu = get_cpu(); | 157 | const unsigned cpu = get_cpu(); |
| 119 | unsigned long *irq_stack_end = | ||
| 120 | (unsigned long *)per_cpu(irq_stack_ptr, cpu); | ||
| 121 | unsigned used = 0; | ||
| 122 | struct thread_info *tinfo; | 158 | struct thread_info *tinfo; |
| 123 | int graph = 0; | 159 | unsigned long *irq_stack; |
| 124 | unsigned long dummy; | 160 | unsigned long dummy; |
| 161 | int graph = 0; | ||
| 162 | int done = 0; | ||
| 125 | 163 | ||
| 126 | if (!task) | 164 | if (!task) |
| 127 | task = current; | 165 | task = current; |
| @@ -143,49 +181,60 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs, | |||
| 143 | * exceptions | 181 | * exceptions |
| 144 | */ | 182 | */ |
| 145 | tinfo = task_thread_info(task); | 183 | tinfo = task_thread_info(task); |
| 146 | for (;;) { | 184 | while (!done) { |
| 185 | unsigned long *stack_end; | ||
| 186 | enum stack_type stype; | ||
| 147 | char *id; | 187 | char *id; |
| 148 | unsigned long *estack_end; | ||
| 149 | estack_end = in_exception_stack(cpu, (unsigned long)stack, | ||
| 150 | &used, &id); | ||
| 151 | 188 | ||
| 152 | if (estack_end) { | 189 | stype = analyze_stack(cpu, task, stack, &stack_end, &id); |
| 190 | |||
| 191 | /* Default finish unless specified to continue */ | ||
| 192 | done = 1; | ||
| 193 | |||
| 194 | switch (stype) { | ||
| 195 | |||
| 196 | /* Break out early if we are on the thread stack */ | ||
| 197 | case STACK_IS_NORMAL: | ||
| 198 | break; | ||
| 199 | |||
| 200 | case STACK_IS_EXCEPTION: | ||
| 201 | |||
| 153 | if (ops->stack(data, id) < 0) | 202 | if (ops->stack(data, id) < 0) |
| 154 | break; | 203 | break; |
| 155 | 204 | ||
| 156 | bp = ops->walk_stack(tinfo, stack, bp, ops, | 205 | bp = ops->walk_stack(tinfo, stack, bp, ops, |
| 157 | data, estack_end, &graph); | 206 | data, stack_end, &graph); |
| 158 | ops->stack(data, "<EOE>"); | 207 | ops->stack(data, "<EOE>"); |
| 159 | /* | 208 | /* |
| 160 | * We link to the next stack via the | 209 | * We link to the next stack via the |
| 161 | * second-to-last pointer (index -2 to end) in the | 210 | * second-to-last pointer (index -2 to end) in the |
| 162 | * exception stack: | 211 | * exception stack: |
| 163 | */ | 212 | */ |
| 164 | stack = (unsigned long *) estack_end[-2]; | 213 | stack = (unsigned long *) stack_end[-2]; |
| 165 | continue; | 214 | done = 0; |
| 166 | } | 215 | break; |
| 167 | if (irq_stack_end) { | 216 | |
| 168 | unsigned long *irq_stack; | 217 | case STACK_IS_IRQ: |
| 169 | irq_stack = irq_stack_end - | 218 | |
| 170 | (IRQ_STACK_SIZE - 64) / sizeof(*irq_stack); | 219 | if (ops->stack(data, "IRQ") < 0) |
| 171 | 220 | break; | |
| 172 | if (in_irq_stack(stack, irq_stack, irq_stack_end)) { | 221 | bp = ops->walk_stack(tinfo, stack, bp, |
| 173 | if (ops->stack(data, "IRQ") < 0) | 222 | ops, data, stack_end, &graph); |
| 174 | break; | 223 | /* |
| 175 | bp = ops->walk_stack(tinfo, stack, bp, | 224 | * We link to the next stack (which would be |
| 176 | ops, data, irq_stack_end, &graph); | 225 | * the process stack normally) the last |
| 177 | /* | 226 | * pointer (index -1 to end) in the IRQ stack: |
| 178 | * We link to the next stack (which would be | 227 | */ |
| 179 | * the process stack normally) the last | 228 | stack = (unsigned long *) (stack_end[-1]); |
| 180 | * pointer (index -1 to end) in the IRQ stack: | 229 | irq_stack = stack_end - irq_stack_size; |
| 181 | */ | 230 | ops->stack(data, "EOI"); |
| 182 | stack = (unsigned long *) (irq_stack_end[-1]); | 231 | done = 0; |
| 183 | irq_stack_end = NULL; | 232 | break; |
| 184 | ops->stack(data, "EOI"); | 233 | |
| 185 | continue; | 234 | case STACK_IS_UNKNOWN: |
| 186 | } | 235 | ops->stack(data, "UNK"); |
| 236 | break; | ||
| 187 | } | 237 | } |
| 188 | break; | ||
| 189 | } | 238 | } |
| 190 | 239 | ||
| 191 | /* | 240 | /* |
diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c index bc4a088f9023..6d7d5a1260a6 100644 --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c | |||
| @@ -203,18 +203,15 @@ static void __init intel_remapping_check(int num, int slot, int func) | |||
| 203 | revision = read_pci_config_byte(num, slot, func, PCI_REVISION_ID); | 203 | revision = read_pci_config_byte(num, slot, func, PCI_REVISION_ID); |
| 204 | 204 | ||
| 205 | /* | 205 | /* |
| 206 | * Revision 13 of all triggering devices id in this quirk have | 206 | * Revision <= 13 of all triggering devices id in this quirk |
| 207 | * a problem draining interrupts when irq remapping is enabled, | 207 | * have a problem draining interrupts when irq remapping is |
| 208 | * and should be flagged as broken. Additionally revisions 0x12 | 208 | * enabled, and should be flagged as broken. Additionally |
| 209 | * and 0x22 of device id 0x3405 has this problem. | 209 | * revision 0x22 of device id 0x3405 has this problem. |
| 210 | */ | 210 | */ |
| 211 | if (revision == 0x13) | 211 | if (revision <= 0x13) |
| 212 | set_irq_remapping_broken(); | 212 | set_irq_remapping_broken(); |
| 213 | else if ((device == 0x3405) && | 213 | else if (device == 0x3405 && revision == 0x22) |
| 214 | ((revision == 0x12) || | ||
| 215 | (revision == 0x22))) | ||
| 216 | set_irq_remapping_broken(); | 214 | set_irq_remapping_broken(); |
| 217 | |||
| 218 | } | 215 | } |
| 219 | 216 | ||
| 220 | /* | 217 | /* |
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S index 81ba27679f18..f36bd42d6f0c 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86/kernel/head_32.S | |||
| @@ -544,6 +544,10 @@ ENDPROC(early_idt_handlers) | |||
| 544 | /* This is global to keep gas from relaxing the jumps */ | 544 | /* This is global to keep gas from relaxing the jumps */ |
| 545 | ENTRY(early_idt_handler) | 545 | ENTRY(early_idt_handler) |
| 546 | cld | 546 | cld |
| 547 | |||
| 548 | cmpl $2,(%esp) # X86_TRAP_NMI | ||
| 549 | je is_nmi # Ignore NMI | ||
| 550 | |||
| 547 | cmpl $2,%ss:early_recursion_flag | 551 | cmpl $2,%ss:early_recursion_flag |
| 548 | je hlt_loop | 552 | je hlt_loop |
| 549 | incl %ss:early_recursion_flag | 553 | incl %ss:early_recursion_flag |
| @@ -594,8 +598,9 @@ ex_entry: | |||
| 594 | pop %edx | 598 | pop %edx |
| 595 | pop %ecx | 599 | pop %ecx |
| 596 | pop %eax | 600 | pop %eax |
| 597 | addl $8,%esp /* drop vector number and error code */ | ||
| 598 | decl %ss:early_recursion_flag | 601 | decl %ss:early_recursion_flag |
| 602 | is_nmi: | ||
| 603 | addl $8,%esp /* drop vector number and error code */ | ||
| 599 | iret | 604 | iret |
| 600 | ENDPROC(early_idt_handler) | 605 | ENDPROC(early_idt_handler) |
| 601 | 606 | ||
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index e1aabdb314c8..a468c0a65c42 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S | |||
| @@ -343,6 +343,9 @@ early_idt_handlers: | |||
| 343 | ENTRY(early_idt_handler) | 343 | ENTRY(early_idt_handler) |
| 344 | cld | 344 | cld |
| 345 | 345 | ||
| 346 | cmpl $2,(%rsp) # X86_TRAP_NMI | ||
| 347 | je is_nmi # Ignore NMI | ||
| 348 | |||
| 346 | cmpl $2,early_recursion_flag(%rip) | 349 | cmpl $2,early_recursion_flag(%rip) |
| 347 | jz 1f | 350 | jz 1f |
| 348 | incl early_recursion_flag(%rip) | 351 | incl early_recursion_flag(%rip) |
| @@ -405,8 +408,9 @@ ENTRY(early_idt_handler) | |||
| 405 | popq %rdx | 408 | popq %rdx |
| 406 | popq %rcx | 409 | popq %rcx |
| 407 | popq %rax | 410 | popq %rax |
| 408 | addq $16,%rsp # drop vector number and error code | ||
| 409 | decl early_recursion_flag(%rip) | 411 | decl early_recursion_flag(%rip) |
| 412 | is_nmi: | ||
| 413 | addq $16,%rsp # drop vector number and error code | ||
| 410 | INTERRUPT_RETURN | 414 | INTERRUPT_RETURN |
| 411 | ENDPROC(early_idt_handler) | 415 | ENDPROC(early_idt_handler) |
| 412 | 416 | ||
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index da85a8e830a1..014618dbaa7b 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
| @@ -521,7 +521,7 @@ static int hpet_setup_irq(struct hpet_dev *dev) | |||
| 521 | { | 521 | { |
| 522 | 522 | ||
| 523 | if (request_irq(dev->irq, hpet_interrupt_handler, | 523 | if (request_irq(dev->irq, hpet_interrupt_handler, |
| 524 | IRQF_TIMER | IRQF_DISABLED | IRQF_NOBALANCING, | 524 | IRQF_TIMER | IRQF_NOBALANCING, |
| 525 | dev->name, dev)) | 525 | dev->name, dev)) |
| 526 | return -1; | 526 | return -1; |
| 527 | 527 | ||
| @@ -699,7 +699,7 @@ static int hpet_cpuhp_notify(struct notifier_block *n, | |||
| 699 | /* FIXME: add schedule_work_on() */ | 699 | /* FIXME: add schedule_work_on() */ |
| 700 | schedule_delayed_work_on(cpu, &work.work, 0); | 700 | schedule_delayed_work_on(cpu, &work.work, 0); |
| 701 | wait_for_completion(&work.complete); | 701 | wait_for_completion(&work.complete); |
| 702 | destroy_timer_on_stack(&work.work.timer); | 702 | destroy_delayed_work_on_stack(&work.work); |
| 703 | break; | 703 | break; |
| 704 | case CPU_DEAD: | 704 | case CPU_DEAD: |
| 705 | if (hdev) { | 705 | if (hdev) { |
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c index e8368c6dd2a2..d5dd80814419 100644 --- a/arch/x86/kernel/i387.c +++ b/arch/x86/kernel/i387.c | |||
| @@ -86,10 +86,19 @@ EXPORT_SYMBOL(__kernel_fpu_begin); | |||
| 86 | 86 | ||
| 87 | void __kernel_fpu_end(void) | 87 | void __kernel_fpu_end(void) |
| 88 | { | 88 | { |
| 89 | if (use_eager_fpu()) | 89 | if (use_eager_fpu()) { |
| 90 | math_state_restore(); | 90 | /* |
| 91 | else | 91 | * For eager fpu, most the time, tsk_used_math() is true. |
| 92 | * Restore the user math as we are done with the kernel usage. | ||
| 93 | * At few instances during thread exit, signal handling etc, | ||
| 94 | * tsk_used_math() is false. Those few places will take proper | ||
| 95 | * actions, so we don't need to restore the math here. | ||
| 96 | */ | ||
| 97 | if (likely(tsk_used_math(current))) | ||
| 98 | math_state_restore(); | ||
| 99 | } else { | ||
| 92 | stts(); | 100 | stts(); |
| 101 | } | ||
| 93 | } | 102 | } |
| 94 | EXPORT_SYMBOL(__kernel_fpu_end); | 103 | EXPORT_SYMBOL(__kernel_fpu_end); |
| 95 | 104 | ||
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index d99f31d9a750..42805fac0092 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c | |||
| @@ -125,6 +125,12 @@ int arch_show_interrupts(struct seq_file *p, int prec) | |||
| 125 | seq_printf(p, "%10u ", per_cpu(mce_poll_count, j)); | 125 | seq_printf(p, "%10u ", per_cpu(mce_poll_count, j)); |
| 126 | seq_printf(p, " Machine check polls\n"); | 126 | seq_printf(p, " Machine check polls\n"); |
| 127 | #endif | 127 | #endif |
| 128 | #if defined(CONFIG_HYPERV) || defined(CONFIG_XEN) | ||
| 129 | seq_printf(p, "%*s: ", prec, "THR"); | ||
| 130 | for_each_online_cpu(j) | ||
| 131 | seq_printf(p, "%10u ", irq_stats(j)->irq_hv_callback_count); | ||
| 132 | seq_printf(p, " Hypervisor callback interrupts\n"); | ||
| 133 | #endif | ||
| 128 | seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count)); | 134 | seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count)); |
| 129 | #if defined(CONFIG_X86_IO_APIC) | 135 | #if defined(CONFIG_X86_IO_APIC) |
| 130 | seq_printf(p, "%*s: %10u\n", prec, "MIS", atomic_read(&irq_mis_count)); | 136 | seq_printf(p, "%*s: %10u\n", prec, "MIS", atomic_read(&irq_mis_count)); |
diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c index d7fcbedc9c43..63ce838e5a54 100644 --- a/arch/x86/kernel/irq_32.c +++ b/arch/x86/kernel/irq_32.c | |||
| @@ -55,16 +55,8 @@ static inline int check_stack_overflow(void) { return 0; } | |||
| 55 | static inline void print_stack_overflow(void) { } | 55 | static inline void print_stack_overflow(void) { } |
| 56 | #endif | 56 | #endif |
| 57 | 57 | ||
| 58 | /* | 58 | DEFINE_PER_CPU(struct irq_stack *, hardirq_stack); |
| 59 | * per-CPU IRQ handling contexts (thread information and stack) | 59 | DEFINE_PER_CPU(struct irq_stack *, softirq_stack); |
| 60 | */ | ||
| 61 | union irq_ctx { | ||
| 62 | struct thread_info tinfo; | ||
| 63 | u32 stack[THREAD_SIZE/sizeof(u32)]; | ||
| 64 | } __attribute__((aligned(THREAD_SIZE))); | ||
| 65 | |||
| 66 | static DEFINE_PER_CPU(union irq_ctx *, hardirq_ctx); | ||
| 67 | static DEFINE_PER_CPU(union irq_ctx *, softirq_ctx); | ||
| 68 | 60 | ||
| 69 | static void call_on_stack(void *func, void *stack) | 61 | static void call_on_stack(void *func, void *stack) |
| 70 | { | 62 | { |
| @@ -77,14 +69,26 @@ static void call_on_stack(void *func, void *stack) | |||
| 77 | : "memory", "cc", "edx", "ecx", "eax"); | 69 | : "memory", "cc", "edx", "ecx", "eax"); |
| 78 | } | 70 | } |
| 79 | 71 | ||
| 72 | /* how to get the current stack pointer from C */ | ||
| 73 | #define current_stack_pointer ({ \ | ||
| 74 | unsigned long sp; \ | ||
| 75 | asm("mov %%esp,%0" : "=g" (sp)); \ | ||
| 76 | sp; \ | ||
| 77 | }) | ||
| 78 | |||
| 79 | static inline void *current_stack(void) | ||
| 80 | { | ||
| 81 | return (void *)(current_stack_pointer & ~(THREAD_SIZE - 1)); | ||
| 82 | } | ||
| 83 | |||
| 80 | static inline int | 84 | static inline int |
| 81 | execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq) | 85 | execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq) |
| 82 | { | 86 | { |
| 83 | union irq_ctx *curctx, *irqctx; | 87 | struct irq_stack *curstk, *irqstk; |
| 84 | u32 *isp, arg1, arg2; | 88 | u32 *isp, *prev_esp, arg1, arg2; |
| 85 | 89 | ||
| 86 | curctx = (union irq_ctx *) current_thread_info(); | 90 | curstk = (struct irq_stack *) current_stack(); |
| 87 | irqctx = __this_cpu_read(hardirq_ctx); | 91 | irqstk = __this_cpu_read(hardirq_stack); |
| 88 | 92 | ||
| 89 | /* | 93 | /* |
| 90 | * this is where we switch to the IRQ stack. However, if we are | 94 | * this is where we switch to the IRQ stack. However, if we are |
| @@ -92,13 +96,14 @@ execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq) | |||
| 92 | * handler) we can't do that and just have to keep using the | 96 | * handler) we can't do that and just have to keep using the |
| 93 | * current stack (which is the irq stack already after all) | 97 | * current stack (which is the irq stack already after all) |
| 94 | */ | 98 | */ |
| 95 | if (unlikely(curctx == irqctx)) | 99 | if (unlikely(curstk == irqstk)) |
| 96 | return 0; | 100 | return 0; |
| 97 | 101 | ||
| 98 | /* build the stack frame on the IRQ stack */ | 102 | isp = (u32 *) ((char *)irqstk + sizeof(*irqstk)); |
| 99 | isp = (u32 *) ((char *)irqctx + sizeof(*irqctx)); | 103 | |
| 100 | irqctx->tinfo.task = curctx->tinfo.task; | 104 | /* Save the next esp at the bottom of the stack */ |
| 101 | irqctx->tinfo.previous_esp = current_stack_pointer; | 105 | prev_esp = (u32 *)irqstk; |
| 106 | *prev_esp = current_stack_pointer; | ||
| 102 | 107 | ||
| 103 | if (unlikely(overflow)) | 108 | if (unlikely(overflow)) |
| 104 | call_on_stack(print_stack_overflow, isp); | 109 | call_on_stack(print_stack_overflow, isp); |
| @@ -118,46 +123,40 @@ execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq) | |||
| 118 | */ | 123 | */ |
| 119 | void irq_ctx_init(int cpu) | 124 | void irq_ctx_init(int cpu) |
| 120 | { | 125 | { |
| 121 | union irq_ctx *irqctx; | 126 | struct irq_stack *irqstk; |
| 122 | 127 | ||
| 123 | if (per_cpu(hardirq_ctx, cpu)) | 128 | if (per_cpu(hardirq_stack, cpu)) |
| 124 | return; | 129 | return; |
| 125 | 130 | ||
| 126 | irqctx = page_address(alloc_pages_node(cpu_to_node(cpu), | 131 | irqstk = page_address(alloc_pages_node(cpu_to_node(cpu), |
| 127 | THREADINFO_GFP, | 132 | THREADINFO_GFP, |
| 128 | THREAD_SIZE_ORDER)); | 133 | THREAD_SIZE_ORDER)); |
| 129 | memset(&irqctx->tinfo, 0, sizeof(struct thread_info)); | 134 | per_cpu(hardirq_stack, cpu) = irqstk; |
| 130 | irqctx->tinfo.cpu = cpu; | ||
| 131 | irqctx->tinfo.addr_limit = MAKE_MM_SEG(0); | ||
| 132 | |||
| 133 | per_cpu(hardirq_ctx, cpu) = irqctx; | ||
| 134 | 135 | ||
| 135 | irqctx = page_address(alloc_pages_node(cpu_to_node(cpu), | 136 | irqstk = page_address(alloc_pages_node(cpu_to_node(cpu), |
| 136 | THREADINFO_GFP, | 137 | THREADINFO_GFP, |
| 137 | THREAD_SIZE_ORDER)); | 138 | THREAD_SIZE_ORDER)); |
| 138 | memset(&irqctx->tinfo, 0, sizeof(struct thread_info)); | 139 | per_cpu(softirq_stack, cpu) = irqstk; |
| 139 | irqctx->tinfo.cpu = cpu; | ||
| 140 | irqctx->tinfo.addr_limit = MAKE_MM_SEG(0); | ||
| 141 | |||
| 142 | per_cpu(softirq_ctx, cpu) = irqctx; | ||
| 143 | 140 | ||
| 144 | printk(KERN_DEBUG "CPU %u irqstacks, hard=%p soft=%p\n", | 141 | printk(KERN_DEBUG "CPU %u irqstacks, hard=%p soft=%p\n", |
| 145 | cpu, per_cpu(hardirq_ctx, cpu), per_cpu(softirq_ctx, cpu)); | 142 | cpu, per_cpu(hardirq_stack, cpu), per_cpu(softirq_stack, cpu)); |
| 146 | } | 143 | } |
| 147 | 144 | ||
| 148 | void do_softirq_own_stack(void) | 145 | void do_softirq_own_stack(void) |
| 149 | { | 146 | { |
| 150 | struct thread_info *curctx; | 147 | struct thread_info *curstk; |
| 151 | union irq_ctx *irqctx; | 148 | struct irq_stack *irqstk; |
| 152 | u32 *isp; | 149 | u32 *isp, *prev_esp; |
| 153 | 150 | ||
| 154 | curctx = current_thread_info(); | 151 | curstk = current_stack(); |
| 155 | irqctx = __this_cpu_read(softirq_ctx); | 152 | irqstk = __this_cpu_read(softirq_stack); |
| 156 | irqctx->tinfo.task = curctx->task; | ||
| 157 | irqctx->tinfo.previous_esp = current_stack_pointer; | ||
| 158 | 153 | ||
| 159 | /* build the stack frame on the softirq stack */ | 154 | /* build the stack frame on the softirq stack */ |
| 160 | isp = (u32 *) ((char *)irqctx + sizeof(*irqctx)); | 155 | isp = (u32 *) ((char *)irqstk + sizeof(*irqstk)); |
| 156 | |||
| 157 | /* Push the previous esp onto the stack */ | ||
| 158 | prev_esp = (u32 *)irqstk; | ||
| 159 | *prev_esp = current_stack_pointer; | ||
| 161 | 160 | ||
| 162 | call_on_stack(__do_softirq, isp); | 161 | call_on_stack(__do_softirq, isp); |
| 163 | } | 162 | } |
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index 4eabc160696f..679cef0791cd 100644 --- a/arch/x86/kernel/machine_kexec_64.c +++ b/arch/x86/kernel/machine_kexec_64.c | |||
| @@ -279,5 +279,7 @@ void arch_crash_save_vmcoreinfo(void) | |||
| 279 | VMCOREINFO_SYMBOL(node_data); | 279 | VMCOREINFO_SYMBOL(node_data); |
| 280 | VMCOREINFO_LENGTH(node_data, MAX_NUMNODES); | 280 | VMCOREINFO_LENGTH(node_data, MAX_NUMNODES); |
| 281 | #endif | 281 | #endif |
| 282 | vmcoreinfo_append_str("KERNELOFFSET=%lx\n", | ||
| 283 | (unsigned long)&_text - __START_KERNEL); | ||
| 282 | } | 284 | } |
| 283 | 285 | ||
diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c index 18be189368bb..e69f9882bf95 100644 --- a/arch/x86/kernel/module.c +++ b/arch/x86/kernel/module.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/mm.h> | 28 | #include <linux/mm.h> |
| 29 | #include <linux/gfp.h> | 29 | #include <linux/gfp.h> |
| 30 | #include <linux/jump_label.h> | 30 | #include <linux/jump_label.h> |
| 31 | #include <linux/random.h> | ||
| 31 | 32 | ||
| 32 | #include <asm/page.h> | 33 | #include <asm/page.h> |
| 33 | #include <asm/pgtable.h> | 34 | #include <asm/pgtable.h> |
| @@ -43,13 +44,52 @@ do { \ | |||
| 43 | } while (0) | 44 | } while (0) |
| 44 | #endif | 45 | #endif |
| 45 | 46 | ||
| 47 | #ifdef CONFIG_RANDOMIZE_BASE | ||
| 48 | static unsigned long module_load_offset; | ||
| 49 | static int randomize_modules = 1; | ||
| 50 | |||
| 51 | /* Mutex protects the module_load_offset. */ | ||
| 52 | static DEFINE_MUTEX(module_kaslr_mutex); | ||
| 53 | |||
| 54 | static int __init parse_nokaslr(char *p) | ||
| 55 | { | ||
| 56 | randomize_modules = 0; | ||
| 57 | return 0; | ||
| 58 | } | ||
| 59 | early_param("nokaslr", parse_nokaslr); | ||
| 60 | |||
| 61 | static unsigned long int get_module_load_offset(void) | ||
| 62 | { | ||
| 63 | if (randomize_modules) { | ||
| 64 | mutex_lock(&module_kaslr_mutex); | ||
| 65 | /* | ||
| 66 | * Calculate the module_load_offset the first time this | ||
| 67 | * code is called. Once calculated it stays the same until | ||
| 68 | * reboot. | ||
| 69 | */ | ||
| 70 | if (module_load_offset == 0) | ||
| 71 | module_load_offset = | ||
| 72 | (get_random_int() % 1024 + 1) * PAGE_SIZE; | ||
| 73 | mutex_unlock(&module_kaslr_mutex); | ||
| 74 | } | ||
| 75 | return module_load_offset; | ||
| 76 | } | ||
| 77 | #else | ||
| 78 | static unsigned long int get_module_load_offset(void) | ||
| 79 | { | ||
| 80 | return 0; | ||
| 81 | } | ||
| 82 | #endif | ||
| 83 | |||
| 46 | void *module_alloc(unsigned long size) | 84 | void *module_alloc(unsigned long size) |
| 47 | { | 85 | { |
| 48 | if (PAGE_ALIGN(size) > MODULES_LEN) | 86 | if (PAGE_ALIGN(size) > MODULES_LEN) |
| 49 | return NULL; | 87 | return NULL; |
| 50 | return __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END, | 88 | return __vmalloc_node_range(size, 1, |
| 51 | GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL_EXEC, | 89 | MODULES_VADDR + get_module_load_offset(), |
| 52 | NUMA_NO_NODE, __builtin_return_address(0)); | 90 | MODULES_END, GFP_KERNEL | __GFP_HIGHMEM, |
| 91 | PAGE_KERNEL_EXEC, NUMA_NO_NODE, | ||
| 92 | __builtin_return_address(0)); | ||
| 53 | } | 93 | } |
| 54 | 94 | ||
| 55 | #ifdef CONFIG_X86_32 | 95 | #ifdef CONFIG_X86_32 |
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c index 6fcb49ce50a1..b4872b999a71 100644 --- a/arch/x86/kernel/nmi.c +++ b/arch/x86/kernel/nmi.c | |||
| @@ -87,6 +87,7 @@ __setup("unknown_nmi_panic", setup_unknown_nmi_panic); | |||
| 87 | #define nmi_to_desc(type) (&nmi_desc[type]) | 87 | #define nmi_to_desc(type) (&nmi_desc[type]) |
| 88 | 88 | ||
| 89 | static u64 nmi_longest_ns = 1 * NSEC_PER_MSEC; | 89 | static u64 nmi_longest_ns = 1 * NSEC_PER_MSEC; |
| 90 | |||
| 90 | static int __init nmi_warning_debugfs(void) | 91 | static int __init nmi_warning_debugfs(void) |
| 91 | { | 92 | { |
| 92 | debugfs_create_u64("nmi_longest_ns", 0644, | 93 | debugfs_create_u64("nmi_longest_ns", 0644, |
| @@ -95,6 +96,20 @@ static int __init nmi_warning_debugfs(void) | |||
| 95 | } | 96 | } |
| 96 | fs_initcall(nmi_warning_debugfs); | 97 | fs_initcall(nmi_warning_debugfs); |
| 97 | 98 | ||
| 99 | static void nmi_max_handler(struct irq_work *w) | ||
| 100 | { | ||
| 101 | struct nmiaction *a = container_of(w, struct nmiaction, irq_work); | ||
| 102 | int remainder_ns, decimal_msecs; | ||
| 103 | u64 whole_msecs = ACCESS_ONCE(a->max_duration); | ||
| 104 | |||
| 105 | remainder_ns = do_div(whole_msecs, (1000 * 1000)); | ||
| 106 | decimal_msecs = remainder_ns / 1000; | ||
| 107 | |||
| 108 | printk_ratelimited(KERN_INFO | ||
| 109 | "INFO: NMI handler (%ps) took too long to run: %lld.%03d msecs\n", | ||
| 110 | a->handler, whole_msecs, decimal_msecs); | ||
| 111 | } | ||
| 112 | |||
| 98 | static int __kprobes nmi_handle(unsigned int type, struct pt_regs *regs, bool b2b) | 113 | static int __kprobes nmi_handle(unsigned int type, struct pt_regs *regs, bool b2b) |
| 99 | { | 114 | { |
| 100 | struct nmi_desc *desc = nmi_to_desc(type); | 115 | struct nmi_desc *desc = nmi_to_desc(type); |
| @@ -110,26 +125,20 @@ static int __kprobes nmi_handle(unsigned int type, struct pt_regs *regs, bool b2 | |||
| 110 | * to handle those situations. | 125 | * to handle those situations. |
| 111 | */ | 126 | */ |
| 112 | list_for_each_entry_rcu(a, &desc->head, list) { | 127 | list_for_each_entry_rcu(a, &desc->head, list) { |
| 113 | u64 before, delta, whole_msecs; | 128 | int thishandled; |
| 114 | int remainder_ns, decimal_msecs, thishandled; | 129 | u64 delta; |
| 115 | 130 | ||
| 116 | before = sched_clock(); | 131 | delta = sched_clock(); |
| 117 | thishandled = a->handler(type, regs); | 132 | thishandled = a->handler(type, regs); |
| 118 | handled += thishandled; | 133 | handled += thishandled; |
| 119 | delta = sched_clock() - before; | 134 | delta = sched_clock() - delta; |
| 120 | trace_nmi_handler(a->handler, (int)delta, thishandled); | 135 | trace_nmi_handler(a->handler, (int)delta, thishandled); |
| 121 | 136 | ||
| 122 | if (delta < nmi_longest_ns) | 137 | if (delta < nmi_longest_ns || delta < a->max_duration) |
| 123 | continue; | 138 | continue; |
| 124 | 139 | ||
| 125 | nmi_longest_ns = delta; | 140 | a->max_duration = delta; |
| 126 | whole_msecs = delta; | 141 | irq_work_queue(&a->irq_work); |
| 127 | remainder_ns = do_div(whole_msecs, (1000 * 1000)); | ||
| 128 | decimal_msecs = remainder_ns / 1000; | ||
| 129 | printk_ratelimited(KERN_INFO | ||
| 130 | "INFO: NMI handler (%ps) took too long to run: " | ||
| 131 | "%lld.%03d msecs\n", a->handler, whole_msecs, | ||
| 132 | decimal_msecs); | ||
| 133 | } | 142 | } |
| 134 | 143 | ||
| 135 | rcu_read_unlock(); | 144 | rcu_read_unlock(); |
| @@ -146,6 +155,8 @@ int __register_nmi_handler(unsigned int type, struct nmiaction *action) | |||
| 146 | if (!action->handler) | 155 | if (!action->handler) |
| 147 | return -EINVAL; | 156 | return -EINVAL; |
| 148 | 157 | ||
| 158 | init_irq_work(&action->irq_work, nmi_max_handler); | ||
| 159 | |||
| 149 | spin_lock_irqsave(&desc->lock, flags); | 160 | spin_lock_irqsave(&desc->lock, flags); |
| 150 | 161 | ||
| 151 | /* | 162 | /* |
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 3fb8d95ab8b5..4505e2a950d8 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
| @@ -298,10 +298,7 @@ void arch_cpu_idle_dead(void) | |||
| 298 | */ | 298 | */ |
| 299 | void arch_cpu_idle(void) | 299 | void arch_cpu_idle(void) |
| 300 | { | 300 | { |
| 301 | if (cpuidle_idle_call()) | 301 | x86_idle(); |
| 302 | x86_idle(); | ||
| 303 | else | ||
| 304 | local_irq_enable(); | ||
| 305 | } | 302 | } |
| 306 | 303 | ||
| 307 | /* | 304 | /* |
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index 0de43e98ce08..7bc86bbe7485 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c | |||
| @@ -314,6 +314,10 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) | |||
| 314 | */ | 314 | */ |
| 315 | arch_end_context_switch(next_p); | 315 | arch_end_context_switch(next_p); |
| 316 | 316 | ||
| 317 | this_cpu_write(kernel_stack, | ||
| 318 | (unsigned long)task_stack_page(next_p) + | ||
| 319 | THREAD_SIZE - KERNEL_STACK_OFFSET); | ||
| 320 | |||
| 317 | /* | 321 | /* |
| 318 | * Restore %gs if needed (which is common) | 322 | * Restore %gs if needed (which is common) |
| 319 | */ | 323 | */ |
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index 7461f50d5bb1..678c0ada3b3c 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c | |||
| @@ -184,14 +184,14 @@ unsigned long kernel_stack_pointer(struct pt_regs *regs) | |||
| 184 | { | 184 | { |
| 185 | unsigned long context = (unsigned long)regs & ~(THREAD_SIZE - 1); | 185 | unsigned long context = (unsigned long)regs & ~(THREAD_SIZE - 1); |
| 186 | unsigned long sp = (unsigned long)®s->sp; | 186 | unsigned long sp = (unsigned long)®s->sp; |
| 187 | struct thread_info *tinfo; | 187 | u32 *prev_esp; |
| 188 | 188 | ||
| 189 | if (context == (sp & ~(THREAD_SIZE - 1))) | 189 | if (context == (sp & ~(THREAD_SIZE - 1))) |
| 190 | return sp; | 190 | return sp; |
| 191 | 191 | ||
| 192 | tinfo = (struct thread_info *)context; | 192 | prev_esp = (u32 *)(context); |
| 193 | if (tinfo->previous_esp) | 193 | if (prev_esp) |
| 194 | return tinfo->previous_esp; | 194 | return (unsigned long)prev_esp; |
| 195 | 195 | ||
| 196 | return (unsigned long)regs; | 196 | return (unsigned long)regs; |
| 197 | } | 197 | } |
diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c index 7c6acd4b8995..ff898bbf579d 100644 --- a/arch/x86/kernel/quirks.c +++ b/arch/x86/kernel/quirks.c | |||
| @@ -529,7 +529,7 @@ static void quirk_amd_nb_node(struct pci_dev *dev) | |||
| 529 | return; | 529 | return; |
| 530 | 530 | ||
| 531 | pci_read_config_dword(nb_ht, 0x60, &val); | 531 | pci_read_config_dword(nb_ht, 0x60, &val); |
| 532 | node = val & 7; | 532 | node = pcibus_to_node(dev->bus) | (val & 7); |
| 533 | /* | 533 | /* |
| 534 | * Some hardware may return an invalid node ID, | 534 | * Some hardware may return an invalid node ID, |
| 535 | * so check it first: | 535 | * so check it first: |
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index c752cb43e52f..654b46574b91 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c | |||
| @@ -464,9 +464,12 @@ void __attribute__((weak)) mach_reboot_fixups(void) | |||
| 464 | * 2) If still alive, write to the keyboard controller | 464 | * 2) If still alive, write to the keyboard controller |
| 465 | * 3) If still alive, write to the ACPI reboot register again | 465 | * 3) If still alive, write to the ACPI reboot register again |
| 466 | * 4) If still alive, write to the keyboard controller again | 466 | * 4) If still alive, write to the keyboard controller again |
| 467 | * 5) If still alive, call the EFI runtime service to reboot | ||
| 468 | * 6) If still alive, write to the PCI IO port 0xCF9 to reboot | ||
| 469 | * 7) If still alive, inform BIOS to do a proper reboot | ||
| 467 | * | 470 | * |
| 468 | * If the machine is still alive at this stage, it gives up. We default to | 471 | * If the machine is still alive at this stage, it gives up. We default to |
| 469 | * following the same pattern, except that if we're still alive after (4) we'll | 472 | * following the same pattern, except that if we're still alive after (7) we'll |
| 470 | * try to force a triple fault and then cycle between hitting the keyboard | 473 | * try to force a triple fault and then cycle between hitting the keyboard |
| 471 | * controller and doing that | 474 | * controller and doing that |
| 472 | */ | 475 | */ |
| @@ -502,7 +505,7 @@ static void native_machine_emergency_restart(void) | |||
| 502 | attempt = 1; | 505 | attempt = 1; |
| 503 | reboot_type = BOOT_ACPI; | 506 | reboot_type = BOOT_ACPI; |
| 504 | } else { | 507 | } else { |
| 505 | reboot_type = BOOT_TRIPLE; | 508 | reboot_type = BOOT_EFI; |
| 506 | } | 509 | } |
| 507 | break; | 510 | break; |
| 508 | 511 | ||
| @@ -510,13 +513,15 @@ static void native_machine_emergency_restart(void) | |||
| 510 | load_idt(&no_idt); | 513 | load_idt(&no_idt); |
| 511 | __asm__ __volatile__("int3"); | 514 | __asm__ __volatile__("int3"); |
| 512 | 515 | ||
| 516 | /* We're probably dead after this, but... */ | ||
| 513 | reboot_type = BOOT_KBD; | 517 | reboot_type = BOOT_KBD; |
| 514 | break; | 518 | break; |
| 515 | 519 | ||
| 516 | case BOOT_BIOS: | 520 | case BOOT_BIOS: |
| 517 | machine_real_restart(MRR_BIOS); | 521 | machine_real_restart(MRR_BIOS); |
| 518 | 522 | ||
| 519 | reboot_type = BOOT_KBD; | 523 | /* We're probably dead after this, but... */ |
| 524 | reboot_type = BOOT_TRIPLE; | ||
| 520 | break; | 525 | break; |
| 521 | 526 | ||
| 522 | case BOOT_ACPI: | 527 | case BOOT_ACPI: |
| @@ -530,7 +535,7 @@ static void native_machine_emergency_restart(void) | |||
| 530 | EFI_RESET_WARM : | 535 | EFI_RESET_WARM : |
| 531 | EFI_RESET_COLD, | 536 | EFI_RESET_COLD, |
| 532 | EFI_SUCCESS, 0, NULL); | 537 | EFI_SUCCESS, 0, NULL); |
| 533 | reboot_type = BOOT_KBD; | 538 | reboot_type = BOOT_CF9_COND; |
| 534 | break; | 539 | break; |
| 535 | 540 | ||
| 536 | case BOOT_CF9: | 541 | case BOOT_CF9: |
| @@ -548,7 +553,7 @@ static void native_machine_emergency_restart(void) | |||
| 548 | outb(cf9|reboot_code, 0xcf9); | 553 | outb(cf9|reboot_code, 0xcf9); |
| 549 | udelay(50); | 554 | udelay(50); |
| 550 | } | 555 | } |
| 551 | reboot_type = BOOT_KBD; | 556 | reboot_type = BOOT_BIOS; |
| 552 | break; | 557 | break; |
| 553 | } | 558 | } |
| 554 | } | 559 | } |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 06853e670354..fa511acff7e6 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
| @@ -926,11 +926,11 @@ void __init setup_arch(char **cmdline_p) | |||
| 926 | #ifdef CONFIG_EFI | 926 | #ifdef CONFIG_EFI |
| 927 | if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature, | 927 | if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature, |
| 928 | "EL32", 4)) { | 928 | "EL32", 4)) { |
| 929 | set_bit(EFI_BOOT, &x86_efi_facility); | 929 | set_bit(EFI_BOOT, &efi.flags); |
| 930 | } else if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature, | 930 | } else if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature, |
| 931 | "EL64", 4)) { | 931 | "EL64", 4)) { |
| 932 | set_bit(EFI_BOOT, &x86_efi_facility); | 932 | set_bit(EFI_BOOT, &efi.flags); |
| 933 | set_bit(EFI_64BIT, &x86_efi_facility); | 933 | set_bit(EFI_64BIT, &efi.flags); |
| 934 | } | 934 | } |
| 935 | 935 | ||
| 936 | if (efi_enabled(EFI_BOOT)) | 936 | if (efi_enabled(EFI_BOOT)) |
| @@ -1239,14 +1239,8 @@ void __init setup_arch(char **cmdline_p) | |||
| 1239 | register_refined_jiffies(CLOCK_TICK_RATE); | 1239 | register_refined_jiffies(CLOCK_TICK_RATE); |
| 1240 | 1240 | ||
| 1241 | #ifdef CONFIG_EFI | 1241 | #ifdef CONFIG_EFI |
| 1242 | /* Once setup is done above, unmap the EFI memory map on | 1242 | if (efi_enabled(EFI_BOOT)) |
| 1243 | * mismatched firmware/kernel archtectures since there is no | 1243 | efi_apply_memmap_quirks(); |
| 1244 | * support for runtime services. | ||
| 1245 | */ | ||
| 1246 | if (efi_enabled(EFI_BOOT) && !efi_is_native()) { | ||
| 1247 | pr_info("efi: Setup done, disabling due to 32/64-bit mismatch\n"); | ||
| 1248 | efi_unmap_memmap(); | ||
| 1249 | } | ||
| 1250 | #endif | 1244 | #endif |
| 1251 | } | 1245 | } |
| 1252 | 1246 | ||
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index a32da804252e..34826934d4a7 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
| @@ -122,8 +122,9 @@ static void smp_callin(void) | |||
| 122 | * Since CPU0 is not wakened up by INIT, it doesn't wait for the IPI. | 122 | * Since CPU0 is not wakened up by INIT, it doesn't wait for the IPI. |
| 123 | */ | 123 | */ |
| 124 | cpuid = smp_processor_id(); | 124 | cpuid = smp_processor_id(); |
| 125 | if (apic->wait_for_init_deassert && cpuid != 0) | 125 | if (apic->wait_for_init_deassert && cpuid) |
| 126 | apic->wait_for_init_deassert(&init_deasserted); | 126 | while (!atomic_read(&init_deasserted)) |
| 127 | cpu_relax(); | ||
| 127 | 128 | ||
| 128 | /* | 129 | /* |
| 129 | * (This works even if the APIC is not enabled.) | 130 | * (This works even if the APIC is not enabled.) |
| @@ -701,11 +702,15 @@ wakeup_cpu_via_init_nmi(int cpu, unsigned long start_ip, int apicid, | |||
| 701 | int id; | 702 | int id; |
| 702 | int boot_error; | 703 | int boot_error; |
| 703 | 704 | ||
| 705 | preempt_disable(); | ||
| 706 | |||
| 704 | /* | 707 | /* |
| 705 | * Wake up AP by INIT, INIT, STARTUP sequence. | 708 | * Wake up AP by INIT, INIT, STARTUP sequence. |
| 706 | */ | 709 | */ |
| 707 | if (cpu) | 710 | if (cpu) { |
| 708 | return wakeup_secondary_cpu_via_init(apicid, start_ip); | 711 | boot_error = wakeup_secondary_cpu_via_init(apicid, start_ip); |
| 712 | goto out; | ||
| 713 | } | ||
| 709 | 714 | ||
| 710 | /* | 715 | /* |
| 711 | * Wake up BSP by nmi. | 716 | * Wake up BSP by nmi. |
| @@ -725,6 +730,9 @@ wakeup_cpu_via_init_nmi(int cpu, unsigned long start_ip, int apicid, | |||
| 725 | boot_error = wakeup_secondary_cpu_via_nmi(id, start_ip); | 730 | boot_error = wakeup_secondary_cpu_via_nmi(id, start_ip); |
| 726 | } | 731 | } |
| 727 | 732 | ||
| 733 | out: | ||
| 734 | preempt_enable(); | ||
| 735 | |||
| 728 | return boot_error; | 736 | return boot_error; |
| 729 | } | 737 | } |
| 730 | 738 | ||
| @@ -758,10 +766,10 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle) | |||
| 758 | #else | 766 | #else |
| 759 | clear_tsk_thread_flag(idle, TIF_FORK); | 767 | clear_tsk_thread_flag(idle, TIF_FORK); |
| 760 | initial_gs = per_cpu_offset(cpu); | 768 | initial_gs = per_cpu_offset(cpu); |
| 769 | #endif | ||
| 761 | per_cpu(kernel_stack, cpu) = | 770 | per_cpu(kernel_stack, cpu) = |
| 762 | (unsigned long)task_stack_page(idle) - | 771 | (unsigned long)task_stack_page(idle) - |
| 763 | KERNEL_STACK_OFFSET + THREAD_SIZE; | 772 | KERNEL_STACK_OFFSET + THREAD_SIZE; |
| 764 | #endif | ||
| 765 | early_gdt_descr.address = (unsigned long)get_cpu_gdt_table(cpu); | 773 | early_gdt_descr.address = (unsigned long)get_cpu_gdt_table(cpu); |
| 766 | initial_code = (unsigned long)start_secondary; | 774 | initial_code = (unsigned long)start_secondary; |
| 767 | stack_start = idle->thread.sp; | 775 | stack_start = idle->thread.sp; |
| @@ -1379,7 +1387,7 @@ static inline void mwait_play_dead(void) | |||
| 1379 | 1387 | ||
| 1380 | if (!this_cpu_has(X86_FEATURE_MWAIT)) | 1388 | if (!this_cpu_has(X86_FEATURE_MWAIT)) |
| 1381 | return; | 1389 | return; |
| 1382 | if (!this_cpu_has(X86_FEATURE_CLFLSH)) | 1390 | if (!this_cpu_has(X86_FEATURE_CLFLUSH)) |
| 1383 | return; | 1391 | return; |
| 1384 | if (__this_cpu_read(cpu_info.cpuid_level) < CPUID_MWAIT_LEAF) | 1392 | if (__this_cpu_read(cpu_info.cpuid_level) < CPUID_MWAIT_LEAF) |
| 1385 | return; | 1393 | return; |
diff --git a/arch/x86/kernel/time.c b/arch/x86/kernel/time.c index 24d3c91e9812..bf7ef5ce29df 100644 --- a/arch/x86/kernel/time.c +++ b/arch/x86/kernel/time.c | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | #include <asm/time.h> | 23 | #include <asm/time.h> |
| 24 | 24 | ||
| 25 | #ifdef CONFIG_X86_64 | 25 | #ifdef CONFIG_X86_64 |
| 26 | DEFINE_VVAR(volatile unsigned long, jiffies) = INITIAL_JIFFIES; | 26 | __visible DEFINE_VVAR(volatile unsigned long, jiffies) = INITIAL_JIFFIES; |
| 27 | #endif | 27 | #endif |
| 28 | 28 | ||
| 29 | unsigned long profile_pc(struct pt_regs *regs) | 29 | unsigned long profile_pc(struct pt_regs *regs) |
| @@ -62,7 +62,7 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id) | |||
| 62 | 62 | ||
| 63 | static struct irqaction irq0 = { | 63 | static struct irqaction irq0 = { |
| 64 | .handler = timer_interrupt, | 64 | .handler = timer_interrupt, |
| 65 | .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER, | 65 | .flags = IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER, |
| 66 | .name = "timer" | 66 | .name = "timer" |
| 67 | }; | 67 | }; |
| 68 | 68 | ||
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index c6976257eff5..e5503d8aec1d 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c | |||
| @@ -263,7 +263,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, | |||
| 263 | F(TSC) | F(MSR) | F(PAE) | F(MCE) | | 263 | F(TSC) | F(MSR) | F(PAE) | F(MCE) | |
| 264 | F(CX8) | F(APIC) | 0 /* Reserved */ | F(SEP) | | 264 | F(CX8) | F(APIC) | 0 /* Reserved */ | F(SEP) | |
| 265 | F(MTRR) | F(PGE) | F(MCA) | F(CMOV) | | 265 | F(MTRR) | F(PGE) | F(MCA) | F(CMOV) | |
| 266 | F(PAT) | F(PSE36) | 0 /* PSN */ | F(CLFLSH) | | 266 | F(PAT) | F(PSE36) | 0 /* PSN */ | F(CLFLUSH) | |
| 267 | 0 /* Reserved, DS, ACPI */ | F(MMX) | | 267 | 0 /* Reserved, DS, ACPI */ | F(MMX) | |
| 268 | F(FXSR) | F(XMM) | F(XMM2) | F(SELFSNOOP) | | 268 | F(FXSR) | F(XMM) | F(XMM2) | F(SELFSNOOP) | |
| 269 | 0 /* HTT, TM, Reserved, PBE */; | 269 | 0 /* HTT, TM, Reserved, PBE */; |
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index e50425d0f5f7..9b531351a587 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
| @@ -2672,6 +2672,7 @@ static int __direct_map(struct kvm_vcpu *vcpu, gpa_t v, int write, | |||
| 2672 | break; | 2672 | break; |
| 2673 | } | 2673 | } |
| 2674 | 2674 | ||
| 2675 | drop_large_spte(vcpu, iterator.sptep); | ||
| 2675 | if (!is_shadow_present_pte(*iterator.sptep)) { | 2676 | if (!is_shadow_present_pte(*iterator.sptep)) { |
| 2676 | u64 base_addr = iterator.addr; | 2677 | u64 base_addr = iterator.addr; |
| 2677 | 2678 | ||
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index e81df8fce027..2de1bc09a8d4 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
| @@ -3002,10 +3002,8 @@ static int cr8_write_interception(struct vcpu_svm *svm) | |||
| 3002 | u8 cr8_prev = kvm_get_cr8(&svm->vcpu); | 3002 | u8 cr8_prev = kvm_get_cr8(&svm->vcpu); |
| 3003 | /* instruction emulation calls kvm_set_cr8() */ | 3003 | /* instruction emulation calls kvm_set_cr8() */ |
| 3004 | r = cr_interception(svm); | 3004 | r = cr_interception(svm); |
| 3005 | if (irqchip_in_kernel(svm->vcpu.kvm)) { | 3005 | if (irqchip_in_kernel(svm->vcpu.kvm)) |
| 3006 | clr_cr_intercept(svm, INTERCEPT_CR8_WRITE); | ||
| 3007 | return r; | 3006 | return r; |
| 3008 | } | ||
| 3009 | if (cr8_prev <= kvm_get_cr8(&svm->vcpu)) | 3007 | if (cr8_prev <= kvm_get_cr8(&svm->vcpu)) |
| 3010 | return r; | 3008 | return r; |
| 3011 | kvm_run->exit_reason = KVM_EXIT_SET_TPR; | 3009 | kvm_run->exit_reason = KVM_EXIT_SET_TPR; |
| @@ -3567,6 +3565,8 @@ static void update_cr8_intercept(struct kvm_vcpu *vcpu, int tpr, int irr) | |||
| 3567 | if (is_guest_mode(vcpu) && (vcpu->arch.hflags & HF_VINTR_MASK)) | 3565 | if (is_guest_mode(vcpu) && (vcpu->arch.hflags & HF_VINTR_MASK)) |
| 3568 | return; | 3566 | return; |
| 3569 | 3567 | ||
| 3568 | clr_cr_intercept(svm, INTERCEPT_CR8_WRITE); | ||
| 3569 | |||
| 3570 | if (irr == -1) | 3570 | if (irr == -1) |
| 3571 | return; | 3571 | return; |
| 3572 | 3572 | ||
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index a06f101ef64b..392752834751 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
| @@ -6688,7 +6688,7 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu) | |||
| 6688 | else if (is_page_fault(intr_info)) | 6688 | else if (is_page_fault(intr_info)) |
| 6689 | return enable_ept; | 6689 | return enable_ept; |
| 6690 | else if (is_no_device(intr_info) && | 6690 | else if (is_no_device(intr_info) && |
| 6691 | !(nested_read_cr0(vmcs12) & X86_CR0_TS)) | 6691 | !(vmcs12->guest_cr0 & X86_CR0_TS)) |
| 6692 | return 0; | 6692 | return 0; |
| 6693 | return vmcs12->exception_bitmap & | 6693 | return vmcs12->exception_bitmap & |
| 6694 | (1u << (intr_info & INTR_INFO_VECTOR_MASK)); | 6694 | (1u << (intr_info & INTR_INFO_VECTOR_MASK)); |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 39c28f09dfd5..2b8578432d5b 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
| @@ -6186,7 +6186,7 @@ static int complete_emulated_mmio(struct kvm_vcpu *vcpu) | |||
| 6186 | frag->len -= len; | 6186 | frag->len -= len; |
| 6187 | } | 6187 | } |
| 6188 | 6188 | ||
| 6189 | if (vcpu->mmio_cur_fragment == vcpu->mmio_nr_fragments) { | 6189 | if (vcpu->mmio_cur_fragment >= vcpu->mmio_nr_fragments) { |
| 6190 | vcpu->mmio_needed = 0; | 6190 | vcpu->mmio_needed = 0; |
| 6191 | 6191 | ||
| 6192 | /* FIXME: return into emulator if single-stepping. */ | 6192 | /* FIXME: return into emulator if single-stepping. */ |
diff --git a/arch/x86/lib/hash.c b/arch/x86/lib/hash.c index 3056702e81fb..ff4fa51a5b1f 100644 --- a/arch/x86/lib/hash.c +++ b/arch/x86/lib/hash.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | */ | 32 | */ |
| 33 | 33 | ||
| 34 | #include <linux/hash.h> | 34 | #include <linux/hash.h> |
| 35 | #include <linux/init.h> | ||
| 35 | 36 | ||
| 36 | #include <asm/processor.h> | 37 | #include <asm/processor.h> |
| 37 | #include <asm/cpufeature.h> | 38 | #include <asm/cpufeature.h> |
| @@ -39,7 +40,11 @@ | |||
| 39 | 40 | ||
| 40 | static inline u32 crc32_u32(u32 crc, u32 val) | 41 | static inline u32 crc32_u32(u32 crc, u32 val) |
| 41 | { | 42 | { |
| 43 | #ifdef CONFIG_AS_CRC32 | ||
| 42 | asm ("crc32l %1,%0\n" : "+r" (crc) : "rm" (val)); | 44 | asm ("crc32l %1,%0\n" : "+r" (crc) : "rm" (val)); |
| 45 | #else | ||
| 46 | asm (".byte 0xf2, 0x0f, 0x38, 0xf1, 0xc1" : "+a" (crc) : "c" (val)); | ||
| 47 | #endif | ||
| 43 | return crc; | 48 | return crc; |
| 44 | } | 49 | } |
| 45 | 50 | ||
| @@ -49,19 +54,18 @@ static u32 intel_crc4_2_hash(const void *data, u32 len, u32 seed) | |||
| 49 | u32 i, tmp = 0; | 54 | u32 i, tmp = 0; |
| 50 | 55 | ||
| 51 | for (i = 0; i < len / 4; i++) | 56 | for (i = 0; i < len / 4; i++) |
| 52 | seed = crc32_u32(*p32++, seed); | 57 | seed = crc32_u32(seed, *p32++); |
| 53 | 58 | ||
| 54 | switch (3 - (len & 0x03)) { | 59 | switch (len & 3) { |
| 55 | case 0: | 60 | case 3: |
| 56 | tmp |= *((const u8 *) p32 + 2) << 16; | 61 | tmp |= *((const u8 *) p32 + 2) << 16; |
| 57 | /* fallthrough */ | 62 | /* fallthrough */ |
| 58 | case 1: | 63 | case 2: |
| 59 | tmp |= *((const u8 *) p32 + 1) << 8; | 64 | tmp |= *((const u8 *) p32 + 1) << 8; |
| 60 | /* fallthrough */ | 65 | /* fallthrough */ |
| 61 | case 2: | 66 | case 1: |
| 62 | tmp |= *((const u8 *) p32); | 67 | tmp |= *((const u8 *) p32); |
| 63 | seed = crc32_u32(tmp, seed); | 68 | seed = crc32_u32(seed, tmp); |
| 64 | default: | ||
| 65 | break; | 69 | break; |
| 66 | } | 70 | } |
| 67 | 71 | ||
| @@ -74,12 +78,12 @@ static u32 intel_crc4_2_hash2(const u32 *data, u32 len, u32 seed) | |||
| 74 | u32 i; | 78 | u32 i; |
| 75 | 79 | ||
| 76 | for (i = 0; i < len; i++) | 80 | for (i = 0; i < len; i++) |
| 77 | seed = crc32_u32(*p32++, seed); | 81 | seed = crc32_u32(seed, *p32++); |
| 78 | 82 | ||
| 79 | return seed; | 83 | return seed; |
| 80 | } | 84 | } |
| 81 | 85 | ||
| 82 | void setup_arch_fast_hash(struct fast_hash_ops *ops) | 86 | void __init setup_arch_fast_hash(struct fast_hash_ops *ops) |
| 83 | { | 87 | { |
| 84 | if (cpu_has_xmm4_2) { | 88 | if (cpu_has_xmm4_2) { |
| 85 | ops->hash = intel_crc4_2_hash; | 89 | ops->hash = intel_crc4_2_hash; |
diff --git a/arch/x86/lib/memcpy_32.c b/arch/x86/lib/memcpy_32.c index e78761d6b7f8..a404b4b75533 100644 --- a/arch/x86/lib/memcpy_32.c +++ b/arch/x86/lib/memcpy_32.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #undef memcpy | 4 | #undef memcpy |
| 5 | #undef memset | 5 | #undef memset |
| 6 | 6 | ||
| 7 | void *memcpy(void *to, const void *from, size_t n) | 7 | __visible void *memcpy(void *to, const void *from, size_t n) |
| 8 | { | 8 | { |
| 9 | #ifdef CONFIG_X86_USE_3DNOW | 9 | #ifdef CONFIG_X86_USE_3DNOW |
| 10 | return __memcpy3d(to, from, n); | 10 | return __memcpy3d(to, from, n); |
| @@ -14,13 +14,13 @@ void *memcpy(void *to, const void *from, size_t n) | |||
| 14 | } | 14 | } |
| 15 | EXPORT_SYMBOL(memcpy); | 15 | EXPORT_SYMBOL(memcpy); |
| 16 | 16 | ||
| 17 | void *memset(void *s, int c, size_t count) | 17 | __visible void *memset(void *s, int c, size_t count) |
| 18 | { | 18 | { |
| 19 | return __memset(s, c, count); | 19 | return __memset(s, c, count); |
| 20 | } | 20 | } |
| 21 | EXPORT_SYMBOL(memset); | 21 | EXPORT_SYMBOL(memset); |
| 22 | 22 | ||
| 23 | void *memmove(void *dest, const void *src, size_t n) | 23 | __visible void *memmove(void *dest, const void *src, size_t n) |
| 24 | { | 24 | { |
| 25 | int d0,d1,d2,d3,d4,d5; | 25 | int d0,d1,d2,d3,d4,d5; |
| 26 | char *ret = dest; | 26 | char *ret = dest; |
diff --git a/arch/x86/lib/msr.c b/arch/x86/lib/msr.c index 8f8eebdca7d4..db9db446b71a 100644 --- a/arch/x86/lib/msr.c +++ b/arch/x86/lib/msr.c | |||
| @@ -8,7 +8,7 @@ struct msr *msrs_alloc(void) | |||
| 8 | 8 | ||
| 9 | msrs = alloc_percpu(struct msr); | 9 | msrs = alloc_percpu(struct msr); |
| 10 | if (!msrs) { | 10 | if (!msrs) { |
| 11 | pr_warning("%s: error allocating msrs\n", __func__); | 11 | pr_warn("%s: error allocating msrs\n", __func__); |
| 12 | return NULL; | 12 | return NULL; |
| 13 | } | 13 | } |
| 14 | 14 | ||
| @@ -21,3 +21,90 @@ void msrs_free(struct msr *msrs) | |||
| 21 | free_percpu(msrs); | 21 | free_percpu(msrs); |
| 22 | } | 22 | } |
| 23 | EXPORT_SYMBOL(msrs_free); | 23 | EXPORT_SYMBOL(msrs_free); |
| 24 | |||
| 25 | /** | ||
| 26 | * Read an MSR with error handling | ||
| 27 | * | ||
| 28 | * @msr: MSR to read | ||
| 29 | * @m: value to read into | ||
| 30 | * | ||
| 31 | * It returns read data only on success, otherwise it doesn't change the output | ||
| 32 | * argument @m. | ||
| 33 | * | ||
| 34 | */ | ||
| 35 | int msr_read(u32 msr, struct msr *m) | ||
| 36 | { | ||
| 37 | int err; | ||
| 38 | u64 val; | ||
| 39 | |||
| 40 | err = rdmsrl_safe(msr, &val); | ||
| 41 | if (!err) | ||
| 42 | m->q = val; | ||
| 43 | |||
| 44 | return err; | ||
| 45 | } | ||
| 46 | |||
| 47 | /** | ||
| 48 | * Write an MSR with error handling | ||
| 49 | * | ||
| 50 | * @msr: MSR to write | ||
| 51 | * @m: value to write | ||
| 52 | */ | ||
| 53 | int msr_write(u32 msr, struct msr *m) | ||
| 54 | { | ||
| 55 | return wrmsrl_safe(msr, m->q); | ||
| 56 | } | ||
| 57 | |||
| 58 | static inline int __flip_bit(u32 msr, u8 bit, bool set) | ||
| 59 | { | ||
| 60 | struct msr m, m1; | ||
| 61 | int err = -EINVAL; | ||
| 62 | |||
| 63 | if (bit > 63) | ||
| 64 | return err; | ||
| 65 | |||
| 66 | err = msr_read(msr, &m); | ||
| 67 | if (err) | ||
| 68 | return err; | ||
| 69 | |||
| 70 | m1 = m; | ||
| 71 | if (set) | ||
| 72 | m1.q |= BIT_64(bit); | ||
| 73 | else | ||
| 74 | m1.q &= ~BIT_64(bit); | ||
| 75 | |||
| 76 | if (m1.q == m.q) | ||
| 77 | return 0; | ||
| 78 | |||
| 79 | err = msr_write(msr, &m); | ||
| 80 | if (err) | ||
| 81 | return err; | ||
| 82 | |||
| 83 | return 1; | ||
| 84 | } | ||
| 85 | |||
| 86 | /** | ||
| 87 | * Set @bit in a MSR @msr. | ||
| 88 | * | ||
| 89 | * Retval: | ||
| 90 | * < 0: An error was encountered. | ||
| 91 | * = 0: Bit was already set. | ||
| 92 | * > 0: Hardware accepted the MSR write. | ||
| 93 | */ | ||
| 94 | int msr_set_bit(u32 msr, u8 bit) | ||
| 95 | { | ||
| 96 | return __flip_bit(msr, bit, true); | ||
| 97 | } | ||
| 98 | |||
| 99 | /** | ||
| 100 | * Clear @bit in a MSR @msr. | ||
| 101 | * | ||
| 102 | * Retval: | ||
| 103 | * < 0: An error was encountered. | ||
| 104 | * = 0: Bit was already cleared. | ||
| 105 | * > 0: Hardware accepted the MSR write. | ||
| 106 | */ | ||
| 107 | int msr_clear_bit(u32 msr, u8 bit) | ||
| 108 | { | ||
| 109 | return __flip_bit(msr, bit, false); | ||
| 110 | } | ||
diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c index 0002a3a33081..20621d753d5f 100644 --- a/arch/x86/mm/dump_pagetables.c +++ b/arch/x86/mm/dump_pagetables.c | |||
| @@ -30,6 +30,7 @@ struct pg_state { | |||
| 30 | unsigned long start_address; | 30 | unsigned long start_address; |
| 31 | unsigned long current_address; | 31 | unsigned long current_address; |
| 32 | const struct addr_marker *marker; | 32 | const struct addr_marker *marker; |
| 33 | bool to_dmesg; | ||
| 33 | }; | 34 | }; |
| 34 | 35 | ||
| 35 | struct addr_marker { | 36 | struct addr_marker { |
| @@ -88,10 +89,28 @@ static struct addr_marker address_markers[] = { | |||
| 88 | #define PUD_LEVEL_MULT (PTRS_PER_PMD * PMD_LEVEL_MULT) | 89 | #define PUD_LEVEL_MULT (PTRS_PER_PMD * PMD_LEVEL_MULT) |
| 89 | #define PGD_LEVEL_MULT (PTRS_PER_PUD * PUD_LEVEL_MULT) | 90 | #define PGD_LEVEL_MULT (PTRS_PER_PUD * PUD_LEVEL_MULT) |
| 90 | 91 | ||
| 92 | #define pt_dump_seq_printf(m, to_dmesg, fmt, args...) \ | ||
| 93 | ({ \ | ||
| 94 | if (to_dmesg) \ | ||
| 95 | printk(KERN_INFO fmt, ##args); \ | ||
| 96 | else \ | ||
| 97 | if (m) \ | ||
| 98 | seq_printf(m, fmt, ##args); \ | ||
| 99 | }) | ||
| 100 | |||
| 101 | #define pt_dump_cont_printf(m, to_dmesg, fmt, args...) \ | ||
| 102 | ({ \ | ||
| 103 | if (to_dmesg) \ | ||
| 104 | printk(KERN_CONT fmt, ##args); \ | ||
| 105 | else \ | ||
| 106 | if (m) \ | ||
| 107 | seq_printf(m, fmt, ##args); \ | ||
| 108 | }) | ||
| 109 | |||
| 91 | /* | 110 | /* |
| 92 | * Print a readable form of a pgprot_t to the seq_file | 111 | * Print a readable form of a pgprot_t to the seq_file |
| 93 | */ | 112 | */ |
| 94 | static void printk_prot(struct seq_file *m, pgprot_t prot, int level) | 113 | static void printk_prot(struct seq_file *m, pgprot_t prot, int level, bool dmsg) |
| 95 | { | 114 | { |
| 96 | pgprotval_t pr = pgprot_val(prot); | 115 | pgprotval_t pr = pgprot_val(prot); |
| 97 | static const char * const level_name[] = | 116 | static const char * const level_name[] = |
| @@ -99,47 +118,47 @@ static void printk_prot(struct seq_file *m, pgprot_t prot, int level) | |||
| 99 | 118 | ||
| 100 | if (!pgprot_val(prot)) { | 119 | if (!pgprot_val(prot)) { |
| 101 | /* Not present */ | 120 | /* Not present */ |
| 102 | seq_printf(m, " "); | 121 | pt_dump_cont_printf(m, dmsg, " "); |
| 103 | } else { | 122 | } else { |
| 104 | if (pr & _PAGE_USER) | 123 | if (pr & _PAGE_USER) |
| 105 | seq_printf(m, "USR "); | 124 | pt_dump_cont_printf(m, dmsg, "USR "); |
| 106 | else | 125 | else |
| 107 | seq_printf(m, " "); | 126 | pt_dump_cont_printf(m, dmsg, " "); |
| 108 | if (pr & _PAGE_RW) | 127 | if (pr & _PAGE_RW) |
| 109 | seq_printf(m, "RW "); | 128 | pt_dump_cont_printf(m, dmsg, "RW "); |
| 110 | else | 129 | else |
| 111 | seq_printf(m, "ro "); | 130 | pt_dump_cont_printf(m, dmsg, "ro "); |
| 112 | if (pr & _PAGE_PWT) | 131 | if (pr & _PAGE_PWT) |
| 113 | seq_printf(m, "PWT "); | 132 | pt_dump_cont_printf(m, dmsg, "PWT "); |
| 114 | else | 133 | else |
| 115 | seq_printf(m, " "); | 134 | pt_dump_cont_printf(m, dmsg, " "); |
| 116 | if (pr & _PAGE_PCD) | 135 | if (pr & _PAGE_PCD) |
| 117 | seq_printf(m, "PCD "); | 136 | pt_dump_cont_printf(m, dmsg, "PCD "); |
| 118 | else | 137 | else |
| 119 | seq_printf(m, " "); | 138 | pt_dump_cont_printf(m, dmsg, " "); |
| 120 | 139 | ||
| 121 | /* Bit 9 has a different meaning on level 3 vs 4 */ | 140 | /* Bit 9 has a different meaning on level 3 vs 4 */ |
| 122 | if (level <= 3) { | 141 | if (level <= 3) { |
| 123 | if (pr & _PAGE_PSE) | 142 | if (pr & _PAGE_PSE) |
| 124 | seq_printf(m, "PSE "); | 143 | pt_dump_cont_printf(m, dmsg, "PSE "); |
| 125 | else | 144 | else |
| 126 | seq_printf(m, " "); | 145 | pt_dump_cont_printf(m, dmsg, " "); |
| 127 | } else { | 146 | } else { |
| 128 | if (pr & _PAGE_PAT) | 147 | if (pr & _PAGE_PAT) |
| 129 | seq_printf(m, "pat "); | 148 | pt_dump_cont_printf(m, dmsg, "pat "); |
| 130 | else | 149 | else |
| 131 | seq_printf(m, " "); | 150 | pt_dump_cont_printf(m, dmsg, " "); |
| 132 | } | 151 | } |
| 133 | if (pr & _PAGE_GLOBAL) | 152 | if (pr & _PAGE_GLOBAL) |
| 134 | seq_printf(m, "GLB "); | 153 | pt_dump_cont_printf(m, dmsg, "GLB "); |
| 135 | else | 154 | else |
| 136 | seq_printf(m, " "); | 155 | pt_dump_cont_printf(m, dmsg, " "); |
| 137 | if (pr & _PAGE_NX) | 156 | if (pr & _PAGE_NX) |
| 138 | seq_printf(m, "NX "); | 157 | pt_dump_cont_printf(m, dmsg, "NX "); |
| 139 | else | 158 | else |
| 140 | seq_printf(m, "x "); | 159 | pt_dump_cont_printf(m, dmsg, "x "); |
| 141 | } | 160 | } |
| 142 | seq_printf(m, "%s\n", level_name[level]); | 161 | pt_dump_cont_printf(m, dmsg, "%s\n", level_name[level]); |
| 143 | } | 162 | } |
| 144 | 163 | ||
| 145 | /* | 164 | /* |
| @@ -178,7 +197,8 @@ static void note_page(struct seq_file *m, struct pg_state *st, | |||
| 178 | st->current_prot = new_prot; | 197 | st->current_prot = new_prot; |
| 179 | st->level = level; | 198 | st->level = level; |
| 180 | st->marker = address_markers; | 199 | st->marker = address_markers; |
| 181 | seq_printf(m, "---[ %s ]---\n", st->marker->name); | 200 | pt_dump_seq_printf(m, st->to_dmesg, "---[ %s ]---\n", |
| 201 | st->marker->name); | ||
| 182 | } else if (prot != cur || level != st->level || | 202 | } else if (prot != cur || level != st->level || |
| 183 | st->current_address >= st->marker[1].start_address) { | 203 | st->current_address >= st->marker[1].start_address) { |
| 184 | const char *unit = units; | 204 | const char *unit = units; |
| @@ -188,17 +208,17 @@ static void note_page(struct seq_file *m, struct pg_state *st, | |||
| 188 | /* | 208 | /* |
| 189 | * Now print the actual finished series | 209 | * Now print the actual finished series |
| 190 | */ | 210 | */ |
| 191 | seq_printf(m, "0x%0*lx-0x%0*lx ", | 211 | pt_dump_seq_printf(m, st->to_dmesg, "0x%0*lx-0x%0*lx ", |
| 192 | width, st->start_address, | 212 | width, st->start_address, |
| 193 | width, st->current_address); | 213 | width, st->current_address); |
| 194 | 214 | ||
| 195 | delta = (st->current_address - st->start_address) >> 10; | 215 | delta = (st->current_address - st->start_address) >> 10; |
| 196 | while (!(delta & 1023) && unit[1]) { | 216 | while (!(delta & 1023) && unit[1]) { |
| 197 | delta >>= 10; | 217 | delta >>= 10; |
| 198 | unit++; | 218 | unit++; |
| 199 | } | 219 | } |
| 200 | seq_printf(m, "%9lu%c ", delta, *unit); | 220 | pt_dump_cont_printf(m, st->to_dmesg, "%9lu%c ", delta, *unit); |
| 201 | printk_prot(m, st->current_prot, st->level); | 221 | printk_prot(m, st->current_prot, st->level, st->to_dmesg); |
| 202 | 222 | ||
| 203 | /* | 223 | /* |
| 204 | * We print markers for special areas of address space, | 224 | * We print markers for special areas of address space, |
| @@ -207,7 +227,8 @@ static void note_page(struct seq_file *m, struct pg_state *st, | |||
| 207 | */ | 227 | */ |
| 208 | if (st->current_address >= st->marker[1].start_address) { | 228 | if (st->current_address >= st->marker[1].start_address) { |
| 209 | st->marker++; | 229 | st->marker++; |
| 210 | seq_printf(m, "---[ %s ]---\n", st->marker->name); | 230 | pt_dump_seq_printf(m, st->to_dmesg, "---[ %s ]---\n", |
| 231 | st->marker->name); | ||
| 211 | } | 232 | } |
| 212 | 233 | ||
| 213 | st->start_address = st->current_address; | 234 | st->start_address = st->current_address; |
| @@ -296,7 +317,7 @@ static void walk_pud_level(struct seq_file *m, struct pg_state *st, pgd_t addr, | |||
| 296 | #define pgd_none(a) pud_none(__pud(pgd_val(a))) | 317 | #define pgd_none(a) pud_none(__pud(pgd_val(a))) |
| 297 | #endif | 318 | #endif |
| 298 | 319 | ||
| 299 | static void walk_pgd_level(struct seq_file *m) | 320 | void ptdump_walk_pgd_level(struct seq_file *m, pgd_t *pgd) |
| 300 | { | 321 | { |
| 301 | #ifdef CONFIG_X86_64 | 322 | #ifdef CONFIG_X86_64 |
| 302 | pgd_t *start = (pgd_t *) &init_level4_pgt; | 323 | pgd_t *start = (pgd_t *) &init_level4_pgt; |
| @@ -304,9 +325,12 @@ static void walk_pgd_level(struct seq_file *m) | |||
| 304 | pgd_t *start = swapper_pg_dir; | 325 | pgd_t *start = swapper_pg_dir; |
| 305 | #endif | 326 | #endif |
| 306 | int i; | 327 | int i; |
| 307 | struct pg_state st; | 328 | struct pg_state st = {}; |
| 308 | 329 | ||
| 309 | memset(&st, 0, sizeof(st)); | 330 | if (pgd) { |
| 331 | start = pgd; | ||
| 332 | st.to_dmesg = true; | ||
| 333 | } | ||
| 310 | 334 | ||
| 311 | for (i = 0; i < PTRS_PER_PGD; i++) { | 335 | for (i = 0; i < PTRS_PER_PGD; i++) { |
| 312 | st.current_address = normalize_addr(i * PGD_LEVEL_MULT); | 336 | st.current_address = normalize_addr(i * PGD_LEVEL_MULT); |
| @@ -331,7 +355,7 @@ static void walk_pgd_level(struct seq_file *m) | |||
| 331 | 355 | ||
| 332 | static int ptdump_show(struct seq_file *m, void *v) | 356 | static int ptdump_show(struct seq_file *m, void *v) |
| 333 | { | 357 | { |
| 334 | walk_pgd_level(m); | 358 | ptdump_walk_pgd_level(m, NULL); |
| 335 | return 0; | 359 | return 0; |
| 336 | } | 360 | } |
| 337 | 361 | ||
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 6dea040cc3a1..8e5722992677 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c | |||
| @@ -584,8 +584,13 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code, | |||
| 584 | 584 | ||
| 585 | if (error_code & PF_INSTR) { | 585 | if (error_code & PF_INSTR) { |
| 586 | unsigned int level; | 586 | unsigned int level; |
| 587 | pgd_t *pgd; | ||
| 588 | pte_t *pte; | ||
| 587 | 589 | ||
| 588 | pte_t *pte = lookup_address(address, &level); | 590 | pgd = __va(read_cr3() & PHYSICAL_PAGE_MASK); |
| 591 | pgd += pgd_index(address); | ||
| 592 | |||
| 593 | pte = lookup_address_in_pgd(pgd, address, &level); | ||
| 589 | 594 | ||
| 590 | if (pte && pte_present(*pte) && !pte_exec(*pte)) | 595 | if (pte && pte_present(*pte) && !pte_exec(*pte)) |
| 591 | printk(nx_warning, from_kuid(&init_user_ns, current_uid())); | 596 | printk(nx_warning, from_kuid(&init_user_ns, current_uid())); |
| @@ -1020,13 +1025,17 @@ static inline bool smap_violation(int error_code, struct pt_regs *regs) | |||
| 1020 | * This routine handles page faults. It determines the address, | 1025 | * This routine handles page faults. It determines the address, |
| 1021 | * and the problem, and then passes it off to one of the appropriate | 1026 | * and the problem, and then passes it off to one of the appropriate |
| 1022 | * routines. | 1027 | * routines. |
| 1028 | * | ||
| 1029 | * This function must have noinline because both callers | ||
| 1030 | * {,trace_}do_page_fault() have notrace on. Having this an actual function | ||
| 1031 | * guarantees there's a function trace entry. | ||
| 1023 | */ | 1032 | */ |
| 1024 | static void __kprobes | 1033 | static void __kprobes noinline |
| 1025 | __do_page_fault(struct pt_regs *regs, unsigned long error_code) | 1034 | __do_page_fault(struct pt_regs *regs, unsigned long error_code, |
| 1035 | unsigned long address) | ||
| 1026 | { | 1036 | { |
| 1027 | struct vm_area_struct *vma; | 1037 | struct vm_area_struct *vma; |
| 1028 | struct task_struct *tsk; | 1038 | struct task_struct *tsk; |
| 1029 | unsigned long address; | ||
| 1030 | struct mm_struct *mm; | 1039 | struct mm_struct *mm; |
| 1031 | int fault; | 1040 | int fault; |
| 1032 | unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; | 1041 | unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; |
| @@ -1034,9 +1043,6 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code) | |||
| 1034 | tsk = current; | 1043 | tsk = current; |
| 1035 | mm = tsk->mm; | 1044 | mm = tsk->mm; |
| 1036 | 1045 | ||
| 1037 | /* Get the faulting address: */ | ||
| 1038 | address = read_cr2(); | ||
| 1039 | |||
| 1040 | /* | 1046 | /* |
| 1041 | * Detect and handle instructions that would cause a page fault for | 1047 | * Detect and handle instructions that would cause a page fault for |
| 1042 | * both a tracked kernel page and a userspace page. | 1048 | * both a tracked kernel page and a userspace page. |
| @@ -1248,32 +1254,50 @@ good_area: | |||
| 1248 | up_read(&mm->mmap_sem); | 1254 | up_read(&mm->mmap_sem); |
| 1249 | } | 1255 | } |
| 1250 | 1256 | ||
| 1251 | dotraplinkage void __kprobes | 1257 | dotraplinkage void __kprobes notrace |
| 1252 | do_page_fault(struct pt_regs *regs, unsigned long error_code) | 1258 | do_page_fault(struct pt_regs *regs, unsigned long error_code) |
| 1253 | { | 1259 | { |
| 1260 | unsigned long address = read_cr2(); /* Get the faulting address */ | ||
| 1254 | enum ctx_state prev_state; | 1261 | enum ctx_state prev_state; |
| 1255 | 1262 | ||
| 1263 | /* | ||
| 1264 | * We must have this function tagged with __kprobes, notrace and call | ||
| 1265 | * read_cr2() before calling anything else. To avoid calling any kind | ||
| 1266 | * of tracing machinery before we've observed the CR2 value. | ||
| 1267 | * | ||
| 1268 | * exception_{enter,exit}() contain all sorts of tracepoints. | ||
| 1269 | */ | ||
| 1270 | |||
| 1256 | prev_state = exception_enter(); | 1271 | prev_state = exception_enter(); |
| 1257 | __do_page_fault(regs, error_code); | 1272 | __do_page_fault(regs, error_code, address); |
| 1258 | exception_exit(prev_state); | 1273 | exception_exit(prev_state); |
| 1259 | } | 1274 | } |
| 1260 | 1275 | ||
| 1261 | static void trace_page_fault_entries(struct pt_regs *regs, | 1276 | #ifdef CONFIG_TRACING |
| 1277 | static void trace_page_fault_entries(unsigned long address, struct pt_regs *regs, | ||
| 1262 | unsigned long error_code) | 1278 | unsigned long error_code) |
| 1263 | { | 1279 | { |
| 1264 | if (user_mode(regs)) | 1280 | if (user_mode(regs)) |
| 1265 | trace_page_fault_user(read_cr2(), regs, error_code); | 1281 | trace_page_fault_user(address, regs, error_code); |
| 1266 | else | 1282 | else |
| 1267 | trace_page_fault_kernel(read_cr2(), regs, error_code); | 1283 | trace_page_fault_kernel(address, regs, error_code); |
| 1268 | } | 1284 | } |
| 1269 | 1285 | ||
| 1270 | dotraplinkage void __kprobes | 1286 | dotraplinkage void __kprobes notrace |
| 1271 | trace_do_page_fault(struct pt_regs *regs, unsigned long error_code) | 1287 | trace_do_page_fault(struct pt_regs *regs, unsigned long error_code) |
| 1272 | { | 1288 | { |
| 1289 | /* | ||
| 1290 | * The exception_enter and tracepoint processing could | ||
| 1291 | * trigger another page faults (user space callchain | ||
| 1292 | * reading) and destroy the original cr2 value, so read | ||
| 1293 | * the faulting address now. | ||
| 1294 | */ | ||
| 1295 | unsigned long address = read_cr2(); | ||
| 1273 | enum ctx_state prev_state; | 1296 | enum ctx_state prev_state; |
| 1274 | 1297 | ||
| 1275 | prev_state = exception_enter(); | 1298 | prev_state = exception_enter(); |
| 1276 | trace_page_fault_entries(regs, error_code); | 1299 | trace_page_fault_entries(address, regs, error_code); |
| 1277 | __do_page_fault(regs, error_code); | 1300 | __do_page_fault(regs, error_code, address); |
| 1278 | exception_exit(prev_state); | 1301 | exception_exit(prev_state); |
| 1279 | } | 1302 | } |
| 1303 | #endif /* CONFIG_TRACING */ | ||
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index b3b19f46c016..ae242a7c11c7 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c | |||
| @@ -126,8 +126,8 @@ within(unsigned long addr, unsigned long start, unsigned long end) | |||
| 126 | * @vaddr: virtual start address | 126 | * @vaddr: virtual start address |
| 127 | * @size: number of bytes to flush | 127 | * @size: number of bytes to flush |
| 128 | * | 128 | * |
| 129 | * clflush is an unordered instruction which needs fencing with mfence | 129 | * clflushopt is an unordered instruction which needs fencing with mfence or |
| 130 | * to avoid ordering issues. | 130 | * sfence to avoid ordering issues. |
| 131 | */ | 131 | */ |
| 132 | void clflush_cache_range(void *vaddr, unsigned int size) | 132 | void clflush_cache_range(void *vaddr, unsigned int size) |
| 133 | { | 133 | { |
| @@ -136,11 +136,11 @@ void clflush_cache_range(void *vaddr, unsigned int size) | |||
| 136 | mb(); | 136 | mb(); |
| 137 | 137 | ||
| 138 | for (; vaddr < vend; vaddr += boot_cpu_data.x86_clflush_size) | 138 | for (; vaddr < vend; vaddr += boot_cpu_data.x86_clflush_size) |
| 139 | clflush(vaddr); | 139 | clflushopt(vaddr); |
| 140 | /* | 140 | /* |
| 141 | * Flush any possible final partial cacheline: | 141 | * Flush any possible final partial cacheline: |
| 142 | */ | 142 | */ |
| 143 | clflush(vend); | 143 | clflushopt(vend); |
| 144 | 144 | ||
| 145 | mb(); | 145 | mb(); |
| 146 | } | 146 | } |
| @@ -323,8 +323,12 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address, | |||
| 323 | return prot; | 323 | return prot; |
| 324 | } | 324 | } |
| 325 | 325 | ||
| 326 | static pte_t *__lookup_address_in_pgd(pgd_t *pgd, unsigned long address, | 326 | /* |
| 327 | unsigned int *level) | 327 | * Lookup the page table entry for a virtual address in a specific pgd. |
| 328 | * Return a pointer to the entry and the level of the mapping. | ||
| 329 | */ | ||
| 330 | pte_t *lookup_address_in_pgd(pgd_t *pgd, unsigned long address, | ||
| 331 | unsigned int *level) | ||
| 328 | { | 332 | { |
| 329 | pud_t *pud; | 333 | pud_t *pud; |
| 330 | pmd_t *pmd; | 334 | pmd_t *pmd; |
| @@ -365,7 +369,7 @@ static pte_t *__lookup_address_in_pgd(pgd_t *pgd, unsigned long address, | |||
| 365 | */ | 369 | */ |
| 366 | pte_t *lookup_address(unsigned long address, unsigned int *level) | 370 | pte_t *lookup_address(unsigned long address, unsigned int *level) |
| 367 | { | 371 | { |
| 368 | return __lookup_address_in_pgd(pgd_offset_k(address), address, level); | 372 | return lookup_address_in_pgd(pgd_offset_k(address), address, level); |
| 369 | } | 373 | } |
| 370 | EXPORT_SYMBOL_GPL(lookup_address); | 374 | EXPORT_SYMBOL_GPL(lookup_address); |
| 371 | 375 | ||
| @@ -373,7 +377,7 @@ static pte_t *_lookup_address_cpa(struct cpa_data *cpa, unsigned long address, | |||
| 373 | unsigned int *level) | 377 | unsigned int *level) |
| 374 | { | 378 | { |
| 375 | if (cpa->pgd) | 379 | if (cpa->pgd) |
| 376 | return __lookup_address_in_pgd(cpa->pgd + pgd_index(address), | 380 | return lookup_address_in_pgd(cpa->pgd + pgd_index(address), |
| 377 | address, level); | 381 | address, level); |
| 378 | 382 | ||
| 379 | return lookup_address(address, level); | 383 | return lookup_address(address, level); |
| @@ -692,6 +696,18 @@ static bool try_to_free_pmd_page(pmd_t *pmd) | |||
| 692 | return true; | 696 | return true; |
| 693 | } | 697 | } |
| 694 | 698 | ||
| 699 | static bool try_to_free_pud_page(pud_t *pud) | ||
| 700 | { | ||
| 701 | int i; | ||
| 702 | |||
| 703 | for (i = 0; i < PTRS_PER_PUD; i++) | ||
| 704 | if (!pud_none(pud[i])) | ||
| 705 | return false; | ||
| 706 | |||
| 707 | free_page((unsigned long)pud); | ||
| 708 | return true; | ||
| 709 | } | ||
| 710 | |||
| 695 | static bool unmap_pte_range(pmd_t *pmd, unsigned long start, unsigned long end) | 711 | static bool unmap_pte_range(pmd_t *pmd, unsigned long start, unsigned long end) |
| 696 | { | 712 | { |
| 697 | pte_t *pte = pte_offset_kernel(pmd, start); | 713 | pte_t *pte = pte_offset_kernel(pmd, start); |
| @@ -805,6 +821,16 @@ static void unmap_pud_range(pgd_t *pgd, unsigned long start, unsigned long end) | |||
| 805 | */ | 821 | */ |
| 806 | } | 822 | } |
| 807 | 823 | ||
| 824 | static void unmap_pgd_range(pgd_t *root, unsigned long addr, unsigned long end) | ||
| 825 | { | ||
| 826 | pgd_t *pgd_entry = root + pgd_index(addr); | ||
| 827 | |||
| 828 | unmap_pud_range(pgd_entry, addr, end); | ||
| 829 | |||
| 830 | if (try_to_free_pud_page((pud_t *)pgd_page_vaddr(*pgd_entry))) | ||
| 831 | pgd_clear(pgd_entry); | ||
| 832 | } | ||
| 833 | |||
| 808 | static int alloc_pte_page(pmd_t *pmd) | 834 | static int alloc_pte_page(pmd_t *pmd) |
| 809 | { | 835 | { |
| 810 | pte_t *pte = (pte_t *)get_zeroed_page(GFP_KERNEL | __GFP_NOTRACK); | 836 | pte_t *pte = (pte_t *)get_zeroed_page(GFP_KERNEL | __GFP_NOTRACK); |
| @@ -999,9 +1025,8 @@ static int populate_pud(struct cpa_data *cpa, unsigned long start, pgd_t *pgd, | |||
| 999 | static int populate_pgd(struct cpa_data *cpa, unsigned long addr) | 1025 | static int populate_pgd(struct cpa_data *cpa, unsigned long addr) |
| 1000 | { | 1026 | { |
| 1001 | pgprot_t pgprot = __pgprot(_KERNPG_TABLE); | 1027 | pgprot_t pgprot = __pgprot(_KERNPG_TABLE); |
| 1002 | bool allocd_pgd = false; | ||
| 1003 | pgd_t *pgd_entry; | ||
| 1004 | pud_t *pud = NULL; /* shut up gcc */ | 1028 | pud_t *pud = NULL; /* shut up gcc */ |
| 1029 | pgd_t *pgd_entry; | ||
| 1005 | int ret; | 1030 | int ret; |
| 1006 | 1031 | ||
| 1007 | pgd_entry = cpa->pgd + pgd_index(addr); | 1032 | pgd_entry = cpa->pgd + pgd_index(addr); |
| @@ -1015,7 +1040,6 @@ static int populate_pgd(struct cpa_data *cpa, unsigned long addr) | |||
| 1015 | return -1; | 1040 | return -1; |
| 1016 | 1041 | ||
| 1017 | set_pgd(pgd_entry, __pgd(__pa(pud) | _KERNPG_TABLE)); | 1042 | set_pgd(pgd_entry, __pgd(__pa(pud) | _KERNPG_TABLE)); |
| 1018 | allocd_pgd = true; | ||
| 1019 | } | 1043 | } |
| 1020 | 1044 | ||
| 1021 | pgprot_val(pgprot) &= ~pgprot_val(cpa->mask_clr); | 1045 | pgprot_val(pgprot) &= ~pgprot_val(cpa->mask_clr); |
| @@ -1023,19 +1047,11 @@ static int populate_pgd(struct cpa_data *cpa, unsigned long addr) | |||
| 1023 | 1047 | ||
| 1024 | ret = populate_pud(cpa, addr, pgd_entry, pgprot); | 1048 | ret = populate_pud(cpa, addr, pgd_entry, pgprot); |
| 1025 | if (ret < 0) { | 1049 | if (ret < 0) { |
| 1026 | unmap_pud_range(pgd_entry, addr, | 1050 | unmap_pgd_range(cpa->pgd, addr, |
| 1027 | addr + (cpa->numpages << PAGE_SHIFT)); | 1051 | addr + (cpa->numpages << PAGE_SHIFT)); |
| 1028 | |||
| 1029 | if (allocd_pgd) { | ||
| 1030 | /* | ||
| 1031 | * If I allocated this PUD page, I can just as well | ||
| 1032 | * free it in this error path. | ||
| 1033 | */ | ||
| 1034 | pgd_clear(pgd_entry); | ||
| 1035 | free_page((unsigned long)pud); | ||
| 1036 | } | ||
| 1037 | return ret; | 1052 | return ret; |
| 1038 | } | 1053 | } |
| 1054 | |||
| 1039 | cpa->numpages = ret; | 1055 | cpa->numpages = ret; |
| 1040 | return 0; | 1056 | return 0; |
| 1041 | } | 1057 | } |
| @@ -1377,10 +1393,10 @@ static int change_page_attr_set_clr(unsigned long *addr, int numpages, | |||
| 1377 | cache = cache_attr(mask_set); | 1393 | cache = cache_attr(mask_set); |
| 1378 | 1394 | ||
| 1379 | /* | 1395 | /* |
| 1380 | * On success we use clflush, when the CPU supports it to | 1396 | * On success we use CLFLUSH, when the CPU supports it to |
| 1381 | * avoid the wbindv. If the CPU does not support it and in the | 1397 | * avoid the WBINVD. If the CPU does not support it and in the |
| 1382 | * error case we fall back to cpa_flush_all (which uses | 1398 | * error case we fall back to cpa_flush_all (which uses |
| 1383 | * wbindv): | 1399 | * WBINVD): |
| 1384 | */ | 1400 | */ |
| 1385 | if (!ret && cpu_has_clflush) { | 1401 | if (!ret && cpu_has_clflush) { |
| 1386 | if (cpa.flags & (CPA_PAGES_ARRAY | CPA_ARRAY)) { | 1402 | if (cpa.flags & (CPA_PAGES_ARRAY | CPA_ARRAY)) { |
| @@ -1861,6 +1877,12 @@ out: | |||
| 1861 | return retval; | 1877 | return retval; |
| 1862 | } | 1878 | } |
| 1863 | 1879 | ||
| 1880 | void kernel_unmap_pages_in_pgd(pgd_t *root, unsigned long address, | ||
| 1881 | unsigned numpages) | ||
| 1882 | { | ||
| 1883 | unmap_pgd_range(root, address, address + (numpages << PAGE_SHIFT)); | ||
| 1884 | } | ||
| 1885 | |||
| 1864 | /* | 1886 | /* |
| 1865 | * The testcases use internal knowledge of the implementation that shouldn't | 1887 | * The testcases use internal knowledge of the implementation that shouldn't |
| 1866 | * be exposed to the rest of the kernel. Include these directly here. | 1888 | * be exposed to the rest of the kernel. Include these directly here. |
diff --git a/arch/x86/mm/srat.c b/arch/x86/mm/srat.c index 1953e9c9391a..66338a60aa6e 100644 --- a/arch/x86/mm/srat.c +++ b/arch/x86/mm/srat.c | |||
| @@ -52,12 +52,18 @@ void __init acpi_numa_slit_init(struct acpi_table_slit *slit) | |||
| 52 | int i, j; | 52 | int i, j; |
| 53 | 53 | ||
| 54 | for (i = 0; i < slit->locality_count; i++) { | 54 | for (i = 0; i < slit->locality_count; i++) { |
| 55 | if (pxm_to_node(i) == NUMA_NO_NODE) | 55 | const int from_node = pxm_to_node(i); |
| 56 | |||
| 57 | if (from_node == NUMA_NO_NODE) | ||
| 56 | continue; | 58 | continue; |
| 59 | |||
| 57 | for (j = 0; j < slit->locality_count; j++) { | 60 | for (j = 0; j < slit->locality_count; j++) { |
| 58 | if (pxm_to_node(j) == NUMA_NO_NODE) | 61 | const int to_node = pxm_to_node(j); |
| 62 | |||
| 63 | if (to_node == NUMA_NO_NODE) | ||
| 59 | continue; | 64 | continue; |
| 60 | numa_set_distance(pxm_to_node(i), pxm_to_node(j), | 65 | |
| 66 | numa_set_distance(from_node, to_node, | ||
| 61 | slit->entry[slit->locality_count * i + j]); | 67 | slit->entry[slit->locality_count * i + j]); |
| 62 | } | 68 | } |
| 63 | } | 69 | } |
diff --git a/arch/x86/net/bpf_jit.S b/arch/x86/net/bpf_jit.S index 877b9a1b2152..01495755701b 100644 --- a/arch/x86/net/bpf_jit.S +++ b/arch/x86/net/bpf_jit.S | |||
| @@ -140,7 +140,7 @@ bpf_slow_path_byte_msh: | |||
| 140 | push %r9; \ | 140 | push %r9; \ |
| 141 | push SKBDATA; \ | 141 | push SKBDATA; \ |
| 142 | /* rsi already has offset */ \ | 142 | /* rsi already has offset */ \ |
| 143 | mov $SIZE,%ecx; /* size */ \ | 143 | mov $SIZE,%edx; /* size */ \ |
| 144 | call bpf_internal_load_pointer_neg_helper; \ | 144 | call bpf_internal_load_pointer_neg_helper; \ |
| 145 | test %rax,%rax; \ | 145 | test %rax,%rax; \ |
| 146 | pop SKBDATA; \ | 146 | pop SKBDATA; \ |
diff --git a/arch/x86/platform/efi/Makefile b/arch/x86/platform/efi/Makefile index b7b0b35c1981..d51045afcaaf 100644 --- a/arch/x86/platform/efi/Makefile +++ b/arch/x86/platform/efi/Makefile | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | obj-$(CONFIG_EFI) += efi.o efi_$(BITS).o efi_stub_$(BITS).o | 1 | obj-$(CONFIG_EFI) += efi.o efi_$(BITS).o efi_stub_$(BITS).o |
| 2 | obj-$(CONFIG_ACPI_BGRT) += efi-bgrt.o | 2 | obj-$(CONFIG_ACPI_BGRT) += efi-bgrt.o |
| 3 | obj-$(CONFIG_EARLY_PRINTK_EFI) += early_printk.o | 3 | obj-$(CONFIG_EARLY_PRINTK_EFI) += early_printk.o |
| 4 | obj-$(CONFIG_EFI_MIXED) += efi_thunk_$(BITS).o | ||
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index 1a201ac7cef8..3781dd39e8bd 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c | |||
| @@ -52,6 +52,7 @@ | |||
| 52 | #include <asm/tlbflush.h> | 52 | #include <asm/tlbflush.h> |
| 53 | #include <asm/x86_init.h> | 53 | #include <asm/x86_init.h> |
| 54 | #include <asm/rtc.h> | 54 | #include <asm/rtc.h> |
| 55 | #include <asm/uv/uv.h> | ||
| 55 | 56 | ||
| 56 | #define EFI_DEBUG | 57 | #define EFI_DEBUG |
| 57 | 58 | ||
| @@ -67,9 +68,7 @@ struct efi_memory_map memmap; | |||
| 67 | static struct efi efi_phys __initdata; | 68 | static struct efi efi_phys __initdata; |
| 68 | static efi_system_table_t efi_systab __initdata; | 69 | static efi_system_table_t efi_systab __initdata; |
| 69 | 70 | ||
| 70 | unsigned long x86_efi_facility; | 71 | static efi_config_table_type_t arch_tables[] __initdata = { |
| 71 | |||
| 72 | static __initdata efi_config_table_type_t arch_tables[] = { | ||
| 73 | #ifdef CONFIG_X86_UV | 72 | #ifdef CONFIG_X86_UV |
| 74 | {UV_SYSTEM_TABLE_GUID, "UVsystab", &efi.uv_systab}, | 73 | {UV_SYSTEM_TABLE_GUID, "UVsystab", &efi.uv_systab}, |
| 75 | #endif | 74 | #endif |
| @@ -78,16 +77,7 @@ static __initdata efi_config_table_type_t arch_tables[] = { | |||
| 78 | 77 | ||
| 79 | u64 efi_setup; /* efi setup_data physical address */ | 78 | u64 efi_setup; /* efi setup_data physical address */ |
| 80 | 79 | ||
| 81 | /* | 80 | static bool disable_runtime __initdata = false; |
| 82 | * Returns 1 if 'facility' is enabled, 0 otherwise. | ||
| 83 | */ | ||
| 84 | int efi_enabled(int facility) | ||
| 85 | { | ||
| 86 | return test_bit(facility, &x86_efi_facility) != 0; | ||
| 87 | } | ||
| 88 | EXPORT_SYMBOL(efi_enabled); | ||
| 89 | |||
| 90 | static bool __initdata disable_runtime = false; | ||
| 91 | static int __init setup_noefi(char *arg) | 81 | static int __init setup_noefi(char *arg) |
| 92 | { | 82 | { |
| 93 | disable_runtime = true; | 83 | disable_runtime = true; |
| @@ -256,27 +246,12 @@ static efi_status_t __init phys_efi_set_virtual_address_map( | |||
| 256 | return status; | 246 | return status; |
| 257 | } | 247 | } |
| 258 | 248 | ||
| 259 | static efi_status_t __init phys_efi_get_time(efi_time_t *tm, | ||
| 260 | efi_time_cap_t *tc) | ||
| 261 | { | ||
| 262 | unsigned long flags; | ||
| 263 | efi_status_t status; | ||
| 264 | |||
| 265 | spin_lock_irqsave(&rtc_lock, flags); | ||
| 266 | efi_call_phys_prelog(); | ||
| 267 | status = efi_call_phys2(efi_phys.get_time, virt_to_phys(tm), | ||
| 268 | virt_to_phys(tc)); | ||
| 269 | efi_call_phys_epilog(); | ||
| 270 | spin_unlock_irqrestore(&rtc_lock, flags); | ||
| 271 | return status; | ||
| 272 | } | ||
| 273 | |||
| 274 | int efi_set_rtc_mmss(const struct timespec *now) | 249 | int efi_set_rtc_mmss(const struct timespec *now) |
| 275 | { | 250 | { |
| 276 | unsigned long nowtime = now->tv_sec; | 251 | unsigned long nowtime = now->tv_sec; |
| 277 | efi_status_t status; | 252 | efi_status_t status; |
| 278 | efi_time_t eft; | 253 | efi_time_t eft; |
| 279 | efi_time_cap_t cap; | 254 | efi_time_cap_t cap; |
| 280 | struct rtc_time tm; | 255 | struct rtc_time tm; |
| 281 | 256 | ||
| 282 | status = efi.get_time(&eft, &cap); | 257 | status = efi.get_time(&eft, &cap); |
| @@ -294,9 +269,8 @@ int efi_set_rtc_mmss(const struct timespec *now) | |||
| 294 | eft.second = tm.tm_sec; | 269 | eft.second = tm.tm_sec; |
| 295 | eft.nanosecond = 0; | 270 | eft.nanosecond = 0; |
| 296 | } else { | 271 | } else { |
| 297 | printk(KERN_ERR | 272 | pr_err("%s: Invalid EFI RTC value: write of %lx to EFI RTC failed\n", |
| 298 | "%s: Invalid EFI RTC value: write of %lx to EFI RTC failed\n", | 273 | __func__, nowtime); |
| 299 | __FUNCTION__, nowtime); | ||
| 300 | return -1; | 274 | return -1; |
| 301 | } | 275 | } |
| 302 | 276 | ||
| @@ -412,8 +386,7 @@ static void __init print_efi_memmap(void) | |||
| 412 | p < memmap.map_end; | 386 | p < memmap.map_end; |
| 413 | p += memmap.desc_size, i++) { | 387 | p += memmap.desc_size, i++) { |
| 414 | md = p; | 388 | md = p; |
| 415 | pr_info("mem%02u: type=%u, attr=0x%llx, " | 389 | pr_info("mem%02u: type=%u, attr=0x%llx, range=[0x%016llx-0x%016llx) (%lluMB)\n", |
| 416 | "range=[0x%016llx-0x%016llx) (%lluMB)\n", | ||
| 417 | i, md->type, md->attribute, md->phys_addr, | 390 | i, md->type, md->attribute, md->phys_addr, |
| 418 | md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT), | 391 | md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT), |
| 419 | (md->num_pages >> (20 - EFI_PAGE_SHIFT))); | 392 | (md->num_pages >> (20 - EFI_PAGE_SHIFT))); |
| @@ -445,9 +418,8 @@ void __init efi_reserve_boot_services(void) | |||
| 445 | memblock_is_region_reserved(start, size)) { | 418 | memblock_is_region_reserved(start, size)) { |
| 446 | /* Could not reserve, skip it */ | 419 | /* Could not reserve, skip it */ |
| 447 | md->num_pages = 0; | 420 | md->num_pages = 0; |
| 448 | memblock_dbg("Could not reserve boot range " | 421 | memblock_dbg("Could not reserve boot range [0x%010llx-0x%010llx]\n", |
| 449 | "[0x%010llx-0x%010llx]\n", | 422 | start, start+size-1); |
| 450 | start, start+size-1); | ||
| 451 | } else | 423 | } else |
| 452 | memblock_reserve(start, size); | 424 | memblock_reserve(start, size); |
| 453 | } | 425 | } |
| @@ -455,7 +427,7 @@ void __init efi_reserve_boot_services(void) | |||
| 455 | 427 | ||
| 456 | void __init efi_unmap_memmap(void) | 428 | void __init efi_unmap_memmap(void) |
| 457 | { | 429 | { |
| 458 | clear_bit(EFI_MEMMAP, &x86_efi_facility); | 430 | clear_bit(EFI_MEMMAP, &efi.flags); |
| 459 | if (memmap.map) { | 431 | if (memmap.map) { |
| 460 | early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size); | 432 | early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size); |
| 461 | memmap.map = NULL; | 433 | memmap.map = NULL; |
| @@ -466,9 +438,6 @@ void __init efi_free_boot_services(void) | |||
| 466 | { | 438 | { |
| 467 | void *p; | 439 | void *p; |
| 468 | 440 | ||
| 469 | if (!efi_is_native()) | ||
| 470 | return; | ||
| 471 | |||
| 472 | for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { | 441 | for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { |
| 473 | efi_memory_desc_t *md = p; | 442 | efi_memory_desc_t *md = p; |
| 474 | unsigned long long start = md->phys_addr; | 443 | unsigned long long start = md->phys_addr; |
| @@ -583,45 +552,82 @@ static int __init efi_systab_init(void *phys) | |||
| 583 | return -EINVAL; | 552 | return -EINVAL; |
| 584 | } | 553 | } |
| 585 | if ((efi.systab->hdr.revision >> 16) == 0) | 554 | if ((efi.systab->hdr.revision >> 16) == 0) |
| 586 | pr_err("Warning: System table version " | 555 | pr_err("Warning: System table version %d.%02d, expected 1.00 or greater!\n", |
| 587 | "%d.%02d, expected 1.00 or greater!\n", | ||
| 588 | efi.systab->hdr.revision >> 16, | 556 | efi.systab->hdr.revision >> 16, |
| 589 | efi.systab->hdr.revision & 0xffff); | 557 | efi.systab->hdr.revision & 0xffff); |
| 590 | 558 | ||
| 559 | set_bit(EFI_SYSTEM_TABLES, &efi.flags); | ||
| 560 | |||
| 591 | return 0; | 561 | return 0; |
| 592 | } | 562 | } |
| 593 | 563 | ||
| 594 | static int __init efi_runtime_init(void) | 564 | static int __init efi_runtime_init32(void) |
| 595 | { | 565 | { |
| 596 | efi_runtime_services_t *runtime; | 566 | efi_runtime_services_32_t *runtime; |
| 567 | |||
| 568 | runtime = early_ioremap((unsigned long)efi.systab->runtime, | ||
| 569 | sizeof(efi_runtime_services_32_t)); | ||
| 570 | if (!runtime) { | ||
| 571 | pr_err("Could not map the runtime service table!\n"); | ||
| 572 | return -ENOMEM; | ||
| 573 | } | ||
| 597 | 574 | ||
| 598 | /* | 575 | /* |
| 599 | * Check out the runtime services table. We need to map | 576 | * We will only need *early* access to the following two |
| 600 | * the runtime services table so that we can grab the physical | 577 | * EFI runtime services before set_virtual_address_map |
| 601 | * address of several of the EFI runtime functions, needed to | 578 | * is invoked. |
| 602 | * set the firmware into virtual mode. | ||
| 603 | */ | 579 | */ |
| 580 | efi_phys.set_virtual_address_map = | ||
| 581 | (efi_set_virtual_address_map_t *) | ||
| 582 | (unsigned long)runtime->set_virtual_address_map; | ||
| 583 | early_iounmap(runtime, sizeof(efi_runtime_services_32_t)); | ||
| 584 | |||
| 585 | return 0; | ||
| 586 | } | ||
| 587 | |||
| 588 | static int __init efi_runtime_init64(void) | ||
| 589 | { | ||
| 590 | efi_runtime_services_64_t *runtime; | ||
| 591 | |||
| 604 | runtime = early_ioremap((unsigned long)efi.systab->runtime, | 592 | runtime = early_ioremap((unsigned long)efi.systab->runtime, |
| 605 | sizeof(efi_runtime_services_t)); | 593 | sizeof(efi_runtime_services_64_t)); |
| 606 | if (!runtime) { | 594 | if (!runtime) { |
| 607 | pr_err("Could not map the runtime service table!\n"); | 595 | pr_err("Could not map the runtime service table!\n"); |
| 608 | return -ENOMEM; | 596 | return -ENOMEM; |
| 609 | } | 597 | } |
| 598 | |||
| 610 | /* | 599 | /* |
| 611 | * We will only need *early* access to the following | 600 | * We will only need *early* access to the following two |
| 612 | * two EFI runtime services before set_virtual_address_map | 601 | * EFI runtime services before set_virtual_address_map |
| 613 | * is invoked. | 602 | * is invoked. |
| 614 | */ | 603 | */ |
| 615 | efi_phys.get_time = (efi_get_time_t *)runtime->get_time; | ||
| 616 | efi_phys.set_virtual_address_map = | 604 | efi_phys.set_virtual_address_map = |
| 617 | (efi_set_virtual_address_map_t *) | 605 | (efi_set_virtual_address_map_t *) |
| 618 | runtime->set_virtual_address_map; | 606 | (unsigned long)runtime->set_virtual_address_map; |
| 607 | early_iounmap(runtime, sizeof(efi_runtime_services_64_t)); | ||
| 608 | |||
| 609 | return 0; | ||
| 610 | } | ||
| 611 | |||
| 612 | static int __init efi_runtime_init(void) | ||
| 613 | { | ||
| 614 | int rv; | ||
| 615 | |||
| 619 | /* | 616 | /* |
| 620 | * Make efi_get_time can be called before entering | 617 | * Check out the runtime services table. We need to map |
| 621 | * virtual mode. | 618 | * the runtime services table so that we can grab the physical |
| 619 | * address of several of the EFI runtime functions, needed to | ||
| 620 | * set the firmware into virtual mode. | ||
| 622 | */ | 621 | */ |
| 623 | efi.get_time = phys_efi_get_time; | 622 | if (efi_enabled(EFI_64BIT)) |
| 624 | early_iounmap(runtime, sizeof(efi_runtime_services_t)); | 623 | rv = efi_runtime_init64(); |
| 624 | else | ||
| 625 | rv = efi_runtime_init32(); | ||
| 626 | |||
| 627 | if (rv) | ||
| 628 | return rv; | ||
| 629 | |||
| 630 | set_bit(EFI_RUNTIME_SERVICES, &efi.flags); | ||
| 625 | 631 | ||
| 626 | return 0; | 632 | return 0; |
| 627 | } | 633 | } |
| @@ -640,6 +646,8 @@ static int __init efi_memmap_init(void) | |||
| 640 | if (add_efi_memmap) | 646 | if (add_efi_memmap) |
| 641 | do_add_efi_memmap(); | 647 | do_add_efi_memmap(); |
| 642 | 648 | ||
| 649 | set_bit(EFI_MEMMAP, &efi.flags); | ||
| 650 | |||
| 643 | return 0; | 651 | return 0; |
| 644 | } | 652 | } |
| 645 | 653 | ||
| @@ -722,7 +730,7 @@ void __init efi_init(void) | |||
| 722 | if (efi_systab_init(efi_phys.systab)) | 730 | if (efi_systab_init(efi_phys.systab)) |
| 723 | return; | 731 | return; |
| 724 | 732 | ||
| 725 | set_bit(EFI_SYSTEM_TABLES, &x86_efi_facility); | 733 | set_bit(EFI_SYSTEM_TABLES, &efi.flags); |
| 726 | 734 | ||
| 727 | efi.config_table = (unsigned long)efi.systab->tables; | 735 | efi.config_table = (unsigned long)efi.systab->tables; |
| 728 | efi.fw_vendor = (unsigned long)efi.systab->fw_vendor; | 736 | efi.fw_vendor = (unsigned long)efi.systab->fw_vendor; |
| @@ -750,24 +758,21 @@ void __init efi_init(void) | |||
| 750 | if (efi_config_init(arch_tables)) | 758 | if (efi_config_init(arch_tables)) |
| 751 | return; | 759 | return; |
| 752 | 760 | ||
| 753 | set_bit(EFI_CONFIG_TABLES, &x86_efi_facility); | ||
| 754 | |||
| 755 | /* | 761 | /* |
| 756 | * Note: We currently don't support runtime services on an EFI | 762 | * Note: We currently don't support runtime services on an EFI |
| 757 | * that doesn't match the kernel 32/64-bit mode. | 763 | * that doesn't match the kernel 32/64-bit mode. |
| 758 | */ | 764 | */ |
| 759 | 765 | ||
| 760 | if (!efi_is_native()) | 766 | if (!efi_runtime_supported()) |
| 761 | pr_info("No EFI runtime due to 32/64-bit mismatch with kernel\n"); | 767 | pr_info("No EFI runtime due to 32/64-bit mismatch with kernel\n"); |
| 762 | else { | 768 | else { |
| 763 | if (disable_runtime || efi_runtime_init()) | 769 | if (disable_runtime || efi_runtime_init()) |
| 764 | return; | 770 | return; |
| 765 | set_bit(EFI_RUNTIME_SERVICES, &x86_efi_facility); | ||
| 766 | } | 771 | } |
| 767 | if (efi_memmap_init()) | 772 | if (efi_memmap_init()) |
| 768 | return; | 773 | return; |
| 769 | 774 | ||
| 770 | set_bit(EFI_MEMMAP, &x86_efi_facility); | 775 | set_bit(EFI_MEMMAP, &efi.flags); |
| 771 | 776 | ||
| 772 | print_efi_memmap(); | 777 | print_efi_memmap(); |
| 773 | } | 778 | } |
| @@ -844,6 +849,22 @@ void __init old_map_region(efi_memory_desc_t *md) | |||
| 844 | (unsigned long long)md->phys_addr); | 849 | (unsigned long long)md->phys_addr); |
| 845 | } | 850 | } |
| 846 | 851 | ||
| 852 | static void native_runtime_setup(void) | ||
| 853 | { | ||
| 854 | efi.get_time = virt_efi_get_time; | ||
| 855 | efi.set_time = virt_efi_set_time; | ||
| 856 | efi.get_wakeup_time = virt_efi_get_wakeup_time; | ||
| 857 | efi.set_wakeup_time = virt_efi_set_wakeup_time; | ||
| 858 | efi.get_variable = virt_efi_get_variable; | ||
| 859 | efi.get_next_variable = virt_efi_get_next_variable; | ||
| 860 | efi.set_variable = virt_efi_set_variable; | ||
| 861 | efi.get_next_high_mono_count = virt_efi_get_next_high_mono_count; | ||
| 862 | efi.reset_system = virt_efi_reset_system; | ||
| 863 | efi.query_variable_info = virt_efi_query_variable_info; | ||
| 864 | efi.update_capsule = virt_efi_update_capsule; | ||
| 865 | efi.query_capsule_caps = virt_efi_query_capsule_caps; | ||
| 866 | } | ||
| 867 | |||
| 847 | /* Merge contiguous regions of the same type and attribute */ | 868 | /* Merge contiguous regions of the same type and attribute */ |
| 848 | static void __init efi_merge_regions(void) | 869 | static void __init efi_merge_regions(void) |
| 849 | { | 870 | { |
| @@ -891,8 +912,9 @@ static void __init get_systab_virt_addr(efi_memory_desc_t *md) | |||
| 891 | } | 912 | } |
| 892 | } | 913 | } |
| 893 | 914 | ||
| 894 | static int __init save_runtime_map(void) | 915 | static void __init save_runtime_map(void) |
| 895 | { | 916 | { |
| 917 | #ifdef CONFIG_KEXEC | ||
| 896 | efi_memory_desc_t *md; | 918 | efi_memory_desc_t *md; |
| 897 | void *tmp, *p, *q = NULL; | 919 | void *tmp, *p, *q = NULL; |
| 898 | int count = 0; | 920 | int count = 0; |
| @@ -914,38 +936,44 @@ static int __init save_runtime_map(void) | |||
| 914 | } | 936 | } |
| 915 | 937 | ||
| 916 | efi_runtime_map_setup(q, count, memmap.desc_size); | 938 | efi_runtime_map_setup(q, count, memmap.desc_size); |
| 939 | return; | ||
| 917 | 940 | ||
| 918 | return 0; | ||
| 919 | out: | 941 | out: |
| 920 | kfree(q); | 942 | kfree(q); |
| 921 | return -ENOMEM; | 943 | pr_err("Error saving runtime map, efi runtime on kexec non-functional!!\n"); |
| 944 | #endif | ||
| 922 | } | 945 | } |
| 923 | 946 | ||
| 924 | /* | 947 | static void *realloc_pages(void *old_memmap, int old_shift) |
| 925 | * Map efi regions which were passed via setup_data. The virt_addr is a fixed | ||
| 926 | * addr which was used in first kernel of a kexec boot. | ||
| 927 | */ | ||
| 928 | static void __init efi_map_regions_fixed(void) | ||
| 929 | { | 948 | { |
| 930 | void *p; | 949 | void *ret; |
| 931 | efi_memory_desc_t *md; | ||
| 932 | 950 | ||
| 933 | for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { | 951 | ret = (void *)__get_free_pages(GFP_KERNEL, old_shift + 1); |
| 934 | md = p; | 952 | if (!ret) |
| 935 | efi_map_region_fixed(md); /* FIXME: add error handling */ | 953 | goto out; |
| 936 | get_systab_virt_addr(md); | ||
| 937 | } | ||
| 938 | 954 | ||
| 955 | /* | ||
| 956 | * A first-time allocation doesn't have anything to copy. | ||
| 957 | */ | ||
| 958 | if (!old_memmap) | ||
| 959 | return ret; | ||
| 960 | |||
| 961 | memcpy(ret, old_memmap, PAGE_SIZE << old_shift); | ||
| 962 | |||
| 963 | out: | ||
| 964 | free_pages((unsigned long)old_memmap, old_shift); | ||
| 965 | return ret; | ||
| 939 | } | 966 | } |
| 940 | 967 | ||
| 941 | /* | 968 | /* |
| 942 | * Map efi memory ranges for runtime serivce and update new_memmap with virtual | 969 | * Map the efi memory ranges of the runtime services and update new_mmap with |
| 943 | * addresses. | 970 | * virtual addresses. |
| 944 | */ | 971 | */ |
| 945 | static void * __init efi_map_regions(int *count) | 972 | static void * __init efi_map_regions(int *count, int *pg_shift) |
| 946 | { | 973 | { |
| 974 | void *p, *new_memmap = NULL; | ||
| 975 | unsigned long left = 0; | ||
| 947 | efi_memory_desc_t *md; | 976 | efi_memory_desc_t *md; |
| 948 | void *p, *tmp, *new_memmap = NULL; | ||
| 949 | 977 | ||
| 950 | for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { | 978 | for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { |
| 951 | md = p; | 979 | md = p; |
| @@ -960,20 +988,80 @@ static void * __init efi_map_regions(int *count) | |||
| 960 | efi_map_region(md); | 988 | efi_map_region(md); |
| 961 | get_systab_virt_addr(md); | 989 | get_systab_virt_addr(md); |
| 962 | 990 | ||
| 963 | tmp = krealloc(new_memmap, (*count + 1) * memmap.desc_size, | 991 | if (left < memmap.desc_size) { |
| 964 | GFP_KERNEL); | 992 | new_memmap = realloc_pages(new_memmap, *pg_shift); |
| 965 | if (!tmp) | 993 | if (!new_memmap) |
| 966 | goto out; | 994 | return NULL; |
| 967 | new_memmap = tmp; | 995 | |
| 996 | left += PAGE_SIZE << *pg_shift; | ||
| 997 | (*pg_shift)++; | ||
| 998 | } | ||
| 999 | |||
| 968 | memcpy(new_memmap + (*count * memmap.desc_size), md, | 1000 | memcpy(new_memmap + (*count * memmap.desc_size), md, |
| 969 | memmap.desc_size); | 1001 | memmap.desc_size); |
| 1002 | |||
| 1003 | left -= memmap.desc_size; | ||
| 970 | (*count)++; | 1004 | (*count)++; |
| 971 | } | 1005 | } |
| 972 | 1006 | ||
| 973 | return new_memmap; | 1007 | return new_memmap; |
| 974 | out: | 1008 | } |
| 975 | kfree(new_memmap); | 1009 | |
| 976 | return NULL; | 1010 | static void __init kexec_enter_virtual_mode(void) |
| 1011 | { | ||
| 1012 | #ifdef CONFIG_KEXEC | ||
| 1013 | efi_memory_desc_t *md; | ||
| 1014 | void *p; | ||
| 1015 | |||
| 1016 | efi.systab = NULL; | ||
| 1017 | |||
| 1018 | /* | ||
| 1019 | * We don't do virtual mode, since we don't do runtime services, on | ||
| 1020 | * non-native EFI | ||
| 1021 | */ | ||
| 1022 | if (!efi_is_native()) { | ||
| 1023 | efi_unmap_memmap(); | ||
| 1024 | return; | ||
| 1025 | } | ||
| 1026 | |||
| 1027 | /* | ||
| 1028 | * Map efi regions which were passed via setup_data. The virt_addr is a | ||
| 1029 | * fixed addr which was used in first kernel of a kexec boot. | ||
| 1030 | */ | ||
| 1031 | for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { | ||
| 1032 | md = p; | ||
| 1033 | efi_map_region_fixed(md); /* FIXME: add error handling */ | ||
| 1034 | get_systab_virt_addr(md); | ||
| 1035 | } | ||
| 1036 | |||
| 1037 | save_runtime_map(); | ||
| 1038 | |||
| 1039 | BUG_ON(!efi.systab); | ||
| 1040 | |||
| 1041 | efi_sync_low_kernel_mappings(); | ||
| 1042 | |||
| 1043 | /* | ||
| 1044 | * Now that EFI is in virtual mode, update the function | ||
| 1045 | * pointers in the runtime service table to the new virtual addresses. | ||
| 1046 | * | ||
| 1047 | * Call EFI services through wrapper functions. | ||
| 1048 | */ | ||
| 1049 | efi.runtime_version = efi_systab.hdr.revision; | ||
| 1050 | |||
| 1051 | native_runtime_setup(); | ||
| 1052 | |||
| 1053 | efi.set_virtual_address_map = NULL; | ||
| 1054 | |||
| 1055 | if (efi_enabled(EFI_OLD_MEMMAP) && (__supported_pte_mask & _PAGE_NX)) | ||
| 1056 | runtime_code_page_mkexec(); | ||
| 1057 | |||
| 1058 | /* clean DUMMY object */ | ||
| 1059 | efi.set_variable(efi_dummy_name, &EFI_DUMMY_GUID, | ||
| 1060 | EFI_VARIABLE_NON_VOLATILE | | ||
| 1061 | EFI_VARIABLE_BOOTSERVICE_ACCESS | | ||
| 1062 | EFI_VARIABLE_RUNTIME_ACCESS, | ||
| 1063 | 0, NULL); | ||
| 1064 | #endif | ||
| 977 | } | 1065 | } |
| 978 | 1066 | ||
| 979 | /* | 1067 | /* |
| @@ -995,57 +1083,53 @@ out: | |||
| 995 | * | 1083 | * |
| 996 | * Specially for kexec boot, efi runtime maps in previous kernel should | 1084 | * Specially for kexec boot, efi runtime maps in previous kernel should |
| 997 | * be passed in via setup_data. In that case runtime ranges will be mapped | 1085 | * be passed in via setup_data. In that case runtime ranges will be mapped |
| 998 | * to the same virtual addresses as the first kernel. | 1086 | * to the same virtual addresses as the first kernel, see |
| 1087 | * kexec_enter_virtual_mode(). | ||
| 999 | */ | 1088 | */ |
| 1000 | void __init efi_enter_virtual_mode(void) | 1089 | static void __init __efi_enter_virtual_mode(void) |
| 1001 | { | 1090 | { |
| 1002 | efi_status_t status; | 1091 | int count = 0, pg_shift = 0; |
| 1003 | void *new_memmap = NULL; | 1092 | void *new_memmap = NULL; |
| 1004 | int err, count = 0; | 1093 | efi_status_t status; |
| 1005 | 1094 | ||
| 1006 | efi.systab = NULL; | 1095 | efi.systab = NULL; |
| 1007 | 1096 | ||
| 1008 | /* | 1097 | efi_merge_regions(); |
| 1009 | * We don't do virtual mode, since we don't do runtime services, on | 1098 | new_memmap = efi_map_regions(&count, &pg_shift); |
| 1010 | * non-native EFI | 1099 | if (!new_memmap) { |
| 1011 | */ | 1100 | pr_err("Error reallocating memory, EFI runtime non-functional!\n"); |
| 1012 | if (!efi_is_native()) { | ||
| 1013 | efi_unmap_memmap(); | ||
| 1014 | return; | 1101 | return; |
| 1015 | } | 1102 | } |
| 1016 | 1103 | ||
| 1017 | if (efi_setup) { | 1104 | save_runtime_map(); |
| 1018 | efi_map_regions_fixed(); | ||
| 1019 | } else { | ||
| 1020 | efi_merge_regions(); | ||
| 1021 | new_memmap = efi_map_regions(&count); | ||
| 1022 | if (!new_memmap) { | ||
| 1023 | pr_err("Error reallocating memory, EFI runtime non-functional!\n"); | ||
| 1024 | return; | ||
| 1025 | } | ||
| 1026 | } | ||
| 1027 | |||
| 1028 | err = save_runtime_map(); | ||
| 1029 | if (err) | ||
| 1030 | pr_err("Error saving runtime map, efi runtime on kexec non-functional!!\n"); | ||
| 1031 | 1105 | ||
| 1032 | BUG_ON(!efi.systab); | 1106 | BUG_ON(!efi.systab); |
| 1033 | 1107 | ||
| 1034 | efi_setup_page_tables(); | 1108 | if (efi_setup_page_tables(__pa(new_memmap), 1 << pg_shift)) |
| 1109 | return; | ||
| 1110 | |||
| 1035 | efi_sync_low_kernel_mappings(); | 1111 | efi_sync_low_kernel_mappings(); |
| 1112 | efi_dump_pagetable(); | ||
| 1036 | 1113 | ||
| 1037 | if (!efi_setup) { | 1114 | if (efi_is_native()) { |
| 1038 | status = phys_efi_set_virtual_address_map( | 1115 | status = phys_efi_set_virtual_address_map( |
| 1039 | memmap.desc_size * count, | 1116 | memmap.desc_size * count, |
| 1040 | memmap.desc_size, | 1117 | memmap.desc_size, |
| 1041 | memmap.desc_version, | 1118 | memmap.desc_version, |
| 1042 | (efi_memory_desc_t *)__pa(new_memmap)); | 1119 | (efi_memory_desc_t *)__pa(new_memmap)); |
| 1043 | 1120 | } else { | |
| 1044 | if (status != EFI_SUCCESS) { | 1121 | status = efi_thunk_set_virtual_address_map( |
| 1045 | pr_alert("Unable to switch EFI into virtual mode (status=%lx)!\n", | 1122 | efi_phys.set_virtual_address_map, |
| 1046 | status); | 1123 | memmap.desc_size * count, |
| 1047 | panic("EFI call to SetVirtualAddressMap() failed!"); | 1124 | memmap.desc_size, |
| 1048 | } | 1125 | memmap.desc_version, |
| 1126 | (efi_memory_desc_t *)__pa(new_memmap)); | ||
| 1127 | } | ||
| 1128 | |||
| 1129 | if (status != EFI_SUCCESS) { | ||
| 1130 | pr_alert("Unable to switch EFI into virtual mode (status=%lx)!\n", | ||
| 1131 | status); | ||
| 1132 | panic("EFI call to SetVirtualAddressMap() failed!"); | ||
| 1049 | } | 1133 | } |
| 1050 | 1134 | ||
| 1051 | /* | 1135 | /* |
| @@ -1055,23 +1139,43 @@ void __init efi_enter_virtual_mode(void) | |||
| 1055 | * Call EFI services through wrapper functions. | 1139 | * Call EFI services through wrapper functions. |
| 1056 | */ | 1140 | */ |
| 1057 | efi.runtime_version = efi_systab.hdr.revision; | 1141 | efi.runtime_version = efi_systab.hdr.revision; |
| 1058 | efi.get_time = virt_efi_get_time; | 1142 | |
| 1059 | efi.set_time = virt_efi_set_time; | 1143 | if (efi_is_native()) |
| 1060 | efi.get_wakeup_time = virt_efi_get_wakeup_time; | 1144 | native_runtime_setup(); |
| 1061 | efi.set_wakeup_time = virt_efi_set_wakeup_time; | 1145 | else |
| 1062 | efi.get_variable = virt_efi_get_variable; | 1146 | efi_thunk_runtime_setup(); |
| 1063 | efi.get_next_variable = virt_efi_get_next_variable; | 1147 | |
| 1064 | efi.set_variable = virt_efi_set_variable; | ||
| 1065 | efi.get_next_high_mono_count = virt_efi_get_next_high_mono_count; | ||
| 1066 | efi.reset_system = virt_efi_reset_system; | ||
| 1067 | efi.set_virtual_address_map = NULL; | 1148 | efi.set_virtual_address_map = NULL; |
| 1068 | efi.query_variable_info = virt_efi_query_variable_info; | ||
| 1069 | efi.update_capsule = virt_efi_update_capsule; | ||
| 1070 | efi.query_capsule_caps = virt_efi_query_capsule_caps; | ||
| 1071 | 1149 | ||
| 1072 | efi_runtime_mkexec(); | 1150 | efi_runtime_mkexec(); |
| 1073 | 1151 | ||
| 1074 | kfree(new_memmap); | 1152 | /* |
| 1153 | * We mapped the descriptor array into the EFI pagetable above but we're | ||
| 1154 | * not unmapping it here. Here's why: | ||
| 1155 | * | ||
| 1156 | * We're copying select PGDs from the kernel page table to the EFI page | ||
| 1157 | * table and when we do so and make changes to those PGDs like unmapping | ||
| 1158 | * stuff from them, those changes appear in the kernel page table and we | ||
| 1159 | * go boom. | ||
| 1160 | * | ||
| 1161 | * From setup_real_mode(): | ||
| 1162 | * | ||
| 1163 | * ... | ||
| 1164 | * trampoline_pgd[0] = init_level4_pgt[pgd_index(__PAGE_OFFSET)].pgd; | ||
| 1165 | * | ||
| 1166 | * In this particular case, our allocation is in PGD 0 of the EFI page | ||
| 1167 | * table but we've copied that PGD from PGD[272] of the EFI page table: | ||
| 1168 | * | ||
| 1169 | * pgd_index(__PAGE_OFFSET = 0xffff880000000000) = 272 | ||
| 1170 | * | ||
| 1171 | * where the direct memory mapping in kernel space is. | ||
| 1172 | * | ||
| 1173 | * new_memmap's VA comes from that direct mapping and thus clearing it, | ||
| 1174 | * it would get cleared in the kernel page table too. | ||
| 1175 | * | ||
| 1176 | * efi_cleanup_page_tables(__pa(new_memmap), 1 << pg_shift); | ||
| 1177 | */ | ||
| 1178 | free_pages((unsigned long)new_memmap, pg_shift); | ||
| 1075 | 1179 | ||
| 1076 | /* clean DUMMY object */ | 1180 | /* clean DUMMY object */ |
| 1077 | efi.set_variable(efi_dummy_name, &EFI_DUMMY_GUID, | 1181 | efi.set_variable(efi_dummy_name, &EFI_DUMMY_GUID, |
| @@ -1081,6 +1185,14 @@ void __init efi_enter_virtual_mode(void) | |||
| 1081 | 0, NULL); | 1185 | 0, NULL); |
| 1082 | } | 1186 | } |
| 1083 | 1187 | ||
| 1188 | void __init efi_enter_virtual_mode(void) | ||
| 1189 | { | ||
| 1190 | if (efi_setup) | ||
| 1191 | kexec_enter_virtual_mode(); | ||
| 1192 | else | ||
| 1193 | __efi_enter_virtual_mode(); | ||
| 1194 | } | ||
| 1195 | |||
| 1084 | /* | 1196 | /* |
| 1085 | * Convenience functions to obtain memory types and attributes | 1197 | * Convenience functions to obtain memory types and attributes |
| 1086 | */ | 1198 | */ |
| @@ -1118,9 +1230,8 @@ u64 efi_mem_attributes(unsigned long phys_addr) | |||
| 1118 | } | 1230 | } |
| 1119 | 1231 | ||
| 1120 | /* | 1232 | /* |
| 1121 | * Some firmware has serious problems when using more than 50% of the EFI | 1233 | * Some firmware implementations refuse to boot if there's insufficient space |
| 1122 | * variable store, i.e. it triggers bugs that can brick machines. Ensure that | 1234 | * in the variable store. Ensure that we never use more than a safe limit. |
| 1123 | * we never use more than this safe limit. | ||
| 1124 | * | 1235 | * |
| 1125 | * Return EFI_SUCCESS if it is safe to write 'size' bytes to the variable | 1236 | * Return EFI_SUCCESS if it is safe to write 'size' bytes to the variable |
| 1126 | * store. | 1237 | * store. |
| @@ -1139,10 +1250,9 @@ efi_status_t efi_query_variable_store(u32 attributes, unsigned long size) | |||
| 1139 | return status; | 1250 | return status; |
| 1140 | 1251 | ||
| 1141 | /* | 1252 | /* |
| 1142 | * Some firmware implementations refuse to boot if there's insufficient | 1253 | * We account for that by refusing the write if permitting it would |
| 1143 | * space in the variable store. We account for that by refusing the | 1254 | * reduce the available space to under 5KB. This figure was provided by |
| 1144 | * write if permitting it would reduce the available space to under | 1255 | * Samsung, so should be safe. |
| 1145 | * 5KB. This figure was provided by Samsung, so should be safe. | ||
| 1146 | */ | 1256 | */ |
| 1147 | if ((remaining_size - size < EFI_MIN_RESERVE) && | 1257 | if ((remaining_size - size < EFI_MIN_RESERVE) && |
| 1148 | !efi_no_storage_paranoia) { | 1258 | !efi_no_storage_paranoia) { |
| @@ -1205,8 +1315,27 @@ static int __init parse_efi_cmdline(char *str) | |||
| 1205 | str++; | 1315 | str++; |
| 1206 | 1316 | ||
| 1207 | if (!strncmp(str, "old_map", 7)) | 1317 | if (!strncmp(str, "old_map", 7)) |
| 1208 | set_bit(EFI_OLD_MEMMAP, &x86_efi_facility); | 1318 | set_bit(EFI_OLD_MEMMAP, &efi.flags); |
| 1209 | 1319 | ||
| 1210 | return 0; | 1320 | return 0; |
| 1211 | } | 1321 | } |
| 1212 | early_param("efi", parse_efi_cmdline); | 1322 | early_param("efi", parse_efi_cmdline); |
| 1323 | |||
| 1324 | void __init efi_apply_memmap_quirks(void) | ||
| 1325 | { | ||
| 1326 | /* | ||
| 1327 | * Once setup is done earlier, unmap the EFI memory map on mismatched | ||
| 1328 | * firmware/kernel architectures since there is no support for runtime | ||
| 1329 | * services. | ||
| 1330 | */ | ||
| 1331 | if (!efi_runtime_supported()) { | ||
| 1332 | pr_info("efi: Setup done, disabling due to 32/64-bit mismatch\n"); | ||
| 1333 | efi_unmap_memmap(); | ||
| 1334 | } | ||
| 1335 | |||
| 1336 | /* | ||
| 1337 | * UV doesn't support the new EFI pagetable mapping yet. | ||
| 1338 | */ | ||
| 1339 | if (is_uv_system()) | ||
| 1340 | set_bit(EFI_OLD_MEMMAP, &efi.flags); | ||
| 1341 | } | ||
diff --git a/arch/x86/platform/efi/efi_32.c b/arch/x86/platform/efi/efi_32.c index 0b74cdf7f816..9ee3491e31fb 100644 --- a/arch/x86/platform/efi/efi_32.c +++ b/arch/x86/platform/efi/efi_32.c | |||
| @@ -40,7 +40,12 @@ | |||
| 40 | static unsigned long efi_rt_eflags; | 40 | static unsigned long efi_rt_eflags; |
| 41 | 41 | ||
| 42 | void efi_sync_low_kernel_mappings(void) {} | 42 | void efi_sync_low_kernel_mappings(void) {} |
| 43 | void efi_setup_page_tables(void) {} | 43 | void __init efi_dump_pagetable(void) {} |
| 44 | int efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) | ||
| 45 | { | ||
| 46 | return 0; | ||
| 47 | } | ||
| 48 | void efi_cleanup_page_tables(unsigned long pa_memmap, unsigned num_pages) {} | ||
| 44 | 49 | ||
| 45 | void __init efi_map_region(efi_memory_desc_t *md) | 50 | void __init efi_map_region(efi_memory_desc_t *md) |
| 46 | { | 51 | { |
diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c index 0c2a234fef1e..290d397e1dd9 100644 --- a/arch/x86/platform/efi/efi_64.c +++ b/arch/x86/platform/efi/efi_64.c | |||
| @@ -39,6 +39,7 @@ | |||
| 39 | #include <asm/cacheflush.h> | 39 | #include <asm/cacheflush.h> |
| 40 | #include <asm/fixmap.h> | 40 | #include <asm/fixmap.h> |
| 41 | #include <asm/realmode.h> | 41 | #include <asm/realmode.h> |
| 42 | #include <asm/time.h> | ||
| 42 | 43 | ||
| 43 | static pgd_t *save_pgd __initdata; | 44 | static pgd_t *save_pgd __initdata; |
| 44 | static unsigned long efi_flags __initdata; | 45 | static unsigned long efi_flags __initdata; |
| @@ -58,7 +59,8 @@ struct efi_scratch { | |||
| 58 | u64 prev_cr3; | 59 | u64 prev_cr3; |
| 59 | pgd_t *efi_pgt; | 60 | pgd_t *efi_pgt; |
| 60 | bool use_pgd; | 61 | bool use_pgd; |
| 61 | }; | 62 | u64 phys_stack; |
| 63 | } __packed; | ||
| 62 | 64 | ||
| 63 | static void __init early_code_mapping_set_exec(int executable) | 65 | static void __init early_code_mapping_set_exec(int executable) |
| 64 | { | 66 | { |
| @@ -137,12 +139,64 @@ void efi_sync_low_kernel_mappings(void) | |||
| 137 | sizeof(pgd_t) * num_pgds); | 139 | sizeof(pgd_t) * num_pgds); |
| 138 | } | 140 | } |
| 139 | 141 | ||
| 140 | void efi_setup_page_tables(void) | 142 | int efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) |
| 141 | { | 143 | { |
| 144 | unsigned long text; | ||
| 145 | struct page *page; | ||
| 146 | unsigned npages; | ||
| 147 | pgd_t *pgd; | ||
| 148 | |||
| 149 | if (efi_enabled(EFI_OLD_MEMMAP)) | ||
| 150 | return 0; | ||
| 151 | |||
| 142 | efi_scratch.efi_pgt = (pgd_t *)(unsigned long)real_mode_header->trampoline_pgd; | 152 | efi_scratch.efi_pgt = (pgd_t *)(unsigned long)real_mode_header->trampoline_pgd; |
| 153 | pgd = __va(efi_scratch.efi_pgt); | ||
| 143 | 154 | ||
| 144 | if (!efi_enabled(EFI_OLD_MEMMAP)) | 155 | /* |
| 145 | efi_scratch.use_pgd = true; | 156 | * It can happen that the physical address of new_memmap lands in memory |
| 157 | * which is not mapped in the EFI page table. Therefore we need to go | ||
| 158 | * and ident-map those pages containing the map before calling | ||
| 159 | * phys_efi_set_virtual_address_map(). | ||
| 160 | */ | ||
| 161 | if (kernel_map_pages_in_pgd(pgd, pa_memmap, pa_memmap, num_pages, _PAGE_NX)) { | ||
| 162 | pr_err("Error ident-mapping new memmap (0x%lx)!\n", pa_memmap); | ||
| 163 | return 1; | ||
| 164 | } | ||
| 165 | |||
| 166 | efi_scratch.use_pgd = true; | ||
| 167 | |||
| 168 | /* | ||
| 169 | * When making calls to the firmware everything needs to be 1:1 | ||
| 170 | * mapped and addressable with 32-bit pointers. Map the kernel | ||
| 171 | * text and allocate a new stack because we can't rely on the | ||
| 172 | * stack pointer being < 4GB. | ||
| 173 | */ | ||
| 174 | if (!IS_ENABLED(CONFIG_EFI_MIXED)) | ||
| 175 | return 0; | ||
| 176 | |||
| 177 | page = alloc_page(GFP_KERNEL|__GFP_DMA32); | ||
| 178 | if (!page) | ||
| 179 | panic("Unable to allocate EFI runtime stack < 4GB\n"); | ||
| 180 | |||
| 181 | efi_scratch.phys_stack = virt_to_phys(page_address(page)); | ||
| 182 | efi_scratch.phys_stack += PAGE_SIZE; /* stack grows down */ | ||
| 183 | |||
| 184 | npages = (_end - _text) >> PAGE_SHIFT; | ||
| 185 | text = __pa(_text); | ||
| 186 | |||
| 187 | if (kernel_map_pages_in_pgd(pgd, text >> PAGE_SHIFT, text, npages, 0)) { | ||
| 188 | pr_err("Failed to map kernel text 1:1\n"); | ||
| 189 | return 1; | ||
| 190 | } | ||
| 191 | |||
| 192 | return 0; | ||
| 193 | } | ||
| 194 | |||
| 195 | void efi_cleanup_page_tables(unsigned long pa_memmap, unsigned num_pages) | ||
| 196 | { | ||
| 197 | pgd_t *pgd = (pgd_t *)__va(real_mode_header->trampoline_pgd); | ||
| 198 | |||
| 199 | kernel_unmap_pages_in_pgd(pgd, pa_memmap, num_pages); | ||
| 146 | } | 200 | } |
| 147 | 201 | ||
| 148 | static void __init __map_region(efi_memory_desc_t *md, u64 va) | 202 | static void __init __map_region(efi_memory_desc_t *md, u64 va) |
| @@ -173,6 +227,16 @@ void __init efi_map_region(efi_memory_desc_t *md) | |||
| 173 | */ | 227 | */ |
| 174 | __map_region(md, md->phys_addr); | 228 | __map_region(md, md->phys_addr); |
| 175 | 229 | ||
| 230 | /* | ||
| 231 | * Enforce the 1:1 mapping as the default virtual address when | ||
| 232 | * booting in EFI mixed mode, because even though we may be | ||
| 233 | * running a 64-bit kernel, the firmware may only be 32-bit. | ||
| 234 | */ | ||
| 235 | if (!efi_is_native () && IS_ENABLED(CONFIG_EFI_MIXED)) { | ||
| 236 | md->virt_addr = md->phys_addr; | ||
| 237 | return; | ||
| 238 | } | ||
| 239 | |||
| 176 | efi_va -= size; | 240 | efi_va -= size; |
| 177 | 241 | ||
| 178 | /* Is PA 2M-aligned? */ | 242 | /* Is PA 2M-aligned? */ |
| @@ -242,3 +306,299 @@ void __init efi_runtime_mkexec(void) | |||
| 242 | if (__supported_pte_mask & _PAGE_NX) | 306 | if (__supported_pte_mask & _PAGE_NX) |
| 243 | runtime_code_page_mkexec(); | 307 | runtime_code_page_mkexec(); |
| 244 | } | 308 | } |
| 309 | |||
| 310 | void __init efi_dump_pagetable(void) | ||
| 311 | { | ||
| 312 | #ifdef CONFIG_EFI_PGT_DUMP | ||
| 313 | pgd_t *pgd = (pgd_t *)__va(real_mode_header->trampoline_pgd); | ||
| 314 | |||
| 315 | ptdump_walk_pgd_level(NULL, pgd); | ||
| 316 | #endif | ||
| 317 | } | ||
| 318 | |||
| 319 | #ifdef CONFIG_EFI_MIXED | ||
| 320 | extern efi_status_t efi64_thunk(u32, ...); | ||
| 321 | |||
| 322 | #define runtime_service32(func) \ | ||
| 323 | ({ \ | ||
| 324 | u32 table = (u32)(unsigned long)efi.systab; \ | ||
| 325 | u32 *rt, *___f; \ | ||
| 326 | \ | ||
| 327 | rt = (u32 *)(table + offsetof(efi_system_table_32_t, runtime)); \ | ||
| 328 | ___f = (u32 *)(*rt + offsetof(efi_runtime_services_32_t, func)); \ | ||
| 329 | *___f; \ | ||
| 330 | }) | ||
| 331 | |||
| 332 | /* | ||
| 333 | * Switch to the EFI page tables early so that we can access the 1:1 | ||
| 334 | * runtime services mappings which are not mapped in any other page | ||
| 335 | * tables. This function must be called before runtime_service32(). | ||
| 336 | * | ||
| 337 | * Also, disable interrupts because the IDT points to 64-bit handlers, | ||
| 338 | * which aren't going to function correctly when we switch to 32-bit. | ||
| 339 | */ | ||
| 340 | #define efi_thunk(f, ...) \ | ||
| 341 | ({ \ | ||
| 342 | efi_status_t __s; \ | ||
| 343 | unsigned long flags; \ | ||
| 344 | u32 func; \ | ||
| 345 | \ | ||
| 346 | efi_sync_low_kernel_mappings(); \ | ||
| 347 | local_irq_save(flags); \ | ||
| 348 | \ | ||
| 349 | efi_scratch.prev_cr3 = read_cr3(); \ | ||
| 350 | write_cr3((unsigned long)efi_scratch.efi_pgt); \ | ||
| 351 | __flush_tlb_all(); \ | ||
| 352 | \ | ||
| 353 | func = runtime_service32(f); \ | ||
| 354 | __s = efi64_thunk(func, __VA_ARGS__); \ | ||
| 355 | \ | ||
| 356 | write_cr3(efi_scratch.prev_cr3); \ | ||
| 357 | __flush_tlb_all(); \ | ||
| 358 | local_irq_restore(flags); \ | ||
| 359 | \ | ||
| 360 | __s; \ | ||
| 361 | }) | ||
| 362 | |||
| 363 | efi_status_t efi_thunk_set_virtual_address_map( | ||
| 364 | void *phys_set_virtual_address_map, | ||
| 365 | unsigned long memory_map_size, | ||
| 366 | unsigned long descriptor_size, | ||
| 367 | u32 descriptor_version, | ||
| 368 | efi_memory_desc_t *virtual_map) | ||
| 369 | { | ||
| 370 | efi_status_t status; | ||
| 371 | unsigned long flags; | ||
| 372 | u32 func; | ||
| 373 | |||
| 374 | efi_sync_low_kernel_mappings(); | ||
| 375 | local_irq_save(flags); | ||
| 376 | |||
| 377 | efi_scratch.prev_cr3 = read_cr3(); | ||
| 378 | write_cr3((unsigned long)efi_scratch.efi_pgt); | ||
| 379 | __flush_tlb_all(); | ||
| 380 | |||
| 381 | func = (u32)(unsigned long)phys_set_virtual_address_map; | ||
| 382 | status = efi64_thunk(func, memory_map_size, descriptor_size, | ||
| 383 | descriptor_version, virtual_map); | ||
| 384 | |||
| 385 | write_cr3(efi_scratch.prev_cr3); | ||
| 386 | __flush_tlb_all(); | ||
| 387 | local_irq_restore(flags); | ||
| 388 | |||
| 389 | return status; | ||
| 390 | } | ||
| 391 | |||
| 392 | static efi_status_t efi_thunk_get_time(efi_time_t *tm, efi_time_cap_t *tc) | ||
| 393 | { | ||
| 394 | efi_status_t status; | ||
| 395 | u32 phys_tm, phys_tc; | ||
| 396 | |||
| 397 | spin_lock(&rtc_lock); | ||
| 398 | |||
| 399 | phys_tm = virt_to_phys(tm); | ||
| 400 | phys_tc = virt_to_phys(tc); | ||
| 401 | |||
| 402 | status = efi_thunk(get_time, phys_tm, phys_tc); | ||
| 403 | |||
| 404 | spin_unlock(&rtc_lock); | ||
| 405 | |||
| 406 | return status; | ||
| 407 | } | ||
| 408 | |||
| 409 | static efi_status_t efi_thunk_set_time(efi_time_t *tm) | ||
| 410 | { | ||
| 411 | efi_status_t status; | ||
| 412 | u32 phys_tm; | ||
| 413 | |||
| 414 | spin_lock(&rtc_lock); | ||
| 415 | |||
| 416 | phys_tm = virt_to_phys(tm); | ||
| 417 | |||
| 418 | status = efi_thunk(set_time, phys_tm); | ||
| 419 | |||
| 420 | spin_unlock(&rtc_lock); | ||
| 421 | |||
| 422 | return status; | ||
| 423 | } | ||
| 424 | |||
| 425 | static efi_status_t | ||
| 426 | efi_thunk_get_wakeup_time(efi_bool_t *enabled, efi_bool_t *pending, | ||
| 427 | efi_time_t *tm) | ||
| 428 | { | ||
| 429 | efi_status_t status; | ||
| 430 | u32 phys_enabled, phys_pending, phys_tm; | ||
| 431 | |||
| 432 | spin_lock(&rtc_lock); | ||
| 433 | |||
| 434 | phys_enabled = virt_to_phys(enabled); | ||
| 435 | phys_pending = virt_to_phys(pending); | ||
| 436 | phys_tm = virt_to_phys(tm); | ||
| 437 | |||
| 438 | status = efi_thunk(get_wakeup_time, phys_enabled, | ||
| 439 | phys_pending, phys_tm); | ||
| 440 | |||
| 441 | spin_unlock(&rtc_lock); | ||
| 442 | |||
| 443 | return status; | ||
| 444 | } | ||
| 445 | |||
| 446 | static efi_status_t | ||
| 447 | efi_thunk_set_wakeup_time(efi_bool_t enabled, efi_time_t *tm) | ||
| 448 | { | ||
| 449 | efi_status_t status; | ||
| 450 | u32 phys_tm; | ||
| 451 | |||
| 452 | spin_lock(&rtc_lock); | ||
| 453 | |||
| 454 | phys_tm = virt_to_phys(tm); | ||
| 455 | |||
| 456 | status = efi_thunk(set_wakeup_time, enabled, phys_tm); | ||
| 457 | |||
| 458 | spin_unlock(&rtc_lock); | ||
| 459 | |||
| 460 | return status; | ||
| 461 | } | ||
| 462 | |||
| 463 | |||
| 464 | static efi_status_t | ||
| 465 | efi_thunk_get_variable(efi_char16_t *name, efi_guid_t *vendor, | ||
| 466 | u32 *attr, unsigned long *data_size, void *data) | ||
| 467 | { | ||
| 468 | efi_status_t status; | ||
| 469 | u32 phys_name, phys_vendor, phys_attr; | ||
| 470 | u32 phys_data_size, phys_data; | ||
| 471 | |||
| 472 | phys_data_size = virt_to_phys(data_size); | ||
| 473 | phys_vendor = virt_to_phys(vendor); | ||
| 474 | phys_name = virt_to_phys(name); | ||
| 475 | phys_attr = virt_to_phys(attr); | ||
| 476 | phys_data = virt_to_phys(data); | ||
| 477 | |||
| 478 | status = efi_thunk(get_variable, phys_name, phys_vendor, | ||
| 479 | phys_attr, phys_data_size, phys_data); | ||
| 480 | |||
| 481 | return status; | ||
| 482 | } | ||
| 483 | |||
| 484 | static efi_status_t | ||
| 485 | efi_thunk_set_variable(efi_char16_t *name, efi_guid_t *vendor, | ||
| 486 | u32 attr, unsigned long data_size, void *data) | ||
| 487 | { | ||
| 488 | u32 phys_name, phys_vendor, phys_data; | ||
| 489 | efi_status_t status; | ||
| 490 | |||
| 491 | phys_name = virt_to_phys(name); | ||
| 492 | phys_vendor = virt_to_phys(vendor); | ||
| 493 | phys_data = virt_to_phys(data); | ||
| 494 | |||
| 495 | /* If data_size is > sizeof(u32) we've got problems */ | ||
| 496 | status = efi_thunk(set_variable, phys_name, phys_vendor, | ||
| 497 | attr, data_size, phys_data); | ||
| 498 | |||
| 499 | return status; | ||
| 500 | } | ||
| 501 | |||
| 502 | static efi_status_t | ||
| 503 | efi_thunk_get_next_variable(unsigned long *name_size, | ||
| 504 | efi_char16_t *name, | ||
| 505 | efi_guid_t *vendor) | ||
| 506 | { | ||
| 507 | efi_status_t status; | ||
| 508 | u32 phys_name_size, phys_name, phys_vendor; | ||
| 509 | |||
| 510 | phys_name_size = virt_to_phys(name_size); | ||
| 511 | phys_vendor = virt_to_phys(vendor); | ||
| 512 | phys_name = virt_to_phys(name); | ||
| 513 | |||
| 514 | status = efi_thunk(get_next_variable, phys_name_size, | ||
| 515 | phys_name, phys_vendor); | ||
| 516 | |||
| 517 | return status; | ||
| 518 | } | ||
| 519 | |||
| 520 | static efi_status_t | ||
| 521 | efi_thunk_get_next_high_mono_count(u32 *count) | ||
| 522 | { | ||
| 523 | efi_status_t status; | ||
| 524 | u32 phys_count; | ||
| 525 | |||
| 526 | phys_count = virt_to_phys(count); | ||
| 527 | status = efi_thunk(get_next_high_mono_count, phys_count); | ||
| 528 | |||
| 529 | return status; | ||
| 530 | } | ||
| 531 | |||
| 532 | static void | ||
| 533 | efi_thunk_reset_system(int reset_type, efi_status_t status, | ||
| 534 | unsigned long data_size, efi_char16_t *data) | ||
| 535 | { | ||
| 536 | u32 phys_data; | ||
| 537 | |||
| 538 | phys_data = virt_to_phys(data); | ||
| 539 | |||
| 540 | efi_thunk(reset_system, reset_type, status, data_size, phys_data); | ||
| 541 | } | ||
| 542 | |||
| 543 | static efi_status_t | ||
| 544 | efi_thunk_update_capsule(efi_capsule_header_t **capsules, | ||
| 545 | unsigned long count, unsigned long sg_list) | ||
| 546 | { | ||
| 547 | /* | ||
| 548 | * To properly support this function we would need to repackage | ||
| 549 | * 'capsules' because the firmware doesn't understand 64-bit | ||
| 550 | * pointers. | ||
| 551 | */ | ||
| 552 | return EFI_UNSUPPORTED; | ||
| 553 | } | ||
| 554 | |||
| 555 | static efi_status_t | ||
| 556 | efi_thunk_query_variable_info(u32 attr, u64 *storage_space, | ||
| 557 | u64 *remaining_space, | ||
| 558 | u64 *max_variable_size) | ||
| 559 | { | ||
| 560 | efi_status_t status; | ||
| 561 | u32 phys_storage, phys_remaining, phys_max; | ||
| 562 | |||
| 563 | if (efi.runtime_version < EFI_2_00_SYSTEM_TABLE_REVISION) | ||
| 564 | return EFI_UNSUPPORTED; | ||
| 565 | |||
| 566 | phys_storage = virt_to_phys(storage_space); | ||
| 567 | phys_remaining = virt_to_phys(remaining_space); | ||
| 568 | phys_max = virt_to_phys(max_variable_size); | ||
| 569 | |||
| 570 | status = efi_thunk(query_variable_info, attr, phys_storage, | ||
| 571 | phys_remaining, phys_max); | ||
| 572 | |||
| 573 | return status; | ||
| 574 | } | ||
| 575 | |||
| 576 | static efi_status_t | ||
| 577 | efi_thunk_query_capsule_caps(efi_capsule_header_t **capsules, | ||
| 578 | unsigned long count, u64 *max_size, | ||
| 579 | int *reset_type) | ||
| 580 | { | ||
| 581 | /* | ||
| 582 | * To properly support this function we would need to repackage | ||
| 583 | * 'capsules' because the firmware doesn't understand 64-bit | ||
| 584 | * pointers. | ||
| 585 | */ | ||
| 586 | return EFI_UNSUPPORTED; | ||
| 587 | } | ||
| 588 | |||
| 589 | void efi_thunk_runtime_setup(void) | ||
| 590 | { | ||
| 591 | efi.get_time = efi_thunk_get_time; | ||
| 592 | efi.set_time = efi_thunk_set_time; | ||
| 593 | efi.get_wakeup_time = efi_thunk_get_wakeup_time; | ||
| 594 | efi.set_wakeup_time = efi_thunk_set_wakeup_time; | ||
| 595 | efi.get_variable = efi_thunk_get_variable; | ||
| 596 | efi.get_next_variable = efi_thunk_get_next_variable; | ||
| 597 | efi.set_variable = efi_thunk_set_variable; | ||
| 598 | efi.get_next_high_mono_count = efi_thunk_get_next_high_mono_count; | ||
| 599 | efi.reset_system = efi_thunk_reset_system; | ||
| 600 | efi.query_variable_info = efi_thunk_query_variable_info; | ||
| 601 | efi.update_capsule = efi_thunk_update_capsule; | ||
| 602 | efi.query_capsule_caps = efi_thunk_query_capsule_caps; | ||
| 603 | } | ||
| 604 | #endif /* CONFIG_EFI_MIXED */ | ||
diff --git a/arch/x86/platform/efi/efi_stub_64.S b/arch/x86/platform/efi/efi_stub_64.S index 88073b140298..e0984ef0374b 100644 --- a/arch/x86/platform/efi/efi_stub_64.S +++ b/arch/x86/platform/efi/efi_stub_64.S | |||
| @@ -7,6 +7,10 @@ | |||
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #include <linux/linkage.h> | 9 | #include <linux/linkage.h> |
| 10 | #include <asm/segment.h> | ||
| 11 | #include <asm/msr.h> | ||
| 12 | #include <asm/processor-flags.h> | ||
| 13 | #include <asm/page_types.h> | ||
| 10 | 14 | ||
| 11 | #define SAVE_XMM \ | 15 | #define SAVE_XMM \ |
| 12 | mov %rsp, %rax; \ | 16 | mov %rsp, %rax; \ |
| @@ -164,7 +168,169 @@ ENTRY(efi_call6) | |||
| 164 | ret | 168 | ret |
| 165 | ENDPROC(efi_call6) | 169 | ENDPROC(efi_call6) |
| 166 | 170 | ||
| 171 | #ifdef CONFIG_EFI_MIXED | ||
| 172 | |||
| 173 | /* | ||
| 174 | * We run this function from the 1:1 mapping. | ||
| 175 | * | ||
| 176 | * This function must be invoked with a 1:1 mapped stack. | ||
| 177 | */ | ||
| 178 | ENTRY(__efi64_thunk) | ||
| 179 | movl %ds, %eax | ||
| 180 | push %rax | ||
| 181 | movl %es, %eax | ||
| 182 | push %rax | ||
| 183 | movl %ss, %eax | ||
| 184 | push %rax | ||
| 185 | |||
| 186 | subq $32, %rsp | ||
| 187 | movl %esi, 0x0(%rsp) | ||
| 188 | movl %edx, 0x4(%rsp) | ||
| 189 | movl %ecx, 0x8(%rsp) | ||
| 190 | movq %r8, %rsi | ||
| 191 | movl %esi, 0xc(%rsp) | ||
| 192 | movq %r9, %rsi | ||
| 193 | movl %esi, 0x10(%rsp) | ||
| 194 | |||
| 195 | sgdt save_gdt(%rip) | ||
| 196 | |||
| 197 | leaq 1f(%rip), %rbx | ||
| 198 | movq %rbx, func_rt_ptr(%rip) | ||
| 199 | |||
| 200 | /* Switch to gdt with 32-bit segments */ | ||
| 201 | movl 64(%rsp), %eax | ||
| 202 | lgdt (%rax) | ||
| 203 | |||
| 204 | leaq efi_enter32(%rip), %rax | ||
| 205 | pushq $__KERNEL_CS | ||
| 206 | pushq %rax | ||
| 207 | lretq | ||
| 208 | |||
| 209 | 1: addq $32, %rsp | ||
| 210 | |||
| 211 | lgdt save_gdt(%rip) | ||
| 212 | |||
| 213 | pop %rbx | ||
| 214 | movl %ebx, %ss | ||
| 215 | pop %rbx | ||
| 216 | movl %ebx, %es | ||
| 217 | pop %rbx | ||
| 218 | movl %ebx, %ds | ||
| 219 | |||
| 220 | /* | ||
| 221 | * Convert 32-bit status code into 64-bit. | ||
| 222 | */ | ||
| 223 | test %rax, %rax | ||
| 224 | jz 1f | ||
| 225 | movl %eax, %ecx | ||
| 226 | andl $0x0fffffff, %ecx | ||
| 227 | andl $0xf0000000, %eax | ||
| 228 | shl $32, %rax | ||
| 229 | or %rcx, %rax | ||
| 230 | 1: | ||
| 231 | ret | ||
| 232 | ENDPROC(__efi64_thunk) | ||
| 233 | |||
| 234 | ENTRY(efi_exit32) | ||
| 235 | movq func_rt_ptr(%rip), %rax | ||
| 236 | push %rax | ||
| 237 | mov %rdi, %rax | ||
| 238 | ret | ||
| 239 | ENDPROC(efi_exit32) | ||
| 240 | |||
| 241 | .code32 | ||
| 242 | /* | ||
| 243 | * EFI service pointer must be in %edi. | ||
| 244 | * | ||
| 245 | * The stack should represent the 32-bit calling convention. | ||
| 246 | */ | ||
| 247 | ENTRY(efi_enter32) | ||
| 248 | movl $__KERNEL_DS, %eax | ||
| 249 | movl %eax, %ds | ||
| 250 | movl %eax, %es | ||
| 251 | movl %eax, %ss | ||
| 252 | |||
| 253 | /* Reload pgtables */ | ||
| 254 | movl %cr3, %eax | ||
| 255 | movl %eax, %cr3 | ||
| 256 | |||
| 257 | /* Disable paging */ | ||
| 258 | movl %cr0, %eax | ||
| 259 | btrl $X86_CR0_PG_BIT, %eax | ||
| 260 | movl %eax, %cr0 | ||
| 261 | |||
| 262 | /* Disable long mode via EFER */ | ||
| 263 | movl $MSR_EFER, %ecx | ||
| 264 | rdmsr | ||
| 265 | btrl $_EFER_LME, %eax | ||
| 266 | wrmsr | ||
| 267 | |||
| 268 | call *%edi | ||
| 269 | |||
| 270 | /* We must preserve return value */ | ||
| 271 | movl %eax, %edi | ||
| 272 | |||
| 273 | /* | ||
| 274 | * Some firmware will return with interrupts enabled. Be sure to | ||
| 275 | * disable them before we switch GDTs. | ||
| 276 | */ | ||
| 277 | cli | ||
| 278 | |||
| 279 | movl 68(%esp), %eax | ||
| 280 | movl %eax, 2(%eax) | ||
| 281 | lgdtl (%eax) | ||
| 282 | |||
| 283 | movl %cr4, %eax | ||
| 284 | btsl $(X86_CR4_PAE_BIT), %eax | ||
| 285 | movl %eax, %cr4 | ||
| 286 | |||
| 287 | movl %cr3, %eax | ||
| 288 | movl %eax, %cr3 | ||
| 289 | |||
| 290 | movl $MSR_EFER, %ecx | ||
| 291 | rdmsr | ||
| 292 | btsl $_EFER_LME, %eax | ||
| 293 | wrmsr | ||
| 294 | |||
| 295 | xorl %eax, %eax | ||
| 296 | lldt %ax | ||
| 297 | |||
| 298 | movl 72(%esp), %eax | ||
| 299 | pushl $__KERNEL_CS | ||
| 300 | pushl %eax | ||
| 301 | |||
| 302 | /* Enable paging */ | ||
| 303 | movl %cr0, %eax | ||
| 304 | btsl $X86_CR0_PG_BIT, %eax | ||
| 305 | movl %eax, %cr0 | ||
| 306 | lret | ||
| 307 | ENDPROC(efi_enter32) | ||
| 308 | |||
| 309 | .data | ||
| 310 | .balign 8 | ||
| 311 | .global efi32_boot_gdt | ||
| 312 | efi32_boot_gdt: .word 0 | ||
| 313 | .quad 0 | ||
| 314 | |||
| 315 | save_gdt: .word 0 | ||
| 316 | .quad 0 | ||
| 317 | func_rt_ptr: .quad 0 | ||
| 318 | |||
| 319 | .global efi_gdt64 | ||
| 320 | efi_gdt64: | ||
| 321 | .word efi_gdt64_end - efi_gdt64 | ||
| 322 | .long 0 /* Filled out by user */ | ||
| 323 | .word 0 | ||
| 324 | .quad 0x0000000000000000 /* NULL descriptor */ | ||
| 325 | .quad 0x00af9a000000ffff /* __KERNEL_CS */ | ||
| 326 | .quad 0x00cf92000000ffff /* __KERNEL_DS */ | ||
| 327 | .quad 0x0080890000000000 /* TS descriptor */ | ||
| 328 | .quad 0x0000000000000000 /* TS continued */ | ||
| 329 | efi_gdt64_end: | ||
| 330 | #endif /* CONFIG_EFI_MIXED */ | ||
| 331 | |||
| 167 | .data | 332 | .data |
| 168 | ENTRY(efi_scratch) | 333 | ENTRY(efi_scratch) |
| 169 | .fill 3,8,0 | 334 | .fill 3,8,0 |
| 170 | .byte 0 | 335 | .byte 0 |
| 336 | .quad 0 | ||
diff --git a/arch/x86/platform/efi/efi_thunk_64.S b/arch/x86/platform/efi/efi_thunk_64.S new file mode 100644 index 000000000000..8806fa73e6e6 --- /dev/null +++ b/arch/x86/platform/efi/efi_thunk_64.S | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2014 Intel Corporation; author Matt Fleming | ||
| 3 | */ | ||
| 4 | |||
| 5 | #include <linux/linkage.h> | ||
| 6 | #include <asm/page_types.h> | ||
| 7 | |||
| 8 | .text | ||
| 9 | .code64 | ||
| 10 | ENTRY(efi64_thunk) | ||
| 11 | push %rbp | ||
| 12 | push %rbx | ||
| 13 | |||
| 14 | /* | ||
| 15 | * Switch to 1:1 mapped 32-bit stack pointer. | ||
| 16 | */ | ||
| 17 | movq %rsp, efi_saved_sp(%rip) | ||
| 18 | movq efi_scratch+25(%rip), %rsp | ||
| 19 | |||
| 20 | /* | ||
| 21 | * Calculate the physical address of the kernel text. | ||
| 22 | */ | ||
| 23 | movq $__START_KERNEL_map, %rax | ||
| 24 | subq phys_base(%rip), %rax | ||
| 25 | |||
| 26 | /* | ||
| 27 | * Push some physical addresses onto the stack. This is easier | ||
| 28 | * to do now in a code64 section while the assembler can address | ||
| 29 | * 64-bit values. Note that all the addresses on the stack are | ||
| 30 | * 32-bit. | ||
| 31 | */ | ||
| 32 | subq $16, %rsp | ||
| 33 | leaq efi_exit32(%rip), %rbx | ||
| 34 | subq %rax, %rbx | ||
| 35 | movl %ebx, 8(%rsp) | ||
| 36 | leaq efi_gdt64(%rip), %rbx | ||
| 37 | subq %rax, %rbx | ||
| 38 | movl %ebx, 2(%ebx) | ||
| 39 | movl %ebx, 4(%rsp) | ||
| 40 | leaq efi_gdt32(%rip), %rbx | ||
| 41 | subq %rax, %rbx | ||
| 42 | movl %ebx, 2(%ebx) | ||
| 43 | movl %ebx, (%rsp) | ||
| 44 | |||
| 45 | leaq __efi64_thunk(%rip), %rbx | ||
| 46 | subq %rax, %rbx | ||
| 47 | call *%rbx | ||
| 48 | |||
| 49 | movq efi_saved_sp(%rip), %rsp | ||
| 50 | pop %rbx | ||
| 51 | pop %rbp | ||
| 52 | retq | ||
| 53 | ENDPROC(efi64_thunk) | ||
| 54 | |||
| 55 | .data | ||
| 56 | efi_gdt32: | ||
| 57 | .word efi_gdt32_end - efi_gdt32 | ||
| 58 | .long 0 /* Filled out above */ | ||
| 59 | .word 0 | ||
| 60 | .quad 0x0000000000000000 /* NULL descriptor */ | ||
| 61 | .quad 0x00cf9a000000ffff /* __KERNEL_CS */ | ||
| 62 | .quad 0x00cf93000000ffff /* __KERNEL_DS */ | ||
| 63 | efi_gdt32_end: | ||
| 64 | |||
| 65 | efi_saved_sp: .quad 0 | ||
diff --git a/arch/x86/platform/ts5500/ts5500.c b/arch/x86/platform/ts5500/ts5500.c index 39febb214e8c..9471b9456f25 100644 --- a/arch/x86/platform/ts5500/ts5500.c +++ b/arch/x86/platform/ts5500/ts5500.c | |||
| @@ -88,7 +88,7 @@ struct ts5500_sbc { | |||
| 88 | static const struct { | 88 | static const struct { |
| 89 | const char * const string; | 89 | const char * const string; |
| 90 | const ssize_t offset; | 90 | const ssize_t offset; |
| 91 | } ts5500_signatures[] __initdata = { | 91 | } ts5500_signatures[] __initconst = { |
| 92 | { "TS-5x00 AMD Elan", 0xb14 }, | 92 | { "TS-5x00 AMD Elan", 0xb14 }, |
| 93 | }; | 93 | }; |
| 94 | 94 | ||
diff --git a/arch/x86/um/asm/barrier.h b/arch/x86/um/asm/barrier.h index 7d01b8c56c00..cc04e67bfd05 100644 --- a/arch/x86/um/asm/barrier.h +++ b/arch/x86/um/asm/barrier.h | |||
| @@ -40,11 +40,7 @@ | |||
| 40 | #define smp_rmb() barrier() | 40 | #define smp_rmb() barrier() |
| 41 | #endif /* CONFIG_X86_PPRO_FENCE */ | 41 | #endif /* CONFIG_X86_PPRO_FENCE */ |
| 42 | 42 | ||
| 43 | #ifdef CONFIG_X86_OOSTORE | ||
| 44 | #define smp_wmb() wmb() | ||
| 45 | #else /* CONFIG_X86_OOSTORE */ | ||
| 46 | #define smp_wmb() barrier() | 43 | #define smp_wmb() barrier() |
| 47 | #endif /* CONFIG_X86_OOSTORE */ | ||
| 48 | 44 | ||
| 49 | #define smp_read_barrier_depends() read_barrier_depends() | 45 | #define smp_read_barrier_depends() read_barrier_depends() |
| 50 | #define set_mb(var, value) do { (void)xchg(&var, value); } while (0) | 46 | #define set_mb(var, value) do { (void)xchg(&var, value); } while (0) |
diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile index fd14be1d1472..9206ac7961a5 100644 --- a/arch/x86/vdso/Makefile +++ b/arch/x86/vdso/Makefile | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | # Building vDSO images for x86. | 2 | # Building vDSO images for x86. |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | KBUILD_CFLAGS += $(DISABLE_LTO) | ||
| 6 | |||
| 5 | VDSO64-$(CONFIG_X86_64) := y | 7 | VDSO64-$(CONFIG_X86_64) := y |
| 6 | VDSOX32-$(CONFIG_X86_X32_ABI) := y | 8 | VDSOX32-$(CONFIG_X86_X32_ABI) := y |
| 7 | VDSO32-$(CONFIG_X86_32) := y | 9 | VDSO32-$(CONFIG_X86_32) := y |
| @@ -35,7 +37,8 @@ export CPPFLAGS_vdso.lds += -P -C | |||
| 35 | 37 | ||
| 36 | VDSO_LDFLAGS_vdso.lds = -m64 -Wl,-soname=linux-vdso.so.1 \ | 38 | VDSO_LDFLAGS_vdso.lds = -m64 -Wl,-soname=linux-vdso.so.1 \ |
| 37 | -Wl,--no-undefined \ | 39 | -Wl,--no-undefined \ |
| 38 | -Wl,-z,max-page-size=4096 -Wl,-z,common-page-size=4096 | 40 | -Wl,-z,max-page-size=4096 -Wl,-z,common-page-size=4096 \ |
| 41 | $(DISABLE_LTO) | ||
| 39 | 42 | ||
| 40 | $(obj)/vdso.o: $(src)/vdso.S $(obj)/vdso.so | 43 | $(obj)/vdso.o: $(src)/vdso.S $(obj)/vdso.so |
| 41 | 44 | ||
| @@ -127,7 +130,7 @@ vdso32.so-$(VDSO32-y) += sysenter | |||
| 127 | vdso32-images = $(vdso32.so-y:%=vdso32-%.so) | 130 | vdso32-images = $(vdso32.so-y:%=vdso32-%.so) |
| 128 | 131 | ||
| 129 | CPPFLAGS_vdso32.lds = $(CPPFLAGS_vdso.lds) | 132 | CPPFLAGS_vdso32.lds = $(CPPFLAGS_vdso.lds) |
| 130 | VDSO_LDFLAGS_vdso32.lds = -m32 -Wl,-soname=linux-gate.so.1 | 133 | VDSO_LDFLAGS_vdso32.lds = -m32 -Wl,-m,elf_i386 -Wl,-soname=linux-gate.so.1 |
| 131 | 134 | ||
| 132 | # This makes sure the $(obj) subdirectory exists even though vdso32/ | 135 | # This makes sure the $(obj) subdirectory exists even though vdso32/ |
| 133 | # is not a kbuild sub-make subdirectory. | 136 | # is not a kbuild sub-make subdirectory. |
| @@ -181,7 +184,8 @@ quiet_cmd_vdso = VDSO $@ | |||
| 181 | -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \ | 184 | -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \ |
| 182 | sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@' | 185 | sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@' |
| 183 | 186 | ||
| 184 | VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) | 187 | VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) \ |
| 188 | $(LTO_CFLAGS) | ||
| 185 | GCOV_PROFILE := n | 189 | GCOV_PROFILE := n |
| 186 | 190 | ||
| 187 | # | 191 | # |
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 256282e7888b..2423ef04ffea 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
| @@ -365,7 +365,7 @@ void xen_ptep_modify_prot_commit(struct mm_struct *mm, unsigned long addr, | |||
| 365 | /* Assume pteval_t is equivalent to all the other *val_t types. */ | 365 | /* Assume pteval_t is equivalent to all the other *val_t types. */ |
| 366 | static pteval_t pte_mfn_to_pfn(pteval_t val) | 366 | static pteval_t pte_mfn_to_pfn(pteval_t val) |
| 367 | { | 367 | { |
| 368 | if (pteval_present(val)) { | 368 | if (val & _PAGE_PRESENT) { |
| 369 | unsigned long mfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; | 369 | unsigned long mfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; |
| 370 | unsigned long pfn = mfn_to_pfn(mfn); | 370 | unsigned long pfn = mfn_to_pfn(mfn); |
| 371 | 371 | ||
| @@ -381,7 +381,7 @@ static pteval_t pte_mfn_to_pfn(pteval_t val) | |||
| 381 | 381 | ||
| 382 | static pteval_t pte_pfn_to_mfn(pteval_t val) | 382 | static pteval_t pte_pfn_to_mfn(pteval_t val) |
| 383 | { | 383 | { |
| 384 | if (pteval_present(val)) { | 384 | if (val & _PAGE_PRESENT) { |
| 385 | unsigned long pfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; | 385 | unsigned long pfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; |
| 386 | pteval_t flags = val & PTE_FLAGS_MASK; | 386 | pteval_t flags = val & PTE_FLAGS_MASK; |
| 387 | unsigned long mfn; | 387 | unsigned long mfn; |
diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c index 581521c843a5..4d3acc34a998 100644 --- a/arch/x86/xen/spinlock.c +++ b/arch/x86/xen/spinlock.c | |||
| @@ -183,7 +183,7 @@ __visible void xen_lock_spinning(struct arch_spinlock *lock, __ticket_t want) | |||
| 183 | 183 | ||
| 184 | local_irq_save(flags); | 184 | local_irq_save(flags); |
| 185 | 185 | ||
| 186 | kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq)); | 186 | kstat_incr_irq_this_cpu(irq); |
| 187 | out: | 187 | out: |
| 188 | cpumask_clear_cpu(cpu, &waiting_cpus); | 188 | cpumask_clear_cpu(cpu, &waiting_cpus); |
| 189 | w->lock = NULL; | 189 | w->lock = NULL; |
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index ba56e11cbf77..c87ae7c6e5f9 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig | |||
| @@ -20,6 +20,7 @@ config XTENSA | |||
| 20 | select HAVE_FUNCTION_TRACER | 20 | select HAVE_FUNCTION_TRACER |
| 21 | select HAVE_IRQ_TIME_ACCOUNTING | 21 | select HAVE_IRQ_TIME_ACCOUNTING |
| 22 | select HAVE_PERF_EVENTS | 22 | select HAVE_PERF_EVENTS |
| 23 | select COMMON_CLK | ||
| 23 | help | 24 | help |
| 24 | Xtensa processors are 32-bit RISC machines designed by Tensilica | 25 | Xtensa processors are 32-bit RISC machines designed by Tensilica |
| 25 | primarily for embedded systems. These processors are both | 26 | primarily for embedded systems. These processors are both |
| @@ -80,7 +81,6 @@ choice | |||
| 80 | config XTENSA_VARIANT_FSF | 81 | config XTENSA_VARIANT_FSF |
| 81 | bool "fsf - default (not generic) configuration" | 82 | bool "fsf - default (not generic) configuration" |
| 82 | select MMU | 83 | select MMU |
| 83 | select HAVE_XTENSA_GPIO32 | ||
| 84 | 84 | ||
| 85 | config XTENSA_VARIANT_DC232B | 85 | config XTENSA_VARIANT_DC232B |
| 86 | bool "dc232b - Diamond 232L Standard Core Rev.B (LE)" | 86 | bool "dc232b - Diamond 232L Standard Core Rev.B (LE)" |
| @@ -135,7 +135,6 @@ config HAVE_SMP | |||
| 135 | config SMP | 135 | config SMP |
| 136 | bool "Enable Symmetric multi-processing support" | 136 | bool "Enable Symmetric multi-processing support" |
| 137 | depends on HAVE_SMP | 137 | depends on HAVE_SMP |
| 138 | select USE_GENERIC_SMP_HELPERS | ||
| 139 | select GENERIC_SMP_IDLE_THREAD | 138 | select GENERIC_SMP_IDLE_THREAD |
| 140 | help | 139 | help |
| 141 | Enabled SMP Software; allows more than one CPU/CORE | 140 | Enabled SMP Software; allows more than one CPU/CORE |
diff --git a/arch/xtensa/boot/dts/xtfpga.dtsi b/arch/xtensa/boot/dts/xtfpga.dtsi index 46b4f5eab421..e7370b11348e 100644 --- a/arch/xtensa/boot/dts/xtfpga.dtsi +++ b/arch/xtensa/boot/dts/xtfpga.dtsi | |||
| @@ -35,6 +35,13 @@ | |||
| 35 | interrupt-controller; | 35 | interrupt-controller; |
| 36 | }; | 36 | }; |
| 37 | 37 | ||
| 38 | clocks { | ||
| 39 | osc: main-oscillator { | ||
| 40 | #clock-cells = <0>; | ||
| 41 | compatible = "fixed-clock"; | ||
| 42 | }; | ||
| 43 | }; | ||
| 44 | |||
| 38 | serial0: serial@fd050020 { | 45 | serial0: serial@fd050020 { |
| 39 | device_type = "serial"; | 46 | device_type = "serial"; |
| 40 | compatible = "ns16550a"; | 47 | compatible = "ns16550a"; |
| @@ -42,9 +49,7 @@ | |||
| 42 | reg = <0xfd050020 0x20>; | 49 | reg = <0xfd050020 0x20>; |
| 43 | reg-shift = <2>; | 50 | reg-shift = <2>; |
| 44 | interrupts = <0 1>; /* external irq 0 */ | 51 | interrupts = <0 1>; /* external irq 0 */ |
| 45 | /* Filled in by platform_setup from FPGA register | 52 | clocks = <&osc>; |
| 46 | * clock-frequency = <100000000>; | ||
| 47 | */ | ||
| 48 | }; | 53 | }; |
| 49 | 54 | ||
| 50 | enet0: ethoc@fd030000 { | 55 | enet0: ethoc@fd030000 { |
| @@ -52,5 +57,6 @@ | |||
| 52 | reg = <0xfd030000 0x4000 0xfd800000 0x4000>; | 57 | reg = <0xfd030000 0x4000 0xfd800000 0x4000>; |
| 53 | interrupts = <1 1>; /* external irq 1 */ | 58 | interrupts = <1 1>; /* external irq 1 */ |
| 54 | local-mac-address = [00 50 c2 13 6f 00]; | 59 | local-mac-address = [00 50 c2 13 6f 00]; |
| 60 | clocks = <&osc>; | ||
| 55 | }; | 61 | }; |
| 56 | }; | 62 | }; |
diff --git a/arch/xtensa/include/asm/Kbuild b/arch/xtensa/include/asm/Kbuild index 0a337e4a8370..c3d20ba6eb86 100644 --- a/arch/xtensa/include/asm/Kbuild +++ b/arch/xtensa/include/asm/Kbuild | |||
| @@ -9,6 +9,7 @@ generic-y += errno.h | |||
| 9 | generic-y += exec.h | 9 | generic-y += exec.h |
| 10 | generic-y += fcntl.h | 10 | generic-y += fcntl.h |
| 11 | generic-y += hardirq.h | 11 | generic-y += hardirq.h |
| 12 | generic-y += hash.h | ||
| 12 | generic-y += ioctl.h | 13 | generic-y += ioctl.h |
| 13 | generic-y += irq_regs.h | 14 | generic-y += irq_regs.h |
| 14 | generic-y += kdebug.h | 15 | generic-y += kdebug.h |
| @@ -17,7 +18,9 @@ generic-y += kvm_para.h | |||
| 17 | generic-y += linkage.h | 18 | generic-y += linkage.h |
| 18 | generic-y += local.h | 19 | generic-y += local.h |
| 19 | generic-y += local64.h | 20 | generic-y += local64.h |
| 21 | generic-y += mcs_spinlock.h | ||
| 20 | generic-y += percpu.h | 22 | generic-y += percpu.h |
| 23 | generic-y += preempt.h | ||
| 21 | generic-y += resource.h | 24 | generic-y += resource.h |
| 22 | generic-y += scatterlist.h | 25 | generic-y += scatterlist.h |
| 23 | generic-y += sections.h | 26 | generic-y += sections.h |
| @@ -27,5 +30,3 @@ generic-y += termios.h | |||
| 27 | generic-y += topology.h | 30 | generic-y += topology.h |
| 28 | generic-y += trace_clock.h | 31 | generic-y += trace_clock.h |
| 29 | generic-y += xor.h | 32 | generic-y += xor.h |
| 30 | generic-y += preempt.h | ||
| 31 | generic-y += hash.h | ||
diff --git a/arch/xtensa/include/asm/io.h b/arch/xtensa/include/asm/io.h index 2a042d430c25..74944207167e 100644 --- a/arch/xtensa/include/asm/io.h +++ b/arch/xtensa/include/asm/io.h | |||
| @@ -25,7 +25,7 @@ | |||
| 25 | 25 | ||
| 26 | #ifdef CONFIG_MMU | 26 | #ifdef CONFIG_MMU |
| 27 | 27 | ||
| 28 | #if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && CONFIG_OF | 28 | #if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && defined(CONFIG_OF) |
| 29 | extern unsigned long xtensa_kio_paddr; | 29 | extern unsigned long xtensa_kio_paddr; |
| 30 | 30 | ||
| 31 | static inline unsigned long xtensa_get_kio_paddr(void) | 31 | static inline unsigned long xtensa_get_kio_paddr(void) |
diff --git a/arch/xtensa/include/asm/traps.h b/arch/xtensa/include/asm/traps.h index 8c194f6af45e..677bfcf4ee5d 100644 --- a/arch/xtensa/include/asm/traps.h +++ b/arch/xtensa/include/asm/traps.h | |||
| @@ -23,25 +23,37 @@ void secondary_trap_init(void); | |||
| 23 | 23 | ||
| 24 | static inline void spill_registers(void) | 24 | static inline void spill_registers(void) |
| 25 | { | 25 | { |
| 26 | 26 | #if XCHAL_NUM_AREGS > 16 | |
| 27 | __asm__ __volatile__ ( | 27 | __asm__ __volatile__ ( |
| 28 | "movi a14, "__stringify((1 << PS_EXCM_BIT) | LOCKLEVEL)"\n\t" | 28 | " call12 1f\n" |
| 29 | "mov a12, a0\n\t" | 29 | " _j 2f\n" |
| 30 | "rsr a13, sar\n\t" | 30 | " retw\n" |
| 31 | "xsr a14, ps\n\t" | 31 | " .align 4\n" |
| 32 | "movi a0, _spill_registers\n\t" | 32 | "1:\n" |
| 33 | "rsync\n\t" | 33 | " _entry a1, 48\n" |
| 34 | "callx0 a0\n\t" | 34 | " addi a12, a0, 3\n" |
| 35 | "mov a0, a12\n\t" | 35 | #if XCHAL_NUM_AREGS > 32 |
| 36 | "wsr a13, sar\n\t" | 36 | " .rept (" __stringify(XCHAL_NUM_AREGS) " - 32) / 12\n" |
| 37 | "wsr a14, ps\n\t" | 37 | " _entry a1, 48\n" |
| 38 | : : | 38 | " mov a12, a0\n" |
| 39 | #if defined(CONFIG_FRAME_POINTER) | 39 | " .endr\n" |
| 40 | : "a2", "a3", "a4", "a11", "a12", "a13", "a14", "a15", | 40 | #endif |
| 41 | " _entry a1, 48\n" | ||
| 42 | #if XCHAL_NUM_AREGS % 12 == 0 | ||
| 43 | " mov a8, a8\n" | ||
| 44 | #elif XCHAL_NUM_AREGS % 12 == 4 | ||
| 45 | " mov a12, a12\n" | ||
| 46 | #elif XCHAL_NUM_AREGS % 12 == 8 | ||
| 47 | " mov a4, a4\n" | ||
| 48 | #endif | ||
| 49 | " retw\n" | ||
| 50 | "2:\n" | ||
| 51 | : : : "a12", "a13", "memory"); | ||
| 41 | #else | 52 | #else |
| 42 | : "a2", "a3", "a4", "a7", "a11", "a12", "a13", "a14", "a15", | 53 | __asm__ __volatile__ ( |
| 54 | " mov a12, a12\n" | ||
| 55 | : : : "memory"); | ||
| 43 | #endif | 56 | #endif |
| 44 | "memory"); | ||
| 45 | } | 57 | } |
| 46 | 58 | ||
| 47 | #endif /* _XTENSA_TRAPS_H */ | 59 | #endif /* _XTENSA_TRAPS_H */ |
diff --git a/arch/xtensa/include/asm/vectors.h b/arch/xtensa/include/asm/vectors.h index 5791b45d5a5d..f74ddfbb92ef 100644 --- a/arch/xtensa/include/asm/vectors.h +++ b/arch/xtensa/include/asm/vectors.h | |||
| @@ -25,7 +25,7 @@ | |||
| 25 | #define XCHAL_KIO_DEFAULT_PADDR 0xf0000000 | 25 | #define XCHAL_KIO_DEFAULT_PADDR 0xf0000000 |
| 26 | #define XCHAL_KIO_SIZE 0x10000000 | 26 | #define XCHAL_KIO_SIZE 0x10000000 |
| 27 | 27 | ||
| 28 | #if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && CONFIG_OF | 28 | #if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && defined(CONFIG_OF) |
| 29 | #define XCHAL_KIO_PADDR xtensa_get_kio_paddr() | 29 | #define XCHAL_KIO_PADDR xtensa_get_kio_paddr() |
| 30 | #else | 30 | #else |
| 31 | #define XCHAL_KIO_PADDR XCHAL_KIO_DEFAULT_PADDR | 31 | #define XCHAL_KIO_PADDR XCHAL_KIO_DEFAULT_PADDR |
diff --git a/arch/xtensa/include/uapi/asm/unistd.h b/arch/xtensa/include/uapi/asm/unistd.h index 51940fec6990..b9395529f02d 100644 --- a/arch/xtensa/include/uapi/asm/unistd.h +++ b/arch/xtensa/include/uapi/asm/unistd.h | |||
| @@ -734,7 +734,12 @@ __SYSCALL(332, sys_finit_module, 3) | |||
| 734 | #define __NR_accept4 333 | 734 | #define __NR_accept4 333 |
| 735 | __SYSCALL(333, sys_accept4, 4) | 735 | __SYSCALL(333, sys_accept4, 4) |
| 736 | 736 | ||
| 737 | #define __NR_syscall_count 334 | 737 | #define __NR_sched_setattr 334 |
| 738 | __SYSCALL(334, sys_sched_setattr, 2) | ||
| 739 | #define __NR_sched_getattr 335 | ||
| 740 | __SYSCALL(335, sys_sched_getattr, 3) | ||
| 741 | |||
| 742 | #define __NR_syscall_count 336 | ||
| 738 | 743 | ||
| 739 | /* | 744 | /* |
| 740 | * sysxtensa syscall handler | 745 | * sysxtensa syscall handler |
diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S index 21dbe6bdb8ed..ef7f4990722b 100644 --- a/arch/xtensa/kernel/entry.S +++ b/arch/xtensa/kernel/entry.S | |||
| @@ -1081,196 +1081,53 @@ ENTRY(fast_syscall_spill_registers) | |||
| 1081 | 1081 | ||
| 1082 | rsr a0, sar | 1082 | rsr a0, sar |
| 1083 | s32i a3, a2, PT_AREG3 | 1083 | s32i a3, a2, PT_AREG3 |
| 1084 | s32i a4, a2, PT_AREG4 | 1084 | s32i a0, a2, PT_SAR |
| 1085 | s32i a0, a2, PT_AREG5 # store SAR to PT_AREG5 | ||
| 1086 | 1085 | ||
| 1087 | /* The spill routine might clobber a7, a11, and a15. */ | 1086 | /* The spill routine might clobber a4, a7, a8, a11, a12, and a15. */ |
| 1088 | 1087 | ||
| 1088 | s32i a4, a2, PT_AREG4 | ||
| 1089 | s32i a7, a2, PT_AREG7 | 1089 | s32i a7, a2, PT_AREG7 |
| 1090 | s32i a8, a2, PT_AREG8 | ||
| 1090 | s32i a11, a2, PT_AREG11 | 1091 | s32i a11, a2, PT_AREG11 |
| 1092 | s32i a12, a2, PT_AREG12 | ||
| 1091 | s32i a15, a2, PT_AREG15 | 1093 | s32i a15, a2, PT_AREG15 |
| 1092 | 1094 | ||
| 1093 | call0 _spill_registers # destroys a3, a4, and SAR | ||
| 1094 | |||
| 1095 | /* Advance PC, restore registers and SAR, and return from exception. */ | ||
| 1096 | |||
| 1097 | l32i a3, a2, PT_AREG5 | ||
| 1098 | l32i a4, a2, PT_AREG4 | ||
| 1099 | l32i a0, a2, PT_AREG0 | ||
| 1100 | wsr a3, sar | ||
| 1101 | l32i a3, a2, PT_AREG3 | ||
| 1102 | |||
| 1103 | /* Restore clobbered registers. */ | ||
| 1104 | |||
| 1105 | l32i a7, a2, PT_AREG7 | ||
| 1106 | l32i a11, a2, PT_AREG11 | ||
| 1107 | l32i a15, a2, PT_AREG15 | ||
| 1108 | |||
| 1109 | movi a2, 0 | ||
| 1110 | rfe | ||
| 1111 | |||
| 1112 | ENDPROC(fast_syscall_spill_registers) | ||
| 1113 | |||
| 1114 | /* Fixup handler. | ||
| 1115 | * | ||
| 1116 | * We get here if the spill routine causes an exception, e.g. tlb miss. | ||
| 1117 | * We basically restore WINDOWBASE and WINDOWSTART to the condition when | ||
| 1118 | * we entered the spill routine and jump to the user exception handler. | ||
| 1119 | * | ||
| 1120 | * a0: value of depc, original value in depc | ||
| 1121 | * a2: trashed, original value in EXC_TABLE_DOUBLE_SAVE | ||
| 1122 | * a3: exctable, original value in excsave1 | ||
| 1123 | */ | ||
| 1124 | |||
| 1125 | ENTRY(fast_syscall_spill_registers_fixup) | ||
| 1126 | |||
| 1127 | rsr a2, windowbase # get current windowbase (a2 is saved) | ||
| 1128 | xsr a0, depc # restore depc and a0 | ||
| 1129 | ssl a2 # set shift (32 - WB) | ||
| 1130 | |||
| 1131 | /* We need to make sure the current registers (a0-a3) are preserved. | ||
| 1132 | * To do this, we simply set the bit for the current window frame | ||
| 1133 | * in WS, so that the exception handlers save them to the task stack. | ||
| 1134 | */ | ||
| 1135 | |||
| 1136 | xsr a3, excsave1 # get spill-mask | ||
| 1137 | slli a3, a3, 1 # shift left by one | ||
| 1138 | |||
| 1139 | slli a2, a3, 32-WSBITS | ||
| 1140 | src a2, a3, a2 # a2 = xxwww1yyxxxwww1yy...... | ||
| 1141 | wsr a2, windowstart # set corrected windowstart | ||
| 1142 | |||
| 1143 | srli a3, a3, 1 | ||
| 1144 | rsr a2, excsave1 | ||
| 1145 | l32i a2, a2, EXC_TABLE_DOUBLE_SAVE # restore a2 | ||
| 1146 | xsr a2, excsave1 | ||
| 1147 | s32i a3, a2, EXC_TABLE_DOUBLE_SAVE # save a3 | ||
| 1148 | l32i a3, a2, EXC_TABLE_PARAM # original WB (in user task) | ||
| 1149 | xsr a2, excsave1 | ||
| 1150 | |||
| 1151 | /* Return to the original (user task) WINDOWBASE. | ||
| 1152 | * We leave the following frame behind: | ||
| 1153 | * a0, a1, a2 same | ||
| 1154 | * a3: trashed (saved in EXC_TABLE_DOUBLE_SAVE) | ||
| 1155 | * depc: depc (we have to return to that address) | ||
| 1156 | * excsave_1: exctable | ||
| 1157 | */ | ||
| 1158 | |||
| 1159 | wsr a3, windowbase | ||
| 1160 | rsync | ||
| 1161 | |||
| 1162 | /* We are now in the original frame when we entered _spill_registers: | ||
| 1163 | * a0: return address | ||
| 1164 | * a1: used, stack pointer | ||
| 1165 | * a2: kernel stack pointer | ||
| 1166 | * a3: available | ||
| 1167 | * depc: exception address | ||
| 1168 | * excsave: exctable | ||
| 1169 | * Note: This frame might be the same as above. | ||
| 1170 | */ | ||
| 1171 | |||
| 1172 | /* Setup stack pointer. */ | ||
| 1173 | |||
| 1174 | addi a2, a2, -PT_USER_SIZE | ||
| 1175 | s32i a0, a2, PT_AREG0 | ||
| 1176 | |||
| 1177 | /* Make sure we return to this fixup handler. */ | ||
| 1178 | |||
| 1179 | movi a3, fast_syscall_spill_registers_fixup_return | ||
| 1180 | s32i a3, a2, PT_DEPC # setup depc | ||
| 1181 | |||
| 1182 | /* Jump to the exception handler. */ | ||
| 1183 | |||
| 1184 | rsr a3, excsave1 | ||
| 1185 | rsr a0, exccause | ||
| 1186 | addx4 a0, a0, a3 # find entry in table | ||
| 1187 | l32i a0, a0, EXC_TABLE_FAST_USER # load handler | ||
| 1188 | l32i a3, a3, EXC_TABLE_DOUBLE_SAVE | ||
| 1189 | jx a0 | ||
| 1190 | |||
| 1191 | ENDPROC(fast_syscall_spill_registers_fixup) | ||
| 1192 | |||
| 1193 | ENTRY(fast_syscall_spill_registers_fixup_return) | ||
| 1194 | |||
| 1195 | /* When we return here, all registers have been restored (a2: DEPC) */ | ||
| 1196 | |||
| 1197 | wsr a2, depc # exception address | ||
| 1198 | |||
| 1199 | /* Restore fixup handler. */ | ||
| 1200 | |||
| 1201 | rsr a2, excsave1 | ||
| 1202 | s32i a3, a2, EXC_TABLE_DOUBLE_SAVE | ||
| 1203 | movi a3, fast_syscall_spill_registers_fixup | ||
| 1204 | s32i a3, a2, EXC_TABLE_FIXUP | ||
| 1205 | rsr a3, windowbase | ||
| 1206 | s32i a3, a2, EXC_TABLE_PARAM | ||
| 1207 | l32i a2, a2, EXC_TABLE_KSTK | ||
| 1208 | |||
| 1209 | /* Load WB at the time the exception occurred. */ | ||
| 1210 | |||
| 1211 | rsr a3, sar # WB is still in SAR | ||
| 1212 | neg a3, a3 | ||
| 1213 | wsr a3, windowbase | ||
| 1214 | rsync | ||
| 1215 | |||
| 1216 | rsr a3, excsave1 | ||
| 1217 | l32i a3, a3, EXC_TABLE_DOUBLE_SAVE | ||
| 1218 | |||
| 1219 | rfde | ||
| 1220 | |||
| 1221 | ENDPROC(fast_syscall_spill_registers_fixup_return) | ||
| 1222 | |||
| 1223 | /* | ||
| 1224 | * spill all registers. | ||
| 1225 | * | ||
| 1226 | * This is not a real function. The following conditions must be met: | ||
| 1227 | * | ||
| 1228 | * - must be called with call0. | ||
| 1229 | * - uses a3, a4 and SAR. | ||
| 1230 | * - the last 'valid' register of each frame are clobbered. | ||
| 1231 | * - the caller must have registered a fixup handler | ||
| 1232 | * (or be inside a critical section) | ||
| 1233 | * - PS_EXCM must be set (PS_WOE cleared?) | ||
| 1234 | */ | ||
| 1235 | |||
| 1236 | ENTRY(_spill_registers) | ||
| 1237 | |||
| 1238 | /* | 1095 | /* |
| 1239 | * Rotate ws so that the current windowbase is at bit 0. | 1096 | * Rotate ws so that the current windowbase is at bit 0. |
| 1240 | * Assume ws = xxxwww1yy (www1 current window frame). | 1097 | * Assume ws = xxxwww1yy (www1 current window frame). |
| 1241 | * Rotate ws right so that a4 = yyxxxwww1. | 1098 | * Rotate ws right so that a4 = yyxxxwww1. |
| 1242 | */ | 1099 | */ |
| 1243 | 1100 | ||
| 1244 | rsr a4, windowbase | 1101 | rsr a0, windowbase |
| 1245 | rsr a3, windowstart # a3 = xxxwww1yy | 1102 | rsr a3, windowstart # a3 = xxxwww1yy |
| 1246 | ssr a4 # holds WB | 1103 | ssr a0 # holds WB |
| 1247 | slli a4, a3, WSBITS | 1104 | slli a0, a3, WSBITS |
| 1248 | or a3, a3, a4 # a3 = xxxwww1yyxxxwww1yy | 1105 | or a3, a3, a0 # a3 = xxxwww1yyxxxwww1yy |
| 1249 | srl a3, a3 # a3 = 00xxxwww1yyxxxwww1 | 1106 | srl a3, a3 # a3 = 00xxxwww1yyxxxwww1 |
| 1250 | 1107 | ||
| 1251 | /* We are done if there are no more than the current register frame. */ | 1108 | /* We are done if there are no more than the current register frame. */ |
| 1252 | 1109 | ||
| 1253 | extui a3, a3, 1, WSBITS-1 # a3 = 0yyxxxwww | 1110 | extui a3, a3, 1, WSBITS-1 # a3 = 0yyxxxwww |
| 1254 | movi a4, (1 << (WSBITS-1)) | 1111 | movi a0, (1 << (WSBITS-1)) |
| 1255 | _beqz a3, .Lnospill # only one active frame? jump | 1112 | _beqz a3, .Lnospill # only one active frame? jump |
| 1256 | 1113 | ||
| 1257 | /* We want 1 at the top, so that we return to the current windowbase */ | 1114 | /* We want 1 at the top, so that we return to the current windowbase */ |
| 1258 | 1115 | ||
| 1259 | or a3, a3, a4 # 1yyxxxwww | 1116 | or a3, a3, a0 # 1yyxxxwww |
| 1260 | 1117 | ||
| 1261 | /* Skip empty frames - get 'oldest' WINDOWSTART-bit. */ | 1118 | /* Skip empty frames - get 'oldest' WINDOWSTART-bit. */ |
| 1262 | 1119 | ||
| 1263 | wsr a3, windowstart # save shifted windowstart | 1120 | wsr a3, windowstart # save shifted windowstart |
| 1264 | neg a4, a3 | 1121 | neg a0, a3 |
| 1265 | and a3, a4, a3 # first bit set from right: 000010000 | 1122 | and a3, a0, a3 # first bit set from right: 000010000 |
| 1266 | 1123 | ||
| 1267 | ffs_ws a4, a3 # a4: shifts to skip empty frames | 1124 | ffs_ws a0, a3 # a0: shifts to skip empty frames |
| 1268 | movi a3, WSBITS | 1125 | movi a3, WSBITS |
| 1269 | sub a4, a3, a4 # WSBITS-a4:number of 0-bits from right | 1126 | sub a0, a3, a0 # WSBITS-a0:number of 0-bits from right |
| 1270 | ssr a4 # save in SAR for later. | 1127 | ssr a0 # save in SAR for later. |
| 1271 | 1128 | ||
| 1272 | rsr a3, windowbase | 1129 | rsr a3, windowbase |
| 1273 | add a3, a3, a4 | 1130 | add a3, a3, a0 |
| 1274 | wsr a3, windowbase | 1131 | wsr a3, windowbase |
| 1275 | rsync | 1132 | rsync |
| 1276 | 1133 | ||
| @@ -1285,22 +1142,6 @@ ENTRY(_spill_registers) | |||
| 1285 | * we have to save 4,8. or 12 registers. | 1142 | * we have to save 4,8. or 12 registers. |
| 1286 | */ | 1143 | */ |
| 1287 | 1144 | ||
| 1288 | _bbsi.l a3, 1, .Lc4 | ||
| 1289 | _bbsi.l a3, 2, .Lc8 | ||
| 1290 | |||
| 1291 | /* Special case: we have a call12-frame starting at a4. */ | ||
| 1292 | |||
| 1293 | _bbci.l a3, 3, .Lc12 # bit 3 shouldn't be zero! (Jump to Lc12 first) | ||
| 1294 | |||
| 1295 | s32e a4, a1, -16 # a1 is valid with an empty spill area | ||
| 1296 | l32e a4, a5, -12 | ||
| 1297 | s32e a8, a4, -48 | ||
| 1298 | mov a8, a4 | ||
| 1299 | l32e a4, a1, -16 | ||
| 1300 | j .Lc12c | ||
| 1301 | |||
| 1302 | .Lnospill: | ||
| 1303 | ret | ||
| 1304 | 1145 | ||
| 1305 | .Lloop: _bbsi.l a3, 1, .Lc4 | 1146 | .Lloop: _bbsi.l a3, 1, .Lc4 |
| 1306 | _bbci.l a3, 2, .Lc12 | 1147 | _bbci.l a3, 2, .Lc12 |
| @@ -1314,20 +1155,10 @@ ENTRY(_spill_registers) | |||
| 1314 | s32e a9, a4, -28 | 1155 | s32e a9, a4, -28 |
| 1315 | s32e a10, a4, -24 | 1156 | s32e a10, a4, -24 |
| 1316 | s32e a11, a4, -20 | 1157 | s32e a11, a4, -20 |
| 1317 | |||
| 1318 | srli a11, a3, 2 # shift windowbase by 2 | 1158 | srli a11, a3, 2 # shift windowbase by 2 |
| 1319 | rotw 2 | 1159 | rotw 2 |
| 1320 | _bnei a3, 1, .Lloop | 1160 | _bnei a3, 1, .Lloop |
| 1321 | 1161 | j .Lexit | |
| 1322 | .Lexit: /* Done. Do the final rotation, set WS, and return. */ | ||
| 1323 | |||
| 1324 | rotw 1 | ||
| 1325 | rsr a3, windowbase | ||
| 1326 | ssl a3 | ||
| 1327 | movi a3, 1 | ||
| 1328 | sll a3, a3 | ||
| 1329 | wsr a3, windowstart | ||
| 1330 | ret | ||
| 1331 | 1162 | ||
| 1332 | .Lc4: s32e a4, a9, -16 | 1163 | .Lc4: s32e a4, a9, -16 |
| 1333 | s32e a5, a9, -12 | 1164 | s32e a5, a9, -12 |
| @@ -1343,11 +1174,11 @@ ENTRY(_spill_registers) | |||
| 1343 | 1174 | ||
| 1344 | /* 12-register frame (call12) */ | 1175 | /* 12-register frame (call12) */ |
| 1345 | 1176 | ||
| 1346 | l32e a2, a5, -12 | 1177 | l32e a0, a5, -12 |
| 1347 | s32e a8, a2, -48 | 1178 | s32e a8, a0, -48 |
| 1348 | mov a8, a2 | 1179 | mov a8, a0 |
| 1349 | 1180 | ||
| 1350 | .Lc12c: s32e a9, a8, -44 | 1181 | s32e a9, a8, -44 |
| 1351 | s32e a10, a8, -40 | 1182 | s32e a10, a8, -40 |
| 1352 | s32e a11, a8, -36 | 1183 | s32e a11, a8, -36 |
| 1353 | s32e a12, a8, -32 | 1184 | s32e a12, a8, -32 |
| @@ -1367,30 +1198,54 @@ ENTRY(_spill_registers) | |||
| 1367 | */ | 1198 | */ |
| 1368 | 1199 | ||
| 1369 | rotw 1 | 1200 | rotw 1 |
| 1370 | mov a5, a13 | 1201 | mov a4, a13 |
| 1371 | rotw -1 | 1202 | rotw -1 |
| 1372 | 1203 | ||
| 1373 | s32e a4, a9, -16 | 1204 | s32e a4, a8, -16 |
| 1374 | s32e a5, a9, -12 | 1205 | s32e a5, a8, -12 |
| 1375 | s32e a6, a9, -8 | 1206 | s32e a6, a8, -8 |
| 1376 | s32e a7, a9, -4 | 1207 | s32e a7, a8, -4 |
| 1377 | 1208 | ||
| 1378 | rotw 3 | 1209 | rotw 3 |
| 1379 | 1210 | ||
| 1380 | _beqi a3, 1, .Lexit | 1211 | _beqi a3, 1, .Lexit |
| 1381 | j .Lloop | 1212 | j .Lloop |
| 1382 | 1213 | ||
| 1383 | .Linvalid_mask: | 1214 | .Lexit: |
| 1384 | 1215 | ||
| 1385 | /* We get here because of an unrecoverable error in the window | 1216 | /* Done. Do the final rotation and set WS */ |
| 1386 | * registers. If we are in user space, we kill the application, | 1217 | |
| 1387 | * however, this condition is unrecoverable in kernel space. | 1218 | rotw 1 |
| 1388 | */ | 1219 | rsr a3, windowbase |
| 1220 | ssl a3 | ||
| 1221 | movi a3, 1 | ||
| 1222 | sll a3, a3 | ||
| 1223 | wsr a3, windowstart | ||
| 1224 | .Lnospill: | ||
| 1225 | |||
| 1226 | /* Advance PC, restore registers and SAR, and return from exception. */ | ||
| 1227 | |||
| 1228 | l32i a3, a2, PT_SAR | ||
| 1229 | l32i a0, a2, PT_AREG0 | ||
| 1230 | wsr a3, sar | ||
| 1231 | l32i a3, a2, PT_AREG3 | ||
| 1389 | 1232 | ||
| 1390 | rsr a0, ps | 1233 | /* Restore clobbered registers. */ |
| 1391 | _bbci.l a0, PS_UM_BIT, 1f | ||
| 1392 | 1234 | ||
| 1393 | /* User space: Setup a dummy frame and kill application. | 1235 | l32i a4, a2, PT_AREG4 |
| 1236 | l32i a7, a2, PT_AREG7 | ||
| 1237 | l32i a8, a2, PT_AREG8 | ||
| 1238 | l32i a11, a2, PT_AREG11 | ||
| 1239 | l32i a12, a2, PT_AREG12 | ||
| 1240 | l32i a15, a2, PT_AREG15 | ||
| 1241 | |||
| 1242 | movi a2, 0 | ||
| 1243 | rfe | ||
| 1244 | |||
| 1245 | .Linvalid_mask: | ||
| 1246 | |||
| 1247 | /* We get here because of an unrecoverable error in the window | ||
| 1248 | * registers, so set up a dummy frame and kill the user application. | ||
| 1394 | * Note: We assume EXC_TABLE_KSTK contains a valid stack pointer. | 1249 | * Note: We assume EXC_TABLE_KSTK contains a valid stack pointer. |
| 1395 | */ | 1250 | */ |
| 1396 | 1251 | ||
| @@ -1414,14 +1269,136 @@ ENTRY(_spill_registers) | |||
| 1414 | movi a4, do_exit | 1269 | movi a4, do_exit |
| 1415 | callx4 a4 | 1270 | callx4 a4 |
| 1416 | 1271 | ||
| 1417 | 1: /* Kernel space: PANIC! */ | 1272 | /* shouldn't return, so panic */ |
| 1418 | 1273 | ||
| 1419 | wsr a0, excsave1 | 1274 | wsr a0, excsave1 |
| 1420 | movi a0, unrecoverable_exception | 1275 | movi a0, unrecoverable_exception |
| 1421 | callx0 a0 # should not return | 1276 | callx0 a0 # should not return |
| 1422 | 1: j 1b | 1277 | 1: j 1b |
| 1423 | 1278 | ||
| 1424 | ENDPROC(_spill_registers) | 1279 | |
| 1280 | ENDPROC(fast_syscall_spill_registers) | ||
| 1281 | |||
| 1282 | /* Fixup handler. | ||
| 1283 | * | ||
| 1284 | * We get here if the spill routine causes an exception, e.g. tlb miss. | ||
| 1285 | * We basically restore WINDOWBASE and WINDOWSTART to the condition when | ||
| 1286 | * we entered the spill routine and jump to the user exception handler. | ||
| 1287 | * | ||
| 1288 | * Note that we only need to restore the bits in windowstart that have not | ||
| 1289 | * been spilled yet by the _spill_register routine. Luckily, a3 contains a | ||
| 1290 | * rotated windowstart with only those bits set for frames that haven't been | ||
| 1291 | * spilled yet. Because a3 is rotated such that bit 0 represents the register | ||
| 1292 | * frame for the current windowbase - 1, we need to rotate a3 left by the | ||
| 1293 | * value of the current windowbase + 1 and move it to windowstart. | ||
| 1294 | * | ||
| 1295 | * a0: value of depc, original value in depc | ||
| 1296 | * a2: trashed, original value in EXC_TABLE_DOUBLE_SAVE | ||
| 1297 | * a3: exctable, original value in excsave1 | ||
| 1298 | */ | ||
| 1299 | |||
| 1300 | ENTRY(fast_syscall_spill_registers_fixup) | ||
| 1301 | |||
| 1302 | rsr a2, windowbase # get current windowbase (a2 is saved) | ||
| 1303 | xsr a0, depc # restore depc and a0 | ||
| 1304 | ssl a2 # set shift (32 - WB) | ||
| 1305 | |||
| 1306 | /* We need to make sure the current registers (a0-a3) are preserved. | ||
| 1307 | * To do this, we simply set the bit for the current window frame | ||
| 1308 | * in WS, so that the exception handlers save them to the task stack. | ||
| 1309 | * | ||
| 1310 | * Note: we use a3 to set the windowbase, so we take a special care | ||
| 1311 | * of it, saving it in the original _spill_registers frame across | ||
| 1312 | * the exception handler call. | ||
| 1313 | */ | ||
| 1314 | |||
| 1315 | xsr a3, excsave1 # get spill-mask | ||
| 1316 | slli a3, a3, 1 # shift left by one | ||
| 1317 | addi a3, a3, 1 # set the bit for the current window frame | ||
| 1318 | |||
| 1319 | slli a2, a3, 32-WSBITS | ||
| 1320 | src a2, a3, a2 # a2 = xxwww1yyxxxwww1yy...... | ||
| 1321 | wsr a2, windowstart # set corrected windowstart | ||
| 1322 | |||
| 1323 | srli a3, a3, 1 | ||
| 1324 | rsr a2, excsave1 | ||
| 1325 | l32i a2, a2, EXC_TABLE_DOUBLE_SAVE # restore a2 | ||
| 1326 | xsr a2, excsave1 | ||
| 1327 | s32i a3, a2, EXC_TABLE_DOUBLE_SAVE # save a3 | ||
| 1328 | l32i a3, a2, EXC_TABLE_PARAM # original WB (in user task) | ||
| 1329 | xsr a2, excsave1 | ||
| 1330 | |||
| 1331 | /* Return to the original (user task) WINDOWBASE. | ||
| 1332 | * We leave the following frame behind: | ||
| 1333 | * a0, a1, a2 same | ||
| 1334 | * a3: trashed (saved in EXC_TABLE_DOUBLE_SAVE) | ||
| 1335 | * depc: depc (we have to return to that address) | ||
| 1336 | * excsave_1: exctable | ||
| 1337 | */ | ||
| 1338 | |||
| 1339 | wsr a3, windowbase | ||
| 1340 | rsync | ||
| 1341 | |||
| 1342 | /* We are now in the original frame when we entered _spill_registers: | ||
| 1343 | * a0: return address | ||
| 1344 | * a1: used, stack pointer | ||
| 1345 | * a2: kernel stack pointer | ||
| 1346 | * a3: available | ||
| 1347 | * depc: exception address | ||
| 1348 | * excsave: exctable | ||
| 1349 | * Note: This frame might be the same as above. | ||
| 1350 | */ | ||
| 1351 | |||
| 1352 | /* Setup stack pointer. */ | ||
| 1353 | |||
| 1354 | addi a2, a2, -PT_USER_SIZE | ||
| 1355 | s32i a0, a2, PT_AREG0 | ||
| 1356 | |||
| 1357 | /* Make sure we return to this fixup handler. */ | ||
| 1358 | |||
| 1359 | movi a3, fast_syscall_spill_registers_fixup_return | ||
| 1360 | s32i a3, a2, PT_DEPC # setup depc | ||
| 1361 | |||
| 1362 | /* Jump to the exception handler. */ | ||
| 1363 | |||
| 1364 | rsr a3, excsave1 | ||
| 1365 | rsr a0, exccause | ||
| 1366 | addx4 a0, a0, a3 # find entry in table | ||
| 1367 | l32i a0, a0, EXC_TABLE_FAST_USER # load handler | ||
| 1368 | l32i a3, a3, EXC_TABLE_DOUBLE_SAVE | ||
| 1369 | jx a0 | ||
| 1370 | |||
| 1371 | ENDPROC(fast_syscall_spill_registers_fixup) | ||
| 1372 | |||
| 1373 | ENTRY(fast_syscall_spill_registers_fixup_return) | ||
| 1374 | |||
| 1375 | /* When we return here, all registers have been restored (a2: DEPC) */ | ||
| 1376 | |||
| 1377 | wsr a2, depc # exception address | ||
| 1378 | |||
| 1379 | /* Restore fixup handler. */ | ||
| 1380 | |||
| 1381 | rsr a2, excsave1 | ||
| 1382 | s32i a3, a2, EXC_TABLE_DOUBLE_SAVE | ||
| 1383 | movi a3, fast_syscall_spill_registers_fixup | ||
| 1384 | s32i a3, a2, EXC_TABLE_FIXUP | ||
| 1385 | rsr a3, windowbase | ||
| 1386 | s32i a3, a2, EXC_TABLE_PARAM | ||
| 1387 | l32i a2, a2, EXC_TABLE_KSTK | ||
| 1388 | |||
| 1389 | /* Load WB at the time the exception occurred. */ | ||
| 1390 | |||
| 1391 | rsr a3, sar # WB is still in SAR | ||
| 1392 | neg a3, a3 | ||
| 1393 | wsr a3, windowbase | ||
| 1394 | rsync | ||
| 1395 | |||
| 1396 | rsr a3, excsave1 | ||
| 1397 | l32i a3, a3, EXC_TABLE_DOUBLE_SAVE | ||
| 1398 | |||
| 1399 | rfde | ||
| 1400 | |||
| 1401 | ENDPROC(fast_syscall_spill_registers_fixup_return) | ||
| 1425 | 1402 | ||
| 1426 | #ifdef CONFIG_MMU | 1403 | #ifdef CONFIG_MMU |
| 1427 | /* | 1404 | /* |
| @@ -1794,6 +1771,43 @@ ENTRY(system_call) | |||
| 1794 | 1771 | ||
| 1795 | ENDPROC(system_call) | 1772 | ENDPROC(system_call) |
| 1796 | 1773 | ||
| 1774 | /* | ||
| 1775 | * Spill live registers on the kernel stack macro. | ||
| 1776 | * | ||
| 1777 | * Entry condition: ps.woe is set, ps.excm is cleared | ||
| 1778 | * Exit condition: windowstart has single bit set | ||
| 1779 | * May clobber: a12, a13 | ||
| 1780 | */ | ||
| 1781 | .macro spill_registers_kernel | ||
| 1782 | |||
| 1783 | #if XCHAL_NUM_AREGS > 16 | ||
| 1784 | call12 1f | ||
| 1785 | _j 2f | ||
| 1786 | retw | ||
| 1787 | .align 4 | ||
| 1788 | 1: | ||
| 1789 | _entry a1, 48 | ||
| 1790 | addi a12, a0, 3 | ||
| 1791 | #if XCHAL_NUM_AREGS > 32 | ||
| 1792 | .rept (XCHAL_NUM_AREGS - 32) / 12 | ||
| 1793 | _entry a1, 48 | ||
| 1794 | mov a12, a0 | ||
| 1795 | .endr | ||
| 1796 | #endif | ||
| 1797 | _entry a1, 48 | ||
| 1798 | #if XCHAL_NUM_AREGS % 12 == 0 | ||
| 1799 | mov a8, a8 | ||
| 1800 | #elif XCHAL_NUM_AREGS % 12 == 4 | ||
| 1801 | mov a12, a12 | ||
| 1802 | #elif XCHAL_NUM_AREGS % 12 == 8 | ||
| 1803 | mov a4, a4 | ||
| 1804 | #endif | ||
| 1805 | retw | ||
| 1806 | 2: | ||
| 1807 | #else | ||
| 1808 | mov a12, a12 | ||
| 1809 | #endif | ||
| 1810 | .endm | ||
| 1797 | 1811 | ||
| 1798 | /* | 1812 | /* |
| 1799 | * Task switch. | 1813 | * Task switch. |
| @@ -1806,21 +1820,20 @@ ENTRY(_switch_to) | |||
| 1806 | 1820 | ||
| 1807 | entry a1, 16 | 1821 | entry a1, 16 |
| 1808 | 1822 | ||
| 1809 | mov a12, a2 # preserve 'prev' (a2) | 1823 | mov a10, a2 # preserve 'prev' (a2) |
| 1810 | mov a13, a3 # and 'next' (a3) | 1824 | mov a11, a3 # and 'next' (a3) |
| 1811 | 1825 | ||
| 1812 | l32i a4, a2, TASK_THREAD_INFO | 1826 | l32i a4, a2, TASK_THREAD_INFO |
| 1813 | l32i a5, a3, TASK_THREAD_INFO | 1827 | l32i a5, a3, TASK_THREAD_INFO |
| 1814 | 1828 | ||
| 1815 | save_xtregs_user a4 a6 a8 a9 a10 a11 THREAD_XTREGS_USER | 1829 | save_xtregs_user a4 a6 a8 a9 a12 a13 THREAD_XTREGS_USER |
| 1816 | 1830 | ||
| 1817 | s32i a0, a12, THREAD_RA # save return address | 1831 | s32i a0, a10, THREAD_RA # save return address |
| 1818 | s32i a1, a12, THREAD_SP # save stack pointer | 1832 | s32i a1, a10, THREAD_SP # save stack pointer |
| 1819 | 1833 | ||
| 1820 | /* Disable ints while we manipulate the stack pointer. */ | 1834 | /* Disable ints while we manipulate the stack pointer. */ |
| 1821 | 1835 | ||
| 1822 | movi a14, (1 << PS_EXCM_BIT) | LOCKLEVEL | 1836 | rsil a14, LOCKLEVEL |
| 1823 | xsr a14, ps | ||
| 1824 | rsr a3, excsave1 | 1837 | rsr a3, excsave1 |
| 1825 | rsync | 1838 | rsync |
| 1826 | s32i a3, a3, EXC_TABLE_FIXUP /* enter critical section */ | 1839 | s32i a3, a3, EXC_TABLE_FIXUP /* enter critical section */ |
| @@ -1835,7 +1848,7 @@ ENTRY(_switch_to) | |||
| 1835 | 1848 | ||
| 1836 | /* Flush register file. */ | 1849 | /* Flush register file. */ |
| 1837 | 1850 | ||
| 1838 | call0 _spill_registers # destroys a3, a4, and SAR | 1851 | spill_registers_kernel |
| 1839 | 1852 | ||
| 1840 | /* Set kernel stack (and leave critical section) | 1853 | /* Set kernel stack (and leave critical section) |
| 1841 | * Note: It's save to set it here. The stack will not be overwritten | 1854 | * Note: It's save to set it here. The stack will not be overwritten |
| @@ -1851,13 +1864,13 @@ ENTRY(_switch_to) | |||
| 1851 | 1864 | ||
| 1852 | /* restore context of the task 'next' */ | 1865 | /* restore context of the task 'next' */ |
| 1853 | 1866 | ||
| 1854 | l32i a0, a13, THREAD_RA # restore return address | 1867 | l32i a0, a11, THREAD_RA # restore return address |
| 1855 | l32i a1, a13, THREAD_SP # restore stack pointer | 1868 | l32i a1, a11, THREAD_SP # restore stack pointer |
| 1856 | 1869 | ||
| 1857 | load_xtregs_user a5 a6 a8 a9 a10 a11 THREAD_XTREGS_USER | 1870 | load_xtregs_user a5 a6 a8 a9 a12 a13 THREAD_XTREGS_USER |
| 1858 | 1871 | ||
| 1859 | wsr a14, ps | 1872 | wsr a14, ps |
| 1860 | mov a2, a12 # return 'prev' | 1873 | mov a2, a10 # return 'prev' |
| 1861 | rsync | 1874 | rsync |
| 1862 | 1875 | ||
| 1863 | retw | 1876 | retw |
diff --git a/arch/xtensa/kernel/irq.c b/arch/xtensa/kernel/irq.c index 482868a2de6e..3eee94f621eb 100644 --- a/arch/xtensa/kernel/irq.c +++ b/arch/xtensa/kernel/irq.c | |||
| @@ -155,18 +155,6 @@ void __init init_IRQ(void) | |||
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | #ifdef CONFIG_HOTPLUG_CPU | 157 | #ifdef CONFIG_HOTPLUG_CPU |
| 158 | static void route_irq(struct irq_data *data, unsigned int irq, unsigned int cpu) | ||
| 159 | { | ||
| 160 | struct irq_desc *desc = irq_to_desc(irq); | ||
| 161 | struct irq_chip *chip = irq_data_get_irq_chip(data); | ||
| 162 | unsigned long flags; | ||
| 163 | |||
| 164 | raw_spin_lock_irqsave(&desc->lock, flags); | ||
| 165 | if (chip->irq_set_affinity) | ||
| 166 | chip->irq_set_affinity(data, cpumask_of(cpu), false); | ||
| 167 | raw_spin_unlock_irqrestore(&desc->lock, flags); | ||
| 168 | } | ||
| 169 | |||
| 170 | /* | 158 | /* |
| 171 | * The CPU has been marked offline. Migrate IRQs off this CPU. If | 159 | * The CPU has been marked offline. Migrate IRQs off this CPU. If |
| 172 | * the affinity settings do not allow other CPUs, force them onto any | 160 | * the affinity settings do not allow other CPUs, force them onto any |
| @@ -175,10 +163,9 @@ static void route_irq(struct irq_data *data, unsigned int irq, unsigned int cpu) | |||
| 175 | void migrate_irqs(void) | 163 | void migrate_irqs(void) |
| 176 | { | 164 | { |
| 177 | unsigned int i, cpu = smp_processor_id(); | 165 | unsigned int i, cpu = smp_processor_id(); |
| 178 | struct irq_desc *desc; | ||
| 179 | 166 | ||
| 180 | for_each_irq_desc(i, desc) { | 167 | for_each_active_irq(i) { |
| 181 | struct irq_data *data = irq_desc_get_irq_data(desc); | 168 | struct irq_data *data = irq_get_irq_data(i); |
| 182 | unsigned int newcpu; | 169 | unsigned int newcpu; |
| 183 | 170 | ||
| 184 | if (irqd_is_per_cpu(data)) | 171 | if (irqd_is_per_cpu(data)) |
| @@ -194,11 +181,8 @@ void migrate_irqs(void) | |||
| 194 | i, cpu); | 181 | i, cpu); |
| 195 | 182 | ||
| 196 | cpumask_setall(data->affinity); | 183 | cpumask_setall(data->affinity); |
| 197 | newcpu = cpumask_any_and(data->affinity, | ||
| 198 | cpu_online_mask); | ||
| 199 | } | 184 | } |
| 200 | 185 | irq_set_affinity(i, data->affinity); | |
| 201 | route_irq(data, i, newcpu); | ||
| 202 | } | 186 | } |
| 203 | } | 187 | } |
| 204 | #endif /* CONFIG_HOTPLUG_CPU */ | 188 | #endif /* CONFIG_HOTPLUG_CPU */ |
diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c index 7d12af1317f1..84fe931bb60e 100644 --- a/arch/xtensa/kernel/setup.c +++ b/arch/xtensa/kernel/setup.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/bootmem.h> | 22 | #include <linux/bootmem.h> |
| 23 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
| 24 | #include <linux/percpu.h> | 24 | #include <linux/percpu.h> |
| 25 | #include <linux/clk-provider.h> | ||
| 25 | #include <linux/cpu.h> | 26 | #include <linux/cpu.h> |
| 26 | #include <linux/of_fdt.h> | 27 | #include <linux/of_fdt.h> |
| 27 | #include <linux/of_platform.h> | 28 | #include <linux/of_platform.h> |
| @@ -276,6 +277,7 @@ void __init early_init_devtree(void *params) | |||
| 276 | 277 | ||
| 277 | static int __init xtensa_device_probe(void) | 278 | static int __init xtensa_device_probe(void) |
| 278 | { | 279 | { |
| 280 | of_clk_init(NULL); | ||
| 279 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 281 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
| 280 | return 0; | 282 | return 0; |
| 281 | } | 283 | } |
diff --git a/arch/xtensa/kernel/time.c b/arch/xtensa/kernel/time.c index 08b769d3b3a1..2a1823de69cc 100644 --- a/arch/xtensa/kernel/time.c +++ b/arch/xtensa/kernel/time.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #include <asm/platform.h> | 30 | #include <asm/platform.h> |
| 31 | 31 | ||
| 32 | unsigned long ccount_freq; /* ccount Hz */ | 32 | unsigned long ccount_freq; /* ccount Hz */ |
| 33 | EXPORT_SYMBOL(ccount_freq); | ||
| 33 | 34 | ||
| 34 | static cycle_t ccount_read(struct clocksource *cs) | 35 | static cycle_t ccount_read(struct clocksource *cs) |
| 35 | { | 36 | { |
diff --git a/arch/xtensa/kernel/vectors.S b/arch/xtensa/kernel/vectors.S index cb8fd44caabc..f9e1ec346e35 100644 --- a/arch/xtensa/kernel/vectors.S +++ b/arch/xtensa/kernel/vectors.S | |||
| @@ -235,7 +235,7 @@ ENTRY(_DoubleExceptionVector) | |||
| 235 | 235 | ||
| 236 | /* Check for overflow/underflow exception, jump if overflow. */ | 236 | /* Check for overflow/underflow exception, jump if overflow. */ |
| 237 | 237 | ||
| 238 | _bbci.l a0, 6, _DoubleExceptionVector_WindowOverflow | 238 | bbci.l a0, 6, _DoubleExceptionVector_WindowOverflow |
| 239 | 239 | ||
| 240 | /* | 240 | /* |
| 241 | * Restart window underflow exception. | 241 | * Restart window underflow exception. |
diff --git a/arch/xtensa/kernel/xtensa_ksyms.c b/arch/xtensa/kernel/xtensa_ksyms.c index 74a60c7e085e..80b33ed51f31 100644 --- a/arch/xtensa/kernel/xtensa_ksyms.c +++ b/arch/xtensa/kernel/xtensa_ksyms.c | |||
| @@ -122,9 +122,7 @@ EXPORT_SYMBOL(insw); | |||
| 122 | EXPORT_SYMBOL(insl); | 122 | EXPORT_SYMBOL(insl); |
| 123 | 123 | ||
| 124 | extern long common_exception_return; | 124 | extern long common_exception_return; |
| 125 | extern long _spill_registers; | ||
| 126 | EXPORT_SYMBOL(common_exception_return); | 125 | EXPORT_SYMBOL(common_exception_return); |
| 127 | EXPORT_SYMBOL(_spill_registers); | ||
| 128 | 126 | ||
| 129 | #ifdef CONFIG_FUNCTION_TRACER | 127 | #ifdef CONFIG_FUNCTION_TRACER |
| 130 | EXPORT_SYMBOL(_mcount); | 128 | EXPORT_SYMBOL(_mcount); |
diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c index 479d7537a32a..aff108df92d3 100644 --- a/arch/xtensa/mm/init.c +++ b/arch/xtensa/mm/init.c | |||
| @@ -90,7 +90,7 @@ int __init mem_reserve(unsigned long start, unsigned long end, int must_exist) | |||
| 90 | 90 | ||
| 91 | 91 | ||
| 92 | /* | 92 | /* |
| 93 | * Initialize the bootmem system and give it all the memory we have available. | 93 | * Initialize the bootmem system and give it all low memory we have available. |
| 94 | */ | 94 | */ |
| 95 | 95 | ||
| 96 | void __init bootmem_init(void) | 96 | void __init bootmem_init(void) |
| @@ -142,9 +142,14 @@ void __init bootmem_init(void) | |||
| 142 | 142 | ||
| 143 | /* Add all remaining memory pieces into the bootmem map */ | 143 | /* Add all remaining memory pieces into the bootmem map */ |
| 144 | 144 | ||
| 145 | for (i=0; i<sysmem.nr_banks; i++) | 145 | for (i = 0; i < sysmem.nr_banks; i++) { |
| 146 | free_bootmem(sysmem.bank[i].start, | 146 | if (sysmem.bank[i].start >> PAGE_SHIFT < max_low_pfn) { |
| 147 | sysmem.bank[i].end - sysmem.bank[i].start); | 147 | unsigned long end = min(max_low_pfn << PAGE_SHIFT, |
| 148 | sysmem.bank[i].end); | ||
| 149 | free_bootmem(sysmem.bank[i].start, | ||
| 150 | end - sysmem.bank[i].start); | ||
| 151 | } | ||
| 152 | } | ||
| 148 | 153 | ||
| 149 | } | 154 | } |
| 150 | 155 | ||
diff --git a/arch/xtensa/mm/mmu.c b/arch/xtensa/mm/mmu.c index 36ec171698b8..861203e958da 100644 --- a/arch/xtensa/mm/mmu.c +++ b/arch/xtensa/mm/mmu.c | |||
| @@ -39,7 +39,7 @@ void init_mmu(void) | |||
| 39 | set_itlbcfg_register(0); | 39 | set_itlbcfg_register(0); |
| 40 | set_dtlbcfg_register(0); | 40 | set_dtlbcfg_register(0); |
| 41 | #endif | 41 | #endif |
| 42 | #if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && CONFIG_OF | 42 | #if XCHAL_HAVE_PTP_MMU && XCHAL_HAVE_SPANNING_WAY && defined(CONFIG_OF) |
| 43 | /* | 43 | /* |
| 44 | * Update the IO area mapping in case xtensa_kio_paddr has changed | 44 | * Update the IO area mapping in case xtensa_kio_paddr has changed |
| 45 | */ | 45 | */ |
diff --git a/arch/xtensa/platforms/xtfpga/setup.c b/arch/xtensa/platforms/xtfpga/setup.c index 800227862fe8..57fd08b36f51 100644 --- a/arch/xtensa/platforms/xtfpga/setup.c +++ b/arch/xtensa/platforms/xtfpga/setup.c | |||
| @@ -135,11 +135,11 @@ static void __init update_local_mac(struct device_node *node) | |||
| 135 | 135 | ||
| 136 | static int __init machine_setup(void) | 136 | static int __init machine_setup(void) |
| 137 | { | 137 | { |
| 138 | struct device_node *serial; | 138 | struct device_node *clock; |
| 139 | struct device_node *eth = NULL; | 139 | struct device_node *eth = NULL; |
| 140 | 140 | ||
| 141 | for_each_compatible_node(serial, NULL, "ns16550a") | 141 | for_each_node_by_name(clock, "main-oscillator") |
| 142 | update_clock_frequency(serial); | 142 | update_clock_frequency(clock); |
| 143 | 143 | ||
| 144 | if ((eth = of_find_compatible_node(eth, NULL, "opencores,ethoc"))) | 144 | if ((eth = of_find_compatible_node(eth, NULL, "opencores,ethoc"))) |
| 145 | update_local_mac(eth); | 145 | update_local_mac(eth); |
| @@ -290,6 +290,7 @@ static int __init xtavnet_init(void) | |||
| 290 | * knows whether they set it correctly on the DIP switches. | 290 | * knows whether they set it correctly on the DIP switches. |
| 291 | */ | 291 | */ |
| 292 | pr_info("XTFPGA: Ethernet MAC %pM\n", ethoc_pdata.hwaddr); | 292 | pr_info("XTFPGA: Ethernet MAC %pM\n", ethoc_pdata.hwaddr); |
| 293 | ethoc_pdata.eth_clkfreq = *(long *)XTFPGA_CLKFRQ_VADDR; | ||
| 293 | 294 | ||
| 294 | return 0; | 295 | return 0; |
| 295 | } | 296 | } |
diff --git a/arch/xtensa/variants/fsf/include/variant/tie.h b/arch/xtensa/variants/fsf/include/variant/tie.h index bf4020116df5..244cdea4dee5 100644 --- a/arch/xtensa/variants/fsf/include/variant/tie.h +++ b/arch/xtensa/variants/fsf/include/variant/tie.h | |||
| @@ -18,13 +18,6 @@ | |||
| 18 | #define XCHAL_CP_MASK 0x00 /* bitmask of all CPs by ID */ | 18 | #define XCHAL_CP_MASK 0x00 /* bitmask of all CPs by ID */ |
| 19 | #define XCHAL_CP_PORT_MASK 0x00 /* bitmask of only port CPs */ | 19 | #define XCHAL_CP_PORT_MASK 0x00 /* bitmask of only port CPs */ |
| 20 | 20 | ||
| 21 | /* Basic parameters of each coprocessor: */ | ||
| 22 | #define XCHAL_CP7_NAME "XTIOP" | ||
| 23 | #define XCHAL_CP7_IDENT XTIOP | ||
| 24 | #define XCHAL_CP7_SA_SIZE 0 /* size of state save area */ | ||
| 25 | #define XCHAL_CP7_SA_ALIGN 1 /* min alignment of save area */ | ||
| 26 | #define XCHAL_CP_ID_XTIOP 7 /* coprocessor ID (0..7) */ | ||
| 27 | |||
| 28 | /* Filler info for unassigned coprocessors, to simplify arrays etc: */ | 21 | /* Filler info for unassigned coprocessors, to simplify arrays etc: */ |
| 29 | #define XCHAL_NCP_SA_SIZE 0 | 22 | #define XCHAL_NCP_SA_SIZE 0 |
| 30 | #define XCHAL_NCP_SA_ALIGN 1 | 23 | #define XCHAL_NCP_SA_ALIGN 1 |
| @@ -42,6 +35,8 @@ | |||
| 42 | #define XCHAL_CP5_SA_ALIGN 1 | 35 | #define XCHAL_CP5_SA_ALIGN 1 |
| 43 | #define XCHAL_CP6_SA_SIZE 0 | 36 | #define XCHAL_CP6_SA_SIZE 0 |
| 44 | #define XCHAL_CP6_SA_ALIGN 1 | 37 | #define XCHAL_CP6_SA_ALIGN 1 |
| 38 | #define XCHAL_CP7_SA_SIZE 0 | ||
| 39 | #define XCHAL_CP7_SA_ALIGN 1 | ||
| 45 | 40 | ||
| 46 | /* Save area for non-coprocessor optional and custom (TIE) state: */ | 41 | /* Save area for non-coprocessor optional and custom (TIE) state: */ |
| 47 | #define XCHAL_NCP_SA_SIZE 0 | 42 | #define XCHAL_NCP_SA_SIZE 0 |
