public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Gildas <gildas.ml-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: compilation on ubuntu 32 bit host?
Date: Tue, 14 Nov 2006 17:14:09 +0200	[thread overview]
Message-ID: <4559DD41.4010305@qumranet.com> (raw)
In-Reply-To: <4559D38A.9080802-atKUWr5tajBWk0Htik3J/w@public.gmane.org>

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

Avi Kivity wrote:
> Gildas wrote:
>>
>> I'll test it happily
>
> attached.
>

[failed live on IRC]

Please try this new one.  It will display a few lines before crashing.

(revert the previous patch before)

-- 
error compiling committee.c: too many arguments to function


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

Index: kvm_main.c
===================================================================
--- kvm_main.c	(revision 3648)
+++ kvm_main.c	(working copy)
@@ -555,27 +555,58 @@
 	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)
 {
 	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), "m"(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
https://lists.sourceforge.net/lists/listinfo/kvm-devel

  parent reply	other threads:[~2006-11-14 15:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-10 12:18 compilation on ubuntu 32 bit host? Gildas
     [not found] ` <b2ace7f20611100418i6e94ed5ehaaadeda5a708009e-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2006-11-10 15:04   ` Anthony Liguori
2006-11-10 16:02   ` Avi Kivity
     [not found]     ` <4554A2A6.8020509-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-11-10 16:14       ` Gildas
     [not found]         ` <b2ace7f20611100814o8438c3dybdf9a00b5ee512d3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2006-11-10 16:29           ` Avi Kivity
2006-11-14 13:42   ` Gildas
     [not found]     ` <b2ace7f20611140542of22cf8alc7efdfd0af6be6c-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2006-11-14 13:51       ` Avi Kivity
     [not found]         ` <4559C9D7.2050107-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-11-14 13:59           ` Gildas
     [not found]             ` <b2ace7f20611140559s303a26bcr425506a2f2711390-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2006-11-14 14:16               ` Avi Kivity
     [not found]                 ` <4559CFBE.1020903-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-11-15  9:52                   ` Ubunto live cd (was: Re: compilation on ubuntu 32 bit host?) Avi Kivity
2006-11-14 14:32               ` compilation on ubuntu 32 bit host? Avi Kivity
     [not found]                 ` <4559D38A.9080802-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-11-14 15:14                   ` Avi Kivity [this message]
     [not found]                     ` <4559DD41.4010305-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-11-14 15:39                       ` Avi Kivity
2006-11-14 16:35                       ` Muli Ben-Yehuda
     [not found]                         ` <20061114163556.GA6848-k73YwwB0fHlWk0Htik3J/w@public.gmane.org>
2006-11-14 16:37                           ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4559DD41.4010305@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=gildas.ml-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox