Re: [PATCH try #2] kvm-12 userland guest reboot fix
Avi Kivity <
avi@...>
2007-02-01 08:25:21 GMT
Joerg Roedel wrote:
> From: Markus Rechberger <markus.rechberger@...>
> From: Joerg Roedel <joerg.roedel@...>
>
> 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
> <at> <at> -151,6 +151,9 <at> <at> 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));
>
> <at> <at> -173,9 +176,9 <at> <at> 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);
(Continue reading)