lkml.org 
[lkml]   [2016]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/4] x86/mce/AMD: Fix logic to obtain block address
From
Date
On 2/16/2016 3:45 PM, Aravind Gopalakrishnan wrote:
> In upcoming processors, the BLKPTR field is no longer used
> to indicate the MSR number of the additional register.
> Insted, it simply indicates the prescence of additional MSRs.
>
> Fixing the logic here to gather MSR address from
> MSR_AMD64_SMCA_MCx_MISC() for newer processors
> and we fall back to existing logic for older processors.
>
> Signed-off-by: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
> ---

Caught couple of issues-

>
> + /* Fall back to method we used for older processors */
> + switch (block) {
> + case 0:
> + addr = MSR_IA32_MCx_MISC(bank);
> + break;
> + case 1:
> + offset = ((low & MASK_BLKPTR_LO) >> 21);
> + if (offset)
> + addr = MCG_XBLK_ADDR + offset;
> + break;
> + default:
> + addr = current_addr++;
> + }
> +


This needs to be addr = ++current_addr;

>
> + address = get_block_address(address, high, low,
> + bank, block);

The 'high' and 'low' variables need to be swapped.
Missed this during a rebase to latest tip, Apologies..

>
> + address = get_block_address(address, high, low,
> + bank, block);

and here..

> + address = get_block_address(address, high, low, bank, ++block);
> +

and here..

> + if (!address)
> + return 0;
>
>

Apologies, these didn't show up on initial testing locally..

Fixed these on local branch and it seems to work fine.
I'll send it out as a V2 (Shall wait for further comments/reviews before
I do that).

Thanks,
-Aravind.

\
 
 \ /
  Last update: 2016-02-18 17:21    [W:0.134 / U:0.224 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site