|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 7/6] x86/msr: Introduce msr_{set, clear}_bits() helpers
>>> On 26.06.18 at 20:22, <andrew.cooper3@xxxxxxxxxx> wrote:
> --- a/xen/include/asm-x86/msr.h
> +++ b/xen/include/asm-x86/msr.h
> @@ -11,6 +11,11 @@
> #include <asm/asm_defns.h>
> #include <asm/cpufeature.h>
>
> +static inline void rdmsr_split(unsigned int msr, uint32_t *lo, uint32_t *hi)
> +{
> + asm volatile ( "rdmsr" : "=a" (*lo), "=d" (*hi) : "c" (msr) );
What's the reason for not making this ...
> +}
> +
> #define rdmsr(msr,val1,val2) \
> __asm__ __volatile__("rdmsr" \
> : "=a" (val1), "=d" (val2) \
... use this and ...
> @@ -23,6 +28,11 @@
> val = a__ | ((u64)b__<<32); \
> } while(0)
>
> +static inline void wrmsr_split(unsigned int msr, uint32_t lo, uint32_t hi)
> +{
> + asm volatile ( "wrmsr" :: "a" (lo), "d" (hi), "c" (msr) );
... this use ...
> +}
> +
> #define wrmsr(msr,val1,val2) \
> __asm__ __volatile__("wrmsr" \
> : /* no outputs */ \
... this? In fact it's not really clear why we need the inline functions _and_
the macros. Afaict the two new functions below could also be implemented
with just the macros.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |