On Thu, 2007-03-22 at 09:30 +0200, Avi Kivity wrote:
> Rusty Russell wrote:
> > +static inline unsigned long long native_read_msr(unsigned int msr, int 
> > *err)
> > +{
> > +   unsigned long long val;
> > +
> > +   asm volatile("2: rdmsr ; xorl %0,%0\n"
> > +                "1:\n\t"
> > +                ".section .fixup,\"ax\"\n\t"
> > +                "3:  movl %3,%0 ; jmp 1b\n\t"
> > +                ".previous\n\t"
> > +                ".section __ex_table,\"a\"\n"
> > +                "   .align 4\n\t"
> > +                "   .long  2b,3b\n\t"
> > +                ".previous"
> > +                : "=r" (*err), "=A" (val)
> > +                : "c" (msr), "i" (-EFAULT));
> > +
> > +   return val;
> > +}
> >   
> 
> 
> > +#define rdmsr(msr,val1,val2)                                               
> > \
> > +   do {                                                            \
> > +           int __err;                                              \
> > +           unsigned long long __val = native_read_msr(msr, &__err);        
> > \
> > +           val1 = __val;                                           \
> > +           val2 = __val >> 32;                                     \
> > +   } while(0)
> > +
> >   
> 
> You're silently changing the behavior (as well as the prototype) here,  
> rdmsr() used to fail loudly, now it fails silently, with no way for the 
> caller to check.

Hi Avi!

        Not sure what you're saying about the prototype: the old macro was:

-#define rdmsr(msr,val1,val2) \
-       __asm__ __volatile__("rdmsr" \
-                         : "=a" (val1), "=d" (val2) \
-                         : "c" (msr))
-

Which doesn't seem to be a great difference to me.

The behaviour change (don't oops when an invalid rdmsr is used) was
there with CONFIG_PARAVIRT=y, the cleanup just made !CONFIG_PARAVIRT the
same.  Is it important?

Thanks,
Rusty.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to