cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

aer.h (1822B)


      1/* SPDX-License-Identifier: GPL-2.0 */
      2/*
      3 * Copyright (C) 2006 Intel Corp.
      4 *     Tom Long Nguyen (tom.l.nguyen@intel.com)
      5 *     Zhang Yanmin (yanmin.zhang@intel.com)
      6 */
      7
      8#ifndef _AER_H_
      9#define _AER_H_
     10
     11#include <linux/errno.h>
     12#include <linux/types.h>
     13
     14#define AER_NONFATAL			0
     15#define AER_FATAL			1
     16#define AER_CORRECTABLE			2
     17#define DPC_FATAL			3
     18
     19struct pci_dev;
     20
     21struct aer_header_log_regs {
     22	unsigned int dw0;
     23	unsigned int dw1;
     24	unsigned int dw2;
     25	unsigned int dw3;
     26};
     27
     28struct aer_capability_regs {
     29	u32 header;
     30	u32 uncor_status;
     31	u32 uncor_mask;
     32	u32 uncor_severity;
     33	u32 cor_status;
     34	u32 cor_mask;
     35	u32 cap_control;
     36	struct aer_header_log_regs header_log;
     37	u32 root_command;
     38	u32 root_status;
     39	u16 cor_err_source;
     40	u16 uncor_err_source;
     41};
     42
     43#if defined(CONFIG_PCIEAER)
     44/* PCIe port driver needs this function to enable AER */
     45int pci_enable_pcie_error_reporting(struct pci_dev *dev);
     46int pci_disable_pcie_error_reporting(struct pci_dev *dev);
     47int pci_aer_clear_nonfatal_status(struct pci_dev *dev);
     48void pci_save_aer_state(struct pci_dev *dev);
     49void pci_restore_aer_state(struct pci_dev *dev);
     50#else
     51static inline int pci_enable_pcie_error_reporting(struct pci_dev *dev)
     52{
     53	return -EINVAL;
     54}
     55static inline int pci_disable_pcie_error_reporting(struct pci_dev *dev)
     56{
     57	return -EINVAL;
     58}
     59static inline int pci_aer_clear_nonfatal_status(struct pci_dev *dev)
     60{
     61	return -EINVAL;
     62}
     63static inline void pci_save_aer_state(struct pci_dev *dev) {}
     64static inline void pci_restore_aer_state(struct pci_dev *dev) {}
     65#endif
     66
     67void cper_print_aer(struct pci_dev *dev, int aer_severity,
     68		    struct aer_capability_regs *aer);
     69int cper_severity_to_aer(int cper_severity);
     70void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn,
     71		       int severity, struct aer_capability_regs *aer_regs);
     72#endif //_AER_H_
     73