qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	qemu-devel@nongnu.org
Cc: "Michael Mueller" <mimu@linux.vnet.ibm.com>,
	kvm@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>,
	"Christian Borntraeger" <borntraeger@de.ibm.com>,
	"Gabriel L. Somlo" <gsomlo@gmail.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Jason J. Herne" <jjherne@linux.vnet.ibm.com>,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [RFC 0/2] GET_EMULATED_CPUID support with "allow-emulation" option
Date: Thu, 05 Jun 2014 18:40:25 +0200	[thread overview]
Message-ID: <53909D79.1070609@suse.de> (raw)
In-Reply-To: <53909A41.1060800@redhat.com>


On 05.06.14 18:26, Paolo Bonzini wrote:
> Il 05/06/2014 18:24, Alexander Graf ha scritto:
>>
>> On 05.06.14 18:12, Eduardo Habkost wrote:
>>> This implements GET_SUPPORTED_CPUID support using an explicit option
>>> for it:
>>> "allow-emulation". We don't want any emulated feature to be enabled by
>>> accident,
>>> so they will be enabled only if the user explicitly wants to allow 
>>> them.
>>
>> So is this an all-or-nothing approach? I would really prefer to override
>> individual bits.
>
> You can still disable them with "cpu foo,-movbe,allow-emulation".
>
>> Also, I don't think the line "emulated" is the right one to draw. We
>> "emulate" SVM or VMX too, but still enable them by default as soon as we
>> think they're ready enough.
>
> Well, I disagreed with the whole KVM_GET_EMULATED_CPUID concept for 
> MOVBE too for example.  It seemed overengineered to me, sooner or 
> later we might graduate MOVBE out of KVM_GET_EMULATED_CPUID as well.
>
> However, for MONITOR/MWAIT it makes some sense.

I honestly think what we want for MONITOR/MWAIT is a cpuid-override bit.

   cpuid = user_specified_cpuids();
   cpuid &= kvm_capable_cpuids()
   cpuid |= user_override_cpuids();

   kvm_set_cpuid(cpuid);

If the user knows what he's doing, he can set the force bit. If the 
kernel happens to emulate that instruction, he's happy. If the kernel 
doesn't emulate it, it will fail and he will realize that he did 
something stupid.

But ok, we do have this awesome GET_EMULATE_CPUID ioctl now, so we can 
as well use it - even though I consider it superfluous:

   cpuid = user_specified_cpuids();
   cpuid &= kvm_capable_cpuids()
   cpuid |= user_override_cpuids() & kvm_emulated_cpuid();

   kvm_set_cpuid(cpuid);

but enabling all experimental features inside KVM just because we want 
one or two of them is very counter-intuitive. Imagine we'd introduce 
emulation support for AVX. Suddenly allow-emulation (which I'd need for 
Mac OS X 10.5) would enable AVX as well which I really don't want enabled.

Also, while we can't change the ioctl name anymore, please let's use 
"experimental" rather than "emulated" as the name everywhere. Maybe 
we'll never bump individual features from experimental to fully 
supported, but there's no reason we wouldn't have emulated features that 
are not part of this bitmap and there's no reason we wouldn't have real 
hardware features that are not ready yet and part of this bitmap.


Alex

  reply	other threads:[~2014-06-05 16:40 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05 16:12 [Qemu-devel] [RFC 0/2] GET_EMULATED_CPUID support with "allow-emulation" option Eduardo Habkost
2014-06-05 16:12 ` [Qemu-devel] [RFC 1/2] kvm: Implement kvm_arch_get_emulated_cpuid() Eduardo Habkost
2014-06-05 16:12 ` [Qemu-devel] [RFC 2/2] target-i386: Add "allow-emulation" X86CPU property Eduardo Habkost
2014-06-05 19:57   ` [Qemu-devel] [RFC 2/2 v2] target-i386: Add "x-allow-emulation" " Eduardo Habkost
2014-06-05 22:27     ` Alexander Graf
2014-06-05 16:24 ` [Qemu-devel] [RFC 0/2] GET_EMULATED_CPUID support with "allow-emulation" option Alexander Graf
2014-06-05 16:26   ` Paolo Bonzini
2014-06-05 16:40     ` Alexander Graf [this message]
2014-06-05 16:44       ` Paolo Bonzini
2014-06-05 16:45         ` Alexander Graf
2014-06-05 16:52           ` Paolo Bonzini
2014-06-05 16:54             ` Alexander Graf
2014-06-05 16:57               ` Paolo Bonzini
2014-06-05 17:19                 ` Eduardo Habkost
2014-06-05 17:39                   ` Paolo Bonzini
2014-06-05 18:02                     ` Eduardo Habkost
2014-06-05 19:12                       ` Eduardo Habkost
2014-06-05 19:24                         ` Borislav Petkov
2014-06-05 19:45                           ` Eric Blake
2014-06-05 19:52                             ` Eduardo Habkost
2014-06-05 16:58             ` Alexander Graf
2014-06-05 17:48               ` Eduardo Habkost
2014-06-05 22:24                 ` Alexander Graf
2014-06-06  1:21                   ` Borislav Petkov
2014-06-06  2:37                     ` Eduardo Habkost
2014-06-06 11:16                       ` Alexander Graf
2014-06-06 18:38                         ` Eduardo Habkost
2014-06-05 17:17           ` Eduardo Habkost
2014-06-05 17:38             ` Paolo Bonzini
2014-06-05 17:52               ` Eduardo Habkost
2014-06-05 17:34       ` Eduardo Habkost
2014-06-06 13:29     ` gleb
2014-06-05 18:11   ` Eduardo Habkost

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=53909D79.1070609@suse.de \
    --to=agraf@suse.de \
    --cc=afaerber@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=bp@alien8.de \
    --cc=ehabkost@redhat.com \
    --cc=gsomlo@gmail.com \
    --cc=jjherne@linux.vnet.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=mimu@linux.vnet.ibm.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).