linux/arch/powerpc/platforms
Mahesh Salgaonkar 36df96f8ac powerpc/book3s: Decode and save machine check event.
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.

We do this in real mode C code with ME bit on. The MCE information is still
available on emergency stack (in pt_regs structure format). Even if we take
another exception at this point the MCE early handler will allocate a new
stack frame on top of current one. So when we return back here we still have
our MCE information safe on current stack.

We use per cpu buffer to save high level MCE information. Each per cpu buffer
is an array of machine check event structure indexed by per cpu counter
mce_nest_count. The mce_nest_count is incremented every time we enter
machine check early handler in real mode to get the current free slot
(index = mce_nest_count - 1). The mce_nest_count is decremented once the
MCE info is consumed by virtual mode machine exception handler.

This patch provides save_mce_event(), get_mce_event() and release_mce_event()
generic routines that can be used by machine check handlers to populate and
retrieve the event. The routine release_mce_event() will free the event slot so
that it can be reused. Caller can invoke get_mce_event() with a release flag
either to release the event slot immediately OR keep it so that it can be
fetched again. The event slot can be also released anytime by invoking
release_mce_event().

This patch also updates kvm code to invoke get_mce_event to retrieve generic
mce event rather than paca->opal_mce_evt.

The KVM code always calls get_mce_event() with release flags set to false so
that event is available for linus host machine

If machine check occurs while we are in guest, KVM tries to handle the error.
If KVM is able to handle MC error successfully, it enters the guest and
delivers the machine check to guest. If KVM is not able to handle MC error, it
exists the guest and passes the control to linux host machine check handler
which then logs MC event and decides how to handle it in linux host. In failure
case, KVM needs to make sure that the MC event is available for linux host to
consume. Hence KVM always calls get_mce_event() with release flags set to false
and later it invokes release_mce_event() only if it succeeds to handle error.

Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-12-05 16:05:20 +11:00
..
8xx DeviceTree updates for 3.13. This is a bit larger pull request than 2013-11-12 16:52:17 +09:00
40x Removal of GENERIC_GPIO for v3.10 2013-05-09 09:59:16 -07:00
44x i2c: move OF helpers into the core 2013-08-23 10:22:20 +02:00
52xx powerpc/52xx: fix build breakage for MPC5200 LPBFIFO module 2013-10-30 22:34:56 +01:00
82xx powerpc: add explicit OF includes 2013-10-09 20:04:11 -05:00
83xx DeviceTree updates for 3.13. This is a bit larger pull request than 2013-11-12 16:52:17 +09:00
85xx DeviceTree updates for 3.13. This is a bit larger pull request than 2013-11-12 16:52:17 +09:00
86xx powerpc: add explicit OF includes 2013-10-09 20:04:11 -05:00
512x DeviceTree updates for 3.13. This is a bit larger pull request than 2013-11-12 16:52:17 +09:00
amigaone pcspkr: Cleanup Kconfig dependencies 2011-06-09 15:01:41 +02:00
cell Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-11-13 15:34:18 +09:00
chrp powerpc/nvram: Fix endian issue when reading the NVRAM size 2013-10-31 12:37:27 +11:00
embedded6xx DeviceTree updates for 3.13. This is a bit larger pull request than 2013-11-12 16:52:17 +09:00
maple POWERPC: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
pasemi powerpc: add explicit OF includes 2013-10-09 20:04:11 -05:00
powermac tree-wide: use reinit_completion instead of INIT_COMPLETION 2013-11-15 09:32:21 +09:00
powernv powerpc/book3s: Decode and save machine check event. 2013-12-05 16:05:20 +11:00
ps3 powerpc/ps3: Remove inline marking of EXPORT_SYMBOL functions 2013-12-02 14:06:53 +11:00
pseries powerpc/pseries: CONFIG_PSERIES_MSI should depend on PPC_PSERIES 2013-12-02 14:16:05 +11:00
wsp powerpc: booke: Fix build failures 2013-11-21 10:33:42 +11:00
fsl_uli1575.c of/irq: Refactor interrupt-map parsing 2013-10-24 11:43:04 +01:00
Kconfig powerpc: Better split CONFIG_PPC_INDIRECT_PIO and CONFIG_PPC_INDIRECT_MMIO 2013-08-14 14:57:50 +10:00
Kconfig.cputype powerpc: allyesconfig should not select CONFIG_CPU_LITTLE_ENDIAN 2013-11-25 11:49:12 +11:00
Makefile powerpc: Remove the main legacy iSerie platform code 2012-03-09 10:35:11 +11:00