2012-06-01 18:22:06

by Yinghai Lu

[permalink] [raw]
Subject: Re: [PATCH 2/4] x86, CPU: Fix show_msr MSR accessing function

On Fri, Jun 1, 2012 at 7:52 AM, Borislav Petkov <[email protected]> wrote:
> From: Borislav Petkov <[email protected]>
>
> There's no real reason why, when showing the MSRs on a CPU at boottime,
> we should be using the AMD-specific variant. Simply use the generic safe
> one which handles #GPs just fine.
>
> Cc: Yinghai Lu <[email protected]>
> Signed-off-by: Borislav Petkov <[email protected]>
> ---
> ?arch/x86/kernel/cpu/common.c | ? ?2 +-
> ?1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
> index 82f29e70d058..232fba2d54c9 100644
> --- a/arch/x86/kernel/cpu/common.c
> +++ b/arch/x86/kernel/cpu/common.c
> @@ -947,7 +947,7 @@ static void __cpuinit __print_cpu_msr(void)
> ? ? ? ? ? ? ? ?index_max = msr_range_array[i].max;
>
> ? ? ? ? ? ? ? ?for (index = index_min; index < index_max; index++) {
> - ? ? ? ? ? ? ? ? ? ? ? if (rdmsrl_amd_safe(index, &val))
> + ? ? ? ? ? ? ? ? ? ? ? if (rdmsrl_safe(index, &val))
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?continue;
> ? ? ? ? ? ? ? ? ? ? ? ?printk(KERN_INFO " MSR%08x: %016llx\n", index, val);
> ? ? ? ? ? ? ? ?}
> --

can you double check if the range will need special passcode ?



{ 0x00000000, 0x00000418},
{ 0xc0000000, 0xc000040b},
{ 0xc0010000, 0xc0010142},
{ 0xc0011000, 0xc001103b},

passcode should be
gprs[7] = 0x9c5a203a;

Thanks

Yinghai


Subject: Re: [PATCH 2/4] x86, CPU: Fix show_msr MSR accessing function

On Fri, Jun 01, 2012 at 11:22:03AM -0700, Yinghai Lu wrote:
> can you double check if the range will need special passcode ?
>
> { 0x00000000, 0x00000418},
> { 0xc0000000, 0xc000040b},
> { 0xc0010000, 0xc0010142},
> { 0xc0011000, 0xc001103b},
>
> passcode should be
> gprs[7] = 0x9c5a203a;

This currently reads the MSRs it can read without the passcode. There's
no reason I'm aware of to access the other MSRs.

--
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551