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

Re: [Xen-devel] [PATCH v2 2/3] xen/hvm: introduce a fpu_uninitialised field to the CPU save record



On 17/11/15 18:44, Roger Pau Monne wrote:
> Introduce a new filed to signal if the FPU has been initialised or not. Xen

field

> needs this new filed in order to know whether to set the FPU as initialised
> or not during restore of CPU context. Previously Xen always wrongly assumed
> the FPU was initialised on restore.
>
> Signed-off-by: Roger Pau Monnà <roger.pau@xxxxxxxxxx>
> Cc: Jan Beulich <jbeulich@xxxxxxxx>
> Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> Changes since v1:
>  - Don't add yet another compat structure, new fields should always be added
>    to the end of the existing structure and offsetof should be used to
>    compare sizes.
>  - Leave the previous compat structure as-is, since the field was not added
>    to the end we cannot remove it and use offsetof in this case.

How can this work?

Making it zeroextended means that any short record will be padded with
zeroes.  As a result, the compat checking logic is skipped.

(This HVM_SAVE_* infrastructure is truly horrifying code which should
never have been accepted.  I think I have correctly followed what it is
doing, but I could be mistaken.)

~Andrew

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

 


Rackspace

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