aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuraj Jitindar Singh <sjitindarsingh@gmail.com>2016-10-13 20:53:19 -0400
committerPaul Mackerras <paulus@ozlabs.org>2016-11-27 19:48:47 -0500
commitec76d819d27040e418801d1a57bd3bdfde51019e (patch)
tree90a89b6eac9dbe1a5f545c8de06cdbaeb57074d2
parenta8acaece5d88db234d0b82b8692dea15d602f622 (diff)
KVM: Export kvm module parameter variables
The kvm module has the parameters halt_poll_ns, halt_poll_ns_grow, and halt_poll_ns_shrink. Halt polling was recently added to the powerpc kvm-hv module and these parameters were essentially duplicated for that. There is no benefit to this duplication and it can lead to confusion when trying to tune halt polling. Thus move the definition of these variables to kvm_host.h and export them. This will allow the kvm-hv module to use the same module parameters by accessing these variables, which will be implemented in the next patch, meaning that they will no longer be duplicated. Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
-rw-r--r--include/linux/kvm_host.h4
-rw-r--r--virt/kvm/kvm_main.c9
2 files changed, 10 insertions, 3 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 01c0b9cc3915..29b500a857d1 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -1107,6 +1107,10 @@ static inline bool kvm_check_request(int req, struct kvm_vcpu *vcpu)
1107 1107
1108extern bool kvm_rebooting; 1108extern bool kvm_rebooting;
1109 1109
1110extern unsigned int halt_poll_ns;
1111extern unsigned int halt_poll_ns_grow;
1112extern unsigned int halt_poll_ns_shrink;
1113
1110struct kvm_device { 1114struct kvm_device {
1111 struct kvm_device_ops *ops; 1115 struct kvm_device_ops *ops;
1112 struct kvm *kvm; 1116 struct kvm *kvm;
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index fbf04c0c898c..9831cdf35436 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -70,16 +70,19 @@ MODULE_AUTHOR("Qumranet");
70MODULE_LICENSE("GPL"); 70MODULE_LICENSE("GPL");
71 71
72/* Architectures should define their poll value according to the halt latency */ 72/* Architectures should define their poll value according to the halt latency */
73static unsigned int halt_poll_ns = KVM_HALT_POLL_NS_DEFAULT; 73unsigned int halt_poll_ns = KVM_HALT_POLL_NS_DEFAULT;
74module_param(halt_poll_ns, uint, S_IRUGO | S_IWUSR); 74module_param(halt_poll_ns, uint, S_IRUGO | S_IWUSR);
75EXPORT_SYMBOL_GPL(halt_poll_ns);
75 76
76/* Default doubles per-vcpu halt_poll_ns. */ 77/* Default doubles per-vcpu halt_poll_ns. */
77static unsigned int halt_poll_ns_grow = 2; 78unsigned int halt_poll_ns_grow = 2;
78module_param(halt_poll_ns_grow, uint, S_IRUGO | S_IWUSR); 79module_param(halt_poll_ns_grow, uint, S_IRUGO | S_IWUSR);
80EXPORT_SYMBOL_GPL(halt_poll_ns_grow);
79 81
80/* Default resets per-vcpu halt_poll_ns . */ 82/* Default resets per-vcpu halt_poll_ns . */
81static unsigned int halt_poll_ns_shrink; 83unsigned int halt_poll_ns_shrink;
82module_param(halt_poll_ns_shrink, uint, S_IRUGO | S_IWUSR); 84module_param(halt_poll_ns_shrink, uint, S_IRUGO | S_IWUSR);
85EXPORT_SYMBOL_GPL(halt_poll_ns_shrink);
83 86
84/* 87/*
85 * Ordering of locks: 88 * Ordering of locks: