File tree Expand file tree Collapse file tree 5 files changed +21
-24
lines changed Expand file tree Collapse file tree 5 files changed +21
-24
lines changed Original file line number Diff line number Diff line change 4
4
5
5
#include <linux/bits.h>
6
6
7
- /*
8
- * CPU model specific register (MSR) numbers.
9
- *
10
- * Do not add new entries to this file unless the definitions are shared
11
- * between multiple compilation units.
12
- */
7
+ /* CPU model specific register (MSR) numbers. */
13
8
14
9
/* x86-64 specific MSRs */
15
10
#define MSR_EFER 0xc0000080 /* extended feature register */
1050
1045
#define VMX_BASIC_MEM_TYPE_WB 6LLU
1051
1046
#define VMX_BASIC_INOUT 0x0040000000000000LLU
1052
1047
1048
+ /* Resctrl MSRs: */
1049
+ /* - Intel: */
1050
+ #define MSR_IA32_L3_QOS_CFG 0xc81
1051
+ #define MSR_IA32_L2_QOS_CFG 0xc82
1052
+ #define MSR_IA32_QM_EVTSEL 0xc8d
1053
+ #define MSR_IA32_QM_CTR 0xc8e
1054
+ #define MSR_IA32_PQR_ASSOC 0xc8f
1055
+ #define MSR_IA32_L3_CBM_BASE 0xc90
1056
+ #define MSR_IA32_L2_CBM_BASE 0xd10
1057
+ #define MSR_IA32_MBA_THRTL_BASE 0xd50
1058
+
1059
+ /* - AMD: */
1060
+ #define MSR_IA32_MBA_BW_BASE 0xc0000200
1061
+
1053
1062
/* MSR_IA32_VMX_MISC bits */
1054
1063
#define MSR_IA32_VMX_MISC_INTEL_PT (1ULL << 14)
1055
1064
#define MSR_IA32_VMX_MISC_VMWRITE_SHADOW_RO_FIELDS (1ULL << 29)
Original file line number Diff line number Diff line change 7
7
#include <linux/sched.h>
8
8
#include <linux/jump_label.h>
9
9
10
- #define IA32_PQR_ASSOC 0x0c8f
11
-
12
10
/**
13
11
* struct resctrl_pqr_state - State cache for the PQR MSR
14
12
* @cur_rmid: The cached Resource Monitoring ID
15
13
* @cur_closid: The cached Class Of Service ID
16
14
* @default_rmid: The user assigned Resource Monitoring ID
17
15
* @default_closid: The user assigned cached Class Of Service ID
18
16
*
19
- * The upper 32 bits of IA32_PQR_ASSOC contain closid and the
20
- * lower 10 bits rmid. The update to IA32_PQR_ASSOC always
17
+ * The upper 32 bits of MSR_IA32_PQR_ASSOC contain closid and the
18
+ * lower 10 bits rmid. The update to MSR_IA32_PQR_ASSOC always
21
19
* contains both parts, so we need to cache them. This also
22
20
* stores the user configured per cpu CLOSID and RMID.
23
21
*
@@ -77,7 +75,7 @@ static void __resctrl_sched_in(void)
77
75
if (closid != state -> cur_closid || rmid != state -> cur_rmid ) {
78
76
state -> cur_closid = closid ;
79
77
state -> cur_rmid = rmid ;
80
- wrmsr (IA32_PQR_ASSOC , rmid , closid );
78
+ wrmsr (MSR_IA32_PQR_ASSOC , rmid , closid );
81
79
}
82
80
}
83
81
Original file line number Diff line number Diff line change @@ -575,7 +575,7 @@ static void clear_closid_rmid(int cpu)
575
575
state -> default_rmid = 0 ;
576
576
state -> cur_closid = 0 ;
577
577
state -> cur_rmid = 0 ;
578
- wrmsr (IA32_PQR_ASSOC , 0 , 0 );
578
+ wrmsr (MSR_IA32_PQR_ASSOC , 0 , 0 );
579
579
}
580
580
581
581
static int resctrl_online_cpu (unsigned int cpu )
Original file line number Diff line number Diff line change 8
8
#include <linux/fs_context.h>
9
9
#include <linux/jump_label.h>
10
10
11
- #define MSR_IA32_L3_QOS_CFG 0xc81
12
- #define MSR_IA32_L2_QOS_CFG 0xc82
13
- #define MSR_IA32_L3_CBM_BASE 0xc90
14
- #define MSR_IA32_L2_CBM_BASE 0xd10
15
- #define MSR_IA32_MBA_THRTL_BASE 0xd50
16
- #define MSR_IA32_MBA_BW_BASE 0xc0000200
17
-
18
- #define MSR_IA32_QM_CTR 0x0c8e
19
- #define MSR_IA32_QM_EVTSEL 0x0c8d
20
-
21
11
#define L3_QOS_CDP_ENABLE 0x01ULL
22
12
23
13
#define L2_QOS_CDP_ENABLE 0x01ULL
Original file line number Diff line number Diff line change @@ -477,7 +477,7 @@ static int pseudo_lock_fn(void *_rdtgrp)
477
477
* pseudo-locked followed by reading of kernel memory to load it
478
478
* into the cache.
479
479
*/
480
- __wrmsr (IA32_PQR_ASSOC , rmid_p , rdtgrp -> closid );
480
+ __wrmsr (MSR_IA32_PQR_ASSOC , rmid_p , rdtgrp -> closid );
481
481
/*
482
482
* Cache was flushed earlier. Now access kernel memory to read it
483
483
* into cache region associated with just activated plr->closid.
@@ -513,7 +513,7 @@ static int pseudo_lock_fn(void *_rdtgrp)
513
513
* Critical section end: restore closid with capacity bitmask that
514
514
* does not overlap with pseudo-locked region.
515
515
*/
516
- __wrmsr (IA32_PQR_ASSOC , rmid_p , closid_p );
516
+ __wrmsr (MSR_IA32_PQR_ASSOC , rmid_p , closid_p );
517
517
518
518
/* Re-enable the hardware prefetcher(s) */
519
519
wrmsrl (MSR_MISC_FEATURE_CONTROL , saved_msr );
You can’t perform that action at this time.
0 commit comments