From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH][SVM] CPL initialization fix Date: Mon, 10 Mar 2008 19:26:23 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ben Guthro , xen-devel , Robert Phillips List-Id: xen-devel@lists.xenproject.org For reference, from AMD's manual, Vol.2: "The processor reads the current privilege level from the CPL field in the VMCB, not from SS.DPL. However, SS.DPL should match the CPL field." And from Intel's manual, Vol.3B: "Note that the value of the DPL field for SS is always equal to the logical processor=B9s current privilege level (CPL)." -- Keir On 10/3/08 19:18, "Keir Fraser" wrote: > CPL is architecturally SS.DPL in almost all cases. It's certainly not > CS.DPL. What do you mean by 'migrate a QEMU guest'? >=20 > -- Keir >=20 > On 10/3/08 19:14, "Ben Guthro" wrote: >=20 >> CPL should be determined by code segment's DPL, not data segment's. >>=20 >> This solves a problem migrating a QEMU guest without PV-on-HVM drivers >>=20 >> Signed-off-by: Robert Plillips >> Signed-off-by: Ben Guthro >> diff -r f76f151a7431 xen/arch/x86/hvm/svm/svm.c >> --- a/xen/arch/x86/hvm/svm/svm.c >> +++ b/xen/arch/x86/hvm/svm/svm.c >> @@ -557,7 +557,7 @@ static void svm_set_segment_register(str >> break; >> case x86_seg_ss: >> memcpy(&vmcb->ss, reg, sizeof(*reg)); >> - vmcb->cpl =3D vmcb->ss.attr.fields.dpl; >> + vmcb->cpl =3D vmcb->cs.attr.fields.dpl; >> break; >> case x86_seg_tr: >> memcpy(&vmcb->tr, reg, sizeof(*reg)); >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xensource.com >> http://lists.xensource.com/xen-devel >=20 >=20 >=20 > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel