| 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 | #define MAX_MBA_BW 100u |
| 11 | #define MBM_OVERFLOW_INTERVAL 1000 |
| 12 | |
| 13 | /* Reads to Local DRAM Memory */ |
| 14 | #define READS_TO_LOCAL_MEM BIT(0) |
| 15 | |
| 16 | /* Reads to Remote DRAM Memory */ |
| 17 | #define READS_TO_REMOTE_MEM BIT(1) |
| 18 | |
| 19 | /* Non-Temporal Writes to Local Memory */ |
| 20 | #define NON_TEMP_WRITE_TO_LOCAL_MEM BIT(2) |
| 21 | |
| 22 | /* Non-Temporal Writes to Remote Memory */ |
| 23 | #define NON_TEMP_WRITE_TO_REMOTE_MEM BIT(3) |
| 24 | |
| 25 | /* Reads to Local Memory the system identifies as "Slow Memory" */ |
| 26 | #define READS_TO_LOCAL_S_MEM BIT(4) |
| 27 | |
| 28 | /* Reads to Remote Memory the system identifies as "Slow Memory" */ |
| 29 | #define READS_TO_REMOTE_S_MEM BIT(5) |
| 30 | |
| 31 | /* Dirty Victims to All Types of Memory */ |
| 32 | #define DIRTY_VICTIMS_TO_ALL_MEM BIT(6) |
| 33 | |
| 34 | /* Max event bits supported */ |
| 35 | #define MAX_EVT_CONFIG_BITS GENMASK(6, 0) |
| 36 | |
| 37 | /* |
| 38 | * Event IDs, the values match those used to program IA32_QM_EVTSEL before |
| 39 | * reading IA32_QM_CTR on RDT systems. |
| 40 | */ |
| 41 | enum resctrl_event_id { |
| 42 | QOS_L3_OCCUP_EVENT_ID = 0x01, |
| 43 | QOS_L3_MBM_TOTAL_EVENT_ID = 0x02, |
| 44 | QOS_L3_MBM_LOCAL_EVENT_ID = 0x03, |
| 45 | |
| 46 | /* Must be the last */ |
| 47 | QOS_NUM_EVENTS, |
| 48 | }; |
| 49 | |
| 50 | #endif /* __LINUX_RESCTRL_TYPES_H */ |
| 51 | |