From c0a8f4bb84b98bb11b4ce6724a4fa16f71cf3ca1 Mon Sep 17 00:00:00 2001 From: Lakshmanan M Date: Wed, 23 Oct 2019 12:40:08 +0530 Subject: [PATCH] gpu: nvgpu: add doxygen comments for mmu_fault Add doxygen documentation for mmu_fault in mmu_fault.h JIRA NVGPU-4105 Change-Id: I8704c636b9341e7b11d0a941d9f199dc56c4ae4a Signed-off-by: Lakshmanan M Reviewed-on: https://git-master.nvidia.com/r/2223947 Reviewed-by: Rajesh Devaraj Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Alex Waterman GVS: Gerrit_Virtual_Submit Reviewed-by: Ankur Kishore Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/mmu_fault.h | 151 +++++++++++++++++++- 1 file changed, 150 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/include/nvgpu/mmu_fault.h b/drivers/gpu/nvgpu/include/nvgpu/mmu_fault.h index 689b2c6a6..2633adb25 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/mmu_fault.h +++ b/drivers/gpu/nvgpu/include/nvgpu/mmu_fault.h @@ -23,45 +23,194 @@ #ifndef NVGPU_MMU_FAULT_H #define NVGPU_MMU_FAULT_H +/** + * @file + * + * GMMU fault buffer information. + */ + #include +/** Index of non-replayable faults in GMMU fault information buffer. */ #define NVGPU_MMU_FAULT_NONREPLAY_INDX 0U + +/** Index of replayable faults in GMMU fault information buffer. */ #define NVGPU_MMU_FAULT_REPLAY_INDX 1U -/* replay and nonreplay faults */ +/** Maximum number of valid index in GMMU fault information buffer. */ #define NVGPU_MMU_FAULT_TYPE_NUM 2U +/** Register index of non-replayable faults in BAR0 aperture. */ #define NVGPU_MMU_FAULT_NONREPLAY_REG_INDX 0U + +/** Register index of replayable faults in BAR0 aperture. */ #define NVGPU_MMU_FAULT_REPLAY_REG_INDX 1U + +/** State which is used for disabling the GMMU fault hardware support. */ #define NVGPU_MMU_FAULT_BUF_DISABLED 0U + +/** State which is used for enabling the GMMU fault hardware support. */ #define NVGPU_MMU_FAULT_BUF_ENABLED 1U +/** + * Forward declared opaque placeholder type that does not really exist, but + * helps the compiler about getting types right. + */ struct nvgpu_channel; +/** + * This structure describes the various debug information reported + * by GMMU during MMU fault exceptions. + * + *Fault buffer format + *------------------- + * + * 31 28 24 23 16 15 8 7 4 0 + *.-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-. + *| inst_lo |0 0|apr|0 0 0 0 0 0 0 0| + *`-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-' + *| inst_hi | + *`-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-' + *| addr_31_12 | |AP | + *`-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-' + *| addr_63_32 | + *`-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-' + *| timestamp_lo | + *`-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-' + *| timestamp_hi | + *`-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-' + *| (reserved) | engine_id | + *`-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-' + *|V|R|P| gpc_id |0 0 0|t|0|acctp|0| client |RF0 0|faulttype| + * + */ struct mmu_fault_info { + /** The faulting context's instance pointer physical address. */ u64 inst_ptr; + + /** + * Aperture (SYSMEM or VIDMEM) of faulting context's + * instance pointer. + */ u32 inst_aperture; + + /** Faulting GMMU virtual address. */ u64 fault_addr; + + /** Aperture (SYSMEM or VIDMEM) of faulting GMMU virtual address. */ u32 fault_addr_aperture; + + /** + * The time instant at which the fault has occurred. This variable + * contains the LSB 32-bit value of actual gpu time. + */ u32 timestamp_lo; + + /** + * The time instant at which the fault has occurred. This variable + * contains the MSB 32-bit value of actual gpu time. + */ u32 timestamp_hi; + + /** + * The MMU engine ID's (i.e. virtual address spaces) has experienced + * a GMMU fault (i.e. GRAPHICS, CE0, HOST0, ...). + */ u32 mmu_engine_id; + + /** GPC id if client type is gpc. For gv11b, NUM_GPCS = 1. */ u32 gpc_id; + + /** + * Client type indicates whether the faulting request originated + * in a GPC, or if it came from another type of HUB client. + */ u32 client_type; + + /** + * Indicates which MMU client generated the faulting request. + * Index in #gv11b_gpc_client_descs/#gv11b_hub_client_descs + * const string array which tells the user understandable string of + * faulting engine and subengine information + * (i.e. gr copy, ce shim, pe 0, ...). + */ u32 client_id; + + /** + * The fault_type field indicates whether the faulting request was + * a read or a write. + */ u32 fault_type; + + /** + * Indicates the type of the faulting request. + * Index in #gv11b_fault_access_type_descs + * const string array which tells the user understandable string of + * access type information + * (i.e. virt read, virt write, phys read, phys write, ...). + */ u32 access_type; + + /** + * This fault indicates an illegal access to a protected region. + */ u32 protected_mode; + + /** + * This fault indicates whether the fault type is replayable or + * non-replayable. + */ bool replayable_fault; + + /** + * Set to true if replayable fault is enabled for any client in the + * instance block. It does not indicate whether the fault is + * replayable. + */ u32 replay_fault_en; + + /** + * Indicates that this current buffer entry is valid or not. + */ bool valid; + + /** PBDMA id if faulting MMU client is a PBDMA. */ u32 faulted_pbdma; + + /** Engine id if faulting MMU client is an engine (GR, CE, ...). */ u32 faulted_engine; + + /** + * Sub engine id if faulting MMU client is an engine + * (i.e. GPC_L1_0, GPC_PE_0, ...). + */ u32 faulted_subid; + + /** Faulting channel identifier. */ u32 chid; + + /** Pointer to a faulting channel structure. */ struct nvgpu_channel *refch; + + /** + * Pointer to a client type description in + * #gv11b_fault_client_type_descs const string array + * (gpc and hub). + */ const char *client_type_desc; + + /** + * Pointer to a client access type description in + * #gv11b_fault_access_type_descs const string array + * (i.e. virt read, virt write, phys read, phys write, ...). + */ const char *fault_type_desc; + + /** + * Pointer to a client type description in + * #gv11b_gpc_client_descs/#gv11b_hub_client_descs const string array + * (i.e. gr copy, ce shim, pe 0, ...). + */ const char *client_id_desc; };