All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nadav Amit <nadav.amit@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Nadav Amit <namit@cs.technion.ac.il>,
	joro@8bytes.org, kvm@vger.kernel.org
Subject: Re: [PATCH 2/2] KVM: vmx: Reflect misc_enables in real CPU
Date: Thu, 21 Aug 2014 15:28:57 +0300	[thread overview]
Message-ID: <DA277BFF-147D-4368-BADF-50691905CE0F@gmail.com> (raw)
In-Reply-To: <53F5DD2B.6080808@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1722 bytes --]


On Aug 21, 2014, at 2:51 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:

> 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.
> 

No, it’s me... I had too many versions of this patch which caused me to lose track.
I originally used kvm_set_shared_msr, but since disabling fast-strings or turning on FOPCODE compatibility affects performance negatively, I thought it would be better to set them upon exit, as otherwise operations as memcpy in the kernel would be considerably slower.

Nadav

[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

  reply	other threads:[~2014-08-21 12:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-20 13:58 [PATCH 0/2] KVM: vmx: Supporting IA32_MISC_ENABLE MSR Nadav Amit
2014-08-20 13:58 ` [PATCH 1/2] KVM: x86: update cpuid according to IA32_MISC_ENABLE Nadav Amit
2014-08-20 13:58 ` [PATCH 2/2] KVM: vmx: Reflect misc_enables in real CPU Nadav Amit
2014-08-21 11:51   ` Paolo Bonzini
2014-08-21 12:28     ` Nadav Amit [this message]
2014-08-20 14:00 ` [PATCH] x86: Test debug exceptions with disabled fast-string Nadav Amit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DA277BFF-147D-4368-BADF-50691905CE0F@gmail.com \
    --to=nadav.amit@gmail.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=namit@cs.technion.ac.il \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.