>>> On 04.10.16 at 15:58, <andrew.coop...@citrix.com> wrote:
> On 04/10/16 14:39, Jan Beulich wrote:
>> @@ -770,9 +773,23 @@ static int _get_fpu(
>>          unsigned long cr0;
>>  
>>          fail_if(!ops->read_cr);
>> +        if ( type >= X86EMUL_FPU_xmm )
>> +        {
>> +            unsigned long cr4;
>> +
>> +            rc = ops->read_cr(4, &cr4, ctxt);
>> +            if ( rc != X86EMUL_OKAY )
>> +                return rc;
>> +            generate_exception_if(!(cr4 & ((type == X86EMUL_FPU_xmm)
>> +                                           ? CR4_OSFXSR : CR4_OSXSAVE)),
>> +                                  EXC_UD, -1);
>> +        }
>> +
>>          rc = ops->read_cr(0, &cr0, ctxt);
>>          if ( rc != X86EMUL_OKAY )
>>              return rc;
>> +        if ( !(cr0 & CR0_PE) || (ctxt->regs->eflags & EFLG_VM) )
>> +            generate_exception_if(type >= X86EMUL_FPU_ymm, EXC_UD, -1);
> 
> Is this an appropriate check to do here?  This restriction is because
> the VEX prefix isn't permitted in real/vm86 mode.
> 
> Instead of a generate_exception_if(), I would instead have an ASSERT()
> that we don't actually reach this point.

Hmm, that's right.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to