lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Wed, 18 Jul 2007 18:02:23 -0700 From: Andrew Morton <akpm@...ux-foundation.org> To: Juergen Beisert <juergen127@...uzholzen.de> Cc: TAKADA Yoshihito <takada@....nifty.com>, linux-kernel@...r.kernel.org, Jordan Crouse <jordan.crouse@....com>, Andres Salomon <dilinger@...ian.org>, Andi Kleen <ak@...e.de>, Alan Cox <alan@...rguk.ukuu.org.uk> Subject: Re: [PATCH 1/1] i386: Geode's TSC is not neccessary to mark tu unstable On Sun, 15 Jul 2007 21:06:27 +0200 Juergen Beisert <juergen127@...uzholzen.de> wrote: > Replace NSC/Cyrix specific chipset access macros by inlined functions. > With the macros a line like this fails (and does nothing): > setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88); > With inlined functions this line will work as expected. I don't get it. Why would the macros behave differently from inlined functions? diff -puN /dev/null include/asm-i386/processor-cyrix.h > --- /dev/null > +++ a/include/asm-i386/processor-cyrix.h > @@ -0,0 +1,20 @@ > +#ifndef __ASM_I386_PROCESSOR_CYRIX_H > +#define __ASM_I386_PROCESSOR_CYRIX > + > +#include <asm/processor-flags.h> > +/* > + * NSC/Cyrix CPU indexed register access > + */ > +static inline u8 getCx86(u8 reg) > +{ > + outb(reg, 0x22); > + return inb(0x23); > +} > + > +static inline void setCx86(u8 reg, u8 data) > +{ > + outb(reg, 0x22); > + outb(data, 0x23); > +} > + > +#endif > diff -puN include/asm-i386/processor.h~i386-geodes-tsc-is-not-neccessary-to-mark-tu-unstable include/asm-i386/processor.h > --- a/include/asm-i386/processor.h~i386-geodes-tsc-is-not-neccessary-to-mark-tu-unstable > +++ a/include/asm-i386/processor.h > @@ -168,17 +168,6 @@ static inline void clear_in_cr4 (unsigne > write_cr4(cr4); > } > > -/* > - * NSC/Cyrix CPU indexed register access macros > - */ > - > -#define getCx86(reg) ({ outb((reg), 0x22); inb(0x23); }) > - > -#define setCx86(reg, data) do { \ > - outb((reg), 0x22); \ > - outb((data), 0x23); \ > -} while (0) > - > /* Stop speculative execution */ > static inline void sync_core(void) > { > diff -puN include/asm-x86_64/processor.h~i386-geodes-tsc-is-not-neccessary-to-mark-tu-unstable include/asm-x86_64/processor.h > --- a/include/asm-x86_64/processor.h~i386-geodes-tsc-is-not-neccessary-to-mark-tu-unstable > +++ a/include/asm-x86_64/processor.h > @@ -389,17 +389,6 @@ static inline void prefetchw(void *x) > > #define cpu_relax() rep_nop() > > -/* > - * NSC/Cyrix CPU indexed register access macros > - */ > - > -#define getCx86(reg) ({ outb((reg), 0x22); inb(0x23); }) > - > -#define setCx86(reg, data) do { \ > - outb((reg), 0x22); \ > - outb((data), 0x23); \ > -} while (0) > - > static inline void serialize_cpu(void) > { > __asm__ __volatile__ ("cpuid" : : : "ax", "bx", "cx", "dx"); > - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists