From: Jan Kiszka <jan.kiszka@web.de>
To: Avi Kivity <avi@qumranet.com>
Cc: Mohammed Gamal <m.gamal005@gmail.com>,
Jan Kiszka <jan.kiszka@siemens.com>,
Anthony Liguori <anthony@codemonkey.ws>,
kvm@vger.kernel.org, Rik van Riel <riel@surriel.com>
Subject: Re: [Regression] kvm-userspace: VM freezes after booting FreeDOS
Date: Sun, 13 Jul 2008 11:09:10 +0200 [thread overview]
Message-ID: <4879C636.30003@web.de> (raw)
In-Reply-To: <4879B4AC.1070809@qumranet.com>
[-- Attachment #1: Type: text/plain, Size: 2021 bytes --]
Avi Kivity wrote:
> Jan Kiszka wrote:
>> It looks like that we should forward all #DB exceptions to the guest in
>> real mode unless we are sure they were caused by a host-injection. Here
>> is more or less a hack to achieve this (breaking guest debugging for
>> now):
>>
>> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
>> index b60fcec..a6f9c9b 100644
>> --- a/arch/x86/kvm/vmx.c
>> +++ b/arch/x86/kvm/vmx.c
>> @@ -2244,6 +2244,15 @@ static int handle_rmode_exception(struct
>> kvm_vcpu *vcpu,
>> if (((vec == GP_VECTOR) || (vec == SS_VECTOR)) && err_code == 0)
>> if (emulate_instruction(vcpu, NULL, 0, 0, 0) == EMULATE_DONE)
>> return 1;
>> + /*
>> + * Forward #DB
>> + * FIXME: Quick-hack, breaks guest debugging in real mode, will be
>> + * fixed with the required debugging infrastructure rework.
>> + */
>> + if (vec == 1) {
>>
>
> DB_VECTOR
For sure, just needs a tiny cleanup in svm.c that I had in some other
patches.
>
>> + vmx_inject_irq(vcpu, vec);
>>
>
> kvm_queue_exception()
OK.
>
>> + return 1;
>> + }
>> return 0;
>> }
>>
>
> But it seems the best thing to do is not to trap #DB in
> update_exception_bitmap()?
Was my first idea as well. I do not understand what is going on there,
but when I simply exclude #DB from the exception bitmap in real mode,
the problem pops up again: #GP on the instruction that should raise the #DB.
>
>> /me now wonders if there are not even more exceptions that have to be
>> forwarded. Right now we catch them all, but I did not find some path
>> via which actual ones are pushed to the guest.
>
> Looks like update_exception_bitmap() assumes none. From a cursory look,
> seems like #DE (divide error), #DB, #BP (Breakpoint), #OF (overflow),
> #BR (range check) all need to be passed to the guest.
Hmm, unless KVM did something to fix up some exception, shouldn't all of
them be passed?
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
next prev parent reply other threads:[~2008-07-13 9:09 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-10 15:47 [Regression] kvm-userspace: VM freezes after booting FreeDOS Mohammed Gamal
2008-07-10 15:48 ` Mohammed Gamal
2008-07-10 16:31 ` Anthony Liguori
2008-07-10 19:52 ` Mohammed Gamal
2008-07-10 20:02 ` Anthony Liguori
2008-07-10 20:32 ` Mohammed Gamal
2008-07-10 20:33 ` Mohammed Gamal
2008-07-10 21:22 ` Jan Kiszka
2008-07-10 22:59 ` Mohammed Gamal
2008-07-11 10:53 ` Jan Kiszka
2008-07-11 14:55 ` Mohammed Gamal
2008-07-12 11:19 ` Jan Kiszka
2008-07-13 7:54 ` Avi Kivity
2008-07-13 9:09 ` Jan Kiszka [this message]
2008-07-13 9:26 ` Mohammed Gamal
2008-07-13 10:08 ` Avi Kivity
2008-07-13 9:55 ` 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=4879C636.30003@web.de \
--to=jan.kiszka@web.de \
--cc=anthony@codemonkey.ws \
--cc=avi@qumranet.com \
--cc=jan.kiszka@siemens.com \
--cc=kvm@vger.kernel.org \
--cc=m.gamal005@gmail.com \
--cc=riel@surriel.com \
/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