From 0efb086043098e2369ecaf806e2dbd702484e247 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 11 Apr 2014 09:05:55 -0700 Subject: [PATCH] 3.13-stable patches added patches: arc-change-.dts-to-use-generic-8250-uart.patch arc-unbork-console.patch crypto-ghash-clmulni-intel-use-c-implementation-for-setkey.patch futex-allow-architectures-to-skip-futex_atomic_cmpxchg_inatomic-test.patch m68k-skip-futex_atomic_cmpxchg_inatomic-test.patch --- ...change-.dts-to-use-generic-8250-uart.patch | 52 +++++++++ queue-3.13/arc-unbork-console.patch | 48 ++++++++ ...ntel-use-c-implementation-for-setkey.patch | 106 +++++++++++++++++ ...p-futex_atomic_cmpxchg_inatomic-test.patch | 110 ++++++++++++++++++ ...p-futex_atomic_cmpxchg_inatomic-test.patch | 32 +++++ queue-3.13/series | 5 + 6 files changed, 353 insertions(+) create mode 100644 queue-3.13/arc-change-.dts-to-use-generic-8250-uart.patch create mode 100644 queue-3.13/arc-unbork-console.patch create mode 100644 queue-3.13/crypto-ghash-clmulni-intel-use-c-implementation-for-setkey.patch create mode 100644 queue-3.13/futex-allow-architectures-to-skip-futex_atomic_cmpxchg_inatomic-test.patch create mode 100644 queue-3.13/m68k-skip-futex_atomic_cmpxchg_inatomic-test.patch diff --git a/queue-3.13/arc-change-.dts-to-use-generic-8250-uart.patch b/queue-3.13/arc-change-.dts-to-use-generic-8250-uart.patch new file mode 100644 index 00000000000..8206d911eba --- /dev/null +++ b/queue-3.13/arc-change-.dts-to-use-generic-8250-uart.patch @@ -0,0 +1,52 @@ +From 6eda477b3c54b8236868c8784e5e042ff14244f0 Mon Sep 17 00:00:00 2001 +From: Mischa Jonker +Date: Thu, 16 May 2013 19:36:08 +0200 +Subject: ARC: [nsimosci] Change .dts to use generic 8250 UART + +From: Mischa Jonker + +commit 6eda477b3c54b8236868c8784e5e042ff14244f0 upstream. + +The Synopsys APB DW UART has a couple of special features that are not +in the System C model. In 3.8, the 8250_dw driver didn't really use these +features, but from 3.9 onwards, the 8250_dw driver has become incompatible +with our model. + +Signed-off-by: Mischa Jonker +Signed-off-by: Vineet Gupta +Cc: Francois Bedard +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arc/boot/dts/nsimosci.dts | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +--- a/arch/arc/boot/dts/nsimosci.dts ++++ b/arch/arc/boot/dts/nsimosci.dts +@@ -11,7 +11,7 @@ + + / { + compatible = "snps,nsimosci"; +- clock-frequency = <80000000>; /* 80 MHZ */ ++ clock-frequency = <20000000>; /* 20 MHZ */ + #address-cells = <1>; + #size-cells = <1>; + interrupt-parent = <&intc>; +@@ -44,15 +44,14 @@ + }; + + uart0: serial@c0000000 { +- compatible = "snps,dw-apb-uart"; ++ compatible = "ns8250"; + reg = <0xc0000000 0x2000>; + interrupts = <11>; +- #clock-frequency = <80000000>; + clock-frequency = <3686400>; + baud = <115200>; + reg-shift = <2>; + reg-io-width = <4>; +- status = "okay"; ++ no-loopback-test = <1>; + }; + + pgu0: pgu@c9000000 { diff --git a/queue-3.13/arc-unbork-console.patch b/queue-3.13/arc-unbork-console.patch new file mode 100644 index 00000000000..7e8dbfdcc4f --- /dev/null +++ b/queue-3.13/arc-unbork-console.patch @@ -0,0 +1,48 @@ +From 61fb4bfc010b0d2940f7fd87acbce6a0f03217cb Mon Sep 17 00:00:00 2001 +From: Vineet Gupta +Date: Sat, 5 Apr 2014 15:30:22 +0530 +Subject: ARC: [nsimosci] Unbork console + +From: Vineet Gupta + +commit 61fb4bfc010b0d2940f7fd87acbce6a0f03217cb upstream. + +Despite the switch to right UART driver (prev patch), serial console +still doesn't work due to missing CONFIG_SERIAL_OF_PLATFORM + +Also fix the default cmdline in DT to not refer to out-of-tree +ARC framebuffer driver for console. + +Signed-off-by: Vineet Gupta +Cc: Francois Bedard +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arc/boot/dts/nsimosci.dts | 5 ++++- + arch/arc/configs/nsimosci_defconfig | 1 + + 2 files changed, 5 insertions(+), 1 deletion(-) + +--- a/arch/arc/boot/dts/nsimosci.dts ++++ b/arch/arc/boot/dts/nsimosci.dts +@@ -17,7 +17,10 @@ + interrupt-parent = <&intc>; + + chosen { +- bootargs = "console=tty0 consoleblank=0"; ++ /* this is for console on PGU */ ++ /* bootargs = "console=tty0 consoleblank=0"; */ ++ /* this is for console on serial */ ++ bootargs = "earlycon=uart8250,mmio32,0xc0000000,115200n8 console=ttyS0,115200n8 consoleblank=0 debug"; + }; + + aliases { +--- a/arch/arc/configs/nsimosci_defconfig ++++ b/arch/arc/configs/nsimosci_defconfig +@@ -54,6 +54,7 @@ CONFIG_SERIO_ARC_PS2=y + CONFIG_SERIAL_8250=y + CONFIG_SERIAL_8250_CONSOLE=y + CONFIG_SERIAL_8250_DW=y ++CONFIG_SERIAL_OF_PLATFORM=y + CONFIG_SERIAL_ARC=y + CONFIG_SERIAL_ARC_CONSOLE=y + # CONFIG_HW_RANDOM is not set diff --git a/queue-3.13/crypto-ghash-clmulni-intel-use-c-implementation-for-setkey.patch b/queue-3.13/crypto-ghash-clmulni-intel-use-c-implementation-for-setkey.patch new file mode 100644 index 00000000000..ce4f8cd3bb4 --- /dev/null +++ b/queue-3.13/crypto-ghash-clmulni-intel-use-c-implementation-for-setkey.patch @@ -0,0 +1,106 @@ +From 8ceee72808d1ae3fb191284afc2257a2be964725 Mon Sep 17 00:00:00 2001 +From: Ard Biesheuvel +Date: Thu, 27 Mar 2014 18:14:40 +0100 +Subject: crypto: ghash-clmulni-intel - use C implementation for setkey() + +From: Ard Biesheuvel + +commit 8ceee72808d1ae3fb191284afc2257a2be964725 upstream. + +The GHASH setkey() function uses SSE registers but fails to call +kernel_fpu_begin()/kernel_fpu_end(). Instead of adding these calls, and +then having to deal with the restriction that they cannot be called from +interrupt context, move the setkey() implementation to the C domain. + +Note that setkey() does not use any particular SSE features and is not +expected to become a performance bottleneck. + +Signed-off-by: Ard Biesheuvel +Acked-by: H. Peter Anvin +Fixes: 0e1227d356e9b (crypto: ghash - Add PCLMULQDQ accelerated implementation) +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/crypto/ghash-clmulni-intel_asm.S | 29 ----------------------------- + arch/x86/crypto/ghash-clmulni-intel_glue.c | 14 +++++++++++--- + 2 files changed, 11 insertions(+), 32 deletions(-) + +--- a/arch/x86/crypto/ghash-clmulni-intel_asm.S ++++ b/arch/x86/crypto/ghash-clmulni-intel_asm.S +@@ -24,10 +24,6 @@ + .align 16 + .Lbswap_mask: + .octa 0x000102030405060708090a0b0c0d0e0f +-.Lpoly: +- .octa 0xc2000000000000000000000000000001 +-.Ltwo_one: +- .octa 0x00000001000000000000000000000001 + + #define DATA %xmm0 + #define SHASH %xmm1 +@@ -134,28 +130,3 @@ ENTRY(clmul_ghash_update) + .Lupdate_just_ret: + ret + ENDPROC(clmul_ghash_update) +- +-/* +- * void clmul_ghash_setkey(be128 *shash, const u8 *key); +- * +- * Calculate hash_key << 1 mod poly +- */ +-ENTRY(clmul_ghash_setkey) +- movaps .Lbswap_mask, BSWAP +- movups (%rsi), %xmm0 +- PSHUFB_XMM BSWAP %xmm0 +- movaps %xmm0, %xmm1 +- psllq $1, %xmm0 +- psrlq $63, %xmm1 +- movaps %xmm1, %xmm2 +- pslldq $8, %xmm1 +- psrldq $8, %xmm2 +- por %xmm1, %xmm0 +- # reduction +- pshufd $0b00100100, %xmm2, %xmm1 +- pcmpeqd .Ltwo_one, %xmm1 +- pand .Lpoly, %xmm1 +- pxor %xmm1, %xmm0 +- movups %xmm0, (%rdi) +- ret +-ENDPROC(clmul_ghash_setkey) +--- a/arch/x86/crypto/ghash-clmulni-intel_glue.c ++++ b/arch/x86/crypto/ghash-clmulni-intel_glue.c +@@ -30,8 +30,6 @@ void clmul_ghash_mul(char *dst, const be + void clmul_ghash_update(char *dst, const char *src, unsigned int srclen, + const be128 *shash); + +-void clmul_ghash_setkey(be128 *shash, const u8 *key); +- + struct ghash_async_ctx { + struct cryptd_ahash *cryptd_tfm; + }; +@@ -58,13 +56,23 @@ static int ghash_setkey(struct crypto_sh + const u8 *key, unsigned int keylen) + { + struct ghash_ctx *ctx = crypto_shash_ctx(tfm); ++ be128 *x = (be128 *)key; ++ u64 a, b; + + if (keylen != GHASH_BLOCK_SIZE) { + crypto_shash_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); + return -EINVAL; + } + +- clmul_ghash_setkey(&ctx->shash, key); ++ /* perform multiplication by 'x' in GF(2^128) */ ++ a = be64_to_cpu(x->a); ++ b = be64_to_cpu(x->b); ++ ++ ctx->shash.a = (__be64)((b << 1) | (a >> 63)); ++ ctx->shash.b = (__be64)((a << 1) | (b >> 63)); ++ ++ if (a >> 63) ++ ctx->shash.b ^= cpu_to_be64(0xc2); + + return 0; + } diff --git a/queue-3.13/futex-allow-architectures-to-skip-futex_atomic_cmpxchg_inatomic-test.patch b/queue-3.13/futex-allow-architectures-to-skip-futex_atomic_cmpxchg_inatomic-test.patch new file mode 100644 index 00000000000..ee5e0a14b61 --- /dev/null +++ b/queue-3.13/futex-allow-architectures-to-skip-futex_atomic_cmpxchg_inatomic-test.patch @@ -0,0 +1,110 @@ +From 03b8c7b623c80af264c4c8d6111e5c6289933666 Mon Sep 17 00:00:00 2001 +From: Heiko Carstens +Date: Sun, 2 Mar 2014 13:09:47 +0100 +Subject: futex: Allow architectures to skip futex_atomic_cmpxchg_inatomic() test + +From: Heiko Carstens + +commit 03b8c7b623c80af264c4c8d6111e5c6289933666 upstream. + +If an architecture has futex_atomic_cmpxchg_inatomic() implemented and there +is no runtime check necessary, allow to skip the test within futex_init(). + +This allows to get rid of some code which would always give the same result, +and also allows the compiler to optimize a couple of if statements away. + +Signed-off-by: Heiko Carstens +Cc: Finn Thain +Cc: Geert Uytterhoeven +Link: http://lkml.kernel.org/r/20140302120947.GA3641@osiris +Signed-off-by: Thomas Gleixner +[geert: Backported to v3.10..v3.13] +Signed-off-by: Geert Uytterhoeven +Signed-off-by: Greg Kroah-Hartman +--- + arch/s390/Kconfig | 1 + + include/linux/futex.h | 4 ++++ + init/Kconfig | 7 +++++++ + kernel/futex.c | 14 ++++++++++++-- + 4 files changed, 24 insertions(+), 2 deletions(-) + +--- a/arch/s390/Kconfig ++++ b/arch/s390/Kconfig +@@ -117,6 +117,7 @@ config S390 + select HAVE_FUNCTION_GRAPH_TRACER + select HAVE_FUNCTION_TRACER + select HAVE_FUNCTION_TRACE_MCOUNT_TEST ++ select HAVE_FUTEX_CMPXCHG if FUTEX + select HAVE_KERNEL_BZIP2 + select HAVE_KERNEL_GZIP + select HAVE_KERNEL_LZ4 +--- a/include/linux/futex.h ++++ b/include/linux/futex.h +@@ -55,7 +55,11 @@ union futex_key { + #ifdef CONFIG_FUTEX + extern void exit_robust_list(struct task_struct *curr); + extern void exit_pi_state_list(struct task_struct *curr); ++#ifdef CONFIG_HAVE_FUTEX_CMPXCHG ++#define futex_cmpxchg_enabled 1 ++#else + extern int futex_cmpxchg_enabled; ++#endif + #else + static inline void exit_robust_list(struct task_struct *curr) + { +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -1399,6 +1399,13 @@ config FUTEX + support for "fast userspace mutexes". The resulting kernel may not + run glibc-based applications correctly. + ++config HAVE_FUTEX_CMPXCHG ++ bool ++ help ++ Architectures should select this if futex_atomic_cmpxchg_inatomic() ++ is implemented and always working. This removes a couple of runtime ++ checks. ++ + config EPOLL + bool "Enable eventpoll support" if EXPERT + default y +--- a/kernel/futex.c ++++ b/kernel/futex.c +@@ -68,7 +68,9 @@ + + #include "locking/rtmutex_common.h" + ++#ifndef CONFIG_HAVE_FUTEX_CMPXCHG + int __read_mostly futex_cmpxchg_enabled; ++#endif + + #define FUTEX_HASHBITS (CONFIG_BASE_SMALL ? 4 : 8) + +@@ -2731,10 +2733,10 @@ SYSCALL_DEFINE6(futex, u32 __user *, uad + return do_futex(uaddr, op, val, tp, uaddr2, val2, val3); + } + +-static int __init futex_init(void) ++static void __init futex_detect_cmpxchg(void) + { ++#ifndef CONFIG_HAVE_FUTEX_CMPXCHG + u32 curval; +- int i; + + /* + * This will fail and we want it. Some arch implementations do +@@ -2748,6 +2750,14 @@ static int __init futex_init(void) + */ + if (cmpxchg_futex_value_locked(&curval, NULL, 0, 0) == -EFAULT) + futex_cmpxchg_enabled = 1; ++#endif ++} ++ ++static int __init futex_init(void) ++{ ++ int i; ++ ++ futex_detect_cmpxchg(); + + for (i = 0; i < ARRAY_SIZE(futex_queues); i++) { + plist_head_init(&futex_queues[i].chain); diff --git a/queue-3.13/m68k-skip-futex_atomic_cmpxchg_inatomic-test.patch b/queue-3.13/m68k-skip-futex_atomic_cmpxchg_inatomic-test.patch new file mode 100644 index 00000000000..c92c61e3e2d --- /dev/null +++ b/queue-3.13/m68k-skip-futex_atomic_cmpxchg_inatomic-test.patch @@ -0,0 +1,32 @@ +From e571c58f313d35c56e0018470e3375ddd1fd320e Mon Sep 17 00:00:00 2001 +From: Finn Thain +Date: Thu, 6 Mar 2014 10:29:27 +1100 +Subject: m68k: Skip futex_atomic_cmpxchg_inatomic() test + +From: Finn Thain + +commit e571c58f313d35c56e0018470e3375ddd1fd320e upstream. + +Skip the futex_atomic_cmpxchg_inatomic() test in futex_init(). It causes a +fatal exception on 68030 (and presumably 68020 also). + +Signed-off-by: Finn Thain +Acked-by: Geert Uytterhoeven +Link: http://lkml.kernel.org/r/alpine.LNX.2.00.1403061006440.5525@nippy.intranet +Signed-off-by: Thomas Gleixner +Signed-off-by: Greg Kroah-Hartman + +--- + arch/m68k/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/m68k/Kconfig ++++ b/arch/m68k/Kconfig +@@ -17,6 +17,7 @@ config M68K + select FPU if MMU + select ARCH_WANT_IPC_PARSE_VERSION + select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE ++ select HAVE_FUTEX_CMPXCHG if MMU && FUTEX + select HAVE_MOD_ARCH_SPECIFIC + select MODULES_USE_ELF_REL + select MODULES_USE_ELF_RELA diff --git a/queue-3.13/series b/queue-3.13/series index 184793211bc..3693c8b7c16 100644 --- a/queue-3.13/series +++ b/queue-3.13/series @@ -58,3 +58,8 @@ rds-prevent-dereference-of-a-null-device-in-rds_iw_laddr_check.patch powernow-k6-disable-cache-when-changing-frequency.patch powernow-k6-correctly-initialize-default-parameters.patch powernow-k6-reorder-frequencies.patch +arc-change-.dts-to-use-generic-8250-uart.patch +arc-unbork-console.patch +futex-allow-architectures-to-skip-futex_atomic_cmpxchg_inatomic-test.patch +m68k-skip-futex_atomic_cmpxchg_inatomic-test.patch +crypto-ghash-clmulni-intel-use-c-implementation-for-setkey.patch -- 2.47.3