From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: [PATCH] KVM: Enable "fast string operations" in MSR_IA32_MISC_ENABLE Date: Thu, 22 Sep 2011 15:03:02 +0300 Message-ID: <1316692982-11539-1-git-send-email-avi@redhat.com> To: Marcelo Tosatti , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:23158 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752462Ab1IVMD0 (ORCPT ); Thu, 22 Sep 2011 08:03:26 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8MC3QcP010349 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 22 Sep 2011 08:03:26 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p8MC3PXm017798 for ; Thu, 22 Sep 2011 08:03:26 -0400 Sender: kvm-owner@vger.kernel.org List-ID: Recent (3.0+) Linux guests check for the fast string bit in MSR_IA32_MISC_ENABLE before enabling rep/movs based memcpy and related on fam 6/model 13+ processors. Enable the bit by default, as required by the specification. Signed-off-by: Avi Kivity --- 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 6b37f18..459f2bf 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -6374,6 +6374,8 @@ void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu) int kvm_arch_vcpu_reset(struct kvm_vcpu *vcpu) { + vcpu->arch.ia32_misc_enable_msr = MSR_IA32_MISC_ENABLE_FAST_STRING; + vcpu->arch.nmi_pending = false; vcpu->arch.nmi_injected = false; -- 1.7.6.3