From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v2 0/3] Fix task switches into/out of VM86 Date: Mon, 30 Jan 2012 15:39:14 +0200 Message-ID: <4F269D82.80607@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> <20120130132931.GI23536@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Kevin Wolf , kvm@vger.kernel.org, joerg.roedel@amd.com, yoshikawa.takuya@oss.ntt.co.jp, mtosatti@redhat.com To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:34840 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752601Ab2A3NjT (ORCPT ); Mon, 30 Jan 2012 08:39:19 -0500 In-Reply-To: <20120130132931.GI23536@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 01/30/2012 03:29 PM, Gleb Natapov wrote: > 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 t= o emulate > > > > > > this behaviour). Real mode forces cpl to 0, vm86 forces cp= l to 3, > > > > > > protected mode (and I think long mode) uses cs.rpl. > > > > > This is what vmx does, not svm.=20 > > > >=20 > > > > That's the architectural definition, except for mode switch seq= uences.=20 > > > > vmx implements it directly which means that mode switch sequenc= es > > > > sometimes fail, either in guest software (setting cr0.pe while = cs & 3 !=3D > > > > 0) or in "microcode" (emulate.c). > > > >=20 > > > The fact that vmx check for cpl by (cs & 3) looks incorrect. It > > > should check dpl. > > > > >=20 > > Which check? > >=20 > In vmx_get_cpl(). 3A 3.2: Current privilege level (CPL) field =97 (Bits 0 and 1 of the CS segment register.) Indicates the privilege level of the currently executing program or procedure. The term current privilege level (CPL) refers to the setting of this field. (probably allows a library with a low DPL to be run as part of a progra= m with high RPL/CPL; or you can use a "conforming code segment" as a sort of SUID bit). --=20 error compiling committee.c: too many arguments to function