RFC Machine check handling in linux host.
Get series with b4
b4 am 20131030143219.26643.24782.stgit@marsVersions newest first · linked by author and title
- v5 RFC Latest12 patches 0 repliesNew
- v4 RFC12 patches 0 repliesSuperseded
- v3 RFC12 patches 9 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 RFC | 10 patches | 2 replies | Superseded | |
| v1 RFC | 9 patches | 12 replies | Superseded |
Changes in v5 from the cover letter
- Rebased to v3.12-rc7
Patches in v5 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/12 | powerpc/book3s: Split the common exception prolog logic into two section.arch/ | +14 | 0 replies | |
| 2/12 | powerpc/book3s: Introduce exclusive emergency stack for machine check exception.arch/ arch/ arch/ | +22 | 0 replies | |
| 3/12 | powerpc/book3s: handle machine check in Linux host.arch/ arch/ arch/ | +127 | 0 replies | |
| 4/12 | powerpc/book3s: Return from interrupt if coming from evil context.arch/ arch/ | +83 | 0 replies | |
| 5/12 | powerpc/book3s: Introduce a early machine check hook in cpu_spec.arch/ arch/ | +12 | 0 replies | |
| 6/12 | powerpc/book3s: Add flush_tlb operation in cpu_spec.arch/ arch/ arch/ +1 more | +44 | 0 replies | |
| 7/12 | powerpc/book3s: Flush SLB/TLBs if we get SLB/TLB machine check errors on power7.arch/ arch/ arch/ +2 more | +227 | 0 replies | |
| 8/12 | powerpc/book3s: Flush SLB/TLBs if we get SLB/TLB machine check errors on power8.arch/ arch/ arch/ | +41 | 0 replies | |
| 9/12 | powerpc/book3s: Decode and save machine check event.arch/ arch/ arch/ +3 more | +434 | 0 replies | |
| 10/12 | powerpc/book3s: Queue up and process delayed MCE events.arch/ arch/ arch/ +2 more | +168 | 0 replies | |
| 11/12 | powerpc/powernv: Remove machine check handling in OPAL.arch/ | +2 | 0 replies | |
| 12/12 | powerpc/powernv: Machine check exception handling.arch/ arch/ arch/ | +70 | 0 replies |
Reviews trailers per patch
5 of 12 patches have a Reviewed-by or Acked-by.
| Patch | Paul Mackerras |
|---|---|
| 1/12 | A-b |
| 2/12 | A-b |
| 3/12 | |
| 4/12 | |
| 5/12 | A-b |
| 6/12 | A-b |
| 7/12 | |
| 8/12 | A-b |
| 9/12 | |
| 10/12 | |
| 11/12 | |
| 12/12 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [RFC PATCH v5 00/12] Machine check handling in linux host.
Hi,
Please find the patch set that performs the machine check handling inside linux host. The design is to be able to handle re-entrancy so that we do not clobber the machine check information during nested machine check interrupt.
The patch 2 introduces separate emergency stack in paca structure exclusively for machine check exception handling. Patch 3 implements the logic to save the raw MCE info onto the emergency stack and prepares to take another exception. Patch 5 and 6 adds CPU-side hooks for early machine check handler and TLB flush. The patch 7 and 8 is responsible to detect SLB/TLB errors and flush them off in the real mode. The patch 9 implements the logic to decode and save high level MCE information to per cpu buffer without clobbering. Patch 10 implements mechanism to queue up MCE event in cases where early handler can not deliver the event to host kernel right away. The patch 12 adds the basic error handling to the high level C code with MMU on.
I have tested SLB multihit, MC coming from opal context on powernv.
Please review and let me know your comments.
Changes in v5:
- Rebased to v3.12-rc7
Changes in v4:
- Split the prolog common macro in 3 parts in patch 1.
- Save the regs from EXMC save area to stack before turning on ME bit.
- Set/Clear MSR_RI bit at right places.
- Handle a situation where machine check comes in when thread was in power saving mode.
- Queue up the MCE event and return from the interrupt if MC is hit during context which we are not sure of. Go to kernel in V mode only if we are coming from hypervisor userspace (HV=1, PR=1).
Changes in v3:
- Rebased to v3.11-rc7
- Handle MCE coming from opal context, secondary thread nap and return from interrupt. Queue up the MCE event in this scenario and log it later during syscall exit path.
Changes in v2:
- Moved early machine check handling code under CPU_FTR_HVMODE section. This makes sure that the early machine check handler will get executed only in hypervisor kernel.
- Add dedicated emergency stack for machine check so that we don't end up disturbing others who use same emergency stack.
- Fixed the machine check early handle where it used to assume that r1 always contains the valid stack pointer.
- Fixed an issue where per-cpu mce_nest_count variable underflows when kvm fails to handle MC error and exit the guest.
- Fixed the code to restore r13 while before exiting early handler.
Thanks,
-Mahesh.
---
Mahesh Salgaonkar (12):
powerpc/book3s: Split the common exception prolog logic into two section. powerpc/book3s: Introduce exclusive emergency stack for machine check exception. powerpc/book3s: handle machine check in Linux host. powerpc/book3s: Return from interrupt if coming from evil context. powerpc/book3s: Introduce a early machine check hook in cpu_spec. powerpc/book3s: Add flush_tlb operation in cpu_spec. powerpc/book3s: Flush SLB/TLBs if we get SLB/TLB machine check errors on power7. powerpc/book3s: Flush SLB/TLBs if we get SLB/TLB machine check errors on power8. powerpc/book3s: Decode and save machine check event. powerpc/book3s: Queue up and process delayed MCE events. powerpc/powernv: Remove machine check handling in OPAL. powerpc/powernv: Machine check exception handling.
arch/powerpc/include/asm/bitops.h | 5 arch/powerpc/include/asm/cputable.h | 12 + arch/powerpc/include/asm/exception-64s.h | 21 +- arch/powerpc/include/asm/mce.h | 198 +++++++++++++++++ arch/powerpc/include/asm/paca.h | 9 + arch/powerpc/kernel/Makefile | 1 arch/powerpc/kernel/asm-offsets.c | 4 arch/powerpc/kernel/cpu_setup_power.S | 38 ++- arch/powerpc/kernel/cputable.c | 16 + arch/powerpc/kernel/entry_64.S | 5 arch/powerpc/kernel/exceptions-64s.S | 196 +++++++++++++++++ arch/powerpc/kernel/idle_power7.S | 1 arch/powerpc/kernel/mce.c | 345 ++++++++++++++++++++++++++++++ arch/powerpc/kernel/mce_power.c | 284 +++++++++++++++++++++++++ arch/powerpc/kernel/setup_64.c | 10 + arch/powerpc/kernel/traps.c | 15 + arch/powerpc/kvm/book3s_hv_ras.c | 50 ++-- arch/powerpc/platforms/powernv/opal.c | 161 ++++---------- arch/powerpc/xmon/xmon.c | 4 19 files changed, 1220 insertions(+), 155 deletions(-) create mode 100644 arch/powerpc/include/asm/mce.h create mode 100644 arch/powerpc/kernel/mce.c create mode 100644 arch/powerpc/kernel/mce_power.c
Signature · 1 line
-Mahesh