From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH v2 0/2] kvm: x86: Emulate MSR_PLATFORM_INFO Date: Thu, 20 Jun 2013 10:34:39 +0200 Message-ID: <51C2BE9F.4030605@redhat.com> References: <1370361738-4277-1-git-send-email-bsd@redhat.com> <20130605084213.GQ4725@redhat.com> <51C06914.1090904@redhat.com> <20130618151652.GA21032@redhat.com> <20130618154045.GD21032@redhat.com> <20130620073151.GU5832@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Bandan Das , kvm@vger.kernel.org, Marcelo Tosatti , "Nakajima, Jun" To: Gleb Natapov Return-path: Received: from mail-qe0-f45.google.com ([209.85.128.45]:45550 "EHLO mail-qe0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754012Ab3FTIer (ORCPT ); Thu, 20 Jun 2013 04:34:47 -0400 Received: by mail-qe0-f45.google.com with SMTP id w7so3772651qeb.4 for ; Thu, 20 Jun 2013 01:34:47 -0700 (PDT) In-Reply-To: <20130620073151.GU5832@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Il 20/06/2013 09:31, Gleb Natapov ha scritto: >> I agree with you on the potential problems but I think we are completely >> ignoring the "non-migration" use case. These users will probably benefit >> from a correct value of (virtual) msr_platform_info. And it appears, the >> easiest way to give both options to the user is using a new module_param, >> say ignore_platform_info. >> > Migration is important part of virtualization. PMU emulation currently > is in demo status because migration is not implemented yet, but at least > it is possible to implement it. But there's a lot more to do for migration than just moving the MSR contents from one machine to another. We need to support customizing the values of CPUID leaf 0ah, so that PMU migration can work if you specify "lowest common denominator" CPU models. I haven't looked at it yet because QEMU support for this is not in sight. >> Scenarios : >> 1. ignore_platform_info = 0 (Default). Inject #GP if application tries to >> read this MSR. >> 2. ignore_platform_info = 1. User wants to read the calculated value, her >> environment doesn't require migration. >> 3. ignore_msrs = 1. If this is set, we always return 0 and application will >> hopefully resort to a workaround. >> > Module flag is global for all VMs on a host. Implementing it like this > will guaranty that the feature will not be used in production ever. > ignore_msrs exists only for developers to quickly check if a problem goes > away if some MSR does not #GP, never as a real solution. > > To make it somewhat useful the flag should be per-vm and exposed to all > layers up to a management. Management is the one who enables it per VM > basis and guaranties that VM with the feature enabled is never live > migrated. Frankly IMO it will be another management knob that will never > be set. I agree. I think it's fine to apply Bandan's patches. It's just one more thing to care about when migrating machines that use the PMU. And I hope that Intel will add TSC scaling sooner or later, which will fix the issue automatically. Hear, Jun! :) Paolo