Re: compilation on ubuntu 32 bit host?

Avi Kivity
2006-11-14T15:39:19Z

[-- Attachment #1: Type: text/plain, Size: 233 bytes --]

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

[-- Attachment #2: kvm-test-bios-vmx-on-all-cpus-3.patch --]
[-- Type: text/x-patch, Size: 1830 bytes --]

--- ./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)

[-- Attachment #3: Type: text/plain, Size: 373 bytes --]

-------------------------------------------------------------------------
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

[-- Attachment #4: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org