diff options
author | Babu Moger <babu.moger@amd.com> | 2018-03-16 16:37:22 -0400 |
---|---|---|
committer | Radim Krčmář <rkrcmar@redhat.com> | 2018-03-28 16:47:06 -0400 |
commit | 7fbc85a5fb2b018d7030cba53f4c42ab90304acd (patch) | |
tree | 8bb27a5770caf4b1f612f735115f33b91d0672ab | |
parent | dd60d217062f4527f4a94af8b3a2e9666c26f903 (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.c | 27 |
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 | ||
178 | static int ple_gap = KVM_VMX_DEFAULT_PLE_GAP; | 178 | static unsigned int ple_gap = KVM_VMX_DEFAULT_PLE_GAP; |
179 | module_param(ple_gap, int, S_IRUGO); | 179 | module_param(ple_gap, uint, 0444); |
180 | 180 | ||
181 | static int ple_window = KVM_VMX_DEFAULT_PLE_WINDOW; | 181 | static unsigned int ple_window = KVM_VMX_DEFAULT_PLE_WINDOW; |
182 | module_param(ple_window, int, S_IRUGO); | 182 | module_param(ple_window, uint, 0444); |
183 | 183 | ||
184 | /* Default doubles per-vcpu window every exit. */ | 184 | /* Default doubles per-vcpu window every exit. */ |
185 | static int ple_window_grow = KVM_VMX_DEFAULT_PLE_WINDOW_GROW; | 185 | static unsigned int ple_window_grow = KVM_VMX_DEFAULT_PLE_WINDOW_GROW; |
186 | module_param(ple_window_grow, int, S_IRUGO); | 186 | module_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. */ |
189 | static int ple_window_shrink = KVM_VMX_DEFAULT_PLE_WINDOW_SHRINK; | 189 | static unsigned int ple_window_shrink = KVM_VMX_DEFAULT_PLE_WINDOW_SHRINK; |
190 | module_param(ple_window_shrink, int, S_IRUGO); | 190 | module_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. */ |
193 | static int ple_window_actual_max = KVM_VMX_DEFAULT_PLE_WINDOW_MAX; | 193 | static unsigned int ple_window_actual_max = KVM_VMX_DEFAULT_PLE_WINDOW_MAX; |
194 | static int ple_window_max = KVM_VMX_DEFAULT_PLE_WINDOW_MAX; | 194 | static unsigned int ple_window_max = KVM_VMX_DEFAULT_PLE_WINDOW_MAX; |
195 | module_param(ple_window_max, int, S_IRUGO); | 195 | module_param(ple_window_max, uint, 0444); |
196 | 196 | ||
197 | extern const ulong vmx_return; | 197 | extern const ulong vmx_return; |
198 | 198 | ||
@@ -6984,7 +6984,7 @@ out: | |||
6984 | return ret; | 6984 | return ret; |
6985 | } | 6985 | } |
6986 | 6986 | ||
6987 | static int __grow_ple_window(int val) | 6987 | static 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 | ||
7002 | static int __shrink_ple_window(int val, int modifier, int minimum) | 7002 | static 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; |