Joerg Roedel wrote: > From: Markus Rechberger <[EMAIL PROTECTED]> > From: Joerg Roedel <[EMAIL PROTECTED]> > > 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. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- 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 _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel