From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jes Sorensen Subject: Re: [PATCH] Emulate MSR_EBC_FREQUENCY_ID Date: Thu, 09 Sep 2010 10:55:28 +0200 Message-ID: <4C88A100.60503@redhat.com> References: <1284017626-30542-1-git-send-email-Jes.Sorensen@redhat.com> <4C8896FA.1040103@redhat.com> <4C889AFB.3000106@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:44920 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750895Ab0IIIza (ORCPT ); Thu, 9 Sep 2010 04:55:30 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o898tUOO002323 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 9 Sep 2010 04:55:30 -0400 In-Reply-To: <4C889AFB.3000106@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 09/09/10 10:29, Jes Sorensen wrote: > On 09/09/10 10:12, Avi Kivity wrote: >> From the spec: >> >>> 31:24 Core Clock Frequency to System >>> Bus Frequency Ratio. (R) >>> The processor core clock >>> frequency to system bus >>> frequency ratio observed at the >>> de-assertion of the reset pin. >> >> A frequency ratio of 0 might be unexpected by some guests. > > Problem with that one is that it is only for CPU models 2, 3, 4, 6. > I haven't found a way to distinguish CPU models from within KVM, but > maybe I am blind? > > Bits 31:24 are invalid on models 0 and 1. Actually scratch that - the problem is that we are trying to emulate the MSR because the guest thinks it's valid on the old CPU. However since we don't know which CPU model the guest was expecting, there really isn't a valid answer. Setting bits 31:24 to a divisor or 1 would probably be safe, but there is no guarantee that other guests might not expect the MSR to return 0 in those bits for other cases. I can spin a patch that does that, I am just not convinced it's any safer. Let me know what you prefer. Jes