public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Hecken <dh-LcvzS2Pvy/8X0D0ZMPkEVw@public.gmane.org>
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH try #2] kvm-12 userland guest reboot fix
Date: Thu, 01 Feb 2007 10:07:56 +0100	[thread overview]
Message-ID: <epsalc$ac9$2@sea.gmane.org> (raw)
In-Reply-To: <45C1A3F1.1070803-atKUWr5tajBWk0Htik3J/w@public.gmane.org>

Avi Kivity schrieb:
> Joerg Roedel wrote:
>> From: Markus Rechberger <markus.rechberger-5C7GfCeVMHo@public.gmane.org>
>> From: Joerg Roedel <joerg.roedel-5C7GfCeVMHo@public.gmane.org>
>>
>> This patch fixes the initialization of the segment registers which
>> solves the triple fault and keyboard controller reset problems in
>> kvm/qemu guests as well as the slow grub menu interaction. The patch
>> should also work on Intel VMX now.
>>   
>> diff -upr kvm-12/qemu/target-i386/helper2.c kvm-12-reboot-fixed/qemu/target-i386/helper2.c
>> --- kvm-12/qemu/target-i386/helper2.c	2006-12-31 14:31:38.000000000 +0100
>> +++ kvm-12-reboot-fixed/qemu/target-i386/helper2.c	2007-01-23 20:24:42.265987000 +0100
>> @@ -151,6 +151,9 @@ CPUX86State *cpu_x86_init(void)
>>  void cpu_reset(CPUX86State *env)
>>  {
>>      int i;
>> +    unsigned int flags = DESC_P_MASK |
>> +                         DESC_S_MASK |
>> +                         (2 << DESC_TYPE_SHIFT);
>>  
>>      memset(env, 0, offsetof(CPUX86State, breakpoints));
>>  
>> @@ -173,9 +176,9 @@ void cpu_reset(CPUX86State *env)
>>      env->tr.flags = DESC_P_MASK;
>>      
>>      cpu_x86_load_seg_cache(env, R_CS, 0xf000, 0xffff0000, 0xffff, 0); 
>> -    cpu_x86_load_seg_cache(env, R_DS, 0, 0, 0xffff, 0);
>> -    cpu_x86_load_seg_cache(env, R_ES, 0, 0, 0xffff, 0);
>> -    cpu_x86_load_seg_cache(env, R_SS, 0, 0, 0xffff, 0);
>> +    cpu_x86_load_seg_cache(env, R_DS, 0, 0, 0xffff, flags);
>> +    cpu_x86_load_seg_cache(env, R_ES, 0, 0, 0xffff, flags);
>> +    cpu_x86_load_seg_cache(env, R_SS, 0, 0, 0xffff, flags);
>>      cpu_x86_load_seg_cache(env, R_FS, 0, 0, 0xffff, 0);
>>      cpu_x86_load_seg_cache(env, R_GS, 0, 0, 0xffff, 0);
>>   
> 
> This changes core qemu code, which may make merging our code back to 
> qemu more difficult.  It also means we need to test with -no-kvm.
> 
> Can you try making load_regs() in qemu-kvm.c detect the case of flags == 
> 0 (perhaps only if cr0.pg == 0) and changing it only then?  It should 
> have the same effect.
> 
> 
> 
Hello Avi!

I tried this patch yesterday whilst installing Windows 2003 with kvm svn
 and when the installer requested a reboot I just got this in the console:

unhandled vm exit:  0x80000021
rax 0000000000000000 rbx 0000000000000000 rcx 0000000000000000 rdx
0000000000000600
rsi 0000000000000000 rdi 0000000000000000 rsp 0000000000000000 rbp
0000000000000000
r8  0d7905c600010000 r9  b7f506e0b7f4fff4 r10 bf9d7c3008049138 r11
b7f50898b7f42e42
r12 00000001b7bbf020 r13 0000000000000001 r14 000000920804a0a2 r15
0812335c00000000
rip 000000000000fff0 rflags 00023002

My host is a Fujitsu-Siemens S7110 with Intel Core 2 Duo with Ubuntu
Feisty kernel 2.6.20 and the svn revision was 4368.

Daniel Hecken



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

  parent reply	other threads:[~2007-02-01  9:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-31 16:58 [PATCH try #2] kvm-12 userland guest reboot fix Joerg Roedel
     [not found] ` <20070131165830.GB8491-5C7GfCeVMHo@public.gmane.org>
2007-02-01  8:25   ` Avi Kivity
     [not found]     ` <45C1A3F1.1070803-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-02-01  9:07       ` Daniel Hecken [this message]
2007-02-01  9:37         ` Avi Kivity
2007-02-01 16:39       ` Joerg Roedel
     [not found]         ` <20070201163943.GB7115-5C7GfCeVMHo@public.gmane.org>
2007-02-04  8:40           ` 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='epsalc$ac9$2@sea.gmane.org' \
    --to=dh-lcvzs2pvy/8x0d0zmpkevw@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