Re: kvm-59 doesn't work

Izik Eidus
2008-01-23T13:18:34Z

[-- Attachment #1: Type: text/plain, Size: 637 bytes --]

Andi Kleen wrote:
> On Tue, Jan 15, 2008 at 12:56:52PM +0200, Avi Kivity wrote:
>
>> Andi Kleen wrote:
>>
>>> FWIW it seems things are broken even without -kernel in -59 too. If I try
>>> to boot an existing image with just -hda ... the VGA screen just stays
>>> black while the process runs at 99% CPU. Again with -49 it works fine.
>>>
>>>
>>>
>> Yes, 6b8bb99a9cde386d72b4b7c22b92f4bdec333dab in kvm-userspace.git ought
>> to fix it.
>>
>
> Thanks will try later. How about the oops in 2.6.24 I reported though?
>
> -Andi
>
>
the bellow patch should fix this opss
(it is targeted for 2.6.24-rc7)

--
woof.

[-- Attachment #2: fix-decode.patch --]
[-- Type: text/x-patch, Size: 1815 bytes --]

>From cb019c68bea9955d553c3ef6946e3abed357f1c2 Mon Sep 17 00:00:00 2001
From: Izik Eidus <izike-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Date: Wed, 23 Jan 2008 15:16:26 +0200
Subject: [PATCH] KVM: x86 emulator: fix decoding of registers to dst and src in case of
instructions that declared as SrcMem or DstMem,

right now for instructions that declared as SrcMem or DstMem we dont decode
the registers for dst and src.

Signed-off-by: Izik Eidus <izike-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
---
drivers/kvm/x86_emulate.c | 31 ++++++++++++++++++++++++++++++-
1 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index bd46de6..c5251f4 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -830,7 +830,21 @@ done_prefixes:
*/
if ((d & ModRM) && modrm_mod == 3) {
src.type = OP_REG;
- break;
+ src.ptr = decode_register(modrm_reg, _regs, 0);
+ switch ((src.bytes = op_bytes)) {
+ case 1:
+ src.val = src.orig_val = *(u8 *) src.ptr;
+ break;
+ case 2:
+ src.val = src.orig_val = *(u16 *) src.ptr;
+ break;
+ case 4:
+ src.val = src.orig_val = *(u32 *) src.ptr;
+ break;
+ case 8:
+ src.val = src.orig_val = *(u64 *) src.ptr;
+ break;
+ }
}
src.type = OP_MEM;
src.ptr = (unsigned long *)cr2;
@@ -906,6 +920,21 @@ done_prefixes:
*/
if ((d & ModRM) && modrm_mod == 3) {
dst.type = OP_REG;
+ dst.ptr = decode_register(modrm_reg, _regs, 0);
+ switch ((dst.bytes = op_bytes)) {
+ case 1:
+ dst.val = *(u8 *)dst.ptr;
+ break;
+ case 2:
+ dst.val = *(u16 *)dst.ptr;
+ break;
+ case 4:
+ dst.val = *(u32 *)dst.ptr;
+ break;
+ case 8:
+ dst.val = *(u64 *)dst.ptr;
+ break;
+ }
break;
}
if (d & BitOp) {
--
1.5.3.6

[-- Attachment #3: Type: text/plain, Size: 228 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

[-- Attachment #4: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org