linux/arch/x86/kernel/cpu/mce/severity.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * MCE grading rules.
 * Copyright 2008, 2009 Intel Corporation.
 *
 * Author: Andi Kleen
 */
#include <linux/kernel.h>
#include <linux/seq_file.h>
#include <linux/init.h>
#include <linux/debugfs.h>
#include <linux/uaccess.h>

#include <asm/mce.h>
#include <asm/cpu_device_id.h>
#include <asm/traps.h>
#include <asm/insn.h>
#include <asm/insn-eval.h>

#include "internal.h"

/*
 * Grade an mce by severity. In general the most severe ones are processed
 * first. Since there are quite a lot of combinations test the bits in a
 * table-driven way. The rules are simply processed in order, first
 * match wins.
 *
 * Note this is only used for machine check exceptions, the corrected
 * errors use much simpler rules. The exceptions still check for the corrected
 * errors, but only to leave them alone for the CMCI handler (except for
 * panic situations)
 */

enum context {};
enum ser {};
enum exception {};

static struct severity {} severities[] =;

#define mc_recoverable(mcg)

static bool is_copy_from_user(struct pt_regs *regs)
{}

/*
 * If mcgstatus indicated that ip/cs on the stack were
 * no good, then "m->cs" will be zero and we will have
 * to assume the worst case (IN_KERNEL) as we actually
 * have no idea what we were executing when the machine
 * check hit.
 * If we do have a good "m->cs" (or a faked one in the
 * case we were executing in VM86 mode) we can use it to
 * distinguish an exception taken in user from from one
 * taken in the kernel.
 */
static noinstr int error_context(struct mce *m, struct pt_regs *regs)
{}

/* See AMD PPR(s) section Machine Check Error Handling. */
static noinstr int mce_severity_amd(struct mce *m, struct pt_regs *regs, char **msg, bool is_excp)
{}

static noinstr int mce_severity_intel(struct mce *m, struct pt_regs *regs, char **msg, bool is_excp)
{}

int noinstr mce_severity(struct mce *m, struct pt_regs *regs, char **msg, bool is_excp)
{}

#ifdef CONFIG_DEBUG_FS
static void *s_start(struct seq_file *f, loff_t *pos)
{}

static void *s_next(struct seq_file *f, void *data, loff_t *pos)
{}

static void s_stop(struct seq_file *f, void *data)
{}

static int s_show(struct seq_file *f, void *data)
{}

static const struct seq_operations severities_seq_ops =;

static int severities_coverage_open(struct inode *inode, struct file *file)
{}

static ssize_t severities_coverage_write(struct file *file,
					 const char __user *ubuf,
					 size_t count, loff_t *ppos)
{}

static const struct file_operations severities_coverage_fops =;

static int __init severities_debugfs_init(void)
{}
late_initcall(severities_debugfs_init);
#endif /* CONFIG_DEBUG_FS */