Subject: Re: [RFC PATCH 7/9] powerpc: Decode and save machine check event.

From: Mahesh Jagannath Salgaonkar <[email-masked]>
Date: Thu, 08 Aug 2013 18:49:51 +0530

On 08/08/2013 10:44 AM, Paul Mackerras wrote:
> On Wed, Aug 07, 2013 at 03:09:13PM +0530, Mahesh J Salgaonkar wrote:
>> From: Mahesh Salgaonkar <[email-masked]>
>>
>> Now that we handle machine check in linux, the MCE decoding should also
>> take place in linux host. This info is crucial to log before we go down
>> in case we can not handle the machine check errors. This patch decodes
>> and populates a machine check event which contain high level meaning full
>> MCE information.
> 
> A couple of things worry me about this patch:
> 
> First, there is the fact that we can only do get_mce_event() once for
> a given machine check.  You call it in kvmppc_realmode_mc_power7(),
> which is fine, but if it is not something we recognize and can handle
> we will proceed to exit the guest and jump to machine_check_fwnmi,
> which will then proceed to machine_check_common() and then
> opal_machine_check(), where you have added another call to
> get_mce_event(), which will probably underflow your little per-cpu
> stack of machine check events.

Ouch! I missed that. Will work on fixing it.

> 
> Secondly, we shouldn't call save_mce_event() if we're not in
> hypervisor mode, since per-cpu variables are not in general accessible
> in real mode when running under a hypervisor with a limited real-mode
> area (RMA).

Does that mean in real mode we can never be able to access per cpu
variable? OR do I need to use some tweaks to access those?

Thanks,
-Mahesh.