From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [RFC PATCH] emulator: Fix task switch into/out of VM86 Date: Tue, 10 Jan 2012 13:30:47 +0200 Message-ID: <20120110113047.GM2167@redhat.com> References: <1326139810-5448-1-git-send-email-kwolf@redhat.com> <20120110090122.GI2167@redhat.com> <4F0C04A6.1080705@redhat.com> <4F0C201E.3040206@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, joerg.roedel@amd.com To: Kevin Wolf Return-path: Received: from mx1.redhat.com ([209.132.183.28]:36939 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753918Ab2AJLau (ORCPT ); Tue, 10 Jan 2012 06:30:50 -0500 Content-Disposition: inline In-Reply-To: <4F0C201E.3040206@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Jan 10, 2012 at 12:25:18PM +0100, Kevin Wolf wrote: > Am 10.01.2012 10:28, schrieb Kevin Wolf: > > 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. > > Did that now, and it looks like exit_int_info is always 0 during the > task switch intercept for a task gate in the IDT. So special-casing VM86 > won't help, I'm afraid. > Joerg, do you know how can we check that task switch was cause by an exception triggering task gate if exit_int_info is not provided during intercept (short of decoding instruction that caused intercept to see if it's a call to a gate, which is racy) ? -- Gleb.