From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 0/2] kvm: disable virtualization on kdump Date: Thu, 30 Oct 2008 09:52:17 +0200 Message-ID: <490967B1.3040209@redhat.com> References: <4904676F.3020706@redhat.com> <490487C1.1010707@redhat.com> <20081026213927.GF23893@blackpad> <49058645.9010005@redhat.com> <20081027122808.GH23893@blackpad> <4905C9ED.807@redhat.com> <20081028194530.GK23893@blackpad> <49082FD0.3040009@redhat.com> <4908975A.7050900@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Eduardo Habkost , Simon Horman , kexec@lists.infradead.org, kvm@vger.kernel.org, Andrew Morton , Vivek Goyal , Haren Myneni To: "Eric W. Biederman" Return-path: Received: from mx2.redhat.com ([66.187.237.31]:59100 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753177AbYJ3HwR (ORCPT ); Thu, 30 Oct 2008 03:52:17 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Eric W. Biederman wrote: > Avi Kivity writes: > > >> Eric W. Biederman wrote: >> >>> Most of the reason I was wondering is that the cpu hardware probing >>> largely seems to be a duplicate of what we have in the core for >>> probing cpu capabilities already, and could likely be made smaller >>> by building upon the existing codebase. >>> >>> >>> >> We use the core cpuid functions, or are you referring to something else? >> > > I was referring to the arch/x86/kernel/cpu/* > and arch/x86/include/asm/cpufeature.h > > The core functions that are responsible for detecting all of the cpu features, > and disabling them if there are cpu errata. > > The usual pattern is that code does all of the magic detection logic and > then the code that would use it would just need to test: cpu_has_vmx or cpu_has_svm. > > vmx is much more complicated than that, with some features define in read-only msrs. > At least in part that allows us to show the working cpu features in /proc/cpuinfo. > > Yes that's a problem now; you can only tell if you have vmx or not, without any information as to the various vmx subfeatures. > Cool. I forget if we have to test for EFER on 32bit, or if we can just wrmsr > and be done with it. Regardless that sounds easy to do on the kexec path. > if (cpu_has_svm()) disable_svme(); -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.