[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2] x86emul: don't read mask register on AVX512F-incapable platforms



>>> On 29.03.19 at 10:19, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 29/03/2019 07:42, Jan Beulich wrote:
>> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
>> @@ -3511,7 +3511,8 @@ x86_emulate(
>>      }
>>  
>>      /* With a memory operand, fetch the mask register in use (if any). */
>> -    if ( ea.type == OP_MEM && evex.opmsk )
>> +    if ( ea.type == OP_MEM && cpu_has_avx512f && evex.opmsk &&
>> +         _get_fpu(fpu_type = X86EMUL_FPU_opmask, ctxt, ops) == X86EMUL_OKAY 
>> )
> 
> The cpu_has_avx512f check is now redundant.  It is fully encapsulated by
> _get_fpu() being happy with X86EMUL_FPU_opmask.

Well, that'll end up being inconsistent with what we do elsewhere:
If we did as you say, host_and_vcpu_must_have(avx512f) could
(and for consistency then should) all become just
vcpu_must_have(avx512f). Similarly for AVX.

I'd like to put up the other option then: Rather than using
_get_fpu() (and in particular the read_xcr() and read_cr() hooks)
we could read the real XCR0 here. After all we issue the KMOV not
because the guest has specified it, but because we need the value
of the register for correct fault suppression emulation.

> Preferably with it dropped, Reviewed-by: Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx>

Let me know of the applicability of this.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.