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

Re: [Xen-devel] [PATCHv1 3/5] x86/fpu: Add a per-domain field to set the width of FIP/FDP



On 18/02/16 18:52, David Vrabel wrote:
> The x86 architecture allows either: a) the 64-bit FIP/FDP registers to be
> restored (clearing FCS and FDS); or b) the 32-bit FIP/FDP and FCS/FDS
> registers to be restored (clearing the upper 32-bits).

^ of FIP/FDP

> diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
> index 4fad638..362fd8f 100644
> --- a/xen/include/asm-x86/domain.h
> +++ b/xen/include/asm-x86/domain.h
> @@ -394,6 +394,21 @@ struct arch_domain
>  
>      /* Emulated devices enabled bitmap. */
>      uint32_t emulation_flags;
> +
> +    /*
> +     * The width of the FIP/FDP register in the FPU that needs to be
> +     * saved/restored during a context switch.  This is needed because
> +     * the FPU can either: a) restore the 64-bit FIP/FDP and clear FCS
> +     * and FDS; or b) retstore the 32-bit FIP/FDP (clearing the upper
> +     * 32-bits) and restore FCS/FDS.
> +     *
> +     * Which one is needed depends on the guest.
> +     *
> +     * This can be either: 8, 4 or 0.  0 means auto-detect the size
> +     * based on the width of FIP/FDP values that are written by by the
> +     * guest.
> +     */
> +    uint8_t x87_fip_width;

Can we get away with always using fpu_sse.x[FPU_WORD_SIZE_OFFSET],
instead if duplicating the information in arch_domain and risking them
getting out of sync?

VMs which have migrated in will already have some policy latched, and we
should preserve their old behaviour if possible.

~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®.