On 16/01/17 16:58, Jan Beulich wrote:
On 16.01.17 at 12:40, wrote:
>> @@ -1007,10 +864,13 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
>> break;
>>
>> case XSTATE_CPUID:
>> -if ( subleaf > ARRAY_SIZE(p->xstate.raw) )
>>> On 16.01.17 at 12:40, wrote:
> @@ -1007,10 +864,13 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
> break;
>
> case XSTATE_CPUID:
> -if ( subleaf > ARRAY_SIZE(p->xstate.raw) )
> +if ( !p->basic.xsave ||
The xstate union now contains sanitised values, so it can be handled fully in
the non-legacy path.
c/s 1c0bc709d "x86/cpuid: Perform max_leaf calculations in guest_cpuid()"
accidentally introduced a boundary error for the subleaf check, although it
was masked by the correct logic in the legacy