KVM: arm: implements the kvm_arch_vcpu_in_kernel()
authorLongpeng(Mike) <longpeng2@huawei.com>
Tue, 8 Aug 2017 04:05:35 +0000 (12:05 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 8 Aug 2017 08:57:43 +0000 (10:57 +0200)
This implements the kvm_arch_vcpu_in_kernel() for ARM, and adjusts
the calls to kvm_vcpu_on_spin().

Signed-off-by: Longpeng(Mike) <longpeng2@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/arm/kvm/handle_exit.c
arch/arm64/kvm/handle_exit.c
virt/kvm/arm/arm.c

index 196122bb696827ffc55c7be116f2183b24b63529..cf8bf6bf87c4b822ff6f19f0206602baca519479 100644 (file)
@@ -67,7 +67,7 @@ static int kvm_handle_wfx(struct kvm_vcpu *vcpu, struct kvm_run *run)
        if (kvm_vcpu_get_hsr(vcpu) & HSR_WFI_IS_WFE) {
                trace_kvm_wfx(*vcpu_pc(vcpu), true);
                vcpu->stat.wfe_exit_stat++;
-               kvm_vcpu_on_spin(vcpu, false);
+               kvm_vcpu_on_spin(vcpu, vcpu_mode_priv(vcpu));
        } else {
                trace_kvm_wfx(*vcpu_pc(vcpu), false);
                vcpu->stat.wfi_exit_stat++;
index da57622cacca882103640cbcb6f1472ce0f6761c..7debb74843a053bfdec33cb69326f3f3d0968297 100644 (file)
@@ -84,7 +84,7 @@ static int kvm_handle_wfx(struct kvm_vcpu *vcpu, struct kvm_run *run)
        if (kvm_vcpu_get_hsr(vcpu) & ESR_ELx_WFx_ISS_WFE) {
                trace_kvm_wfx_arm64(*vcpu_pc(vcpu), true);
                vcpu->stat.wfe_exit_stat++;
-               kvm_vcpu_on_spin(vcpu, false);
+               kvm_vcpu_on_spin(vcpu, vcpu_mode_priv(vcpu));
        } else {
                trace_kvm_wfx_arm64(*vcpu_pc(vcpu), false);
                vcpu->stat.wfi_exit_stat++;
index 862f820d06d4bfd3cd2b1ea5b176f65ca960079a..b9f68e4add71015ea2a9757c4c30a7eed65cfa7b 100644 (file)
@@ -418,7 +418,7 @@ int kvm_arch_vcpu_runnable(struct kvm_vcpu *v)
 
 bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu)
 {
-       return false;
+       return vcpu_mode_priv(vcpu);
 }
 
 /* Just ensure a guest exit from a particular CPU */