1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (C) 2025 Arm Ltd.
4  * Based on arch/x86/kernel/cpu/resctrl/internal.h
5  */
6 
7 #ifndef __LINUX_RESCTRL_TYPES_H
8 #define __LINUX_RESCTRL_TYPES_H
9 
10 /* Reads to Local DRAM Memory */
11 #define READS_TO_LOCAL_MEM		BIT(0)
12 
13 /* Reads to Remote DRAM Memory */
14 #define READS_TO_REMOTE_MEM		BIT(1)
15 
16 /* Non-Temporal Writes to Local Memory */
17 #define NON_TEMP_WRITE_TO_LOCAL_MEM	BIT(2)
18 
19 /* Non-Temporal Writes to Remote Memory */
20 #define NON_TEMP_WRITE_TO_REMOTE_MEM	BIT(3)
21 
22 /* Reads to Local Memory the system identifies as "Slow Memory" */
23 #define READS_TO_LOCAL_S_MEM		BIT(4)
24 
25 /* Reads to Remote Memory the system identifies as "Slow Memory" */
26 #define READS_TO_REMOTE_S_MEM		BIT(5)
27 
28 /* Dirty Victims to All Types of Memory */
29 #define DIRTY_VICTIMS_TO_ALL_MEM	BIT(6)
30 
31 /* Max event bits supported */
32 #define MAX_EVT_CONFIG_BITS		GENMASK(6, 0)
33 
34 enum resctrl_res_level {
35 	RDT_RESOURCE_L3,
36 	RDT_RESOURCE_L2,
37 	RDT_RESOURCE_MBA,
38 	RDT_RESOURCE_SMBA,
39 
40 	/* Must be the last */
41 	RDT_NUM_RESOURCES,
42 };
43 
44 /*
45  * Event IDs, the values match those used to program IA32_QM_EVTSEL before
46  * reading IA32_QM_CTR on RDT systems.
47  */
48 enum resctrl_event_id {
49 	QOS_L3_OCCUP_EVENT_ID		= 0x01,
50 	QOS_L3_MBM_TOTAL_EVENT_ID	= 0x02,
51 	QOS_L3_MBM_LOCAL_EVENT_ID	= 0x03,
52 };
53 
54 #endif /* __LINUX_RESCTRL_TYPES_H */
55