From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: compilation on ubuntu 32 bit host? Date: Tue, 14 Nov 2006 17:39:19 +0200 Message-ID: <4559E327.7020506@qumranet.com> References: <4559C9D7.2050107@qumranet.com> <4559D38A.9080802@qumranet.com> <4559DD41.4010305@qumranet.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000509000206070706030803" Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Return-path: To: Gildas In-Reply-To: <4559DD41.4010305-atKUWr5tajBWk0Htik3J/w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org This is a multi-part message in MIME format. --------------000509000206070706030803 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Avi Kivity wrote: > Avi Kivity wrote: >> Gildas wrote: >>> >>> I'll test it happily >> >> attached. >> > > [failed live on IRC] > [did not apply] new patch attached -- error compiling committee.c: too many arguments to function --------------000509000206070706030803 Content-Type: text/x-patch; name="kvm-test-bios-vmx-on-all-cpus-3.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="kvm-test-bios-vmx-on-all-cpus-3.patch" --- ./kvm_main.c.old 2006-11-14 17:35:50.000000000 +0200 +++ ./kvm_main.c 2006-11-14 17:37:31.000000000 +0200 @@ -518,12 +518,24 @@ return 0; } -static __init int vmx_disabled_by_bios(void) +static int vmx_disabled; + +static __init void __vmx_disabled_by_bios(void *garbage) { u64 msr; rdmsrl(MSR_IA32_FEATURE_CONTROL, msr); - return (msr & 5) == 1; /* locked but not enabled */ + if ((msr & 5) == 1) { /* locked but not enabled */ + vmx_disabled = 1; + smp_wmb(); + } +} + +static __init int vmx_disabled_by_bios(void) +{ + on_each_cpu(__vmx_disabled_by_bios, 0, 0, 1); + smp_rmb(); + return vmx_disabled; } static __init void kvm_enable(void *garbage) @@ -531,13 +543,32 @@ int cpu = raw_smp_processor_id(); u64 phys_addr = __pa(per_cpu(vmxarea, cpu)); u64 old; + u64 cr0f0, cr0f1, cr4f0, cr4f1; rdmsrl(MSR_IA32_FEATURE_CONTROL, old); if ((old & 5) == 0) /* enable and lock */ wrmsrl(MSR_IA32_FEATURE_CONTROL, old | 5); write_cr4(read_cr4() | CR4_VMXE); /* FIXME: not cpu hotplug safe */ + printk(KERN_ERR "enabling vmx on cpu %d\n", raw_smp_processor_id()); + printk(KERN_ERR "cr0 %lx cr4 %lx phys_addr %llx\n", + read_cr0(), read_cr4(), phys_addr); + +#define MSR_IA32_VMX_CR0_FIXED0 0x486 +#define MSR_IA32_VMX_CR0_FIXED1 0x487 + +#define MSR_IA32_VMX_CR4_FIXED0 0x488 +#define MSR_IA32_VMX_CR4_FIXED1 0x489 + + rdmsrl(MSR_IA32_VMX_CR0_FIXED0, cr0f0); + rdmsrl(MSR_IA32_VMX_CR0_FIXED1, cr0f1); + rdmsrl(MSR_IA32_VMX_CR4_FIXED0, cr4f0); + rdmsrl(MSR_IA32_VMX_CR4_FIXED1, cr4f1); + printk(KERN_ERR "cr0 fixed %llx %llx\n", cr0f0, cr0f1); + printk(KERN_ERR "cr4 fixed %llx %llx\n", cr4f0, cr4f1); + printk(KERN_ERR "doing it now!\n"); asm volatile (ASM_VMX_VMXON_RAX : : "a"(&phys_addr) : "memory", "cc"); + printk(KERN_ERR "done\n"); } static void kvm_disable(void *garbage) --------------000509000206070706030803 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 --------------000509000206070706030803 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --------------000509000206070706030803--