Subject: Re: [PATCH] powerpc: Fix the corrupt r3 error during MCE handling.

From: Mahesh Jagannath Salgaonkar <[email-masked]>
Date: Thu, 11 Jul 2013 10:04:29 +0530

On 07/10/2013 07:41 PM, Aneesh Kumar K.V wrote:
> Mahesh J Salgaonkar <[email-masked]> writes:
> 
>> From: Mahesh Salgaonkar <[email-masked]>
>>
>> During Machine Check interrupt on pseries platform, R3 generally points to
>> memory region inside RTAS (FWNMI) area. We see r3 corruption because when RTAS
>> delivers the machine check exception it passes the address inside FWNMI area
>> with the top most bit set. This patch fixes this issue by masking top two bit
>> in machine check exception handler.
> 
> I always got that error and used to wonder why I find FWNMI
> corrupt. IS this a rtas bug or is it documented in papr ?

Nope. There is no mention of it in PAPR. It looks like a bug in RTAS.

> 
> 
>>
>> Signed-off-by: Mahesh Salgaonkar <[email-masked]>
>> ---
>>  arch/powerpc/platforms/pseries/ras.c |    3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c
>> index 7b3cbde..721c058 100644
>> --- a/arch/powerpc/platforms/pseries/ras.c
>> +++ b/arch/powerpc/platforms/pseries/ras.c
>> @@ -287,6 +287,9 @@ static struct rtas_error_log *fwnmi_get_errinfo(struct pt_regs *regs)
>>  	unsigned long *savep;
>>  	struct rtas_error_log *h, *errhdr = NULL;
>>
>> +	/* Mask top two bits */
>> +	regs->gpr[3] &= ~(0x3UL << 62);
>> +
>>  	if (!VALID_FWNMI_BUFFER(regs->gpr[3])) {
>>  		printk(KERN_ERR "FWNMI: corrupt r3 0x%016lx\n", regs->gpr[3]);
>>  		return NULL;
>>
> 
> -aneesh
> 
> _______________________________________________
> Linuxppc-dev mailing list
> [email-masked]
> https://lists.ozlabs.org/listinfo/linuxppc-dev
>