• R/O
  • HTTP
  • SSH
  • HTTPS

linux-2.4.36: Commit

2.4.36-stable kernel tree


Commit MetaInfo

Revisionba89d5a7c93fd275487ab58268ca53cf14b426bd (tree)
Zeit2008-02-11 06:54:44
AutorWilly Tarreau <w@1wt....>
CommiterWilly Tarreau

Log Message

i386: fix setCx86/getCx86 race in macros

Because of the way the setCx86 macro is defined, a call to
setCx86(XXXX, getCx86(XXXX)) will produce the wrong output sequence.
This affects at least one place in arch/i386/kernel/setup.c :

/* Enable MMX extensions (App note 108) */
setCx86(CX86_CCR7, getCx86(CX86_CCR7)|1);

A correct solution consists in passing the value argument via a
temporary variable. 2.6 has a different fix using inline functions,
which produce equivalent code though.

Signed-off-by: Willy Tarreau <w@1wt.eu>

Ändern Zusammenfassung

Diff

--- a/include/asm-i386/processor.h
+++ b/include/asm-i386/processor.h
@@ -234,8 +234,9 @@ static inline void clear_in_cr4 (unsigned long mask)
234234 #define getCx86(reg) ({ outb((reg), 0x22); inb(0x23); })
235235
236236 #define setCx86(reg, data) do { \
237+ unsigned char _tmp_data = (data); \
237238 outb((reg), 0x22); \
238- outb((data), 0x23); \
239+ outb(_tmp_data, 0x23); \
239240 } while (0)
240241
241242 /*
Show on old repository browser