drivers/gpu/drm/xe/xe_pagefault_types.h

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_pagefault_types.h

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/xe/xe_pagefault_types.h
Extension
.h
Size
4345 bytes
Lines
139
Domain
Driver Families
Bucket
drivers/gpu
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct xe_pagefault_ops {
	/**
	 * @ack_fault: Ack fault
	 * @pf: Page fault
	 * @err: Error state of fault
	 *
	 * Page fault producer receives acknowledgment from the consumer and
	 * sends the result to the HW/FW interface.
	 */
	void (*ack_fault)(struct xe_pagefault *pf, int err);
};

/**
 * struct xe_pagefault - Xe page fault
 *
 * Generic page fault structure for communication between producer and consumer.
 * Carefully sized to be 64 bytes. Upon a device page fault, the producer
 * populates this structure, and the consumer copies it into the page-fault
 * queue for deferred handling.
 */
struct xe_pagefault {
	/**
	 * @gt: GT of fault
	 */
	struct xe_gt *gt;
	/**
	 * @consumer: State for the software handling the fault. Populated by
	 * the producer and may be modified by the consumer to communicate
	 * information back to the producer upon fault acknowledgment.
	 */
	struct {
		/** @consumer.page_addr: address of page fault */
		u64 page_addr;
		/** @consumer.asid: address space ID */
		u32 asid;
		/**
		 * @consumer.access_type: access type and prefetch flag packed
		 * into a u8.
		 */
		u8 access_type;
#define XE_PAGEFAULT_ACCESS_TYPE_MASK	GENMASK(1, 0)
#define XE_PAGEFAULT_ACCESS_PREFETCH	BIT(7)
		/**
		 * @consumer.fault_type_level: fault type and level, u8 rather
		 * than enum to keep size compact
		 */
		u8 fault_type_level;
#define XE_PAGEFAULT_TYPE_LEVEL_NACK		0xff	/* Producer indicates nack fault */
#define XE_PAGEFAULT_LEVEL_MASK			GENMASK(3, 0)
#define XE_PAGEFAULT_TYPE_MASK			GENMASK(7, 4)
		/** @consumer.engine_class: engine class */
		u8 engine_class;
		/** @consumer.engine_instance: engine instance */
		u8 engine_instance;
		/** @consumer.reserved: reserved bits for future expansion */
		u64 reserved;
	} consumer;
	/**
	 * @producer: State for the producer (i.e., HW/FW interface). Populated
	 * by the producer and should not be modified—or even inspected—by the
	 * consumer, except for calling operations.
	 */
	struct {
		/** @producer.private: private pointer */
		void *private;
		/** @producer.ops: operations */
		const struct xe_pagefault_ops *ops;
#define XE_PAGEFAULT_PRODUCER_MSG_LEN_DW	4
		/**
		 * @producer.msg: page fault message, used by producer in fault
		 * acknowledgment to formulate response to HW/FW interface.
		 * Included in the page-fault message because the producer
		 * typically receives the fault in a context where memory cannot
		 * be allocated (e.g., atomic context or the reclaim path).
		 */
		u32 msg[XE_PAGEFAULT_PRODUCER_MSG_LEN_DW];
	} producer;
};

/**
 * struct xe_pagefault_queue - Xe pagefault queue (consumer)
 *
 * Used to capture all device page faults for deferred processing. Size this
 * queue to absorb the device’s worst-case number of outstanding faults.
 */
struct xe_pagefault_queue {
	/**
	 * @data: Data in queue containing struct xe_pagefault, protected by
	 * @lock
	 */

Annotation

Implementation Notes