From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH]: Fix MSR_K7_EVNTSEL{0,3} for SVM Date: Thu, 24 Apr 2008 10:35:49 +0300 Message-ID: <48103855.70006@qumranet.com> References: <480F7E92.6030709@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel@lists.sourceforge.net To: Chris Lalancette Return-path: In-Reply-To: <480F7E92.6030709@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org Chris Lalancette wrote: > Avi, Joerg, > While trying to boot a RHEL-4 guest on latest KVM tip on an AMD machine, I > found that the guest would consistently crash when trying to setup the NMI > watchdog. I traced it down to the following commit: > > 51ef1ac7b23ee32bfcc61c229d634fdc1c68b38a > > It seems that in that commit, the K7_EVNTSEL MSR's were set to fail if the data > != 0. That test is actually fine, the problem is how the code around it is > generated. That is, we are only supposed to go to unhandled if data != 0; but > for some reason, we are *always* going to unhandled, even when the data == 0. > That causes RHEL-4 kernel to crash. If I rearrange the code to look like this: > > case MSR_K7_EVNTSEL0: > case MSR_K7_EVNTSEL1: > case MSR_K7_EVNTSEL2: > case MSR_K7_EVNTSEL3: > > if (data != 0) > return kvm_set_msr_common(vcpu, ecx, data); > > default: > return kvm_set_msr_common(vcpu, ecx, data); > } > > Then everything works again. A patch that does just this is attached. It might > be slightly nicer to say "if (data == 0) return 0" and then just fall through to > the default case, but I don't much care either way. > You mean the gcc generates wrong code? It seems fine here (though wonderfully obfuscated). Can you attach an objdump -Sr svm.o? Also, what gcc version are you using? -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone