arch/powerpc/platforms/pseries/ras.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/pseries/ras.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/pseries/ras.c- Extension
.c- Size
- 24516 bytes
- Lines
- 883
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/sched.hlinux/interrupt.hlinux/irq.hlinux/of.hlinux/fs.hlinux/reboot.hlinux/irq_work.hasm/machdep.hasm/rtas.hasm/firmware.hasm/mce.hpseries.h
Detected Declarations
struct pseries_mc_errorlogstruct epow_errorlogfunction rtas_mc_error_sub_typefunction systemsfunction init_ras_IRQfunction handle_system_shutdownfunction rtas_parse_epow_errlogfunction ras_hotplug_interruptfunction ras_epow_interruptfunction ras_error_interruptfunction fwnmi_release_errinfofunction pSeries_system_reset_exceptionfunction mce_handle_err_realmodefunction mce_handle_err_virtmodefunction mce_handle_errorfunction pSeries_machine_check_log_errfunction power4function recoveredfunction pseries_machine_check_realmode
Annotated Snippet
struct pseries_mc_errorlog {
__be32 fru_id;
__be32 proc_id;
u8 error_type;
/*
* sub_err_type (1 byte). Bit fields depends on error_type
*
* MSB0
* |
* V
* 01234567
* XXXXXXXX
*
* For error_type == MC_ERROR_TYPE_UE
* XXXXXXXX
* X 1: Permanent or Transient UE.
* X 1: Effective address provided.
* X 1: Logical address provided.
* XX 2: Reserved.
* XXX 3: Type of UE error.
*
* For error_type == MC_ERROR_TYPE_SLB/ERAT/TLB
* XXXXXXXX
* X 1: Effective address provided.
* XXXXX 5: Reserved.
* XX 2: Type of SLB/ERAT/TLB error.
*
* For error_type == MC_ERROR_TYPE_CTRL_MEM_ACCESS
* XXXXXXXX
* X 1: Error causing address provided.
* XXX 3: Type of error.
* XXXX 4: Reserved.
*/
u8 sub_err_type;
u8 reserved_1[6];
__be64 effective_address;
__be64 logical_address;
} __packed;
/* RTAS pseries MCE error types */
#define MC_ERROR_TYPE_UE 0x00
#define MC_ERROR_TYPE_SLB 0x01
#define MC_ERROR_TYPE_ERAT 0x02
#define MC_ERROR_TYPE_UNKNOWN 0x03
#define MC_ERROR_TYPE_TLB 0x04
#define MC_ERROR_TYPE_D_CACHE 0x05
#define MC_ERROR_TYPE_I_CACHE 0x07
#define MC_ERROR_TYPE_CTRL_MEM_ACCESS 0x08
/* RTAS pseries MCE error sub types */
#define MC_ERROR_UE_INDETERMINATE 0
#define MC_ERROR_UE_IFETCH 1
#define MC_ERROR_UE_PAGE_TABLE_WALK_IFETCH 2
#define MC_ERROR_UE_LOAD_STORE 3
#define MC_ERROR_UE_PAGE_TABLE_WALK_LOAD_STORE 4
#define UE_EFFECTIVE_ADDR_PROVIDED 0x40
#define UE_LOGICAL_ADDR_PROVIDED 0x20
#define MC_EFFECTIVE_ADDR_PROVIDED 0x80
#define MC_ERROR_SLB_PARITY 0
#define MC_ERROR_SLB_MULTIHIT 1
#define MC_ERROR_SLB_INDETERMINATE 2
#define MC_ERROR_ERAT_PARITY 1
#define MC_ERROR_ERAT_MULTIHIT 2
#define MC_ERROR_ERAT_INDETERMINATE 3
#define MC_ERROR_TLB_PARITY 1
#define MC_ERROR_TLB_MULTIHIT 2
#define MC_ERROR_TLB_INDETERMINATE 3
#define MC_ERROR_CTRL_MEM_ACCESS_PTABLE_WALK 0
#define MC_ERROR_CTRL_MEM_ACCESS_OP_ACCESS 1
static inline u8 rtas_mc_error_sub_type(const struct pseries_mc_errorlog *mlog)
{
switch (mlog->error_type) {
case MC_ERROR_TYPE_UE:
return (mlog->sub_err_type & 0x07);
case MC_ERROR_TYPE_SLB:
case MC_ERROR_TYPE_ERAT:
case MC_ERROR_TYPE_TLB:
return (mlog->sub_err_type & 0x03);
case MC_ERROR_TYPE_CTRL_MEM_ACCESS:
return (mlog->sub_err_type & 0x70) >> 4;
default:
return 0;
}
}
Annotation
- Immediate include surface: `linux/sched.h`, `linux/interrupt.h`, `linux/irq.h`, `linux/of.h`, `linux/fs.h`, `linux/reboot.h`, `linux/irq_work.h`, `asm/machdep.h`.
- Detected declarations: `struct pseries_mc_errorlog`, `struct epow_errorlog`, `function rtas_mc_error_sub_type`, `function systems`, `function init_ras_IRQ`, `function handle_system_shutdown`, `function rtas_parse_epow_errlog`, `function ras_hotplug_interrupt`, `function ras_epow_interrupt`, `function ras_error_interrupt`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.