public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Aurelien Jarno <aurelien-rXXEIb44qovR7s880joybQ@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: KVM 29: Page fault in kernel mode while booting	GNU/kFreeBSD
Date: Wed, 25 Jul 2007 06:14:20 +0300	[thread overview]
Message-ID: <46A6C00C.8030609@qumranet.com> (raw)
In-Reply-To: <20070724231700.GD28101-OqXK5JiLQY5aJl8KAwiEcA@public.gmane.org>

Aurelien Jarno wrote:
> On Fri, Jul 20, 2007 at 09:57:55AM +0300, Avi Kivity wrote:
>   
>> Avi Kivity wrote:
>>     
>>>> Please tell me what I can do to help debugging this problem. 
>>>> Alternatively I have uploaded an image to reproduce the problem here:
>>>> http://temp.aurel32.net/kfreebsd-amd64.img.g
>>>>     
>>>>         
>>> I've downloaded the image and booted it three times using kvm HEAD. 
>>> Each time I got to the login prompt.
>>>
>>> Is this always reproducible?  Can you check with kvm HEAD (not that I
>>> think of anything that could have fixed this).
>>>
>>>   
>>>       
>> Sorry, that was on Intel.  It reproduces easily on AMD.
>>     
>
> By comparing the cases were the old and the new condition are different,
> I have found that the problem occurs for the lmsw and smsw instructions.
>   

Ah, I was looking at amd-specific instructions (vmx decodes lmsw) but
missed these two.  Good work.

> The patch below is very ugly, but it workarounds the problem.
>   

It's not ugly, it just lives in an ugly function.  But it does lack a
changelog and a signoff.

As to the ugliness, prehaps no_wb should be part of the opcode
descriptor bitmask (opcode_table and friend).

> diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
> index 21ce977..6c1523f 100644
> --- a/drivers/kvm/x86_emulate.c
> +++ b/drivers/kvm/x86_emulate.c
> @@ -1206,11 +1206,13 @@ twobyte_insn:
>  				goto cannot_emulate;
>  			*(u16 *)&_regs[modrm_rm]
>  				= realmode_get_cr(ctxt->vcpu, 0);
> +			no_wb = 1;
>  			break;
>  		case 6: /* lmsw */
>  			if (modrm_mod != 3)
>  				goto cannot_emulate;
>  			realmode_lmsw(ctxt->vcpu, (u16)modrm_val, &_eflags);
> +			no_wb = 1;
>  			break;
>  		case 7: /* invlpg*/
>
>   


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


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

  parent reply	other threads:[~2007-07-25  3:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-14 17:06 KVM 29: Page fault in kernel mode while booting GNU/kFreeBSD Aurelien Jarno
     [not found] ` <20070714170618.GB6527-OqXK5JiLQY5aJl8KAwiEcA@public.gmane.org>
2007-07-15  6:23   ` Avi Kivity
     [not found]     ` <4699BD63.8010904-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-07-15 12:11       ` Aurelien Jarno
     [not found]         ` <20070715121159.GO3941-OqXK5JiLQY5aJl8KAwiEcA@public.gmane.org>
2007-07-15 12:30           ` Avi Kivity
     [not found]             ` <469A1373.5090904-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-07-15 13:11               ` Aurelien Jarno
2007-07-18  7:46   ` Aurelien Jarno
2007-07-20  6:50   ` Avi Kivity
     [not found]     ` <46A05B23.50409-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-07-20  6:57       ` Avi Kivity
     [not found]         ` <46A05CF3.1070900-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-07-20 22:20           ` Aurelien Jarno
2007-07-24 23:17           ` Aurelien Jarno
     [not found]             ` <20070724231700.GD28101-OqXK5JiLQY5aJl8KAwiEcA@public.gmane.org>
2007-07-25  3:14               ` Avi Kivity [this message]
     [not found]                 ` <46A6C00C.8030609-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-07-25  8:19                   ` Aurelien Jarno
     [not found]                     ` <20070725081954.GA14103-OqXK5JiLQY5aJl8KAwiEcA@public.gmane.org>
2007-07-25  8:27                       ` 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=46A6C00C.8030609@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=aurelien-rXXEIb44qovR7s880joybQ@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