public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [RFC PATCH] emulator: Fix task switch into/out of VM86
Date: Tue, 10 Jan 2012 10:28:06 +0100	[thread overview]
Message-ID: <4F0C04A6.1080705@redhat.com> (raw)
In-Reply-To: <20120110090122.GI2167@redhat.com>

Am 10.01.2012 10:01, schrieb Gleb Natapov:
> On Mon, Jan 09, 2012 at 09:10:10PM +0100, Kevin Wolf wrote:
>> * This works with VMX, but with SVM I have an additional problem: When
>>   trying to exit VM86 (usually by an exception) through a task gate in
>>   the IDT, the code runs into the reason = TASK_SWITCH_CALL path. I
>>   searched a bit in the documentation, but didn't find any obvious way
>>   to fix this.
>>
> Hmm, so exit_int_info is invalid during task switch exit even though
> task switch was caused by an exception. I wonder is this the case when
> vcpu is not in vm86 mode too?

No idea, I would have to try it out.

> For vm86 we can change:
> 
>         else
>                 reason = TASK_SWITCH_CALL;
> 
> to
> 	else if (vcpu in vm86 mode)
> 		reason = TASK_SWITCH_GATE;
> 	else
> 		reason = TASK_SWITCH_CALL;
> 
> IIRC you can't change tasks by call in vm86 mode.

Didn't check it in the manual, but you'll have a hard time accessing a
protected mode segment in VM86, so I guess you're right. And in the VM86
branch we can probably fake the rest of the interrupt information so
that we can pass the checks in the emulator (basically saying "not a
software interrupt" should be enough).

Kevin

  reply	other threads:[~2012-01-10  9:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-09 20:10 [RFC PATCH] emulator: Fix task switch into/out of VM86 Kevin Wolf
2012-01-10  3:08 ` Takuya Yoshikawa
2012-01-10  4:07 ` Takuya Yoshikawa
2012-01-10  9:01 ` Gleb Natapov
2012-01-10  9:28   ` Kevin Wolf [this message]
2012-01-10 10:17     ` Gleb Natapov
2012-01-10 11:25     ` Kevin Wolf
2012-01-10 11:30       ` Gleb Natapov
2012-01-10 17:51         ` Joerg Roedel
2012-01-16 15:37           ` Kevin Wolf
2012-01-16 15:57             ` Joerg Roedel

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=4F0C04A6.1080705@redhat.com \
    --to=kwolf@redhat.com \
    --cc=gleb@redhat.com \
    --cc=kvm@vger.kernel.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