Skip to content

Commit 26951ec

Browse files
flying-122sean-jc
authored andcommitted
KVM: x86: Use octal for file permission
Convert all module params to octal permissions to improve code readability and to make checkpatch happy: WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. Signed-off-by: Peng Hao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent bf328e2 commit 26951ec

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

arch/x86/kvm/svm/svm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ module_param_named(npt, npt_enabled, bool, 0444);
199199

200200
/* allow nested virtualization in KVM/SVM */
201201
static int nested = true;
202-
module_param(nested, int, S_IRUGO);
202+
module_param(nested, int, 0444);
203203

204204
/* enable/disable Next RIP Save */
205205
int nrips = true;

arch/x86/kvm/vmx/vmx.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,28 +82,28 @@ bool __read_mostly enable_vpid = 1;
8282
module_param_named(vpid, enable_vpid, bool, 0444);
8383

8484
static bool __read_mostly enable_vnmi = 1;
85-
module_param_named(vnmi, enable_vnmi, bool, S_IRUGO);
85+
module_param_named(vnmi, enable_vnmi, bool, 0444);
8686

8787
bool __read_mostly flexpriority_enabled = 1;
88-
module_param_named(flexpriority, flexpriority_enabled, bool, S_IRUGO);
88+
module_param_named(flexpriority, flexpriority_enabled, bool, 0444);
8989

9090
bool __read_mostly enable_ept = 1;
91-
module_param_named(ept, enable_ept, bool, S_IRUGO);
91+
module_param_named(ept, enable_ept, bool, 0444);
9292

9393
bool __read_mostly enable_unrestricted_guest = 1;
9494
module_param_named(unrestricted_guest,
95-
enable_unrestricted_guest, bool, S_IRUGO);
95+
enable_unrestricted_guest, bool, 0444);
9696

9797
bool __read_mostly enable_ept_ad_bits = 1;
98-
module_param_named(eptad, enable_ept_ad_bits, bool, S_IRUGO);
98+
module_param_named(eptad, enable_ept_ad_bits, bool, 0444);
9999

100100
static bool __read_mostly emulate_invalid_guest_state = true;
101-
module_param(emulate_invalid_guest_state, bool, S_IRUGO);
101+
module_param(emulate_invalid_guest_state, bool, 0444);
102102

103103
static bool __read_mostly fasteoi = 1;
104-
module_param(fasteoi, bool, S_IRUGO);
104+
module_param(fasteoi, bool, 0444);
105105

106-
module_param(enable_apicv, bool, S_IRUGO);
106+
module_param(enable_apicv, bool, 0444);
107107

108108
bool __read_mostly enable_ipiv = true;
109109
module_param(enable_ipiv, bool, 0444);
@@ -114,10 +114,10 @@ module_param(enable_ipiv, bool, 0444);
114114
* use VMX instructions.
115115
*/
116116
static bool __read_mostly nested = 1;
117-
module_param(nested, bool, S_IRUGO);
117+
module_param(nested, bool, 0444);
118118

119119
bool __read_mostly enable_pml = 1;
120-
module_param_named(pml, enable_pml, bool, S_IRUGO);
120+
module_param_named(pml, enable_pml, bool, 0444);
121121

122122
static bool __read_mostly error_on_inconsistent_vmcs_config = true;
123123
module_param(error_on_inconsistent_vmcs_config, bool, 0444);

arch/x86/kvm/x86.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,21 +145,21 @@ EXPORT_STATIC_CALL_GPL(kvm_x86_get_cs_db_l_bits);
145145
EXPORT_STATIC_CALL_GPL(kvm_x86_cache_reg);
146146

147147
static bool __read_mostly ignore_msrs = 0;
148-
module_param(ignore_msrs, bool, S_IRUGO | S_IWUSR);
148+
module_param(ignore_msrs, bool, 0644);
149149

150150
bool __read_mostly report_ignored_msrs = true;
151-
module_param(report_ignored_msrs, bool, S_IRUGO | S_IWUSR);
151+
module_param(report_ignored_msrs, bool, 0644);
152152
EXPORT_SYMBOL_GPL(report_ignored_msrs);
153153

154154
unsigned int min_timer_period_us = 200;
155-
module_param(min_timer_period_us, uint, S_IRUGO | S_IWUSR);
155+
module_param(min_timer_period_us, uint, 0644);
156156

157157
static bool __read_mostly kvmclock_periodic_sync = true;
158-
module_param(kvmclock_periodic_sync, bool, S_IRUGO);
158+
module_param(kvmclock_periodic_sync, bool, 0444);
159159

160160
/* tsc tolerance in parts per million - default to 1/2 of the NTP threshold */
161161
static u32 __read_mostly tsc_tolerance_ppm = 250;
162-
module_param(tsc_tolerance_ppm, uint, S_IRUGO | S_IWUSR);
162+
module_param(tsc_tolerance_ppm, uint, 0644);
163163

164164
/*
165165
* lapic timer advance (tscdeadline mode only) in nanoseconds. '-1' enables
@@ -168,13 +168,13 @@ module_param(tsc_tolerance_ppm, uint, S_IRUGO | S_IWUSR);
168168
* tuning, i.e. allows privileged userspace to set an exact advancement time.
169169
*/
170170
static int __read_mostly lapic_timer_advance_ns = -1;
171-
module_param(lapic_timer_advance_ns, int, S_IRUGO | S_IWUSR);
171+
module_param(lapic_timer_advance_ns, int, 0644);
172172

173173
static bool __read_mostly vector_hashing = true;
174-
module_param(vector_hashing, bool, S_IRUGO);
174+
module_param(vector_hashing, bool, 0444);
175175

176176
bool __read_mostly enable_vmware_backdoor = false;
177-
module_param(enable_vmware_backdoor, bool, S_IRUGO);
177+
module_param(enable_vmware_backdoor, bool, 0444);
178178
EXPORT_SYMBOL_GPL(enable_vmware_backdoor);
179179

180180
/*
@@ -186,7 +186,7 @@ static int __read_mostly force_emulation_prefix;
186186
module_param(force_emulation_prefix, int, 0644);
187187

188188
int __read_mostly pi_inject_timer = -1;
189-
module_param(pi_inject_timer, bint, S_IRUGO | S_IWUSR);
189+
module_param(pi_inject_timer, bint, 0644);
190190

191191
/* Enable/disable PMU virtualization */
192192
bool __read_mostly enable_pmu = true;

0 commit comments

Comments
 (0)