From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 09/13] KVM: x86: save/load state on SMM switch Date: Tue, 05 May 2015 15:18:48 +0200 Message-ID: <5548C338.2040206@redhat.com> References: <1430393772-27208-1-git-send-email-pbonzini@redhat.com> <1430393772-27208-10-git-send-email-pbonzini@redhat.com> <20150504195902.GA15848@potion.brq.redhat.com> <55488F47.8070904@redhat.com> <20150505124833.GA11121@potion.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, bsd@redhat.com, guangrong.xiao@linux.intel.com, Yang Zhang , wanpeng.li@linux.intel.com To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:38288 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946020AbbEENu0 (ORCPT ); Tue, 5 May 2015 09:50:26 -0400 In-Reply-To: <20150505124833.GA11121@potion.brq.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 05/05/2015 14:48, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: >>>> > > > +{ >>>> > > > + desc->g =3D (flags >> 15) & 1; >>>> > > > + desc->d =3D (flags >> 14) & 1; >>>> > > > + desc->l =3D (flags >> 13) & 1; >>>> > > > + desc->avl =3D (flags >> 12) & 1; >>>> > > > + desc->p =3D (flags >> 7) & 1; >>>> > > > + desc->dpl =3D (flags >> 5) & 3; >>>> > > > + desc->s =3D (flags >> 4) & 1; >>>> > > > + desc->type =3D flags & 15; >>> > > >>> > > I can't find a description of this ... can you point me to a pl= ace where >>> > > the gap between 'p' and 'avl' is documented? >>> > > (Not that it matters unless the guest reads it, but it's a bit = weird.) >> >=20 >> > It turns out that access rights are stored in the same format as t= he VMX >> > access rights. > Thanks, so it really has a "reserved" space in the middle, to save so= me > processing because the format is horrible (backward compatible). >=20 >> > access rights. However, they are shifted by 8, which my code abov= e >> > doesn't do (bug). > I think you are shifting it right, though ... they wouldn't fit into = a > word if shifted left. Right, they have to be shifted right in the 64-bit case but not the 32-bit case. Paolo