aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBabu Moger <babu.moger@amd.com>2018-03-16 16:37:22 -0400
committerRadim Krčmář <rkrcmar@redhat.com>2018-03-28 16:47:06 -0400
commit7fbc85a5fb2b018d7030cba53f4c42ab90304acd (patch)
tree8bb27a5770caf4b1f612f735115f33b91d0672ab
parentdd60d217062f4527f4a94af8b3a2e9666c26f903 (diff)
KVM: VMX: Fix the module parameters for vmx
The vmx module parameters are supposed to be unsigned variants. Also fixed the checkpatch errors like the one below. WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. +module_param(ple_gap, uint, S_IRUGO); Signed-off-by: Babu Moger <babu.moger@amd.com> [Expanded uint to unsigned int in code. - Radim] Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
-rw-r--r--arch/x86/kvm/vmx.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 0e5510ebd3f2..4eb252b13121 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -175,24 +175,24 @@ module_param_named(preemption_timer, enable_preemption_timer, bool, S_IRUGO);
175#define KVM_VMX_DEFAULT_PLE_WINDOW_MAX \ 175#define KVM_VMX_DEFAULT_PLE_WINDOW_MAX \
176 INT_MAX / KVM_VMX_DEFAULT_PLE_WINDOW_GROW 176 INT_MAX / KVM_VMX_DEFAULT_PLE_WINDOW_GROW
177 177
178static int ple_gap = KVM_VMX_DEFAULT_PLE_GAP; 178static unsigned int ple_gap = KVM_VMX_DEFAULT_PLE_GAP;
179module_param(ple_gap, int, S_IRUGO); 179module_param(ple_gap, uint, 0444);
180 180
181static int ple_window = KVM_VMX_DEFAULT_PLE_WINDOW; 181static unsigned int ple_window = KVM_VMX_DEFAULT_PLE_WINDOW;
182module_param(ple_window, int, S_IRUGO); 182module_param(ple_window, uint, 0444);
183 183
184/* Default doubles per-vcpu window every exit. */ 184/* Default doubles per-vcpu window every exit. */
185static int ple_window_grow = KVM_VMX_DEFAULT_PLE_WINDOW_GROW; 185static unsigned int ple_window_grow = KVM_VMX_DEFAULT_PLE_WINDOW_GROW;
186module_param(ple_window_grow, int, S_IRUGO); 186module_param(ple_window_grow, uint, 0444);
187 187
188/* Default resets per-vcpu window every exit to ple_window. */ 188/* Default resets per-vcpu window every exit to ple_window. */
189static int ple_window_shrink = KVM_VMX_DEFAULT_PLE_WINDOW_SHRINK; 189static unsigned int ple_window_shrink = KVM_VMX_DEFAULT_PLE_WINDOW_SHRINK;
190module_param(ple_window_shrink, int, S_IRUGO); 190module_param(ple_window_shrink, uint, 0444);
191 191
192/* Default is to compute the maximum so we can never overflow. */ 192/* Default is to compute the maximum so we can never overflow. */
193static int ple_window_actual_max = KVM_VMX_DEFAULT_PLE_WINDOW_MAX; 193static unsigned int ple_window_actual_max = KVM_VMX_DEFAULT_PLE_WINDOW_MAX;
194static int ple_window_max = KVM_VMX_DEFAULT_PLE_WINDOW_MAX; 194static unsigned int ple_window_max = KVM_VMX_DEFAULT_PLE_WINDOW_MAX;
195module_param(ple_window_max, int, S_IRUGO); 195module_param(ple_window_max, uint, 0444);
196 196
197extern const ulong vmx_return; 197extern const ulong vmx_return;
198 198
@@ -6984,7 +6984,7 @@ out:
6984 return ret; 6984 return ret;
6985} 6985}
6986 6986
6987static int __grow_ple_window(int val) 6987static unsigned int __grow_ple_window(unsigned int val)
6988{ 6988{
6989 if (ple_window_grow < 1) 6989 if (ple_window_grow < 1)
6990 return ple_window; 6990 return ple_window;
@@ -6999,7 +6999,8 @@ static int __grow_ple_window(int val)
6999 return val; 6999 return val;
7000} 7000}
7001 7001
7002static int __shrink_ple_window(int val, int modifier, int minimum) 7002static unsigned int __shrink_ple_window(unsigned int val,
7003 unsigned int modifier, unsigned int minimum)
7003{ 7004{
7004 if (modifier < 1) 7005 if (modifier < 1)
7005 return ple_window; 7006 return ple_window;