From patchwork Thu Oct 21 18:25:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 68756 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D819CB70EC for ; Fri, 22 Oct 2010 05:34:00 +1100 (EST) Received: from localhost ([127.0.0.1]:59139 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8zxc-0001lq-Kq for incoming@patchwork.ozlabs.org; Thu, 21 Oct 2010 14:33:56 -0400 Received: from [140.186.70.92] (port=33415 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8zql-0006sB-BJ for qemu-devel@nongnu.org; Thu, 21 Oct 2010 14:26:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8zqi-0002GI-L8 for qemu-devel@nongnu.org; Thu, 21 Oct 2010 14:26:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26955) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8zqi-0002FQ-Eb for qemu-devel@nongnu.org; Thu, 21 Oct 2010 14:26:48 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9LIQlnn007683 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 21 Oct 2010 14:26:47 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o9LIQl0T021366; Thu, 21 Oct 2010 14:26:47 -0400 Received: from amt.cnet (vpn-8-132.rdu.redhat.com [10.11.8.132]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o9LIQkHL031178; Thu, 21 Oct 2010 14:26:46 -0400 Received: from amt.cnet (localhost.localdomain [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 3B93268A0A9; Thu, 21 Oct 2010 16:26:13 -0200 (BRST) Received: (from marcelo@localhost) by amt.cnet (8.14.4/8.14.4/Submit) id o9LIQBCn030342; Thu, 21 Oct 2010 16:26:11 -0200 From: Marcelo Tosatti To: Anthony Liguori Date: Thu, 21 Oct 2010 16:25:50 -0200 Message-Id: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 4/7] kvm: add save/restore of MSR_VM_HSAVE_PA X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org commit 2bba4446746add456ceeb0e8359a43032a2ea333 Author: Alexander Graf Date: Thu Dec 18 15:38:32 2008 +0100 Enable nested SVM support in userspace Signed-off-by: Marcelo Tosatti --- target-i386/kvm.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 587ee19..e6c9a1d 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -790,6 +790,7 @@ static int kvm_put_msrs(CPUState *env, int level) kvm_msr_entry_set(&msrs[n++], MSR_IA32_SYSENTER_EIP, env->sysenter_eip); if (kvm_has_msr_star(env)) kvm_msr_entry_set(&msrs[n++], MSR_STAR, env->star); + kvm_msr_entry_set(&msrs[n++], MSR_VM_HSAVE_PA, env->vm_hsave); #ifdef TARGET_X86_64 /* FIXME if lm capable */ kvm_msr_entry_set(&msrs[n++], MSR_CSTAR, env->cstar); @@ -1015,6 +1016,7 @@ static int kvm_get_msrs(CPUState *env) msrs[n++].index = MSR_IA32_SYSENTER_EIP; if (kvm_has_msr_star(env)) msrs[n++].index = MSR_STAR; + msrs[n++].index = MSR_VM_HSAVE_PA; msrs[n++].index = MSR_IA32_TSC; #ifdef TARGET_X86_64 /* FIXME lm_capable_kernel */ @@ -1071,6 +1073,9 @@ static int kvm_get_msrs(CPUState *env) case MSR_IA32_TSC: env->tsc = msrs[i].data; break; + case MSR_VM_HSAVE_PA: + env->vm_hsave = msrs[i].data; + break; case MSR_KVM_SYSTEM_TIME: env->system_time_msr = msrs[i].data; break;