From patchwork Thu Jul 21 22:38:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Waychison X-Patchwork-Id: 997422 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6LMcSkO007038 for ; Thu, 21 Jul 2011 22:38:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751189Ab1GUWiZ (ORCPT ); Thu, 21 Jul 2011 18:38:25 -0400 Received: from smtp-out.google.com ([74.125.121.67]:45106 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751041Ab1GUWiY (ORCPT ); Thu, 21 Jul 2011 18:38:24 -0400 Received: from hpaq12.eem.corp.google.com (hpaq12.eem.corp.google.com [172.25.149.12]) by smtp-out.google.com with ESMTP id p6LMcGnR015051; Thu, 21 Jul 2011 15:38:16 -0700 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1311287896; bh=QC7aOCjGZ46h2yGT+K6thW2BDJE=; h=From:To:Cc:Subject:Date:Message-Id; b=P/ZzE8wTjZRhz+xAJHyg1kTGhzG+N3M4EfsTo6MjDDHrNX6NGtnD+fIUeta2pOmdj Sq3nkqGwJ1IXd8ei2G1Lw== 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=FEn/W7k0RGWyj60wjklEeVQf4Z+w8wIWs84RPGYlPVV2xBbRFmCM3mTpxBu3YU77u QjXxtRbGFsSYlVQVVbm6w== Received: from mike2.sea.corp.google.com (mike2.sea.corp.google.com [172.31.71.68]) by hpaq12.eem.corp.google.com with ESMTP id p6LMcDMt000329; Thu, 21 Jul 2011 15:38:14 -0700 Received: by mike2.sea.corp.google.com (Postfix, from userid 11438) id 1392220B87; Thu, 21 Jul 2011 15:38:13 -0700 (PDT) From: Mike Waychison To: Cory Maccarrone , Andy Thornton , Miche Baker-Harvey , Avi Kivity , Marcelo Tosatti , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Cc: x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Mike Waychison Subject: [PATCH] kvm: get_msr support for HV_X64_MSR_APIC_ASSIST_PAGE Date: Thu, 21 Jul 2011 15:38:10 -0700 Message-Id: <1311287890-22124-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 (demeter1.kernel.org [140.211.167.41]); Thu, 21 Jul 2011 22:38:28 +0000 (UTC) "get" support for the HV_X64_MSR_APIC_ASSIST_PAGE msr was missing, even though it is explicitly enumerated as something the vmm should save in msrs_to_save and reported to userland via the KVM_GET_MSR_INDEX_LIST ioctl. Add "get" support for HV_X64_MSR_APIC_ASSIST_PAGE. We simply return the guest visible value of this register, which seems to be correct as a set on the register is validated for us already. Signed-off-by: Mike Waychison --- arch/x86/kvm/x86.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 77c9d86..15148ef 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -1748,6 +1748,8 @@ static int get_msr_hyperv(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata) return kvm_hv_vapic_msr_read(vcpu, APIC_ICR, 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; default: pr_unimpl(vcpu, "Hyper-V unhandled rdmsr: 0x%x\n", msr); return 1;