[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <46023096.8060809@qumranet.com>
Date: Thu, 22 Mar 2007 09:30:30 +0200
From: Avi Kivity <avi@...ranet.com>
To: Rusty Russell <rusty@...tcorp.com.au>
Cc: Andrew Morton <akpm@...l.org>,
Jeremy Fitzhardinge <jeremy@...p.org>,
lkml - Kernel Mailing List <linux-kernel@...r.kernel.org>,
Andi Kleen <ak@....de>
Subject: Re: [PATCH] Cleanup: rationalize paravirt wrappers
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.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
-
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