On 21/08/2024 4:56 pm, Jan Beulich wrote:
>>>>> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
>>>>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
>>>>> @@ -8114,13 +8114,13 @@ x86_emulate(
>>>>> }
>>>>> else if ( state->simd_size != simd_none )
>>>>> {
>>>>> - generate_exception_if(!op_bytes, X86_EXC_UD);
>>>>> generate_exception_if((vex.opcx && (d & TwoOp) &&
>>>>> (vex.reg != 0xf || (evex_encoded() &&
>>>>> !evex.RX))),
>>>>> X86_EXC_UD);
>>>>>
>>>>> - if ( !opc )
>>>>> - BUG();
>>>>> + EXPECT(op_bytes);
>>>>> + EXPECT(opc);
>>>> This is the only BUG() in x86_emulate.c, and it's right to get rid of it
>>>> IMO.
>>>>
>>>> Therefore, we should have a hunk removing it from
>>>> tools/tests/x86_emulator/x86-emulate.h too, which will prevent
>>>> reintroduction.
>>>>
>>>> Maybe even undef BUG somewhere in x86_emulate/private.h?
>>> Both of these actions can only be taken if the other BUG() in decode.c
>>> also goes away. But yes, what you suggest is probably the best course of
>>> action. I guess I'll do that in yet another patch, though.
>> Is that BUG() local to your tree? I cant see it in staging.
> I first thought it would be when you mentioned you found only one, but it's
> been there for a long time[1], in VEX/EVEX prefix decoding. With a comment
> added by you[2].
Oh, I'm clearly blind.
But yes, that one wants to become EXPECT() too, I'd say.
~Andrew