From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH 08/12] KVM: x86: save/load state on SMM switch Date: Thu, 21 May 2015 18:33:36 +0200 Message-ID: <20150521163335.GA31171@potion.brq.redhat.com> References: <1431084034-8425-1-git-send-email-pbonzini@redhat.com> <1431084034-8425-9-git-send-email-pbonzini@redhat.com> <20150521162036.GA31183@potion.brq.redhat.com> <555E061C.1020705@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 To: Paolo Bonzini Return-path: Content-Disposition: inline In-Reply-To: <555E061C.1020705@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 2015-05-21 18:21+0200, Paolo Bonzini: > On 21/05/2015 18:20, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: > >=20 > >> > + set_desc_base(&desc, get_smstate(u32, smbase, offset + 8)= ); > >> > + set_desc_limit(&desc, get_smstate(u32, smbase, offset + 4)= ); > >> > + rsm_set_desc_flags(&desc, get_smstate(u32, smbase, offset)); > > (There wan't a layout where this would be right, so we could save t= he > > shifting of those flags in 64 bit mode. Intel P6 was close, and t= hey > > had only 2 bytes for access right, which means they weren't shifte= d.) >=20 > Check the AMD architecture manual. I must be blind, is there more than Table 10-2? (And according to ADM manual, we are overwriting GDT and IDT base at offset 0xff88 and 0xff94 with ES and CS data, so it's not the best reference for this case ...)