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 15:29:31 +0200 Message-ID: <20120130132931.GI23536@redhat.com> References: <1327692216-20450-1-git-send-email-kwolf@redhat.com> <20120127195239.GB2938@redhat.com> <4F265961.3070501@redhat.com> <20120130085541.GI30469@redhat.com> <4F267254.7040900@redhat.com> <4F2674BB.2000608@redhat.com> <20120130105022.GC23536@redhat.com> <4F268626.5090209@redhat.com> <20120130123127.GH23536@redhat.com> <4F269AE7.2060204@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Kevin Wolf , kvm@vger.kernel.org, joerg.roedel@amd.com, yoshikawa.takuya@oss.ntt.co.jp, mtosatti@redhat.com To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:48197 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751671Ab2A3N3o (ORCPT ); Mon, 30 Jan 2012 08:29:44 -0500 Content-Disposition: inline In-Reply-To: <4F269AE7.2060204@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Jan 30, 2012 at 03:28:07PM +0200, Avi Kivity wrote: > On 01/30/2012 02:31 PM, Gleb Natapov wrote: > > On Mon, Jan 30, 2012 at 01:59:34PM +0200, Avi Kivity wrote: > > > > > It's best to make it independent (like svm, and force vmx to emulate > > > > > this behaviour). Real mode forces cpl to 0, vm86 forces cpl to 3, > > > > > protected mode (and I think long mode) uses cs.rpl. > > > > This is what vmx does, not svm. > > > > > > That's the architectural definition, except for mode switch sequences. > > > vmx implements it directly which means that mode switch sequences > > > sometimes fail, either in guest software (setting cr0.pe while cs & 3 != > > > 0) or in "microcode" (emulate.c). > > > > > The fact that vmx check for cpl by (cs & 3) looks incorrect. It > > should check dpl. > > > > Which check? > In vmx_get_cpl(). -- Gleb.