From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 4/6] Implement Hyper-V MSRs Date: Sun, 17 May 2009 12:54:53 +0300 Message-ID: <4A0FDEED.9020906@redhat.com> References: <1242375740-31222-1-git-send-email-agraf@suse.de> <1242375740-31222-2-git-send-email-agraf@suse.de> <1242375740-31222-3-git-send-email-agraf@suse.de> <1242375740-31222-4-git-send-email-agraf@suse.de> <1242375740-31222-5-git-send-email-agraf@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, joerg.roedel@amd.com To: Alexander Graf Return-path: Received: from mx2.redhat.com ([66.187.237.31]:36185 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750813AbZEQJy5 (ORCPT ); Sun, 17 May 2009 05:54:57 -0400 In-Reply-To: <1242375740-31222-5-git-send-email-agraf@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: Alexander Graf wrote: > Hyper-V uses some MSRs, some of which are actually reserved for BIOS usage. > > But let's be nice today and have it its way, because otherwise it fails > terribly. > > For MSRs where I could find a name I used the name, otherwise they're just > added in their hex form for now. > > Most of these are not Hyper-V MSRs. They are x86 MSRs that happen to be hit by Hyper-v. > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c > index ef43a18..30e6b43 100644 > --- a/arch/x86/kvm/svm.c > +++ b/arch/x86/kvm/svm.c > @@ -1932,6 +1932,7 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 *data) > *data = svm->hsave_msr; > break; > case MSR_VM_CR: > + case 0x40000081: > *data = 0; > break; > This probably is a Hyper-V MSR, but I don't see how it expects it to be present in real hardware. Are you sure this is really needed? > @@ -2034,6 +2035,10 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data) > case MSR_VM_HSAVE_PA: > svm->hsave_msr = data; > break; > + case MSR_VM_CR: > + case MSR_VM_IGNNE: > + case MSR_K8_HWCR: > + break; > Please add a ratelimited printk() if any value is written which would cause behaviour which we do not emulate. This will prevent a guest getting unexpected behaviour silently. -- error compiling committee.c: too many arguments to function