From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH v2 0/3] Fix task switches into/out of VM86 Date: Mon, 30 Jan 2012 12:22:05 +0200 Message-ID: <20120130102205.GA23536@redhat.com> References: <1327692216-20450-1-git-send-email-kwolf@redhat.com> <20120127195239.GB2938@redhat.com> <4F265961.3070501@redhat.com> <20120130085541.GI30469@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, joerg.roedel@amd.com, yoshikawa.takuya@oss.ntt.co.jp, avi@redhat.com, mtosatti@redhat.com To: Kevin Wolf Return-path: Received: from mx1.redhat.com ([209.132.183.28]:12973 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751194Ab2A3KWL convert rfc822-to-8bit (ORCPT ); Mon, 30 Jan 2012 05:22:11 -0500 Content-Disposition: inline In-Reply-To: <20120130085541.GI30469@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Jan 30, 2012 at 10:55:41AM +0200, Gleb Natapov wrote: > On Mon, Jan 30, 2012 at 09:48:33AM +0100, Kevin Wolf wrote: > > Am 27.01.2012 20:52, schrieb Gleb Natapov: > > > On Fri, Jan 27, 2012 at 08:23:33PM +0100, Kevin Wolf wrote: > > >> I believe this should work with both VMX and SVM now. Gleb, J=C3= =B6rg, can one of > > >> you test this with SVM? I did some testing on my buggy processor= and it looks > > >> as good as it gets, but it would be better if you could confirm. > > >> > > > You forgot to set cpl to 3 in vmcb in svm_set_rflags() when vm86 = is enabled, no? > >=20 > > SVM updates the CPL when the segment selector for CS is loaded. Fro= m a > > svm.c POV, segment selectors are updated immediately after set_rfla= gs, > > so it wouldn't really make a difference to do it twice. > >=20 > It is too subtle to rely on that. The fact is that checking cpl after > set_rflags provides incorrect value. This better be fixed. BTW does > load_state_from_tss16() need the same fix? >=20 Probably not since you can't switch to vm86 this way. But may be for other reasons. -- Gleb.