From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 2/2] KVM: vmx: Reflect misc_enables in real CPU Date: Thu, 21 Aug 2014 13:51:07 +0200 Message-ID: <53F5DD2B.6080808@redhat.com> References: <1408543109-30687-1-git-send-email-namit@cs.technion.ac.il> <1408543109-30687-3-git-send-email-namit@cs.technion.ac.il> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Cc: joro@8bytes.org, kvm@vger.kernel.org, nadav.amit@gmail.com To: Nadav Amit Return-path: Received: from mail-we0-f180.google.com ([74.125.82.180]:37315 "EHLO mail-we0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754196AbaHULvM (ORCPT ); Thu, 21 Aug 2014 07:51:12 -0400 Received: by mail-we0-f180.google.com with SMTP id w61so9184808wes.11 for ; Thu, 21 Aug 2014 04:51:11 -0700 (PDT) In-Reply-To: <1408543109-30687-3-git-send-email-namit@cs.technion.ac.il> Sender: kvm-owner@vger.kernel.org List-ID: Il 20/08/2014 15:58, Nadav Amit ha scritto: > IA32_MISC_ENABLE MSR has two bits that affect the actual results which can be > observed by the guest: fast string enable, and FOPCODE compatibility. Guests > may wish to change the default settings of these bits. > > Linux usually enables fast-string by default. However, when "fast string" is > enabled data breakpoints are only recognized on boundaries between data-groups. > On some old CPUs enabling fast-string also resulted in single-step not > occurring upon each iteration. > > FOPCODE compatibility can be used to analyze program performance by recording > the last instruction executed before FSAVE/FSTENV/FXSAVE. > > This patch saves and restores these bits in IA32_MISC_ENABLE if they are > supported upon entry to guest and exit to userspace respectively. To avoid > possible issues, fast-string can only be enabled by the guest if the host > enabled them. The physical CPU version is checked to ensure no shared bits are > reconfigured in the process. Maybe I'm dense :) but why are you saying upon exit to userspace? It is switched upon VM exit simply. In fact I was thinking you'd use kvm_set_shared_msr for this, but it looks like you aren't doing that. Paolo