From e2a3bd26573b1e03dc730aa0b89ae9ef70c47b5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Fabian=20Silva=20Delgado?= Date: Fri, 7 Feb 2014 22:44:25 -0200 Subject: linux-libre-3.13.2-1: updating version --- ...rect-invalid-use-of-user-timespec-in-the-.patch | 80 ---------------------- libre-testing/linux-libre/PKGBUILD | 13 ++-- 2 files changed, 4 insertions(+), 89 deletions(-) delete mode 100644 libre-testing/linux-libre/0001-x86-x32-Correct-invalid-use-of-user-timespec-in-the-.patch (limited to 'libre-testing/linux-libre') diff --git a/libre-testing/linux-libre/0001-x86-x32-Correct-invalid-use-of-user-timespec-in-the-.patch b/libre-testing/linux-libre/0001-x86-x32-Correct-invalid-use-of-user-timespec-in-the-.patch deleted file mode 100644 index 3f1bccc80..000000000 --- a/libre-testing/linux-libre/0001-x86-x32-Correct-invalid-use-of-user-timespec-in-the-.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 2def2ef2ae5f3990aabdbe8a755911902707d268 Mon Sep 17 00:00:00 2001 -From: PaX Team -Date: Thu, 30 Jan 2014 16:59:25 -0800 -Subject: [PATCH] x86, x32: Correct invalid use of user timespec in the kernel - -The x32 case for the recvmsg() timout handling is broken: - - asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg, - unsigned int vlen, unsigned int flags, - struct compat_timespec __user *timeout) - { - int datagrams; - struct timespec ktspec; - - if (flags & MSG_CMSG_COMPAT) - return -EINVAL; - - if (COMPAT_USE_64BIT_TIME) - return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen, - flags | MSG_CMSG_COMPAT, - (struct timespec *) timeout); - ... - -The timeout pointer parameter is provided by userland (hence the __user -annotation) but for x32 syscalls it's simply cast to a kernel pointer -and is passed to __sys_recvmmsg which will eventually directly -dereference it for both reading and writing. Other callers to -__sys_recvmmsg properly copy from userland to the kernel first. - -The bug was introduced by commit ee4fa23c4bfc ("compat: Use -COMPAT_USE_64BIT_TIME in net/compat.c") and should affect all kernels -since 3.4 (and perhaps vendor kernels if they backported x32 support -along with this code). - -Note that CONFIG_X86_X32_ABI gets enabled at build time and only if -CONFIG_X86_X32 is enabled and ld can build x32 executables. - -Other uses of COMPAT_USE_64BIT_TIME seem fine. - -This addresses CVE-2014-0038. - -Signed-off-by: PaX Team -Signed-off-by: H. Peter Anvin -Cc: # v3.4+ -Signed-off-by: Linus Torvalds ---- - net/compat.c | 9 ++------- - 1 file changed, 2 insertions(+), 7 deletions(-) - -diff --git a/net/compat.c b/net/compat.c -index dd32e34..f50161f 100644 ---- a/net/compat.c -+++ b/net/compat.c -@@ -780,21 +780,16 @@ asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg, - if (flags & MSG_CMSG_COMPAT) - return -EINVAL; - -- if (COMPAT_USE_64BIT_TIME) -- return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen, -- flags | MSG_CMSG_COMPAT, -- (struct timespec *) timeout); -- - if (timeout == NULL) - return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen, - flags | MSG_CMSG_COMPAT, NULL); - -- if (get_compat_timespec(&ktspec, timeout)) -+ if (compat_get_timespec(&ktspec, timeout)) - return -EFAULT; - - datagrams = __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen, - flags | MSG_CMSG_COMPAT, &ktspec); -- if (datagrams > 0 && put_compat_timespec(&ktspec, timeout)) -+ if (datagrams > 0 && compat_put_timespec(&ktspec, timeout)) - datagrams = -EFAULT; - - return datagrams; --- -1.8.5.3 - diff --git a/libre-testing/linux-libre/PKGBUILD b/libre-testing/linux-libre/PKGBUILD index c9368029f..27a13b53a 100644 --- a/libre-testing/linux-libre/PKGBUILD +++ b/libre-testing/linux-libre/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 204858 2014-01-29 14:54:08Z tpowa $ +# $Id: PKGBUILD 205546 2014-02-06 22:45:04Z thomas $ # Maintainer: Tobias Powalowski # Maintainer: Thomas Baechler # Maintainer (Parabola): André Silva @@ -10,9 +10,9 @@ pkgbase=linux-libre # Build stock -LIBRE kernel #pkgbase=linux-libre-custom # Build kernel with a different name _basekernel=3.13 -_sublevel=1 +_sublevel=2 pkgver=${_basekernel}.${_sublevel} -pkgrel=2 +pkgrel=1 _lxopkgver=${_basekernel}.1 # nearly always the same as pkgver arch=('i686' 'x86_64' 'mips64el') url="http://linux-libre.fsfla.org/" @@ -38,10 +38,9 @@ source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${_basekernel}-gn '0006-rpc_pipe-fix-cleanup-of-dummy-gssd-directory-when-no.patch' '0001-syscalls.h-use-gcc-alias-instead-of-assembler-aliase.patch' 'i8042-fix-aliases.patch' - '0001-x86-x32-Correct-invalid-use-of-user-timespec-in-the-.patch' "http://www.linux-libre.fsfla.org/pub/linux-libre/lemote/gnewsense/pool/debuginfo/linux-patches-${_lxopkgver}-gnu_0loongsonlibre_mipsel.tar.xz") md5sums=('98a8e803e0ed08557f3cdd4d56b0ddc1' - '312e6bf90c4de3f455669f8cccf4eddd' + '5594978ab8b62033274cf36305baf238' 'b6a3a3f9cac1be38384241ad58d45d46' '3740951ae165b89a2139d45ae7d82173' 'e49ac236dfeef709f91a3d993ea7b62c' @@ -58,7 +57,6 @@ md5sums=('98a8e803e0ed08557f3cdd4d56b0ddc1' 'a724515b350b29c53f20e631c6cf9a14' 'e6fa278c092ad83780e2dd0568e24ca6' '93dbf73af819b77f03453a9c6de2bb47' - '336d2c4afd7ee5f2bdf0dcb1a54df4b2' '7710668dfdd138f3ad0b93c50455455e') if [ "$CARCH" != "mips64el" ]; then # don't use the Loongson-specific patches on non-mips64el arches. @@ -112,9 +110,6 @@ prepare() { # Fix i8042 aliases patch -p1 -i "${srcdir}/i8042-fix-aliases.patch" - # Fix CVE-2014-0038 - patch -p1 -i "${srcdir}/0001-x86-x32-Correct-invalid-use-of-user-timespec-in-the-.patch" - if [ "$CARCH" == "mips64el" ]; then sed -i "s|^EXTRAVERSION.*|EXTRAVERSION =-libre|" Makefile sed -r "s|^( SUBLEVEL = ).*|\1$_sublevel|" \ -- cgit v1.2.3-2-g168b From 669a2c1e4bffc633e7e31ab720f45e79619ddd14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Fabian=20Silva=20Delgado?= Date: Fri, 7 Feb 2014 23:19:11 -0200 Subject: linux-libre: prolixing ChangeLog on libre-testing too --- libre-testing/linux-libre/ChangeLog | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'libre-testing/linux-libre') diff --git a/libre-testing/linux-libre/ChangeLog b/libre-testing/linux-libre/ChangeLog index 9020464ef..4412bccba 100644 --- a/libre-testing/linux-libre/ChangeLog +++ b/libre-testing/linux-libre/ChangeLog @@ -1,8 +1,3 @@ -2013-10-20 André Silva - - * linux-libre-3.11.5-1 - * Replaced email account emulatorman@lavabit.com to emulatorman@parabola.nu. - 2013-07-15 André Silva * linux-libre-3.10.1-1 @@ -18,27 +13,27 @@ * linux-libre-3.7.1-1 * Replaced CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="kernel.org" to CONFIG_NFS_V4_1_IMPLEMENTATION_ID_DOMAIN="linux-libre.fsfla.org" -2012-06-23 André Silva - - * linux-libre-3.4.4-1 - * Replaced email account andre.paulista@adinet.com.uy to emulatorman@lavabit.com. - 2012-05-26 André Silva * linux-libre-3.4-1.2 - * Disabled CONFIG_MICROCODE_INTEL and CONFIG_MICROCODE_AMD modules https://labs.parabola.nu/issues/116 + * Disabled CONFIG_MICROCODE_INTEL and CONFIG_MICROCODE_AMD modules [3] 2012-04-24 André Silva * linux-libre-3.3.3-1 - * Disabled CONFIG_STUB_POULSBO module https://labs.parabola.nu/issues/90 + * Disabled CONFIG_STUB_POULSBO module [2] 2012-04-08 André Silva * linux-libre-3.3.1-1.1 - * Disabled CONFIG_IPW2100 and CONFIG_IPW2200 modules https://labs.parabola.nu/issues/47 + * Disabled CONFIG_IPW2100 and CONFIG_IPW2200 modules [1] 2012-03-03 André Silva * linux-libre-3.2.9-2 - * Enabled CONFIG_FB_VT8623 module https://labs.parabola.nu/issues/14 + * Enabled CONFIG_FB_VT8623 module [0] + +[0] https://labs.parabola.nu/issues/14 +[1] https://labs.parabola.nu/issues/47 +[2] https://labs.parabola.nu/issues/90 +[3] https://labs.parabola.nu/issues/116 -- cgit v1.2.3-2-g168b From bf4a82e5b687d61dcdd31b12921b4bd835c1f409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Fabian=20Silva=20Delgado?= Date: Fri, 7 Feb 2014 23:21:26 -0200 Subject: linux-libre: remove blank space on ChangeLog --- libre-testing/linux-libre/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libre-testing/linux-libre') diff --git a/libre-testing/linux-libre/ChangeLog b/libre-testing/linux-libre/ChangeLog index 4412bccba..5259f3e89 100644 --- a/libre-testing/linux-libre/ChangeLog +++ b/libre-testing/linux-libre/ChangeLog @@ -21,7 +21,7 @@ 2012-04-24 André Silva * linux-libre-3.3.3-1 - * Disabled CONFIG_STUB_POULSBO module [2] + * Disabled CONFIG_STUB_POULSBO module [2] 2012-04-08 André Silva -- cgit v1.2.3-2-g168b From ceb47adec9fe8463d4b5c181d5c46ed14c76f31a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Fabian=20Silva=20Delgado?= Date: Sat, 8 Feb 2014 14:25:23 -0200 Subject: linux-libre-3.13.2-1: updating version for mips64el --- libre-testing/linux-libre/PKGBUILD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libre-testing/linux-libre') diff --git a/libre-testing/linux-libre/PKGBUILD b/libre-testing/linux-libre/PKGBUILD index 27a13b53a..b6bccec3e 100644 --- a/libre-testing/linux-libre/PKGBUILD +++ b/libre-testing/linux-libre/PKGBUILD @@ -13,7 +13,7 @@ _basekernel=3.13 _sublevel=2 pkgver=${_basekernel}.${_sublevel} pkgrel=1 -_lxopkgver=${_basekernel}.1 # nearly always the same as pkgver +_lxopkgver=${_basekernel}.2 # nearly always the same as pkgver arch=('i686' 'x86_64' 'mips64el') url="http://linux-libre.fsfla.org/" license=('GPL2') @@ -57,7 +57,7 @@ md5sums=('98a8e803e0ed08557f3cdd4d56b0ddc1' 'a724515b350b29c53f20e631c6cf9a14' 'e6fa278c092ad83780e2dd0568e24ca6' '93dbf73af819b77f03453a9c6de2bb47' - '7710668dfdd138f3ad0b93c50455455e') + 'cffddbeccd11e296654374b0a1f1bbf9') if [ "$CARCH" != "mips64el" ]; then # don't use the Loongson-specific patches on non-mips64el arches. unset source[${#source[@]}-1] -- cgit v1.2.3-2-g168b From 2ae131d40c2af1a73a796d35d4fddaf1b5802c4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Fabian=20Silva=20Delgado?= Date: Wed, 12 Feb 2014 12:44:54 -0200 Subject: linux-libre-3.13.2-2: revert avmfritz breaker --- .../linux-libre/0001-revert-avmfritz-breaker.patch | 417 +++++++++++++++++++++ libre-testing/linux-libre/PKGBUILD | 10 +- 2 files changed, 425 insertions(+), 2 deletions(-) create mode 100644 libre-testing/linux-libre/0001-revert-avmfritz-breaker.patch (limited to 'libre-testing/linux-libre') diff --git a/libre-testing/linux-libre/0001-revert-avmfritz-breaker.patch b/libre-testing/linux-libre/0001-revert-avmfritz-breaker.patch new file mode 100644 index 000000000..769be2d9b --- /dev/null +++ b/libre-testing/linux-libre/0001-revert-avmfritz-breaker.patch @@ -0,0 +1,417 @@ +From e0f6dec35f9286e78879fe1ac92803fd69fc4fdc Mon Sep 17 00:00:00 2001 +From: H. Peter Anvin +Date: Wed, 04 Dec 2013 22:31:28 +0000 +Subject: x86, bitops: Correct the assembly constraints to testing bitops + +In checkin: + +0c44c2d0f459 x86: Use asm goto to implement better modify_and_test() functions + +the various functions which do modify and test were unified and +optimized using "asm goto". However, this change missed the detail +that the bitops require an "Ir" constraint rather than an "er" +constraint ("I" = integer constant from 0-31, "e" = signed 32-bit +integer constant). This would cause code to miscompile if these +functions were used on constant bit positions 32-255 and the build to +fail if used on constant bit positions above 255. + +Add the constraints as a parameter to the GEN_BINARY_RMWcc() macro to +avoid this problem. + +Reported-by: Jesse Brandeburg +Signed-off-by: H. Peter Anvin +Cc: Peter Zijlstra +Link: http://lkml.kernel.org/r/529E8719.4070202@zytor.com +--- +diff --git a/arch/x86/include/asm/atomic.h b/arch/x86/include/asm/atomic.h +index da31c8b..b17f4f4 100644 +--- a/arch/x86/include/asm/atomic.h ++++ b/arch/x86/include/asm/atomic.h +@@ -77,7 +77,7 @@ static inline void atomic_sub(int i, atomic_t *v) + */ + static inline int atomic_sub_and_test(int i, atomic_t *v) + { +- GEN_BINARY_RMWcc(LOCK_PREFIX "subl", v->counter, i, "%0", "e"); ++ GEN_BINARY_RMWcc(LOCK_PREFIX "subl", v->counter, "er", i, "%0", "e"); + } + + /** +@@ -141,7 +141,7 @@ static inline int atomic_inc_and_test(atomic_t *v) + */ + static inline int atomic_add_negative(int i, atomic_t *v) + { +- GEN_BINARY_RMWcc(LOCK_PREFIX "addl", v->counter, i, "%0", "s"); ++ GEN_BINARY_RMWcc(LOCK_PREFIX "addl", v->counter, "er", i, "%0", "s"); + } + + /** +diff --git a/arch/x86/include/asm/atomic64_64.h b/arch/x86/include/asm/atomic64_64.h +index 3f065c9..46e9052 100644 +--- a/arch/x86/include/asm/atomic64_64.h ++++ b/arch/x86/include/asm/atomic64_64.h +@@ -72,7 +72,7 @@ static inline void atomic64_sub(long i, atomic64_t *v) + */ + static inline int atomic64_sub_and_test(long i, atomic64_t *v) + { +- GEN_BINARY_RMWcc(LOCK_PREFIX "subq", v->counter, i, "%0", "e"); ++ GEN_BINARY_RMWcc(LOCK_PREFIX "subq", v->counter, "er", i, "%0", "e"); + } + + /** +@@ -138,7 +138,7 @@ static inline int atomic64_inc_and_test(atomic64_t *v) + */ + static inline int atomic64_add_negative(long i, atomic64_t *v) + { +- GEN_BINARY_RMWcc(LOCK_PREFIX "addq", v->counter, i, "%0", "s"); ++ GEN_BINARY_RMWcc(LOCK_PREFIX "addq", v->counter, "er", i, "%0", "s"); + } + + /** +diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h +index 6d76d09..9fc1af7 100644 +--- a/arch/x86/include/asm/bitops.h ++++ b/arch/x86/include/asm/bitops.h +@@ -205,7 +205,7 @@ static inline void change_bit(long nr, volatile unsigned long *addr) + */ + static inline int test_and_set_bit(long nr, volatile unsigned long *addr) + { +- GEN_BINARY_RMWcc(LOCK_PREFIX "bts", *addr, nr, "%0", "c"); ++ GEN_BINARY_RMWcc(LOCK_PREFIX "bts", *addr, "Ir", nr, "%0", "c"); + } + + /** +@@ -251,7 +251,7 @@ static inline int __test_and_set_bit(long nr, volatile unsigned long *addr) + */ + static inline int test_and_clear_bit(long nr, volatile unsigned long *addr) + { +- GEN_BINARY_RMWcc(LOCK_PREFIX "btr", *addr, nr, "%0", "c"); ++ GEN_BINARY_RMWcc(LOCK_PREFIX "btr", *addr, "Ir", nr, "%0", "c"); + } + + /** +@@ -304,7 +304,7 @@ static inline int __test_and_change_bit(long nr, volatile unsigned long *addr) + */ + static inline int test_and_change_bit(long nr, volatile unsigned long *addr) + { +- GEN_BINARY_RMWcc(LOCK_PREFIX "btc", *addr, nr, "%0", "c"); ++ GEN_BINARY_RMWcc(LOCK_PREFIX "btc", *addr, "Ir", nr, "%0", "c"); + } + + static __always_inline int constant_test_bit(long nr, const volatile unsigned long *addr) +diff --git a/arch/x86/include/asm/local.h b/arch/x86/include/asm/local.h +index 5b23e60..4ad6560 100644 +--- a/arch/x86/include/asm/local.h ++++ b/arch/x86/include/asm/local.h +@@ -52,7 +52,7 @@ static inline void local_sub(long i, local_t *l) + */ + static inline int local_sub_and_test(long i, local_t *l) + { +- GEN_BINARY_RMWcc(_ASM_SUB, l->a.counter, i, "%0", "e"); ++ GEN_BINARY_RMWcc(_ASM_SUB, l->a.counter, "er", i, "%0", "e"); + } + + /** +@@ -92,7 +92,7 @@ static inline int local_inc_and_test(local_t *l) + */ + static inline int local_add_negative(long i, local_t *l) + { +- GEN_BINARY_RMWcc(_ASM_ADD, l->a.counter, i, "%0", "s"); ++ GEN_BINARY_RMWcc(_ASM_ADD, l->a.counter, "er", i, "%0", "s"); + } + + /** +diff --git a/arch/x86/include/asm/rmwcc.h b/arch/x86/include/asm/rmwcc.h +index 1ff990f..8f7866a 100644 +--- a/arch/x86/include/asm/rmwcc.h ++++ b/arch/x86/include/asm/rmwcc.h +@@ -16,8 +16,8 @@ cc_label: \ + #define GEN_UNARY_RMWcc(op, var, arg0, cc) \ + __GEN_RMWcc(op " " arg0, var, cc) + +-#define GEN_BINARY_RMWcc(op, var, val, arg0, cc) \ +- __GEN_RMWcc(op " %1, " arg0, var, cc, "er" (val)) ++#define GEN_BINARY_RMWcc(op, var, vcon, val, arg0, cc) \ ++ __GEN_RMWcc(op " %1, " arg0, var, cc, vcon (val)) + + #else /* !CC_HAVE_ASM_GOTO */ + +@@ -33,8 +33,8 @@ do { \ + #define GEN_UNARY_RMWcc(op, var, arg0, cc) \ + __GEN_RMWcc(op " " arg0, var, cc) + +-#define GEN_BINARY_RMWcc(op, var, val, arg0, cc) \ +- __GEN_RMWcc(op " %2, " arg0, var, cc, "er" (val)) ++#define GEN_BINARY_RMWcc(op, var, vcon, val, arg0, cc) \ ++ __GEN_RMWcc(op " %2, " arg0, var, cc, vcon (val)) + + #endif /* CC_HAVE_ASM_GOTO */ + +-- +cgit v0.9.2 + +From 0c44c2d0f459cd7e275242b72f500137c4fa834d Mon Sep 17 00:00:00 2001 +From: Peter Zijlstra +Date: Wed, 11 Sep 2013 13:19:24 +0000 +Subject: x86: Use asm goto to implement better modify_and_test() functions + +Linus suggested using asm goto to get rid of the typical SETcc + TEST +instruction pair -- which also clobbers an extra register -- for our +typical modify_and_test() functions. + +Because asm goto doesn't allow output fields it has to include an +unconditinal memory clobber when it changes a memory variable to force +a reload. + +Luckily all atomic ops already imply a compiler barrier to go along +with their memory barrier semantics. + +Suggested-by: Linus Torvalds +Signed-off-by: Peter Zijlstra +Link: http://lkml.kernel.org/n/tip-0mtn9siwbeo1d33bap1422se@git.kernel.org +Signed-off-by: Ingo Molnar +--- +diff --git a/arch/x86/include/asm/atomic.h b/arch/x86/include/asm/atomic.h +index 722aa3b..da31c8b 100644 +--- a/arch/x86/include/asm/atomic.h ++++ b/arch/x86/include/asm/atomic.h +@@ -6,6 +6,7 @@ + #include + #include + #include ++#include + + /* + * Atomic operations that C can't guarantee us. Useful for +@@ -76,12 +77,7 @@ static inline void atomic_sub(int i, atomic_t *v) + */ + static inline int atomic_sub_and_test(int i, atomic_t *v) + { +- unsigned char c; +- +- asm volatile(LOCK_PREFIX "subl %2,%0; sete %1" +- : "+m" (v->counter), "=qm" (c) +- : "ir" (i) : "memory"); +- return c; ++ GEN_BINARY_RMWcc(LOCK_PREFIX "subl", v->counter, i, "%0", "e"); + } + + /** +@@ -118,12 +114,7 @@ static inline void atomic_dec(atomic_t *v) + */ + static inline int atomic_dec_and_test(atomic_t *v) + { +- unsigned char c; +- +- asm volatile(LOCK_PREFIX "decl %0; sete %1" +- : "+m" (v->counter), "=qm" (c) +- : : "memory"); +- return c != 0; ++ GEN_UNARY_RMWcc(LOCK_PREFIX "decl", v->counter, "%0", "e"); + } + + /** +@@ -136,12 +127,7 @@ static inline int atomic_dec_and_test(atomic_t *v) + */ + static inline int atomic_inc_and_test(atomic_t *v) + { +- unsigned char c; +- +- asm volatile(LOCK_PREFIX "incl %0; sete %1" +- : "+m" (v->counter), "=qm" (c) +- : : "memory"); +- return c != 0; ++ GEN_UNARY_RMWcc(LOCK_PREFIX "incl", v->counter, "%0", "e"); + } + + /** +@@ -155,12 +141,7 @@ static inline int atomic_inc_and_test(atomic_t *v) + */ + static inline int atomic_add_negative(int i, atomic_t *v) + { +- unsigned char c; +- +- asm volatile(LOCK_PREFIX "addl %2,%0; sets %1" +- : "+m" (v->counter), "=qm" (c) +- : "ir" (i) : "memory"); +- return c; ++ GEN_BINARY_RMWcc(LOCK_PREFIX "addl", v->counter, i, "%0", "s"); + } + + /** +diff --git a/arch/x86/include/asm/atomic64_64.h b/arch/x86/include/asm/atomic64_64.h +index 0e1cbfc..3f065c9 100644 +--- a/arch/x86/include/asm/atomic64_64.h ++++ b/arch/x86/include/asm/atomic64_64.h +@@ -72,12 +72,7 @@ static inline void atomic64_sub(long i, atomic64_t *v) + */ + static inline int atomic64_sub_and_test(long i, atomic64_t *v) + { +- unsigned char c; +- +- asm volatile(LOCK_PREFIX "subq %2,%0; sete %1" +- : "=m" (v->counter), "=qm" (c) +- : "er" (i), "m" (v->counter) : "memory"); +- return c; ++ GEN_BINARY_RMWcc(LOCK_PREFIX "subq", v->counter, i, "%0", "e"); + } + + /** +@@ -116,12 +111,7 @@ static inline void atomic64_dec(atomic64_t *v) + */ + static inline int atomic64_dec_and_test(atomic64_t *v) + { +- unsigned char c; +- +- asm volatile(LOCK_PREFIX "decq %0; sete %1" +- : "=m" (v->counter), "=qm" (c) +- : "m" (v->counter) : "memory"); +- return c != 0; ++ GEN_UNARY_RMWcc(LOCK_PREFIX "decq", v->counter, "%0", "e"); + } + + /** +@@ -134,12 +124,7 @@ static inline int atomic64_dec_and_test(atomic64_t *v) + */ + static inline int atomic64_inc_and_test(atomic64_t *v) + { +- unsigned char c; +- +- asm volatile(LOCK_PREFIX "incq %0; sete %1" +- : "=m" (v->counter), "=qm" (c) +- : "m" (v->counter) : "memory"); +- return c != 0; ++ GEN_UNARY_RMWcc(LOCK_PREFIX "incq", v->counter, "%0", "e"); + } + + /** +@@ -153,12 +138,7 @@ static inline int atomic64_inc_and_test(atomic64_t *v) + */ + static inline int atomic64_add_negative(long i, atomic64_t *v) + { +- unsigned char c; +- +- asm volatile(LOCK_PREFIX "addq %2,%0; sets %1" +- : "=m" (v->counter), "=qm" (c) +- : "er" (i), "m" (v->counter) : "memory"); +- return c; ++ GEN_BINARY_RMWcc(LOCK_PREFIX "addq", v->counter, i, "%0", "s"); + } + + /** +diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h +index 41639ce..6d76d09 100644 +--- a/arch/x86/include/asm/bitops.h ++++ b/arch/x86/include/asm/bitops.h +@@ -14,6 +14,7 @@ + + #include + #include ++#include + + #if BITS_PER_LONG == 32 + # define _BITOPS_LONG_SHIFT 5 +@@ -204,12 +205,7 @@ static inline void change_bit(long nr, volatile unsigned long *addr) + */ + static inline int test_and_set_bit(long nr, volatile unsigned long *addr) + { +- int oldbit; +- +- asm volatile(LOCK_PREFIX "bts %2,%1\n\t" +- "sbb %0,%0" : "=r" (oldbit), ADDR : "Ir" (nr) : "memory"); +- +- return oldbit; ++ GEN_BINARY_RMWcc(LOCK_PREFIX "bts", *addr, nr, "%0", "c"); + } + + /** +@@ -255,13 +251,7 @@ static inline int __test_and_set_bit(long nr, volatile unsigned long *addr) + */ + static inline int test_and_clear_bit(long nr, volatile unsigned long *addr) + { +- int oldbit; +- +- asm volatile(LOCK_PREFIX "btr %2,%1\n\t" +- "sbb %0,%0" +- : "=r" (oldbit), ADDR : "Ir" (nr) : "memory"); +- +- return oldbit; ++ GEN_BINARY_RMWcc(LOCK_PREFIX "btr", *addr, nr, "%0", "c"); + } + + /** +@@ -314,13 +304,7 @@ static inline int __test_and_change_bit(long nr, volatile unsigned long *addr) + */ + static inline int test_and_change_bit(long nr, volatile unsigned long *addr) + { +- int oldbit; +- +- asm volatile(LOCK_PREFIX "btc %2,%1\n\t" +- "sbb %0,%0" +- : "=r" (oldbit), ADDR : "Ir" (nr) : "memory"); +- +- return oldbit; ++ GEN_BINARY_RMWcc(LOCK_PREFIX "btc", *addr, nr, "%0", "c"); + } + + static __always_inline int constant_test_bit(long nr, const volatile unsigned long *addr) +diff --git a/arch/x86/include/asm/local.h b/arch/x86/include/asm/local.h +index 2d89e39..5b23e60 100644 +--- a/arch/x86/include/asm/local.h ++++ b/arch/x86/include/asm/local.h +@@ -52,12 +52,7 @@ static inline void local_sub(long i, local_t *l) + */ + static inline int local_sub_and_test(long i, local_t *l) + { +- unsigned char c; +- +- asm volatile(_ASM_SUB "%2,%0; sete %1" +- : "+m" (l->a.counter), "=qm" (c) +- : "ir" (i) : "memory"); +- return c; ++ GEN_BINARY_RMWcc(_ASM_SUB, l->a.counter, i, "%0", "e"); + } + + /** +@@ -70,12 +65,7 @@ static inline int local_sub_and_test(long i, local_t *l) + */ + static inline int local_dec_and_test(local_t *l) + { +- unsigned char c; +- +- asm volatile(_ASM_DEC "%0; sete %1" +- : "+m" (l->a.counter), "=qm" (c) +- : : "memory"); +- return c != 0; ++ GEN_UNARY_RMWcc(_ASM_DEC, l->a.counter, "%0", "e"); + } + + /** +@@ -88,12 +78,7 @@ static inline int local_dec_and_test(local_t *l) + */ + static inline int local_inc_and_test(local_t *l) + { +- unsigned char c; +- +- asm volatile(_ASM_INC "%0; sete %1" +- : "+m" (l->a.counter), "=qm" (c) +- : : "memory"); +- return c != 0; ++ GEN_UNARY_RMWcc(_ASM_INC, l->a.counter, "%0", "e"); + } + + /** +@@ -107,12 +92,7 @@ static inline int local_inc_and_test(local_t *l) + */ + static inline int local_add_negative(long i, local_t *l) + { +- unsigned char c; +- +- asm volatile(_ASM_ADD "%2,%0; sets %1" +- : "+m" (l->a.counter), "=qm" (c) +- : "ir" (i) : "memory"); +- return c; ++ GEN_BINARY_RMWcc(_ASM_ADD, l->a.counter, i, "%0", "s"); + } + + /** +cgit v0.9.2 diff --git a/libre-testing/linux-libre/PKGBUILD b/libre-testing/linux-libre/PKGBUILD index b6bccec3e..2ff12a4b0 100644 --- a/libre-testing/linux-libre/PKGBUILD +++ b/libre-testing/linux-libre/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 205546 2014-02-06 22:45:04Z thomas $ +# $Id: PKGBUILD 205879 2014-02-12 11:56:01Z tpowa $ # Maintainer: Tobias Powalowski # Maintainer: Thomas Baechler # Maintainer (Parabola): André Silva @@ -12,7 +12,7 @@ pkgbase=linux-libre # Build stock -LIBRE kernel _basekernel=3.13 _sublevel=2 pkgver=${_basekernel}.${_sublevel} -pkgrel=1 +pkgrel=2 _lxopkgver=${_basekernel}.2 # nearly always the same as pkgver arch=('i686' 'x86_64' 'mips64el') url="http://linux-libre.fsfla.org/" @@ -37,6 +37,7 @@ source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${_basekernel}-gn '0005-sunrpc-add-an-info-file-for-the-dummy-gssd-pipe.patch' '0006-rpc_pipe-fix-cleanup-of-dummy-gssd-directory-when-no.patch' '0001-syscalls.h-use-gcc-alias-instead-of-assembler-aliase.patch' + '0001-revert-avmfritz-breaker.patch' 'i8042-fix-aliases.patch' "http://www.linux-libre.fsfla.org/pub/linux-libre/lemote/gnewsense/pool/debuginfo/linux-patches-${_lxopkgver}-gnu_0loongsonlibre_mipsel.tar.xz") md5sums=('98a8e803e0ed08557f3cdd4d56b0ddc1' @@ -56,6 +57,7 @@ md5sums=('98a8e803e0ed08557f3cdd4d56b0ddc1' 'd5907a721b97299f0685c583499f7820' 'a724515b350b29c53f20e631c6cf9a14' 'e6fa278c092ad83780e2dd0568e24ca6' + 'bc1917dd2a0f9e4f511f120c85fa0c49' '93dbf73af819b77f03453a9c6de2bb47' 'cffddbeccd11e296654374b0a1f1bbf9') if [ "$CARCH" != "mips64el" ]; then @@ -109,6 +111,10 @@ prepare() { # Fix i8042 aliases patch -p1 -i "${srcdir}/i8042-fix-aliases.patch" + # Revert avmfritz breaker + # https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=e0f6dec35f9286e78879fe1ac92803fd69fc4fdc + # https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=0c44c2d0f459cd7e275242b72f500137c4fa834d + patch -Rp1 -i "${srcdir}/0001-revert-avmfritz-breaker.patch" if [ "$CARCH" == "mips64el" ]; then sed -i "s|^EXTRAVERSION.*|EXTRAVERSION =-libre|" Makefile -- cgit v1.2.3-2-g168b From a6ab803f0cd66221ec09280cf5777c8af43bdc35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Fabian=20Silva=20Delgado?= Date: Fri, 14 Feb 2014 15:21:37 -0200 Subject: linux-libre-3.13.3-1: updating version * add correct patch for asm issues --- .../linux-libre/0001-quirk-asm_volatile_goto.patch | 51 +++ .../linux-libre/0001-revert-avmfritz-breaker.patch | 417 --------------------- libre-testing/linux-libre/PKGBUILD | 19 +- 3 files changed, 60 insertions(+), 427 deletions(-) create mode 100644 libre-testing/linux-libre/0001-quirk-asm_volatile_goto.patch delete mode 100644 libre-testing/linux-libre/0001-revert-avmfritz-breaker.patch (limited to 'libre-testing/linux-libre') diff --git a/libre-testing/linux-libre/0001-quirk-asm_volatile_goto.patch b/libre-testing/linux-libre/0001-quirk-asm_volatile_goto.patch new file mode 100644 index 000000000..c9ee40400 --- /dev/null +++ b/libre-testing/linux-libre/0001-quirk-asm_volatile_goto.patch @@ -0,0 +1,51 @@ +From a9f180345f5378ac87d80ed0bea55ba421d83859 Mon Sep 17 00:00:00 2001 +From: Steven Noonan +Date: Thu, 13 Feb 2014 07:01:07 +0000 +Subject: compiler/gcc4: Make quirk for asm_volatile_goto() unconditional + +I started noticing problems with KVM guest destruction on Linux +3.12+, where guest memory wasn't being cleaned up. I bisected it +down to the commit introducing the new 'asm goto'-based atomics, +and found this quirk was later applied to those. + +Unfortunately, even with GCC 4.8.2 (which ostensibly fixed the +known 'asm goto' bug) I am still getting some kind of +miscompilation. If I enable the asm_volatile_goto quirk for my +compiler, KVM guests are destroyed correctly and the memory is +cleaned up. + +So make the quirk unconditional for now, until bug is found +and fixed. + +Suggested-by: Linus Torvalds +Signed-off-by: Steven Noonan +Cc: Peter Zijlstra +Cc: Steven Rostedt +Cc: Jakub Jelinek +Cc: Richard Henderson +Cc: Andrew Morton +Cc: Oleg Nesterov +Cc: +Link: http://lkml.kernel.org/r/1392274867-15236-1-git-send-email-steven@uplinklabs.net +Link: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 +Signed-off-by: Ingo Molnar +--- +diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h +index ded4299..2507fd2 100644 +--- a/include/linux/compiler-gcc4.h ++++ b/include/linux/compiler-gcc4.h +@@ -75,11 +75,7 @@ + * + * (asm goto is automatically volatile - the naming reflects this.) + */ +-#if GCC_VERSION <= 40801 +-# define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) +-#else +-# define asm_volatile_goto(x...) do { asm goto(x); } while (0) +-#endif ++#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) + + #ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP + #if GCC_VERSION >= 40400 +-- +cgit v0.9.2 diff --git a/libre-testing/linux-libre/0001-revert-avmfritz-breaker.patch b/libre-testing/linux-libre/0001-revert-avmfritz-breaker.patch deleted file mode 100644 index 769be2d9b..000000000 --- a/libre-testing/linux-libre/0001-revert-avmfritz-breaker.patch +++ /dev/null @@ -1,417 +0,0 @@ -From e0f6dec35f9286e78879fe1ac92803fd69fc4fdc Mon Sep 17 00:00:00 2001 -From: H. Peter Anvin -Date: Wed, 04 Dec 2013 22:31:28 +0000 -Subject: x86, bitops: Correct the assembly constraints to testing bitops - -In checkin: - -0c44c2d0f459 x86: Use asm goto to implement better modify_and_test() functions - -the various functions which do modify and test were unified and -optimized using "asm goto". However, this change missed the detail -that the bitops require an "Ir" constraint rather than an "er" -constraint ("I" = integer constant from 0-31, "e" = signed 32-bit -integer constant). This would cause code to miscompile if these -functions were used on constant bit positions 32-255 and the build to -fail if used on constant bit positions above 255. - -Add the constraints as a parameter to the GEN_BINARY_RMWcc() macro to -avoid this problem. - -Reported-by: Jesse Brandeburg -Signed-off-by: H. Peter Anvin -Cc: Peter Zijlstra -Link: http://lkml.kernel.org/r/529E8719.4070202@zytor.com ---- -diff --git a/arch/x86/include/asm/atomic.h b/arch/x86/include/asm/atomic.h -index da31c8b..b17f4f4 100644 ---- a/arch/x86/include/asm/atomic.h -+++ b/arch/x86/include/asm/atomic.h -@@ -77,7 +77,7 @@ static inline void atomic_sub(int i, atomic_t *v) - */ - static inline int atomic_sub_and_test(int i, atomic_t *v) - { -- GEN_BINARY_RMWcc(LOCK_PREFIX "subl", v->counter, i, "%0", "e"); -+ GEN_BINARY_RMWcc(LOCK_PREFIX "subl", v->counter, "er", i, "%0", "e"); - } - - /** -@@ -141,7 +141,7 @@ static inline int atomic_inc_and_test(atomic_t *v) - */ - static inline int atomic_add_negative(int i, atomic_t *v) - { -- GEN_BINARY_RMWcc(LOCK_PREFIX "addl", v->counter, i, "%0", "s"); -+ GEN_BINARY_RMWcc(LOCK_PREFIX "addl", v->counter, "er", i, "%0", "s"); - } - - /** -diff --git a/arch/x86/include/asm/atomic64_64.h b/arch/x86/include/asm/atomic64_64.h -index 3f065c9..46e9052 100644 ---- a/arch/x86/include/asm/atomic64_64.h -+++ b/arch/x86/include/asm/atomic64_64.h -@@ -72,7 +72,7 @@ static inline void atomic64_sub(long i, atomic64_t *v) - */ - static inline int atomic64_sub_and_test(long i, atomic64_t *v) - { -- GEN_BINARY_RMWcc(LOCK_PREFIX "subq", v->counter, i, "%0", "e"); -+ GEN_BINARY_RMWcc(LOCK_PREFIX "subq", v->counter, "er", i, "%0", "e"); - } - - /** -@@ -138,7 +138,7 @@ static inline int atomic64_inc_and_test(atomic64_t *v) - */ - static inline int atomic64_add_negative(long i, atomic64_t *v) - { -- GEN_BINARY_RMWcc(LOCK_PREFIX "addq", v->counter, i, "%0", "s"); -+ GEN_BINARY_RMWcc(LOCK_PREFIX "addq", v->counter, "er", i, "%0", "s"); - } - - /** -diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h -index 6d76d09..9fc1af7 100644 ---- a/arch/x86/include/asm/bitops.h -+++ b/arch/x86/include/asm/bitops.h -@@ -205,7 +205,7 @@ static inline void change_bit(long nr, volatile unsigned long *addr) - */ - static inline int test_and_set_bit(long nr, volatile unsigned long *addr) - { -- GEN_BINARY_RMWcc(LOCK_PREFIX "bts", *addr, nr, "%0", "c"); -+ GEN_BINARY_RMWcc(LOCK_PREFIX "bts", *addr, "Ir", nr, "%0", "c"); - } - - /** -@@ -251,7 +251,7 @@ static inline int __test_and_set_bit(long nr, volatile unsigned long *addr) - */ - static inline int test_and_clear_bit(long nr, volatile unsigned long *addr) - { -- GEN_BINARY_RMWcc(LOCK_PREFIX "btr", *addr, nr, "%0", "c"); -+ GEN_BINARY_RMWcc(LOCK_PREFIX "btr", *addr, "Ir", nr, "%0", "c"); - } - - /** -@@ -304,7 +304,7 @@ static inline int __test_and_change_bit(long nr, volatile unsigned long *addr) - */ - static inline int test_and_change_bit(long nr, volatile unsigned long *addr) - { -- GEN_BINARY_RMWcc(LOCK_PREFIX "btc", *addr, nr, "%0", "c"); -+ GEN_BINARY_RMWcc(LOCK_PREFIX "btc", *addr, "Ir", nr, "%0", "c"); - } - - static __always_inline int constant_test_bit(long nr, const volatile unsigned long *addr) -diff --git a/arch/x86/include/asm/local.h b/arch/x86/include/asm/local.h -index 5b23e60..4ad6560 100644 ---- a/arch/x86/include/asm/local.h -+++ b/arch/x86/include/asm/local.h -@@ -52,7 +52,7 @@ static inline void local_sub(long i, local_t *l) - */ - static inline int local_sub_and_test(long i, local_t *l) - { -- GEN_BINARY_RMWcc(_ASM_SUB, l->a.counter, i, "%0", "e"); -+ GEN_BINARY_RMWcc(_ASM_SUB, l->a.counter, "er", i, "%0", "e"); - } - - /** -@@ -92,7 +92,7 @@ static inline int local_inc_and_test(local_t *l) - */ - static inline int local_add_negative(long i, local_t *l) - { -- GEN_BINARY_RMWcc(_ASM_ADD, l->a.counter, i, "%0", "s"); -+ GEN_BINARY_RMWcc(_ASM_ADD, l->a.counter, "er", i, "%0", "s"); - } - - /** -diff --git a/arch/x86/include/asm/rmwcc.h b/arch/x86/include/asm/rmwcc.h -index 1ff990f..8f7866a 100644 ---- a/arch/x86/include/asm/rmwcc.h -+++ b/arch/x86/include/asm/rmwcc.h -@@ -16,8 +16,8 @@ cc_label: \ - #define GEN_UNARY_RMWcc(op, var, arg0, cc) \ - __GEN_RMWcc(op " " arg0, var, cc) - --#define GEN_BINARY_RMWcc(op, var, val, arg0, cc) \ -- __GEN_RMWcc(op " %1, " arg0, var, cc, "er" (val)) -+#define GEN_BINARY_RMWcc(op, var, vcon, val, arg0, cc) \ -+ __GEN_RMWcc(op " %1, " arg0, var, cc, vcon (val)) - - #else /* !CC_HAVE_ASM_GOTO */ - -@@ -33,8 +33,8 @@ do { \ - #define GEN_UNARY_RMWcc(op, var, arg0, cc) \ - __GEN_RMWcc(op " " arg0, var, cc) - --#define GEN_BINARY_RMWcc(op, var, val, arg0, cc) \ -- __GEN_RMWcc(op " %2, " arg0, var, cc, "er" (val)) -+#define GEN_BINARY_RMWcc(op, var, vcon, val, arg0, cc) \ -+ __GEN_RMWcc(op " %2, " arg0, var, cc, vcon (val)) - - #endif /* CC_HAVE_ASM_GOTO */ - --- -cgit v0.9.2 - -From 0c44c2d0f459cd7e275242b72f500137c4fa834d Mon Sep 17 00:00:00 2001 -From: Peter Zijlstra -Date: Wed, 11 Sep 2013 13:19:24 +0000 -Subject: x86: Use asm goto to implement better modify_and_test() functions - -Linus suggested using asm goto to get rid of the typical SETcc + TEST -instruction pair -- which also clobbers an extra register -- for our -typical modify_and_test() functions. - -Because asm goto doesn't allow output fields it has to include an -unconditinal memory clobber when it changes a memory variable to force -a reload. - -Luckily all atomic ops already imply a compiler barrier to go along -with their memory barrier semantics. - -Suggested-by: Linus Torvalds -Signed-off-by: Peter Zijlstra -Link: http://lkml.kernel.org/n/tip-0mtn9siwbeo1d33bap1422se@git.kernel.org -Signed-off-by: Ingo Molnar ---- -diff --git a/arch/x86/include/asm/atomic.h b/arch/x86/include/asm/atomic.h -index 722aa3b..da31c8b 100644 ---- a/arch/x86/include/asm/atomic.h -+++ b/arch/x86/include/asm/atomic.h -@@ -6,6 +6,7 @@ - #include - #include - #include -+#include - - /* - * Atomic operations that C can't guarantee us. Useful for -@@ -76,12 +77,7 @@ static inline void atomic_sub(int i, atomic_t *v) - */ - static inline int atomic_sub_and_test(int i, atomic_t *v) - { -- unsigned char c; -- -- asm volatile(LOCK_PREFIX "subl %2,%0; sete %1" -- : "+m" (v->counter), "=qm" (c) -- : "ir" (i) : "memory"); -- return c; -+ GEN_BINARY_RMWcc(LOCK_PREFIX "subl", v->counter, i, "%0", "e"); - } - - /** -@@ -118,12 +114,7 @@ static inline void atomic_dec(atomic_t *v) - */ - static inline int atomic_dec_and_test(atomic_t *v) - { -- unsigned char c; -- -- asm volatile(LOCK_PREFIX "decl %0; sete %1" -- : "+m" (v->counter), "=qm" (c) -- : : "memory"); -- return c != 0; -+ GEN_UNARY_RMWcc(LOCK_PREFIX "decl", v->counter, "%0", "e"); - } - - /** -@@ -136,12 +127,7 @@ static inline int atomic_dec_and_test(atomic_t *v) - */ - static inline int atomic_inc_and_test(atomic_t *v) - { -- unsigned char c; -- -- asm volatile(LOCK_PREFIX "incl %0; sete %1" -- : "+m" (v->counter), "=qm" (c) -- : : "memory"); -- return c != 0; -+ GEN_UNARY_RMWcc(LOCK_PREFIX "incl", v->counter, "%0", "e"); - } - - /** -@@ -155,12 +141,7 @@ static inline int atomic_inc_and_test(atomic_t *v) - */ - static inline int atomic_add_negative(int i, atomic_t *v) - { -- unsigned char c; -- -- asm volatile(LOCK_PREFIX "addl %2,%0; sets %1" -- : "+m" (v->counter), "=qm" (c) -- : "ir" (i) : "memory"); -- return c; -+ GEN_BINARY_RMWcc(LOCK_PREFIX "addl", v->counter, i, "%0", "s"); - } - - /** -diff --git a/arch/x86/include/asm/atomic64_64.h b/arch/x86/include/asm/atomic64_64.h -index 0e1cbfc..3f065c9 100644 ---- a/arch/x86/include/asm/atomic64_64.h -+++ b/arch/x86/include/asm/atomic64_64.h -@@ -72,12 +72,7 @@ static inline void atomic64_sub(long i, atomic64_t *v) - */ - static inline int atomic64_sub_and_test(long i, atomic64_t *v) - { -- unsigned char c; -- -- asm volatile(LOCK_PREFIX "subq %2,%0; sete %1" -- : "=m" (v->counter), "=qm" (c) -- : "er" (i), "m" (v->counter) : "memory"); -- return c; -+ GEN_BINARY_RMWcc(LOCK_PREFIX "subq", v->counter, i, "%0", "e"); - } - - /** -@@ -116,12 +111,7 @@ static inline void atomic64_dec(atomic64_t *v) - */ - static inline int atomic64_dec_and_test(atomic64_t *v) - { -- unsigned char c; -- -- asm volatile(LOCK_PREFIX "decq %0; sete %1" -- : "=m" (v->counter), "=qm" (c) -- : "m" (v->counter) : "memory"); -- return c != 0; -+ GEN_UNARY_RMWcc(LOCK_PREFIX "decq", v->counter, "%0", "e"); - } - - /** -@@ -134,12 +124,7 @@ static inline int atomic64_dec_and_test(atomic64_t *v) - */ - static inline int atomic64_inc_and_test(atomic64_t *v) - { -- unsigned char c; -- -- asm volatile(LOCK_PREFIX "incq %0; sete %1" -- : "=m" (v->counter), "=qm" (c) -- : "m" (v->counter) : "memory"); -- return c != 0; -+ GEN_UNARY_RMWcc(LOCK_PREFIX "incq", v->counter, "%0", "e"); - } - - /** -@@ -153,12 +138,7 @@ static inline int atomic64_inc_and_test(atomic64_t *v) - */ - static inline int atomic64_add_negative(long i, atomic64_t *v) - { -- unsigned char c; -- -- asm volatile(LOCK_PREFIX "addq %2,%0; sets %1" -- : "=m" (v->counter), "=qm" (c) -- : "er" (i), "m" (v->counter) : "memory"); -- return c; -+ GEN_BINARY_RMWcc(LOCK_PREFIX "addq", v->counter, i, "%0", "s"); - } - - /** -diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h -index 41639ce..6d76d09 100644 ---- a/arch/x86/include/asm/bitops.h -+++ b/arch/x86/include/asm/bitops.h -@@ -14,6 +14,7 @@ - - #include - #include -+#include - - #if BITS_PER_LONG == 32 - # define _BITOPS_LONG_SHIFT 5 -@@ -204,12 +205,7 @@ static inline void change_bit(long nr, volatile unsigned long *addr) - */ - static inline int test_and_set_bit(long nr, volatile unsigned long *addr) - { -- int oldbit; -- -- asm volatile(LOCK_PREFIX "bts %2,%1\n\t" -- "sbb %0,%0" : "=r" (oldbit), ADDR : "Ir" (nr) : "memory"); -- -- return oldbit; -+ GEN_BINARY_RMWcc(LOCK_PREFIX "bts", *addr, nr, "%0", "c"); - } - - /** -@@ -255,13 +251,7 @@ static inline int __test_and_set_bit(long nr, volatile unsigned long *addr) - */ - static inline int test_and_clear_bit(long nr, volatile unsigned long *addr) - { -- int oldbit; -- -- asm volatile(LOCK_PREFIX "btr %2,%1\n\t" -- "sbb %0,%0" -- : "=r" (oldbit), ADDR : "Ir" (nr) : "memory"); -- -- return oldbit; -+ GEN_BINARY_RMWcc(LOCK_PREFIX "btr", *addr, nr, "%0", "c"); - } - - /** -@@ -314,13 +304,7 @@ static inline int __test_and_change_bit(long nr, volatile unsigned long *addr) - */ - static inline int test_and_change_bit(long nr, volatile unsigned long *addr) - { -- int oldbit; -- -- asm volatile(LOCK_PREFIX "btc %2,%1\n\t" -- "sbb %0,%0" -- : "=r" (oldbit), ADDR : "Ir" (nr) : "memory"); -- -- return oldbit; -+ GEN_BINARY_RMWcc(LOCK_PREFIX "btc", *addr, nr, "%0", "c"); - } - - static __always_inline int constant_test_bit(long nr, const volatile unsigned long *addr) -diff --git a/arch/x86/include/asm/local.h b/arch/x86/include/asm/local.h -index 2d89e39..5b23e60 100644 ---- a/arch/x86/include/asm/local.h -+++ b/arch/x86/include/asm/local.h -@@ -52,12 +52,7 @@ static inline void local_sub(long i, local_t *l) - */ - static inline int local_sub_and_test(long i, local_t *l) - { -- unsigned char c; -- -- asm volatile(_ASM_SUB "%2,%0; sete %1" -- : "+m" (l->a.counter), "=qm" (c) -- : "ir" (i) : "memory"); -- return c; -+ GEN_BINARY_RMWcc(_ASM_SUB, l->a.counter, i, "%0", "e"); - } - - /** -@@ -70,12 +65,7 @@ static inline int local_sub_and_test(long i, local_t *l) - */ - static inline int local_dec_and_test(local_t *l) - { -- unsigned char c; -- -- asm volatile(_ASM_DEC "%0; sete %1" -- : "+m" (l->a.counter), "=qm" (c) -- : : "memory"); -- return c != 0; -+ GEN_UNARY_RMWcc(_ASM_DEC, l->a.counter, "%0", "e"); - } - - /** -@@ -88,12 +78,7 @@ static inline int local_dec_and_test(local_t *l) - */ - static inline int local_inc_and_test(local_t *l) - { -- unsigned char c; -- -- asm volatile(_ASM_INC "%0; sete %1" -- : "+m" (l->a.counter), "=qm" (c) -- : : "memory"); -- return c != 0; -+ GEN_UNARY_RMWcc(_ASM_INC, l->a.counter, "%0", "e"); - } - - /** -@@ -107,12 +92,7 @@ static inline int local_inc_and_test(local_t *l) - */ - static inline int local_add_negative(long i, local_t *l) - { -- unsigned char c; -- -- asm volatile(_ASM_ADD "%2,%0; sets %1" -- : "+m" (l->a.counter), "=qm" (c) -- : "ir" (i) : "memory"); -- return c; -+ GEN_BINARY_RMWcc(_ASM_ADD, l->a.counter, i, "%0", "s"); - } - - /** -cgit v0.9.2 diff --git a/libre-testing/linux-libre/PKGBUILD b/libre-testing/linux-libre/PKGBUILD index 2ff12a4b0..09d3b6d49 100644 --- a/libre-testing/linux-libre/PKGBUILD +++ b/libre-testing/linux-libre/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 205879 2014-02-12 11:56:01Z tpowa $ +# $Id: PKGBUILD 205930 2014-02-14 08:13:44Z tpowa $ # Maintainer: Tobias Powalowski # Maintainer: Thomas Baechler # Maintainer (Parabola): André Silva @@ -10,9 +10,9 @@ pkgbase=linux-libre # Build stock -LIBRE kernel #pkgbase=linux-libre-custom # Build kernel with a different name _basekernel=3.13 -_sublevel=2 +_sublevel=3 pkgver=${_basekernel}.${_sublevel} -pkgrel=2 +pkgrel=1 _lxopkgver=${_basekernel}.2 # nearly always the same as pkgver arch=('i686' 'x86_64' 'mips64el') url="http://linux-libre.fsfla.org/" @@ -37,11 +37,11 @@ source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${_basekernel}-gn '0005-sunrpc-add-an-info-file-for-the-dummy-gssd-pipe.patch' '0006-rpc_pipe-fix-cleanup-of-dummy-gssd-directory-when-no.patch' '0001-syscalls.h-use-gcc-alias-instead-of-assembler-aliase.patch' - '0001-revert-avmfritz-breaker.patch' + '0001-quirk-asm_volatile_goto.patch' 'i8042-fix-aliases.patch' "http://www.linux-libre.fsfla.org/pub/linux-libre/lemote/gnewsense/pool/debuginfo/linux-patches-${_lxopkgver}-gnu_0loongsonlibre_mipsel.tar.xz") md5sums=('98a8e803e0ed08557f3cdd4d56b0ddc1' - '5594978ab8b62033274cf36305baf238' + 'de4e4158ff1711cd57196f323358d0ec' 'b6a3a3f9cac1be38384241ad58d45d46' '3740951ae165b89a2139d45ae7d82173' 'e49ac236dfeef709f91a3d993ea7b62c' @@ -57,7 +57,7 @@ md5sums=('98a8e803e0ed08557f3cdd4d56b0ddc1' 'd5907a721b97299f0685c583499f7820' 'a724515b350b29c53f20e631c6cf9a14' 'e6fa278c092ad83780e2dd0568e24ca6' - 'bc1917dd2a0f9e4f511f120c85fa0c49' + '6baa312bc166681f48e972824f3f6649' '93dbf73af819b77f03453a9c6de2bb47' 'cffddbeccd11e296654374b0a1f1bbf9') if [ "$CARCH" != "mips64el" ]; then @@ -111,10 +111,9 @@ prepare() { # Fix i8042 aliases patch -p1 -i "${srcdir}/i8042-fix-aliases.patch" - # Revert avmfritz breaker - # https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=e0f6dec35f9286e78879fe1ac92803fd69fc4fdc - # https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=0c44c2d0f459cd7e275242b72f500137c4fa834d - patch -Rp1 -i "${srcdir}/0001-revert-avmfritz-breaker.patch" + # Fix compile issues + # http://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/patch/?id=a9f180345f5378ac87d80ed0bea55ba421d83859 + patch -Np1 -i "${srcdir}/0001-quirk-asm_volatile_goto.patch" if [ "$CARCH" == "mips64el" ]; then sed -i "s|^EXTRAVERSION.*|EXTRAVERSION =-libre|" Makefile -- cgit v1.2.3-2-g168b