From patchwork Sat Jan 4 17:47:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3434121 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 45209C02DC for ; Sat, 4 Jan 2014 17:48:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8113120158 for ; Sat, 4 Jan 2014 17:48:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B9D262014A for ; Sat, 4 Jan 2014 17:48:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754950AbaADRr4 (ORCPT ); Sat, 4 Jan 2014 12:47:56 -0500 Received: from mout.web.de ([212.227.15.3]:60171 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754384AbaADRrp (ORCPT ); Sat, 4 Jan 2014 12:47:45 -0500 Received: from mchn199C.home ([95.157.58.223]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0Lb289-1VXLNx2gfZ-00kfjZ for ; Sat, 04 Jan 2014 18:47:44 +0100 From: Jan Kiszka To: Paolo Bonzini , Gleb Natapov , Marcelo Tosatti Cc: kvm Subject: [PATCH 10/12] KVM: nVMX: Update guest activity state field on L2 exits Date: Sat, 4 Jan 2014 18:47:24 +0100 Message-Id: X-Mailer: git-send-email 1.8.1.1.298.ge7eed54 In-Reply-To: References: In-Reply-To: References: X-Provags-ID: V03:K0:jYMscM3yjZZVYoyApErInNkUbTE9c7+esseLb9wytxojBGfUv8e LHyz7n4JAs3itTmoxq5wd0wpL46IIxvnLZrqqfyckRkM7cTUQSkqpiYq481uT5bHDocK0Ci uf8yIpoqxWtYUASf0pozqPWGes36lDiEugeuXyU8ljdyTdZz18PwDEG8ycEFXe97nh/vL27 UZ0qIekhafsSp0J8ftgNQ== Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jan Kiszka Set guest activity state in L1's VMCS according to the VCPUs mp_state. This ensures we report the correct state in case we L2 executed HLT or if we put L2 into HLT state and it was now woken up by an event. Signed-off-by: Jan Kiszka --- arch/x86/kvm/vmx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index bde8ddd..1245ff1 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -8223,6 +8223,10 @@ static void prepare_vmcs12(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12, vmcs_read32(GUEST_INTERRUPTIBILITY_INFO); vmcs12->guest_pending_dbg_exceptions = vmcs_readl(GUEST_PENDING_DBG_EXCEPTIONS); + if (vcpu->arch.mp_state == KVM_MP_STATE_HALTED) + vmcs12->guest_activity_state = GUEST_ACTIVITY_HLT; + else + vmcs12->guest_activity_state = GUEST_ACTIVITY_ACTIVE; if ((vmcs12->pin_based_vm_exec_control & PIN_BASED_VMX_PREEMPTION_TIMER) && (vmcs12->vm_exit_controls & VM_EXIT_SAVE_VMX_PREEMPTION_TIMER))