From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nadav Amit Subject: Re: [PATCH 2/2] KVM: vmx: Reflect misc_enables in real CPU Date: Thu, 21 Aug 2014 15:28:57 +0300 Message-ID: References: <1408543109-30687-1-git-send-email-namit@cs.technion.ac.il> <1408543109-30687-3-git-send-email-namit@cs.technion.ac.il> <53F5DD2B.6080808@redhat.com> Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: multipart/signed; boundary="Apple-Mail=_C1A752EB-6EF9-4899-BD3D-D3AE1D6D64E5"; protocol="application/pgp-signature"; micalg=pgp-sha512 Cc: Nadav Amit , joro@8bytes.org, kvm@vger.kernel.org To: Paolo Bonzini Return-path: Received: from mail-la0-f41.google.com ([209.85.215.41]:62630 "EHLO mail-la0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754983AbaHUM3E (ORCPT ); Thu, 21 Aug 2014 08:29:04 -0400 Received: by mail-la0-f41.google.com with SMTP id s18so8602182lam.0 for ; Thu, 21 Aug 2014 05:29:03 -0700 (PDT) In-Reply-To: <53F5DD2B.6080808@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: --Apple-Mail=_C1A752EB-6EF9-4899-BD3D-D3AE1D6D64E5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Aug 21, 2014, at 2:51 PM, Paolo Bonzini 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. >>=20 >> 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. >>=20 >> FOPCODE compatibility can be used to analyze program performance by = recording >> the last instruction executed before FSAVE/FSTENV/FXSAVE. >>=20 >> 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. >=20 > 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. >=20 No, it=92s 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 --Apple-Mail=_C1A752EB-6EF9-4899-BD3D-D3AE1D6D64E5 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQEcBAEBCgAGBQJT9eYJAAoJEHlOP0Zr1lTYOMMH/RoxIjpxl21d5YgyOTXuw5Ul 14no3WN24Nu3bGbONiJPZxTEqsf+GWcjmJvvN94dl9tuhwjYzmtCay6EpINOiRrr lepCFx9P/ZRmqiauaQvAECtILQ0UdoYrOAF/yHYICVRMs7fIJbZvWMrMl6PGYe2P BeGoqjeXVLRZezhVTRSRiLjFhViJRUSN2Lm3OLi5LT/GDPohftQH4a86yMMt1ckY J20iRU0Wjpj/vdNYfPpbWCvOvJadwBmbdGOOiMITYwuj9r5LM/x/UL6UnLe5f8oG iRLnfDjF42NimVZTRWaJHBUc0NtECHA4y0qANbmSh9sJF6Obi14uoU3ly9RNAtE= =xjz4 -----END PGP SIGNATURE----- --Apple-Mail=_C1A752EB-6EF9-4899-BD3D-D3AE1D6D64E5--