From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: nitin.a.kamble-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Cc: kvm-devel
<kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
Laurent Vivier <Laurent.Vivier-6ktuUTfB/bM@public.gmane.org>
Subject: Re: [PATCH] (big) real mode emulation - initialization fixes
Date: Fri, 14 Sep 2007 20:08:47 +0300 [thread overview]
Message-ID: <46EAC01F.7040609@qumranet.com> (raw)
In-Reply-To: <1189729357.28738.33.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
Nitin A Kamble wrote:
> Hi Avi,
> Attached is the patch to initialize src.val & dst.val. Without this,
> certain instructions are getting affected in their emulation.
>
> Please apply.
>
>
This seems like it is papering over other bugs. Some instructions use
src.val or dst.val without having decoded the src or dst operand.
Which instructions are these? Can we fix them instead?
> Intialize src.val & dst.val, to fix bugs in certain instruction emulations.
>
> Signed-off-by: Nitin A Kamble <nitin.a.kamble-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>
> diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
> index c2540c3..90ee392 100644
> --- a/drivers/kvm/x86_emulate.c
> +++ b/drivers/kvm/x86_emulate.c
> @@ -832,6 +832,7 @@ done_prefixes:
> srcmem_common:
> src.type = OP_MEM;
> src.ptr = (unsigned long *)cr2;
> + src.val = 0;
> if ((rc = ops->read_emulated((unsigned long)src.ptr,
> &src.val, src.bytes, ctxt->vcpu)) != 0)
> goto done;
> @@ -896,6 +897,7 @@ done_prefixes:
> dst.type = OP_MEM;
> dst.ptr = (unsigned long *)cr2;
> dst.bytes = (d & ByteOp) ? 1 : op_bytes;
> + dst.val = 0;
> if (d & BitOp) {
> unsigned long mask = ~(dst.bytes * 8 - 1);
>
>
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
next prev parent reply other threads:[~2007-09-14 17:08 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1188349132.9270.7.camel@lnitindesktop.sc.intel.com>
[not found] ` <20070829020005.GA32726@jim.sh>
[not found] ` <20070829020005.GA32726-lSbMZ+N7itA@public.gmane.org>
2007-09-01 14:10 ` [PATCH] (big) real mode emulation - push imm8 Avi Kivity
[not found] ` <1188349132.9270.7.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-09-12 7:54 ` Avi Kivity
[not found] ` <46E79B2A.60506-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-09-12 8:16 ` Laurent Vivier
[not found] ` <46E7A073.6030601-6ktuUTfB/bM@public.gmane.org>
2007-09-12 8:28 ` Avi Kivity
[not found] ` <46E7A317.208-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-09-13 0:36 ` Kamble, Nitin A
[not found] ` <47DF6B76DC88174EB18F2393E76FC46EB20712F4@scsmsx412.amr.corp.intel.com>
[not found] ` <47DF6B76DC88174EB18F2393E76FC46EB20712F4-1a9uaKK1+wJcIJlls4ac1rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-09-13 18:15 ` Nitin A Kamble
[not found] ` <1189707324.28738.0.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-09-13 18:28 ` Nitin A Kamble
[not found] ` <1189708119.28738.5.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-09-15 7:13 ` Avi Kivity
2007-09-13 18:55 ` [PATCH] (big) real mode emulation - jump conditional relative Nitin A Kamble
[not found] ` <1189709705.28738.9.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-09-13 20:48 ` Anthony Liguori
[not found] ` <46E9A215.9020304-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-09-13 20:53 ` Kamble, Nitin A
2007-09-13 23:18 ` [PATCH] (big) real mode emulation - jump conditional short relative Nitin A Kamble
[not found] ` <1189725509.28738.12.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-09-13 23:26 ` [PATCH] (big) real mode emulation - or instruction correction Nitin A Kamble
[not found] ` <1189725983.28738.15.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-09-13 23:36 ` [PATCH] (big) real mode emulation - sub imm Nitin A Kamble
[not found] ` <1189726560.28738.18.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-09-13 23:47 ` [PATCH] (big) real mode emulation - cmp correction Nitin A Kamble
[not found] ` <1189727241.28738.21.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-09-13 23:54 ` [PATCH] (big) real mode emulation - mov correction Nitin A Kamble
[not found] ` <1189727640.28738.24.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-09-14 0:02 ` [PATCH] (big) real mode emulation - lea Nitin A Kamble
[not found] ` <1189728138.28738.27.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-09-14 0:15 ` [PATCH] (big) real mode emulation - mov imm Nitin A Kamble
[not found] ` <1189728902.28738.31.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-09-14 0:22 ` [PATCH] (big) real mode emulation - initialization fixes Nitin A Kamble
[not found] ` <1189729357.28738.33.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-09-14 0:40 ` [PATCH] (big) real mode emulation - popf Nitin A Kamble
[not found] ` <1189730445.28738.36.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-09-14 18:20 ` [PATCH] (big) real mode emulation - jmp abs Nitin A Kamble
[not found] ` <1189794045.28738.47.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-09-14 18:43 ` [PATCH] (big) real mode emulation - inc reg Nitin A Kamble
[not found] ` <1189795407.28738.50.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-09-14 18:50 ` [PATCH] (big) real mode emulation - dec reg Nitin A Kamble
[not found] ` <1189795841.28738.53.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-09-18 22:14 ` [PATCH] (big) real mode emulation - correct code placement Nitin A Kamble
[not found] ` <1190153661.4620.3.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-09-19 12:12 ` Avi Kivity
2007-09-15 7:39 ` [PATCH] (big) real mode emulation - inc reg Avi Kivity
2007-09-15 7:41 ` [PATCH] (big) real mode emulation - jmp abs Avi Kivity
2007-09-15 7:45 ` [PATCH] (big) real mode emulation - popf Avi Kivity
2007-09-14 17:08 ` Avi Kivity [this message]
[not found] ` <46EAC01F.7040609-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-09-14 17:33 ` [PATCH] (big) real mode emulation - initialization fixes Nitin A Kamble
[not found] ` <1189791233.28738.42.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-09-14 17:42 ` Avi Kivity
2007-09-15 7:43 ` Avi Kivity
2007-09-15 7:48 ` [PATCH] (big) real mode emulation - mov imm Avi Kivity
2007-09-15 7:36 ` [PATCH] (big) real mode emulation - lea Avi Kivity
2007-09-15 7:33 ` [PATCH] (big) real mode emulation - or instruction correction Avi Kivity
2007-09-15 7:29 ` [PATCH] (big) real mode emulation - jump conditional relative 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=46EAC01F.7040609@qumranet.com \
--to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
--cc=Laurent.Vivier-6ktuUTfB/bM@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=nitin.a.kamble-ral2JQCrhuEAvxtiuMwx3w@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