Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2992625AbbEENui (ORCPT ); Tue, 5 May 2015 09:50:38 -0400 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 Message-ID: <5548C338.2040206@redhat.com> Date: Tue, 05 May 2015 15:18:48 +0200 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= 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 Subject: Re: [PATCH 09/13] KVM: x86: save/load state on SMM switch 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> In-Reply-To: <20150505124833.GA11121@potion.brq.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1406 Lines: 36 On 05/05/2015 14:48, Radim Krčmář wrote: >>>> > > > +{ >>>> > > > + desc->g = (flags >> 15) & 1; >>>> > > > + desc->d = (flags >> 14) & 1; >>>> > > > + desc->l = (flags >> 13) & 1; >>>> > > > + desc->avl = (flags >> 12) & 1; >>>> > > > + desc->p = (flags >> 7) & 1; >>>> > > > + desc->dpl = (flags >> 5) & 3; >>>> > > > + desc->s = (flags >> 4) & 1; >>>> > > > + desc->type = flags & 15; >>> > > >>> > > I can't find a description of this ... can you point me to a place where >>> > > the gap between 'p' and 'avl' is documented? >>> > > (Not that it matters unless the guest reads it, but it's a bit weird.) >> > >> > It turns out that access rights are stored in the same format as the VMX >> > access rights. > Thanks, so it really has a "reserved" space in the middle, to save some > processing because the format is horrible (backward compatible). > >> > access rights. However, they are shifted by 8, which my code above >> > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/