From patchwork Sat Jul 23 07:31:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Waychison X-Patchwork-Id: 1001662 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6N7WKIS018022 for ; Sat, 23 Jul 2011 07:32:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751151Ab1GWHb7 (ORCPT ); Sat, 23 Jul 2011 03:31:59 -0400 Received: from smtp-out.google.com ([74.125.121.67]:30968 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750772Ab1GWHb5 (ORCPT ); Sat, 23 Jul 2011 03:31:57 -0400 Received: from hpaq11.eem.corp.google.com (hpaq11.eem.corp.google.com [172.25.149.11]) by smtp-out.google.com with ESMTP id p6N7VpLv032108; Sat, 23 Jul 2011 00:31:51 -0700 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1311406311; bh=ek4FTyZvl5zUXWRZ774/3OW+4dQ=; h=From:To:Cc:Subject:Date:Message-Id; b=jNUjY6oV4v6dF9n76v/5tOw13uvQpW7arAujGTiqx030ZrilADVHF1wKtMuSqkI5O gKpQvs+Gh95nITaktuCfg== DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=from:to:cc:subject:date:message-id:x-mailer; b=YczMAb2G4PPe2iUesSzjsjEM8r1SMa9ieYD3FMV2OtA8hBOtWPCdM42SSxa4q3JMR K7ptJ9e1rRaEytEyIXwNw== Received: from mike2.sea.corp.google.com (mike2.sea.corp.google.com [172.31.71.68]) by hpaq11.eem.corp.google.com with ESMTP id p6N7VmeP018218; Sat, 23 Jul 2011 00:31:49 -0700 Received: by mike2.sea.corp.google.com (Postfix, from userid 11438) id 30FC220AD0; Sat, 23 Jul 2011 00:31:48 -0700 (PDT) From: Mike Waychison To: Avi Kivity , Marcelo Tosatti Cc: x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Mike Waychison Subject: [PATCH] kvm: Really fix HV_X64_MSR_APIC_ASSIST_PAGE Date: Sat, 23 Jul 2011 00:31:45 -0700 Message-Id: <1311406305-24523-1-git-send-email-mikew@google.com> X-Mailer: git-send-email 1.7.3.1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sat, 23 Jul 2011 07:32:21 +0000 (UTC) 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 --- arch/x86/kvm/x86.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 15148ef..6960efe 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -1749,7 +1749,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;