aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2014-08-26 07:27:46 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2014-08-29 08:02:49 -0400
commit48d89b92609a66bc41f479c560640bc413add3b4 (patch)
tree498120aebeff63753f1e48dc45faf6f0b3517b38
parenta7c0b07d570848e50fce4d31ac01313484d6b844 (diff)
KVM: x86: fix some sparse warnings
Sparse reports the following easily fixed warnings: arch/x86/kvm/vmx.c:8795:48: sparse: Using plain integer as NULL pointer arch/x86/kvm/vmx.c:2138:5: sparse: symbol vmx_read_l1_tsc was not declared. Should it be static? arch/x86/kvm/vmx.c:6151:48: sparse: Using plain integer as NULL pointer arch/x86/kvm/vmx.c:8851:6: sparse: symbol vmx_sched_in was not declared. Should it be static? arch/x86/kvm/svm.c:2162:5: sparse: symbol svm_read_l1_tsc was not declared. Should it be static? Cc: Radim Krčmář <rkrcmar@redhat.com> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--arch/x86/kvm/svm.c2
-rw-r--r--arch/x86/kvm/vmx.c12
2 files changed, 7 insertions, 7 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 1703aab84a6d..7cd230e55118 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -3031,7 +3031,7 @@ static int cr8_write_interception(struct vcpu_svm *svm)
3031 return 0; 3031 return 0;
3032} 3032}
3033 3033
3034u64 svm_read_l1_tsc(struct kvm_vcpu *vcpu, u64 host_tsc) 3034static u64 svm_read_l1_tsc(struct kvm_vcpu *vcpu, u64 host_tsc)
3035{ 3035{
3036 struct vmcb *vmcb = get_host_vmcb(to_svm(vcpu)); 3036 struct vmcb *vmcb = get_host_vmcb(to_svm(vcpu));
3037 return vmcb->control.tsc_offset + 3037 return vmcb->control.tsc_offset +
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 73ba2a265f85..d70550d0bcff 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2159,7 +2159,7 @@ static u64 guest_read_tsc(void)
2159 * Like guest_read_tsc, but always returns L1's notion of the timestamp 2159 * Like guest_read_tsc, but always returns L1's notion of the timestamp
2160 * counter, even if a nested guest (L2) is currently running. 2160 * counter, even if a nested guest (L2) is currently running.
2161 */ 2161 */
2162u64 vmx_read_l1_tsc(struct kvm_vcpu *vcpu, u64 host_tsc) 2162static u64 vmx_read_l1_tsc(struct kvm_vcpu *vcpu, u64 host_tsc)
2163{ 2163{
2164 u64 tsc_offset; 2164 u64 tsc_offset;
2165 2165
@@ -6246,11 +6246,11 @@ static void free_nested(struct vcpu_vmx *vmx)
6246 /* Unpin physical memory we referred to in current vmcs02 */ 6246 /* Unpin physical memory we referred to in current vmcs02 */
6247 if (vmx->nested.apic_access_page) { 6247 if (vmx->nested.apic_access_page) {
6248 nested_release_page(vmx->nested.apic_access_page); 6248 nested_release_page(vmx->nested.apic_access_page);
6249 vmx->nested.apic_access_page = 0; 6249 vmx->nested.apic_access_page = NULL;
6250 } 6250 }
6251 if (vmx->nested.virtual_apic_page) { 6251 if (vmx->nested.virtual_apic_page) {
6252 nested_release_page(vmx->nested.virtual_apic_page); 6252 nested_release_page(vmx->nested.virtual_apic_page);
6253 vmx->nested.virtual_apic_page = 0; 6253 vmx->nested.virtual_apic_page = NULL;
6254 } 6254 }
6255 6255
6256 nested_free_all_saved_vmcss(vmx); 6256 nested_free_all_saved_vmcss(vmx);
@@ -8950,11 +8950,11 @@ static void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 exit_reason,
8950 /* Unpin physical memory we referred to in vmcs02 */ 8950 /* Unpin physical memory we referred to in vmcs02 */
8951 if (vmx->nested.apic_access_page) { 8951 if (vmx->nested.apic_access_page) {
8952 nested_release_page(vmx->nested.apic_access_page); 8952 nested_release_page(vmx->nested.apic_access_page);
8953 vmx->nested.apic_access_page = 0; 8953 vmx->nested.apic_access_page = NULL;
8954 } 8954 }
8955 if (vmx->nested.virtual_apic_page) { 8955 if (vmx->nested.virtual_apic_page) {
8956 nested_release_page(vmx->nested.virtual_apic_page); 8956 nested_release_page(vmx->nested.virtual_apic_page);
8957 vmx->nested.virtual_apic_page = 0; 8957 vmx->nested.virtual_apic_page = NULL;
8958 } 8958 }
8959 8959
8960 /* 8960 /*
@@ -9010,7 +9010,7 @@ static int vmx_check_intercept(struct kvm_vcpu *vcpu,
9010 return X86EMUL_CONTINUE; 9010 return X86EMUL_CONTINUE;
9011} 9011}
9012 9012
9013void vmx_sched_in(struct kvm_vcpu *vcpu, int cpu) 9013static void vmx_sched_in(struct kvm_vcpu *vcpu, int cpu)
9014{ 9014{
9015 if (ple_gap) 9015 if (ple_gap)
9016 shrink_ple_window(vcpu); 9016 shrink_ple_window(vcpu);