@@ -66,12 +66,16 @@ def hex(x):
66
66
parser .add_argument ('-f' , '--fid' , default = - 1 , type = hex , help = 'FID to set (in hex)' )
67
67
parser .add_argument ('-d' , '--did' , default = - 1 , type = hex , help = 'DID to set (in hex)' )
68
68
parser .add_argument ('-v' , '--vid' , default = - 1 , type = hex , help = 'VID to set (in hex)' )
69
+ parser .add_argument ('--c6-enable' , action = 'store_true' , help = 'Enable C-State C6' )
70
+ parser .add_argument ('--c6-disable' , action = 'store_true' , help = 'Disable C-State C6' )
69
71
70
72
args = parser .parse_args ()
71
73
72
74
if args .list :
73
75
for p in range (len (pstates )):
74
76
print ('P' + str (p ) + " - " + pstate2str (readmsr (pstates [p ])))
77
+ print ('C6 State - Package - ' + ('Enabled' if readmsr (0xC0010292 ) & (1 << 32 ) else 'Disabled' ))
78
+ print ('C6 State - Core - ' + ('Enabled' if readmsr (0xC0010296 ) & ((1 << 22 ) | (1 << 14 ) | (1 << 6 )) == ((1 << 22 ) | (1 << 14 ) | (1 << 6 )) else 'Disabled' ))
75
79
76
80
if args .pstate >= 0 :
77
81
new = old = readmsr (pstates [args .pstate ])
@@ -99,5 +103,15 @@ def hex(x):
99
103
print ('New P' + str (args .pstate ) + ': ' + pstate2str (new ))
100
104
writemsr (pstates [args .pstate ], new )
101
105
102
- if not args .list and args .pstate == - 1 :
106
+ if args .c6_enable :
107
+ writemsr (0xC0010292 , readmsr (0xC0010292 ) | (1 << 32 ))
108
+ writemsr (0xC0010296 , readmsr (0xC0010296 ) | ((1 << 22 ) | (1 << 14 ) | (1 << 6 )))
109
+ print ('Enabling C6 state' )
110
+
111
+ if args .c6_disable :
112
+ writemsr (0xC0010292 , readmsr (0xC0010292 ) & ~ (1 << 32 ))
113
+ writemsr (0xC0010296 , readmsr (0xC0010296 ) & ~ ((1 << 22 ) | (1 << 14 ) | (1 << 6 )))
114
+ print ('Disabling C6 state' )
115
+
116
+ if not args .list and args .pstate == - 1 and not args .c6_enable and not args .c6_disable :
103
117
parser .print_help ()
0 commit comments