[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <56C5E575.8040301@amd.com>
Date:	Thu, 18 Feb 2016 09:38:29 -0600
From:	Aravind Gopalakrishnan <aravind.gopalakrishnan@....com>
To:	<bp@...en8.de>, <tony.luck@...el.com>, <hpa@...or.com>,
	<mingo@...hat.com>, <tglx@...utronix.de>,
	<dougthompson@...ssion.com>, <mchehab@....samsung.com>
CC:	<x86@...nel.org>, <linux-edac@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, <ashok.raj@...el.com>,
	<gong.chen@...ux.intel.com>, <len.brown@...el.com>,
	<peterz@...radead.org>, <ak@...ux.intel.com>,
	<alexander.shishkin@...ux.intel.com>
Subject: Re: [PATCH 2/4] x86/mce/AMD: Fix logic to obtain block address
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@....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.
Powered by blists - more mailing lists
 
