Re: [PATCH 2/3] x86, msr: rewrite AMD rd/wrmsr variants
From: H. Peter Anvin
Date: Sun Aug 30 2009 - 16:05:32 EST
On 08/30/2009 04:50 AM, Borislav Petkov wrote:
> +
> +#define memset(d,c,l) __builtin_memset(d,c,l)
> static inline int rdmsrl_amd_safe(unsigned msr, unsigned long long *p)
> {
> - int err;
> + u32 gprs[8];
> + int err, i;
> +
> + memset(gprs, 0, sizeof(u32) * 8);
> +
> + gprs[1] = msr;
> + gprs[7] = 0x9c5a203a;
> +
> + err = native_rdmsr_safe_regs(gprs);
> +
> + *p = gprs[0] | ((u64)gprs[2] << 32);
>
> - *p = native_read_msr_amd_safe(msr, &err);
> return err;
> }
>
In file included from
/home/hpa/kernel/linux-2.6-tip.msr/arch/x86/include/asm/processor.h:21,
from
/home/hpa/kernel/linux-2.6-tip.msr/include/linux/prefetch.h:14,
from
/home/hpa/kernel/linux-2.6-tip.msr/include/linux/list.h:6,
from
/home/hpa/kernel/linux-2.6-tip.msr/include/linux/smp.h:11,
from
/home/hpa/kernel/linux-2.6-tip.msr/include/linux/kernel_stat.h:4,
from
/home/hpa/kernel/linux-2.6-tip.msr/arch/x86/kernel/irq_64.c:11:
/home/hpa/kernel/linux-2.6-tip.msr/arch/x86/include/asm/msr.h: In
function ârdmsrl_amd_safeâ:
/home/hpa/kernel/linux-2.6-tip.msr/arch/x86/include/asm/msr.h:176:
warning: unused variable âiâ
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/