From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v2 29/30] tools/libxc: Use featuresets rather than guesswork Date: Wed, 17 Feb 2016 13:03:10 +0000 Message-ID: <56C46F8E.3090400@citrix.com> References: <1454679743-18133-1-git-send-email-andrew.cooper3@citrix.com> <1454679743-18133-30-git-send-email-andrew.cooper3@citrix.com> <56C4438702000078000D2F38@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <56C4438702000078000D2F38@prv-mh.provo.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Ian Jackson , Wei Liu , Ian Campbell , Xen-devel List-Id: xen-devel@lists.xenproject.org On 17/02/16 08:55, Jan Beulich wrote: >>>> On 05.02.16 at 14:42, wrote: >> @@ -467,11 +420,8 @@ static void xc_cpuid_config_xsave(xc_interface *xch, >> regs[1] = 512 + 64; /* FP/SSE + XSAVE.HEADER */ >> break; >> case 1: /* leaf 1 */ >> - regs[0] &= (XSAVEOPT | XSAVEC | XGETBV1 | XSAVES); >> - if ( !info->hvm ) >> - regs[0] &= ~XSAVES; >> - regs[2] &= info->xfeature_mask; >> - regs[3] = 0; >> + regs[0] = info->featureset[featureword_of(X86_FEATURE_XSAVEOPT)]; >> + regs[1] = regs[2] = regs[3] = 0; >> break; > This change (to regs[2] handling) reminds me of an apparent issue > in the earlier dependencies patch, which I realized only after having > sent the reply, and then forgot to send another reply for: Shouldn't > features requiring certain XSAVE states depend on that state's > availability instead of just XSAVE? That would make the above use > proper masking for both regs[2] and regs[3] (and also for regs[0] > and regs[3] in the sub-leaf 0 case). Have you looks at this patch in combination with the following one? Strictly speaking, there is a difference between the xstate availability and the features which use them. However, the former are not level-able on older hardware. I have deliberately constructed the former from the latter, to prevent the two becoming different, and unlike real hardware. ~Andrew