Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction abstraction

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>
Cc: Jeremy Fitzhardinge <jeremy@...>, <benh@...>, xen-devel <xen-devel@...>, Peter Zijlstra <a.p.zijlstra@...>, kvm-devel <kvm-devel@...>, <x86@...>, LKML <linux-kernel@...>, Virtualization Mailing List <virtualization@...>, Hugh Dickins <hugh@...>, Thomas Gleixner <tglx@...>
Date: Friday, June 20, 2008 - 3:56 pm

* Linus Torvalds <torvalds@linux-foundation.org> wrote:


okay - Jeremy, could you try the fix below? (or tip/master, i just 
pushed this out)

(i dont use gcc 3.x myself to build the kernel, had way too many 
miscompilations in randconfig tests in the past.)

	Ingo

-------------->
commit b68b80b8ab39c42707dc126c41e87d46edc97c27
Author: Ingo Molnar <mingo@elte.hu>
Date:   Fri Jun 20 21:50:20 2008 +0200

    x86, bitops: make constant-bit set/clear_bit ops faster, gcc workaround
    
    Jeremy Fitzhardinge reported this compiler bug:
    
    Suggestion from Linus: add "r" to the input constraint of the
    set_bit()/clear_bit()'s constant 'nr' branch:
    
    Blows up on "gcc version 3.4.4 20050314 (prerelease) (Debian 3.4.3-13)":
    
     CC      init/main.o
    include2/asm/bitops.h: In function `start_kernel':
    include2/asm/bitops.h:59: warning: asm operand 1 probably doesn't match constraints
    include2/asm/bitops.h:59: warning: asm operand 1 probably doesn't match constraints
    include2/asm/bitops.h:59: warning: asm operand 1 probably doesn't match constraints
    include2/asm/bitops.h:59: error: impossible constraint in `asm'
    include2/asm/bitops.h:59: error: impossible constraint in `asm'
    include2/asm/bitops.h:59: error: impossible constraint in `asm'
    
    Reported-by: Jeremy Fitzhardinge <jeremy@goop.org>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/include/asm-x86/bitops.h b/include/asm-x86/bitops.h
index 6c50548..4575de4 100644
--- a/include/asm-x86/bitops.h
+++ b/include/asm-x86/bitops.h
@@ -58,7 +58,7 @@ static inline void set_bit(unsigned int nr, volatile unsigned long *addr)
 	if (IS_IMMEDIATE(nr)) {
 		asm volatile(LOCK_PREFIX "orb %1,%0"
 			: CONST_MASK_ADDR(nr, addr)
-			: "i" (CONST_MASK(nr))
+			: "ir" (CONST_MASK(nr))
 			: "memory");
 	} else {
 		asm volatile(LOCK_PREFIX "bts %1,%0"
@@ -95,7 +95,7 @@ static inline void clear_bit(int nr, volatile unsigned long *addr)
 	if (IS_IMMEDIATE(nr)) {
 		asm volatile(LOCK_PREFIX "andb %1,%0"
 			: CONST_MASK_ADDR(nr, addr)
-			: "i" (~CONST_MASK(nr)));
+			: "ir" (~CONST_MASK(nr)));
 	} else {
 		asm volatile(LOCK_PREFIX "btr %1,%0"
 			: BITOP_ADDR(addr)
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0 of 4] mm+paravirt+xen: add pte read-modify-write ab..., Jeremy Fitzhardinge, (Mon Jun 16, 7:29 am)
[PATCH 2 of 4] paravirt: add hooks for ptep_modify_prot_star..., Jeremy Fitzhardinge, (Mon Jun 16, 7:30 am)
[PATCH 4 of 4] xen: add mechanism to extend existing multica..., Jeremy Fitzhardinge, (Mon Jun 16, 7:30 am)
[PATCH 3 of 4] xen: implement ptep_modify_prot_start/commit, Jeremy Fitzhardinge, (Mon Jun 16, 7:30 am)
[PATCH 1 of 4] mm: add a ptep_modify_prot transaction abstra..., Jeremy Fitzhardinge, (Mon Jun 16, 7:30 am)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ab..., Benjamin Herrenschmidt, (Wed Jun 18, 7:23 pm)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ab..., Jeremy Fitzhardinge, (Wed Jun 18, 7:59 pm)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ab..., Jeremy Fitzhardinge, (Wed Jun 18, 8:15 pm)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ab..., Benjamin Herrenschmidt, (Wed Jun 18, 8:39 pm)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ab..., Jeremy Fitzhardinge, (Thu Jun 19, 1:03 am)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ab..., Benjamin Herrenschmidt, (Thu Jun 19, 3:20 am)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ab..., Jeremy Fitzhardinge, (Thu Jun 19, 1:57 pm)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ab..., Jeremy Fitzhardinge, (Wed Jun 18, 8:37 pm)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ab..., Jeremy Fitzhardinge, (Fri Jun 20, 3:06 pm)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ab..., Ingo Molnar, (Fri Jun 20, 3:56 pm)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ab..., Jeremy Fitzhardinge, (Fri Jun 20, 4:05 pm)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ab..., Jeremy Fitzhardinge, (Fri Jun 20, 4:16 pm)
Re: [PATCH 1 of 4] mm: add a ptep_modify_prot transaction ab..., Jeremy Fitzhardinge, (Fri Jun 20, 4:22 pm)