public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Joerg Roedel <joerg.roedel-5C7GfCeVMHo@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	Waba <waba-QpUHywXCggs@public.gmane.org>
Subject: Re: Solaris 10 doesn't work under KVM
Date: Sun, 04 Feb 2007 11:50:39 +0200	[thread overview]
Message-ID: <45C5AC6F.4070506@qumranet.com> (raw)
In-Reply-To: <20070202191942.GB8804-5C7GfCeVMHo@public.gmane.org>

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

Joerg Roedel wrote:
> On Thu, Feb 01, 2007 at 10:49:24PM +0100, Waba wrote:
>   
>> On Mon, Jan 29, 2007 at 01:49:06PM +0200, Avi Kivity wrote:
>>     
>>> The attached patch should fix it.
>>>       
>> Update for those who wouldn't have followed IRC meanwhile: this patch
>> does fix the bug for Opteron-based systems, but doesn't improve anything
>> on my X2 4600+. Avi therefore suggests that someone (_joro?) with
>> knowledge and access to an X2 has a look at it.
>>     
>
> I was able to reproduce the bug on a SVM machine here and did some
> deeper research. I intercepted the #UD exception and printed out the
> opcode. This opcode was all zero in the first time and changed randomly
> to other undefined values. I also saved the last exit code before the UD
> intercept and that was a PF intercept. The guest is in 32 bit PAE mode
> when this happens.
> Regarding this research I assume this bug is not SVM related, I think
> something in the MMU goes wrong here.
>
>   

kvm-trunk has a fix for this which is both mmu and svm related, see 
revision 4348.  It seems to fix the exact same problem on opterons but 
not on the athlons.

Waba, can you apply the attached patch and post dmesg after the error 
occurs?  (it also has a small fix which may help).


-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


[-- Attachment #2: kvm-cr0-wp-test.patch --]
[-- Type: text/x-patch, Size: 1248 bytes --]

Index: svm.c
===================================================================
--- svm.c	(revision 4382)
+++ svm.c	(working copy)
@@ -553,7 +553,7 @@
 	 * cr0 val on cpu init should be 0x60000010, we enable cpu
 	 * cache by default. the orderly way is to enable cache in bios.
 	 */
-	save->cr0 = 0x00000010 | CR0_PG_MASK;
+	save->cr0 = 0x00000010 | CR0_PG_MASK | CR0_WP_MASK;
 	save->cr4 = CR4_PAE_MASK;
 	/* rdx = ?? */
 }
@@ -1430,6 +1430,17 @@
 	asm volatile ("mov %0, %%dr3" : : "r"(db_regs[3]));
 }
 
+static void check_cr0_wp(struct kvm_vcpu *vcpu, const char *where)
+{
+	static int last_cr0_wp = -1;
+	int cr0_wp;
+
+	cr0_wp = !!(vcpu->svm->vmcb->save.cr0 & CR0_WP_MASK);
+	if (cr0_wp != last_cr0_wp)
+		printk("cr0_wp: %d (%s)\n", cr0_wp, where);
+	last_cr0_wp = cr0_wp;
+}
+
 static int svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 {
 	u16 fs_selector;
@@ -1463,6 +1474,8 @@
 	fx_save(vcpu->host_fx_image);
 	fx_restore(vcpu->guest_fx_image);
 
+	check_cr0_wp(vcpu, "before");
+
 	asm volatile (
 #ifdef CONFIG_X86_64
 		"push %%rbx; push %%rcx; push %%rdx;"
@@ -1572,6 +1585,8 @@
 #endif
 		: "cc", "memory" );
 
+	check_cr0_wp(vcpu, "after");
+
 	fx_save(vcpu->guest_fx_image);
 	fx_restore(vcpu->host_fx_image);
 

[-- Attachment #3: Type: text/plain, Size: 374 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:[~2007-02-04  9:50 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-28 14:40 Solaris 10 doesn't work under KVM Waba
2007-01-28 17:38 ` Michael Riepe
     [not found]   ` <45BCDF8C.1000508-0QoEqw4nQxo@public.gmane.org>
2007-01-28 18:28     ` Waba
2007-01-28 19:27 ` Avi Kivity
     [not found]   ` <45BCF91E.2030704-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-28 20:25     ` Anthony Liguori
2007-01-28 22:23     ` Waba
2007-01-29  8:28       ` Avi Kivity
     [not found]         ` <45BDB03B.8000305-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-29  9:40           ` Avi Kivity
2007-01-29 11:49 ` Avi Kivity
     [not found]   ` <45BDDF32.3010607-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-02-01 21:49     ` Waba
2007-02-02 19:19       ` Joerg Roedel
     [not found]         ` <20070202191942.GB8804-5C7GfCeVMHo@public.gmane.org>
2007-02-04  9:50           ` Avi Kivity [this message]
2007-02-04 18:31           ` Waba
2007-02-07  9:42             ` Avi Kivity
     [not found]               ` <45C99EE9.3010306-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-02-07 23:04                 ` Waba
2007-02-08  9:27                   ` Avi Kivity
     [not found]                     ` <45CAECEB.4000701-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-02-08  9:58                       ` Joerg Roedel
     [not found]                         ` <20070208095816.GA5204-5C7GfCeVMHo@public.gmane.org>
2007-02-08 10:04                           ` Avi Kivity
     [not found]                             ` <45CAF5C6.8020104-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-02-08 10:19                               ` Joerg Roedel
     [not found]                                 ` <20070208101945.GB5204-5C7GfCeVMHo@public.gmane.org>
2007-02-08 10:39                                   ` Avi Kivity
     [not found]                                     ` <45CAFDF6.4020402-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-02-08 11:00                                       ` Cyril Plisko
     [not found]                                         ` <c7dddeaa0702080300i31eb933fjfcdb4570f82b0a79-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-02-08 12:21                                           ` Avi Kivity
     [not found]                                             ` <45CB15E3.7010803-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-02-08 13:45                                               ` Cyril Plisko
2007-02-08 14:45                                               ` Joerg Roedel
     [not found]                                                 ` <20070208144530.GC5204-5C7GfCeVMHo@public.gmane.org>
2007-02-08 14:58                                                   ` Cyril Plisko
2007-02-10 13:34                       ` Waba
2007-02-11  9:14                         ` Avi Kivity
     [not found]                           ` <45CEDE92.4090204-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-02-11 10:43                             ` Waba
2007-02-11 10:58                               ` Avi Kivity
2007-02-12  9:48                         ` Avi Kivity
     [not found]                           ` <45D03801.4040006-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-02-12 14:57                             ` Gregory Haskins
     [not found]                               ` <45D03A33.BA47.005A.0-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>
2007-02-12 17:35                                 ` Dor Laor
2007-02-13 14:06                             ` Waba
2007-02-13 14:37                               ` Avi Kivity
     [not found]                                 ` <45D1CD1F.907-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-02-13 21:44                                   ` Waba
2007-02-14 13:20                                     ` Avi Kivity
     [not found]                                       ` <45D30C92.8000808-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-02-16 12:14                                         ` Waba
2007-02-18  9:44                                           ` Avi Kivity
2007-02-12 17:58                         ` Joerg Roedel

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=45C5AC6F.4070506@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=joerg.roedel-5C7GfCeVMHo@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=waba-QpUHywXCggs@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