Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/linux
File: iommu.h
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
[0] Fix | Delete
/*
[1] Fix | Delete
* IOMMU user API definitions
[2] Fix | Delete
*/
[3] Fix | Delete
[4] Fix | Delete
#ifndef _IOMMU_H
[5] Fix | Delete
#define _IOMMU_H
[6] Fix | Delete
[7] Fix | Delete
#include <linux/types.h>
[8] Fix | Delete
[9] Fix | Delete
#define IOMMU_FAULT_PERM_READ (1 << 0) /* read */
[10] Fix | Delete
#define IOMMU_FAULT_PERM_WRITE (1 << 1) /* write */
[11] Fix | Delete
#define IOMMU_FAULT_PERM_EXEC (1 << 2) /* exec */
[12] Fix | Delete
#define IOMMU_FAULT_PERM_PRIV (1 << 3) /* privileged */
[13] Fix | Delete
[14] Fix | Delete
/* Generic fault types, can be expanded IRQ remapping fault */
[15] Fix | Delete
enum iommu_fault_type {
[16] Fix | Delete
IOMMU_FAULT_DMA_UNRECOV = 1, /* unrecoverable fault */
[17] Fix | Delete
IOMMU_FAULT_PAGE_REQ, /* page request fault */
[18] Fix | Delete
};
[19] Fix | Delete
[20] Fix | Delete
enum iommu_fault_reason {
[21] Fix | Delete
IOMMU_FAULT_REASON_UNKNOWN = 0,
[22] Fix | Delete
[23] Fix | Delete
/* Could not access the PASID table (fetch caused external abort) */
[24] Fix | Delete
IOMMU_FAULT_REASON_PASID_FETCH,
[25] Fix | Delete
[26] Fix | Delete
/* PASID entry is invalid or has configuration errors */
[27] Fix | Delete
IOMMU_FAULT_REASON_BAD_PASID_ENTRY,
[28] Fix | Delete
[29] Fix | Delete
/*
[30] Fix | Delete
* PASID is out of range (e.g. exceeds the maximum PASID
[31] Fix | Delete
* supported by the IOMMU) or disabled.
[32] Fix | Delete
*/
[33] Fix | Delete
IOMMU_FAULT_REASON_PASID_INVALID,
[34] Fix | Delete
[35] Fix | Delete
/*
[36] Fix | Delete
* An external abort occurred fetching (or updating) a translation
[37] Fix | Delete
* table descriptor
[38] Fix | Delete
*/
[39] Fix | Delete
IOMMU_FAULT_REASON_WALK_EABT,
[40] Fix | Delete
[41] Fix | Delete
/*
[42] Fix | Delete
* Could not access the page table entry (Bad address),
[43] Fix | Delete
* actual translation fault
[44] Fix | Delete
*/
[45] Fix | Delete
IOMMU_FAULT_REASON_PTE_FETCH,
[46] Fix | Delete
[47] Fix | Delete
/* Protection flag check failed */
[48] Fix | Delete
IOMMU_FAULT_REASON_PERMISSION,
[49] Fix | Delete
[50] Fix | Delete
/* access flag check failed */
[51] Fix | Delete
IOMMU_FAULT_REASON_ACCESS,
[52] Fix | Delete
[53] Fix | Delete
/* Output address of a translation stage caused Address Size fault */
[54] Fix | Delete
IOMMU_FAULT_REASON_OOR_ADDRESS,
[55] Fix | Delete
};
[56] Fix | Delete
[57] Fix | Delete
/**
[58] Fix | Delete
* struct iommu_fault_unrecoverable - Unrecoverable fault data
[59] Fix | Delete
* @reason: reason of the fault, from &enum iommu_fault_reason
[60] Fix | Delete
* @flags: parameters of this fault (IOMMU_FAULT_UNRECOV_* values)
[61] Fix | Delete
* @pasid: Process Address Space ID
[62] Fix | Delete
* @perm: requested permission access using by the incoming transaction
[63] Fix | Delete
* (IOMMU_FAULT_PERM_* values)
[64] Fix | Delete
* @addr: offending page address
[65] Fix | Delete
* @fetch_addr: address that caused a fetch abort, if any
[66] Fix | Delete
*/
[67] Fix | Delete
struct iommu_fault_unrecoverable {
[68] Fix | Delete
__u32 reason;
[69] Fix | Delete
#define IOMMU_FAULT_UNRECOV_PASID_VALID (1 << 0)
[70] Fix | Delete
#define IOMMU_FAULT_UNRECOV_ADDR_VALID (1 << 1)
[71] Fix | Delete
#define IOMMU_FAULT_UNRECOV_FETCH_ADDR_VALID (1 << 2)
[72] Fix | Delete
__u32 flags;
[73] Fix | Delete
__u32 pasid;
[74] Fix | Delete
__u32 perm;
[75] Fix | Delete
__u64 addr;
[76] Fix | Delete
__u64 fetch_addr;
[77] Fix | Delete
};
[78] Fix | Delete
[79] Fix | Delete
/**
[80] Fix | Delete
* struct iommu_fault_page_request - Page Request data
[81] Fix | Delete
* @flags: encodes whether the corresponding fields are valid and whether this
[82] Fix | Delete
* is the last page in group (IOMMU_FAULT_PAGE_REQUEST_* values).
[83] Fix | Delete
* When IOMMU_FAULT_PAGE_RESPONSE_NEEDS_PASID is set, the page response
[84] Fix | Delete
* must have the same PASID value as the page request. When it is clear,
[85] Fix | Delete
* the page response should not have a PASID.
[86] Fix | Delete
* @pasid: Process Address Space ID
[87] Fix | Delete
* @grpid: Page Request Group Index
[88] Fix | Delete
* @perm: requested page permissions (IOMMU_FAULT_PERM_* values)
[89] Fix | Delete
* @addr: page address
[90] Fix | Delete
* @private_data: device-specific private information
[91] Fix | Delete
*/
[92] Fix | Delete
struct iommu_fault_page_request {
[93] Fix | Delete
#define IOMMU_FAULT_PAGE_REQUEST_PASID_VALID (1 << 0)
[94] Fix | Delete
#define IOMMU_FAULT_PAGE_REQUEST_LAST_PAGE (1 << 1)
[95] Fix | Delete
#define IOMMU_FAULT_PAGE_REQUEST_PRIV_DATA (1 << 2)
[96] Fix | Delete
#define IOMMU_FAULT_PAGE_RESPONSE_NEEDS_PASID (1 << 3)
[97] Fix | Delete
__u32 flags;
[98] Fix | Delete
__u32 pasid;
[99] Fix | Delete
__u32 grpid;
[100] Fix | Delete
__u32 perm;
[101] Fix | Delete
__u64 addr;
[102] Fix | Delete
__u64 private_data[2];
[103] Fix | Delete
};
[104] Fix | Delete
[105] Fix | Delete
/**
[106] Fix | Delete
* struct iommu_fault - Generic fault data
[107] Fix | Delete
* @type: fault type from &enum iommu_fault_type
[108] Fix | Delete
* @padding: reserved for future use (should be zero)
[109] Fix | Delete
* @event: fault event, when @type is %IOMMU_FAULT_DMA_UNRECOV
[110] Fix | Delete
* @prm: Page Request message, when @type is %IOMMU_FAULT_PAGE_REQ
[111] Fix | Delete
* @padding2: sets the fault size to allow for future extensions
[112] Fix | Delete
*/
[113] Fix | Delete
struct iommu_fault {
[114] Fix | Delete
__u32 type;
[115] Fix | Delete
__u32 padding;
[116] Fix | Delete
union {
[117] Fix | Delete
struct iommu_fault_unrecoverable event;
[118] Fix | Delete
struct iommu_fault_page_request prm;
[119] Fix | Delete
__u8 padding2[56];
[120] Fix | Delete
};
[121] Fix | Delete
};
[122] Fix | Delete
[123] Fix | Delete
/**
[124] Fix | Delete
* enum iommu_page_response_code - Return status of fault handlers
[125] Fix | Delete
* @IOMMU_PAGE_RESP_SUCCESS: Fault has been handled and the page tables
[126] Fix | Delete
* populated, retry the access. This is "Success" in PCI PRI.
[127] Fix | Delete
* @IOMMU_PAGE_RESP_FAILURE: General error. Drop all subsequent faults from
[128] Fix | Delete
* this device if possible. This is "Response Failure" in PCI PRI.
[129] Fix | Delete
* @IOMMU_PAGE_RESP_INVALID: Could not handle this fault, don't retry the
[130] Fix | Delete
* access. This is "Invalid Request" in PCI PRI.
[131] Fix | Delete
*/
[132] Fix | Delete
enum iommu_page_response_code {
[133] Fix | Delete
IOMMU_PAGE_RESP_SUCCESS = 0,
[134] Fix | Delete
IOMMU_PAGE_RESP_INVALID,
[135] Fix | Delete
IOMMU_PAGE_RESP_FAILURE,
[136] Fix | Delete
};
[137] Fix | Delete
[138] Fix | Delete
/**
[139] Fix | Delete
* struct iommu_page_response - Generic page response information
[140] Fix | Delete
* @argsz: User filled size of this data
[141] Fix | Delete
* @version: API version of this structure
[142] Fix | Delete
* @flags: encodes whether the corresponding fields are valid
[143] Fix | Delete
* (IOMMU_FAULT_PAGE_RESPONSE_* values)
[144] Fix | Delete
* @pasid: Process Address Space ID
[145] Fix | Delete
* @grpid: Page Request Group Index
[146] Fix | Delete
* @code: response code from &enum iommu_page_response_code
[147] Fix | Delete
*/
[148] Fix | Delete
struct iommu_page_response {
[149] Fix | Delete
__u32 argsz;
[150] Fix | Delete
#define IOMMU_PAGE_RESP_VERSION_1 1
[151] Fix | Delete
__u32 version;
[152] Fix | Delete
#define IOMMU_PAGE_RESP_PASID_VALID (1 << 0)
[153] Fix | Delete
__u32 flags;
[154] Fix | Delete
__u32 pasid;
[155] Fix | Delete
__u32 grpid;
[156] Fix | Delete
__u32 code;
[157] Fix | Delete
};
[158] Fix | Delete
[159] Fix | Delete
#endif /* _IOMMU_H */
[160] Fix | Delete
[161] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function