KVM: Really fix HV_X64_MSR_APIC_ASSIST_PAGE
authorMike Waychison <mikew@google.com>
Sat, 23 Jul 2011 07:31:45 +0000 (00:31 -0700)
committerAvi Kivity <avi@redhat.com>
Sun, 25 Sep 2011 16:17:58 +0000 (19:17 +0300)
Commit 0945d4b228 tried to fix the get_msr path for the
HV_X64_MSR_APIC_ASSIST_PAGE msr, but was poorly tested.  We should be
returning 0 if the read succeeded, and passing the value back to the
caller via the pdata out argument, not returning the value directly.

Signed-off-by: Mike Waychison <mikew@google.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/x86.c

index e80f0d7c2c0df5a873da2e8417958f51a8c57f4d..6cb353c83a12b4aae654e4fbb753ebbfd4e2948e 100644 (file)
@@ -1826,7 +1826,8 @@ static int get_msr_hyperv(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata)
        case HV_X64_MSR_TPR:
                return kvm_hv_vapic_msr_read(vcpu, APIC_TASKPRI, pdata);
        case HV_X64_MSR_APIC_ASSIST_PAGE:
-               return vcpu->arch.hv_vapic;
+               data = vcpu->arch.hv_vapic;
+               break;
        default:
                pr_unimpl(vcpu, "Hyper-V unhandled rdmsr: 0x%x\n", msr);
                return 1;