On Tue, Apr 16, 2013 at 01:47:46PM +0200, Paolo Bonzini wrote: > Il 10/04/2013 12:08, Gleb Natapov ha scritto: > >> > What is the opinion from the KVM folks on this? Shall we start to > >> > emulate instructions the host does not provide? In this particular case > >> > a relatively simple patch fixes a problem (starting Atom optimized > >> > kernels on non-Atom machines). > > We can add the emulation, but we should not start announcing the instruction > > availability to a guest if host cpu does not have it by default. This > > may trick a guest into thinking that movbe is the fastest way to do > > something when it is not. > > > > This does highlight a weakness in CPU_GET_SUPPORTED_CPUID, but I think > this is not a problem in practice. > > With a management layer such as oVirt it's not a problem. For example, > oVirt has its own library of processors. It doesn't care if KVM enables > movbe. If you tell it your datacenter is a mix of Haswells and Sandy > Bridges it will pick the CPUID bits that are common to all. > > However, even without a suitable management layer it is also not really > a problem. > > The only processors that support MOVBE are Atom and Haswell. Haswell > adds a whole lot of extra CPUID features, hence "-cpu Haswell,enforce" > will fail with or without movbe emulation. "-cpu Haswell" will disable > all Haswell new features except movbe will remain slow; that's fine, I > think, anyway it's not what you'ld do except to play with CPU models. > No that's not fine. KVM should not trick userspace (QEMU is just one of them) into nonoptimal configuration. And you forgot about -cpu host in your analysis. -- Gleb. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html